diff --git a/.appveyor/workflow.yml b/.appveyor/workflow.yml deleted file mode 100644 index 7f8050611b..0000000000 --- a/.appveyor/workflow.yml +++ /dev/null @@ -1,128 +0,0 @@ -environment: - matrix: - - job_name: java-tool-and-runtime - - job_name: csharp-runtime - job_depends_on: java-tool-and-runtime - - job_name: dart-runtime - job_depends_on: java-tool-and-runtime - - job_name: go-runtime - job_depends_on: java-tool-and-runtime - - job_name: javascript-runtime - job_depends_on: java-tool-and-runtime - - job_name: php-runtime - job_depends_on: java-tool-and-runtime - - job_name: python2-runtime - job_depends_on: java-tool-and-runtime - - job_name: python3-runtime - job_depends_on: java-tool-and-runtime - -matrix: - fast_finish: false - -version: '4.9.3-SNAPSHOT+AppVeyor.{build}' -cache: - - '%USERPROFILE%\.m2' - - '%USERPROFILE%\.nuget\packages -> **\project.json' -image: Visual Studio 2019 -# not using MSBuild -build: off - -for: - - matrix: - only: - - job_name: java-tool-and-runtime - build_script: - - mvn -q -DskipTests install --batch-mode - test_script: - - cd tool-testsuite - - mvn -q test - - cd ..\runtime-testsuite - - mvn -q -Dtest=java.* test - - - matrix: - only: - - job_name: csharp-runtime - build_script: - - mvn -q -DskipTests install --batch-mode - - dotnet build runtime/CSharp/src/Antlr4.csproj -c Release - after_build: - - dotnet pack runtime/CSharp/src/Antlr4.csproj -c Release - test_script: - - cd runtime-testsuite - - mvn -q -Dtest=csharp.* test - artifacts: - - path: 'runtime\**\*.nupkg' - name: NuGet - - - matrix: - only: - - job_name: dart-runtime - install: - - cinst -y dart-sdk --version=2.12.1 - build_script: - - mvn -q -DskipTests install --batch-mode - test_script: - - cd runtime-testsuite - - mvn -q -Dtest=dart.* test -Dantlr-dart-dart="C:\tools\dart-sdk\bin\dart.exe" -Dantlr-dart-pub="C:\tools\dart-sdk\bin\pub.bat" -Dantlr-dart-dart2native="C:\tools\dart-sdk\bin\dart2native.bat" - - - matrix: - only: - - job_name: go-runtime - build_script: - - mvn -q -DskipTests install --batch-mode - test_script: - - cd runtime-testsuite - - mvn -q -Dtest=go.* test - - - matrix: - only: - - job_name: javascript-runtime - install: - - cinst nodejs.install - - node --version - - npm --version - - npm install -g yarn@v1.22.10 - build_script: - - cd runtime\JavaScript\ - - npm install - - npm link - - cd ..\.. - - mvn -q -DskipTests install --batch-mode - test_script: - - cd runtime\JavaScript\ - - yarn test - - cd ..\.. - - cd runtime-testsuite - - mvn -q -Dtest=javascript.* test -Dantlr-javascript-npm="C:\Program Files\nodejs\npm.cmd" -Dantlr-javascript-nodejs="C:\Program Files\nodejs\node.exe" - - - matrix: - only: - - job_name: php-runtime - install: - - git clone https://github.com/antlr/antlr-php-runtime.git - - mv antlr-php-runtime runtime/PHP - - cinst -y php --params "/InstallDir:C:\tools\php" - - cinst -y composer - build_script: - - mvn -q -DskipTests install --batch-mode - test_script: - - cd runtime-testsuite - - mvn -q -Dtest=php.* test -Dantlr-php-php="C:\tools\php\php.exe" - - - matrix: - only: - - job_name: python2-runtime - build_script: - - mvn -q -DskipTests install --batch-mode - test_script: - - cd runtime-testsuite - - mvn -q -Dtest=python2.* test -Dantlr-python2-python="C:\Python27\python.exe" - - - matrix: - only: - - job_name: python3-runtime - build_script: - - mvn -q -DskipTests install --batch-mode - test_script: - - cd runtime-testsuite - - mvn -q -Dtest=python3.* test -Dantlr-python3-python="C:\Python35\python.exe" diff --git a/.circleci/config.yml b/.circleci/config.yml index ddc522c8ee..5a01544e01 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 jobs: test_tool_and_runtime_java: docker: - - image: cimg/openjdk:8.0 + - image: cimg/openjdk:11.0 steps: - checkout - run: @@ -13,13 +13,13 @@ jobs: name: test runtime command: | cd runtime-testsuite - mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=java.* test + mvn -Dparallel=classes -DthreadCount=4 -Dtest=java.** test cd .. - run: name: test tool command: | cd tool-testsuite - mvn -q -Dparallel=methods -DthreadCount=4 test + mvn -Dparallel=classes -DthreadCount=4 test cd .. test_runtime: parameters: @@ -32,7 +32,11 @@ jobs: type: string default: java docker: - - image: cimg/openjdk:8.0 + - image: cimg/openjdk:11.0 + environment: + MAVEN_OPTS: -Xmx512m + parallelism: 4 + resource_class: large environment: TARGET: << parameters.target >> GROUP: << parameters.test-group >> @@ -57,10 +61,4 @@ workflows: - test_runtime: matrix: parameters: - target: [ dart, go, python2, python3, javascript, php ] - - test_runtime: - matrix: - parameters: -# target: [ cpp, dotnet, swift ] - target: [ cpp, dotnet, dart ] - test-group: [ LEXER, PARSER, RECURSION ] + target: [ dart, go, python2, python3, javascript, php, cpp, dotnet ] diff --git a/.circleci/scripts/install-linux-javascript.sh b/.circleci/scripts/install-linux-javascript.sh index f862300f4a..2b8c8912a1 100755 --- a/.circleci/scripts/install-linux-javascript.sh +++ b/.circleci/scripts/install-linux-javascript.sh @@ -9,10 +9,6 @@ sudo apt-get install -y nodejs echo node version: $(node --version) echo "done installing nodejs" -echo "installing yarn..." -sudo npm install -g yarn@v1.22.10 -echo "done installing yarn" - echo "packaging javascript runtime..." pushd runtime/JavaScript sudo npm install diff --git a/.circleci/scripts/install-linux-php.sh b/.circleci/scripts/install-linux-php.sh index 863668f29d..4127d1ce61 100755 --- a/.circleci/scripts/install-linux-php.sh +++ b/.circleci/scripts/install-linux-php.sh @@ -2,15 +2,19 @@ set -euo pipefail -sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -sudo apt-get update -qq - +sudo apt install software-properties-common +sudo add-apt-repository ppa:ondrej/php sudo apt update -sudo apt install php-all-dev +sudo apt install wget php8.0-cli php8.0-zip unzip +wget -O composer-setup.php https://getcomposer.org/installer +sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer + +sudo apt install php8.0 +sudo apt install php8.0-mbstring +sudo apt install php8.0-xml php -v -sudo apt install composer git clone https://github.com/antlr/antlr-php-runtime.git runtime/PHP composer install -d runtime/PHP diff --git a/.circleci/scripts/run-tests-cpp.sh b/.circleci/scripts/run-tests-cpp.sh index 0913a82d87..58b59ff283 100755 --- a/.circleci/scripts/run-tests-cpp.sh +++ b/.circleci/scripts/run-tests-cpp.sh @@ -3,15 +3,6 @@ set -euo pipefail pushd runtime-testsuite - echo "running maven tests..." - if [ $GROUP == "LEXER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=cpp.* test - elif [ $GROUP == "PARSER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=cpp.* test - elif [ $GROUP == "RECURSION" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=cpp.* test - else - mvn -q -Dtest=cpp.* test - fi +export MAVEN_OPTS="-Xmx8g" +mvn -Dparallel=classes -DthreadCount=4 -Dtest=cpp.** test popd - diff --git a/.circleci/scripts/run-tests-dart.sh b/.circleci/scripts/run-tests-dart.sh index 89ccc37afd..2f9015df6c 100755 --- a/.circleci/scripts/run-tests-dart.sh +++ b/.circleci/scripts/run-tests-dart.sh @@ -6,6 +6,6 @@ dart --version pushd runtime-testsuite echo "running maven tests..." -# mvn -q -Dparallel=classes -DthreadCount=4 -Dtest=dart.* test - mvn -q -Dtest=dart.* test + export MAVEN_OPTS="-Xmx8g" + mvn -Dparallel=classes -DthreadCount=4 -Dtest=dart.** test popd diff --git a/.circleci/scripts/run-tests-dotnet.sh b/.circleci/scripts/run-tests-dotnet.sh index 5af345c42e..c0e6eeef6f 100755 --- a/.circleci/scripts/run-tests-dotnet.sh +++ b/.circleci/scripts/run-tests-dotnet.sh @@ -2,15 +2,7 @@ set -euo pipefail -pushd runtime-testsuite/ - echo "running maven tests..." - if [ $GROUP == "LEXER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=csharp.* test - elif [ $GROUP == "PARSER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=csharp.* test - elif [ $GROUP == "RECURSION" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=csharp.* test - else - mvn -q -Dtest=csharp.* test - fi +pushd runtime-testsuite +export MAVEN_OPTS="-Xmx8g" +mvn -Dparallel=classes -DthreadCount=4 -Dtest=csharp.** test popd diff --git a/.circleci/scripts/run-tests-go.sh b/.circleci/scripts/run-tests-go.sh index 3c29def4d3..b5317f3e2a 100755 --- a/.circleci/scripts/run-tests-go.sh +++ b/.circleci/scripts/run-tests-go.sh @@ -6,5 +6,6 @@ go version pushd runtime-testsuite echo "running maven tests..." - mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=go.* test -popd \ No newline at end of file + export MAVEN_OPTS="-Xmx8g" + mvn -Dparallel=classes -DthreadCount=4 -Dtest=go.** test +popd diff --git a/.circleci/scripts/run-tests-javascript.sh b/.circleci/scripts/run-tests-javascript.sh index c06e242faf..b0b461fce0 100755 --- a/.circleci/scripts/run-tests-javascript.sh +++ b/.circleci/scripts/run-tests-javascript.sh @@ -6,8 +6,8 @@ declare -i RESULT=0 pushd runtime/JavaScript - echo "running jest tests..." - yarn test + echo "running jasmine tests..." + npm test RESULT+=$? popd @@ -15,9 +15,10 @@ popd pushd runtime-testsuite echo "running maven tests..." - mvn -q -Dtest=javascript.* test + export MAVEN_OPTS="-Xmx8g" + mvn -Dtest=javascript.** test RESULT+=$? popd -exit $RESULT \ No newline at end of file +exit $RESULT diff --git a/.circleci/scripts/run-tests-php.sh b/.circleci/scripts/run-tests-php.sh index 67a87aa7c7..e46ebb3d66 100755 --- a/.circleci/scripts/run-tests-php.sh +++ b/.circleci/scripts/run-tests-php.sh @@ -7,5 +7,6 @@ php -v php_path=$(which php) pushd runtime-testsuite echo "running maven tests..." - mvn -q -DPHP_PATH="${php_path}" -Dparallel=methods -DthreadCount=4 -Dtest=php.* test + export MAVEN_OPTS="-Xmx8g" + mvn -DPHP_PATH="${php_path}" -Dparallel=classes -DthreadCount=4 -Dtest=php.** test popd diff --git a/.circleci/scripts/run-tests-python2.sh b/.circleci/scripts/run-tests-python2.sh index 9b65b302ec..772009ac3d 100755 --- a/.circleci/scripts/run-tests-python2.sh +++ b/.circleci/scripts/run-tests-python2.sh @@ -4,21 +4,19 @@ set -euo pipefail python2 --version -pushd runtime/Python2/tests - echo "running native tests..." - python2 run.py - rc=$? - if [ $rc != 0 ]; then - echo "failed running native tests" - fi -popd +# TODO: https://github.com/antlr/antlr4/issues/3521 +# +# pushd runtime/Python2/tests +# echo "running native tests..." +# python2 run.py +# rc=$? +# if [ $rc != 0 ]; then +# echo "failed running native tests" +# fi +# popd -if [ $rc == 0 ]; then - pushd runtime-testsuite - echo "running maven tests..." - mvn -q -Dtest=python2.* test - rc=$? - popd -fi - -# return $rc \ No newline at end of file +pushd runtime-testsuite + echo "running maven tests..." + export MAVEN_OPTS="-Xmx8g" + mvn -Dparallel=classes -DthreadCount=4 -Dtest=python2.** test +popd \ No newline at end of file diff --git a/.circleci/scripts/run-tests-python3.sh b/.circleci/scripts/run-tests-python3.sh index 11290cccb2..2be5773a1c 100755 --- a/.circleci/scripts/run-tests-python3.sh +++ b/.circleci/scripts/run-tests-python3.sh @@ -4,21 +4,19 @@ set -euo pipefail python3 --version -pushd runtime/Python3/tests - echo "running native tests..." - python3 run.py - rc=$? - if [ $rc != 0 ]; then - echo "failed running native tests" - fi -popd - -if [ $rc == 0 ]; then - pushd runtime-testsuite - echo "running maven tests..." - mvn -q -Dtest=python3.* test - rc=$? - popd -fi +# TODO: https://github.com/antlr/antlr4/issues/3521 +# +# pushd runtime/Python3/tests +# echo "running native tests..." +# python3 run.py +# rc=$? +# if [ $rc != 0 ]; then +# echo "failed running native tests" +# fi +# popd -# return $rc \ No newline at end of file +pushd runtime-testsuite + echo "running maven tests..." + export MAVEN_OPTS="-Xmx8g" + mvn -Dparallel=classes -DthreadCount=4 -Dtest=python3.** test +popd diff --git a/.circleci/scripts/run-tests-swift.sh b/.circleci/scripts/run-tests-swift.sh index c773b64924..bc68f84735 100755 --- a/.circleci/scripts/run-tests-swift.sh +++ b/.circleci/scripts/run-tests-swift.sh @@ -1,27 +1,22 @@ #!/bin/bash +# Appears to be unused + set -euo pipefail -pushd runtime/Swift - echo "running native tests..." - ./boot.py --test - rc=$? - if [ $rc != 0 ]; then - echo "failed running native tests" - fi -popd +# TODO: https://github.com/antlr/antlr4/issues/3521 +# +# pushd runtime/Swift +# echo "running native tests..." +# ./boot.py --test +# rc=$? +# if [ $rc != 0 ]; then +# echo "failed running native tests" +# fi +# popd -if [ $rc == 0 ]; then - pushd runtime-testsuite - echo "running maven tests..." - if [ $GROUP == "LEXER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=swift.* test - elif [ $GROUP == "PARSER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=swift.* test - elif [ $GROUP == "RECURSION" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=swift.* test - else - mvn -q -Dtest=swift.* test - fi - popd -fi +pushd runtime-testsuite + echo "running maven tests..." + export MAVEN_OPTS="-Xmx8g" + mvn -Dparallel=classes -DthreadCount=4 -Dtest=swift.** test +popd diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..96e93e796a --- /dev/null +++ b/.clang-format @@ -0,0 +1,20 @@ +--- +# This section defines defaults for all languages. Currently we derive ANTLR style from LLVM. +BasedOnStyle: LLVM +# Only use clang-format for C++ for now. +DisableFormat: true + +--- +# This section configures C++ formatting. +Language: Cpp +DisableFormat: false +Standard: c++17 +# Prevent clang-format from attempting to pick the alignment and always use right alignment. +DerivePointerAlignment: false +# ANTLR existing style is to right align pointers and references. +PointerAlignment: Right +ReferenceAlignment: Right +# Some of ANTLR existing code is longer than the default 80, so use 100 for now. +ColumnLimit: 100 +# Historically ANTLR has used indentation within namespaces, so replicate it. +NamespaceIndentation: Inner diff --git a/.editorconfig b/.editorconfig index daa6da0fb6..1c32f7d661 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,3 +8,11 @@ charset = utf-8 insert_final_newline = true trim_trailing_whitespace = true indent_style = tab +ij_java_else_on_new_line = true + +[*.{h,cpp}] +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 diff --git a/.gitattributes b/.gitattributes index 5edc9289fe..3bacbd399f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ # This rule applies to all files which don't match another line below -* text=auto +* text=auto \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8ac81421f4..686759a7a9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,23 @@ \ No newline at end of file +(Please make sure your PR is in a branch other than dev or master + and also make sure that you derive this branch from dev.) + +As of 4.10, ANTLR uses the Linux Foundation's Developer +Certificate of Origin, DCO, version 1.1. See either +https://developercertificate.org/ or file +contributors-cert-of-origin.txt in the main directory. + +Each commit requires a "signature", which is simple as +using `-s` (not `-S`) to the git commit command: + +git commit -s -m 'This is my commit message' + +Github's pull request process enforces the sig and gives +instructions on how to fix any commits that lack the sig. +See https://github.com/apps/dco for more info. + +No signature is required in this file (unlike the +previous ANTLR contributor's certificate of origin.) +--> diff --git a/.github/scripts/install-dotnet-on-osx.sh b/.github/scripts-macosx/install-dotnet-on-osx.sh similarity index 100% rename from .github/scripts/install-dotnet-on-osx.sh rename to .github/scripts-macosx/install-dotnet-on-osx.sh diff --git a/.github/scripts/mac-action-runner-readme.txt b/.github/scripts-macosx/mac-action-runner-readme.txt similarity index 100% rename from .github/scripts/mac-action-runner-readme.txt rename to .github/scripts-macosx/mac-action-runner-readme.txt diff --git a/.github/scripts-macosx/run-tests-cpp.sh b/.github/scripts-macosx/run-tests-cpp.sh new file mode 100755 index 0000000000..58b59ff283 --- /dev/null +++ b/.github/scripts-macosx/run-tests-cpp.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -euo pipefail + +pushd runtime-testsuite +export MAVEN_OPTS="-Xmx8g" +mvn -Dparallel=classes -DthreadCount=4 -Dtest=cpp.** test +popd diff --git a/.github/scripts-macosx/run-tests-dotnet.sh b/.github/scripts-macosx/run-tests-dotnet.sh new file mode 100755 index 0000000000..32788e1c85 --- /dev/null +++ b/.github/scripts-macosx/run-tests-dotnet.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Appears not to be used at moment + +set -euo pipefail + +export PATH=$PATH:~/.dotnet + +# we need to build the runtime before test run, since we used "--no-dependencies" +# when we call dotnet cli for restore and build, in order to speed up + +dotnet build -c Release -f netstandard2.0 runtime/CSharp/Antlr4.csproj + +# run tests +pushd runtime-testsuite/ +export MAVEN_OPTS="-Xmx8g" +mvn -Dparallel=classes -DthreadCount=4 -Dtest=csharp.** test +popd diff --git a/.github/scripts/run-tests-swift.sh b/.github/scripts-macosx/run-tests-swift.sh similarity index 56% rename from .github/scripts/run-tests-swift.sh rename to .github/scripts-macosx/run-tests-swift.sh index 7e40e9376a..a6d6470179 100755 --- a/.github/scripts/run-tests-swift.sh +++ b/.github/scripts-macosx/run-tests-swift.sh @@ -27,24 +27,20 @@ swift --version swift build --version # run swift tests -pushd runtime/Swift -./boot.py --test + +# TODO: https://github.com/antlr/antlr4/issues/3521 +# pushd runtime/Swift +# ./boot.py --test +# rc=$? +# popd + +# run java tests +cd runtime-testsuite/ +# mvn -e -Dparallel=classes -DthreadCount=4 -Dtest=swift.** test +# I don't know swift enough to make it parallel. revert to single threaded +export MAVEN_OPTS="-Xmx8g" +mvn -e -Dtest=swift.** test rc=$? -popd - -if [ $rc == 0 ]; then - # run java tests - cd runtime-testsuite/ - if [ $GROUP == "LEXER" ]; then - mvn -e -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest="swift.*" test - elif [ $GROUP == "PARSER" ]; then - mvn -e -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest="swift.*" test - elif [ $GROUP == "RECURSION" ]; then - mvn -e -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest="swift.*" test - else - mvn -e -q -Dtest=swift.* test - fi - rc=$? - cat target/surefire-reports/*.dumpstream || true -fi +cat target/surefire-reports/*.dumpstream || true + exit $rc diff --git a/.github/scripts-windows/run-tests-csharp.cmd b/.github/scripts-windows/run-tests-csharp.cmd new file mode 100644 index 0000000000..c5e1fb0a77 --- /dev/null +++ b/.github/scripts-windows/run-tests-csharp.cmd @@ -0,0 +1,5 @@ +dotnet build runtime/CSharp/src/Antlr4.csproj -c Release +dotnet pack runtime/CSharp/src/Antlr4.csproj -c Release +cd runtime-testsuite +mvn -Dparallel=classes -DthreadCount=2 -Dtest=csharp.** test +cd .. diff --git a/.github/scripts-windows/run-tests-dart.cmd b/.github/scripts-windows/run-tests-dart.cmd new file mode 100644 index 0000000000..2fd5034ba7 --- /dev/null +++ b/.github/scripts-windows/run-tests-dart.cmd @@ -0,0 +1,5 @@ +C:\ProgramData\chocolatey\bin\choco.exe -y install dart-sdk + +cd runtime-testsuite +mvn -Dtest=dart.** test -Dantlr-dart-dart="C:\tools\dart-sdk\bin\dart.exe" -Dantlr-dart-pub="C:\tools\dart-sdk\bin\pub.bat" -Dantlr-dart-dart2native="C:\tools\dart-sdk\bin\dart2native.bat" +cd .. diff --git a/.github/scripts-windows/run-tests-go.cmd b/.github/scripts-windows/run-tests-go.cmd new file mode 100644 index 0000000000..1c15fd1c95 --- /dev/null +++ b/.github/scripts-windows/run-tests-go.cmd @@ -0,0 +1,3 @@ +cd runtime-testsuite +mvn -Dparallel=classes -DthreadCount=2 -Dtest=go.** test +cd .. diff --git a/.github/scripts-windows/run-tests-java.cmd b/.github/scripts-windows/run-tests-java.cmd new file mode 100755 index 0000000000..55e9ea5621 --- /dev/null +++ b/.github/scripts-windows/run-tests-java.cmd @@ -0,0 +1,3 @@ +cd runtime-testsuite +mvn -Dparallel=classes -DthreadCount=2 -Dtest=java.** test +cd .. diff --git a/.github/scripts-windows/run-tests-javascript.cmd b/.github/scripts-windows/run-tests-javascript.cmd new file mode 100644 index 0000000000..b8744e8980 --- /dev/null +++ b/.github/scripts-windows/run-tests-javascript.cmd @@ -0,0 +1,3 @@ +cd runtime-testsuite +mvn -Dparallel=classes -DthreadCount=2 -Dtest=javascript.** test +cd .. diff --git a/.github/scripts-windows/run-tests-php.cmd b/.github/scripts-windows/run-tests-php.cmd new file mode 100644 index 0000000000..155cc0472f --- /dev/null +++ b/.github/scripts-windows/run-tests-php.cmd @@ -0,0 +1,8 @@ +REM C:\ProgramData\chocolatey\bin\choco.exe install php -y --package-parameters='"/DontAddToPath"' + +git clone https://github.com/antlr/antlr-php-runtime.git +move antlr-php-runtime runtime\PHP + +cd runtime-testsuite +mvn -Dparallel=classes -DthreadCount=2 -Dtest=php.** test -Dantlr-php-php="C:\tools\php81\php.exe" +cd .. diff --git a/.github/scripts-windows/run-tests-python2.cmd b/.github/scripts-windows/run-tests-python2.cmd new file mode 100644 index 0000000000..351355b03a --- /dev/null +++ b/.github/scripts-windows/run-tests-python2.cmd @@ -0,0 +1,3 @@ +cd runtime-testsuite +mvn -Dparallel=classes -DthreadCount=2 -Dantlr-python2-python="C:\Python27\python.exe" -Dtest=python2.** test +cd .. diff --git a/.github/scripts-windows/run-tests-python3.cmd b/.github/scripts-windows/run-tests-python3.cmd new file mode 100644 index 0000000000..fe448be018 --- /dev/null +++ b/.github/scripts-windows/run-tests-python3.cmd @@ -0,0 +1,3 @@ +cd runtime-testsuite +mvn -Dparallel=classes -DthreadCount=2 -Dantlr-python3-python="C:\Python310\python.exe" -Dtest=python3.** test +cd .. diff --git a/.github/scripts/run-tests-cpp.sh b/.github/scripts/run-tests-cpp.sh deleted file mode 100755 index 6fad9df27f..0000000000 --- a/.github/scripts/run-tests-cpp.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -cd runtime-testsuite/ - -if [ $GROUP == "LEXER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=cpp.* test -elif [ $GROUP == "PARSER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=cpp.* test -elif [ $GROUP == "RECURSION" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=cpp.* test -else - mvn -q -Dtest=cpp.* test -fi diff --git a/.github/scripts/run-tests-dotnet.sh b/.github/scripts/run-tests-dotnet.sh deleted file mode 100755 index 39055c3ac3..0000000000 --- a/.github/scripts/run-tests-dotnet.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -export PATH=$PATH:~/.dotnet - -# we need to build the runtime before test run, since we used "--no-dependencies" -# when we call dotnet cli for restore and build, in order to speed up - -dotnet build -c Release -f netstandard2.0 runtime/CSharp/Antlr4.csproj - -# run tests -cd runtime-testsuite/ - -if [ $GROUP == "LEXER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=csharp.* test -elif [ $GROUP == "PARSER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=csharp.* test -elif [ $GROUP == "RECURSION" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=csharp.* test -else - mvn -q -Dtest=csharp.* test -fi diff --git a/.github/workflows/macosx.yml b/.github/workflows/macosx.yml index c53c97d182..b9fb2db458 100644 --- a/.github/workflows/macosx.yml +++ b/.github/workflows/macosx.yml @@ -2,9 +2,9 @@ name: MacOSX on: push: - branches: [ master ] + branches: [ dev ] pull_request: - branches: [ master ] + branches: [ dev ] jobs: build: @@ -12,23 +12,20 @@ jobs: strategy: fail-fast: false matrix: -# TARGET: [swift, cpp, dotnet] disabling dotnet which is unstable on M1 TARGET: [swift, cpp] - GROUP: [LEXER, PARSER, RECURSION] steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 + - name: Set up JDK 11 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 11 - name: Set up Maven uses: stCarolas/setup-maven@v4 with: - maven-version: 3.5.4 + maven-version: 3.8.4 - name: Build tool with Maven run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V - name: Test with Maven - run: arch -x86_64 .github/scripts/run-tests-${{ matrix.TARGET }}.sh + run: .github/scripts-macosx/run-tests-${{ matrix.TARGET }}.sh env: TARGET: ${{ matrix.TARGET }} - GROUP: ${{ matrix.GROUP }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000000..bd11f8b05a --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,77 @@ +name: Windows + +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev ] + +jobs: + build: + runs-on: [self-hosted, windows, x64] + strategy: + fail-fast: false + matrix: + TARGET: [java, python2, python3, javascript, csharp, dart, go, php] + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Set up Maven + uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.5.4 +# fails due to permissions, use global install +# - name: Set up Python 2 +# if: matrix.TARGET == 'python2' +# uses: actions/setup-python@v2 +# with: +# python-version: '2.x' +# architecture: 'x64' +# fails due to permissions, use global install +# - name: Set up Python 3 +# if: matrix.TARGET == 'python3' +# uses: actions/setup-python@v2 +# with: +# python-version: '3.x' +# architecture: 'x64' + - name: Set up Node 14 + if: matrix.TARGET == 'javascript' + uses: actions/setup-node@v2 + with: + node-version: '14' + - name: Setup Dotnet 3.1 and 5.0 + if: matrix.TARGET == 'csharp' + uses: actions/setup-dotnet@v1 + with: + dotnet-version: | + 3.1.x + 5.0.x +# fails due to os (Linux only), use global install +# - name: Setup Dart 2.12.1 +# uses: dart-lang/setup-dart@v1 +# with: +# sdk: 2.12.1 + - name: Setup Go 1.13.1 + if: matrix.TARGET == 'go' + uses: actions/setup-go@v2 + with: + go-version: '^1.13.1' +# requires manually setting up pwsh +# fails due to incorrect script (missing printf) +# - name: Setup PHP 8.2 +# if: matrix.TARGET == 'php' +# uses: shivammathur/setup-php@v2 +# with: +# php-version: '8.2' +# extensions: mbstring +# tools: composer + - name: Build tool with Maven + run: mvn install -DskipTests=true -Darguments="-Dmaven.javadoc.skip=true" -B -V + - name: Test with Maven + run: .github/scripts-windows/run-tests-${{ matrix.TARGET }}.cmd + env: + TARGET: ${{ matrix.TARGET }} diff --git a/.travis/before-install-linux-dart.sh b/.travis/before-install-linux-dart.sh deleted file mode 100755 index 9b471196c4..0000000000 --- a/.travis/before-install-linux-dart.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -euo pipefail -wget https://storage.googleapis.com/dart-archive/channels/stable/release/2.12.1/linux_packages/dart_2.12.1-1_amd64.deb -sudo dpkg -i ./dart_2.12.1-1_amd64.deb -sudo rm ./dart_2.12.1-1_amd64.deb -sudo apt-get install -f diff --git a/.travis/before-install-linux-dotnet.sh b/.travis/before-install-linux-dotnet.sh deleted file mode 100755 index 57ff8ed046..0000000000 --- a/.travis/before-install-linux-dotnet.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb -sudo dpkg -i packages-microsoft-prod.deb -sudo apt-get update; \ - sudo apt-get install -y apt-transport-https && \ - sudo apt-get update && \ - sudo apt-get install -y dotnet-sdk-3.1 \ No newline at end of file diff --git a/.travis/before-install-linux-go.sh b/.travis/before-install-linux-go.sh deleted file mode 100755 index 16c8281801..0000000000 --- a/.travis/before-install-linux-go.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -eval "$(sudo gimme 1.7.3)" -( go version ; go env ) || true diff --git a/.travis/before-install-linux-javascript.sh b/.travis/before-install-linux-javascript.sh deleted file mode 100755 index 5ad81f41ca..0000000000 --- a/.travis/before-install-linux-javascript.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -# use v14 and check -echo node version: $(node --version) - diff --git a/.travis/before-install-linux-php.sh b/.travis/before-install-linux-php.sh deleted file mode 100755 index 09028e5b86..0000000000 --- a/.travis/before-install-linux-php.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -sudo apt-get update -qq - -php -v - -git clone https://github.com/antlr/antlr-php-runtime.git -mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V \ No newline at end of file diff --git a/.travis/before-install-linux-swift.sh b/.travis/before-install-linux-swift.sh deleted file mode 100755 index 1a2b2a5550..0000000000 --- a/.travis/before-install-linux-swift.sh +++ /dev/null @@ -1,13 +0,0 @@ -set -euo pipefail - -# install dependencies -# some packages below will be update, swift assumes newer versions -# of, for example, sqlite3 and libicu, without the update some -# tools will not work -sudo apt-get update -sudo apt-get install clang-3.6 libxml2 -sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.6 100 - -# This would fix a know linker issue mentioned in: -# https://bugs.swift.org/browse/SR-2299 -sudo ln -sf ld.gold /usr/bin/ld diff --git a/.travis/before-install-osx-dotnet.sh b/.travis/before-install-osx-dotnet.sh deleted file mode 100755 index 147f974de8..0000000000 --- a/.travis/before-install-osx-dotnet.sh +++ /dev/null @@ -1,1111 +0,0 @@ -#!/usr/bin/env bash - -# Copied from https://dot.net/v1/dotnet-install.sh (see also https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script#recommended-version) - -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. - -# Stop script on NZEC -set -e -# Stop script if unbound variable found (use ${var:-} if intentional) -set -u -# By default cmd1 | cmd2 returns exit code of cmd2 regardless of cmd1 success -# This is causing it to fail -set -o pipefail - -# Use in the the functions: eval $invocation -invocation='say_verbose "Calling: ${yellow:-}${FUNCNAME[0]} ${green:-}$*${normal:-}"' - -# standard output may be used as a return value in the functions -# we need a way to write text on the screen in the functions so that -# it won't interfere with the return value. -# Exposing stream 3 as a pipe to standard output of the script itself -exec 3>&1 - -# Setup some colors to use. These need to work in fairly limited shells, like the Ubuntu Docker container where there are only 8 colors. -# See if stdout is a terminal -if [ -t 1 ] && command -v tput > /dev/null; then - # see if it supports colors - ncolors=$(tput colors) - if [ -n "$ncolors" ] && [ $ncolors -ge 8 ]; then - bold="$(tput bold || echo)" - normal="$(tput sgr0 || echo)" - black="$(tput setaf 0 || echo)" - red="$(tput setaf 1 || echo)" - green="$(tput setaf 2 || echo)" - yellow="$(tput setaf 3 || echo)" - blue="$(tput setaf 4 || echo)" - magenta="$(tput setaf 5 || echo)" - cyan="$(tput setaf 6 || echo)" - white="$(tput setaf 7 || echo)" - fi -fi - -say_warning() { - printf "%b\n" "${yellow:-}dotnet_install: Warning: $1${normal:-}" -} - -say_err() { - printf "%b\n" "${red:-}dotnet_install: Error: $1${normal:-}" >&2 -} - -say() { - # using stream 3 (defined in the beginning) to not interfere with stdout of functions - # which may be used as return value - printf "%b\n" "${cyan:-}dotnet-install:${normal:-} $1" >&3 -} - -say_verbose() { - if [ "$verbose" = true ]; then - say "$1" - fi -} - -# This platform list is finite - if the SDK/Runtime has supported Linux distribution-specific assets, -# then and only then should the Linux distribution appear in this list. -# Adding a Linux distribution to this list does not imply distribution-specific support. -get_legacy_os_name_from_platform() { - eval $invocation - - platform="$1" - case "$platform" in - "centos.7") - echo "centos" - return 0 - ;; - "debian.8") - echo "debian" - return 0 - ;; - "debian.9") - echo "debian.9" - return 0 - ;; - "fedora.23") - echo "fedora.23" - return 0 - ;; - "fedora.24") - echo "fedora.24" - return 0 - ;; - "fedora.27") - echo "fedora.27" - return 0 - ;; - "fedora.28") - echo "fedora.28" - return 0 - ;; - "opensuse.13.2") - echo "opensuse.13.2" - return 0 - ;; - "opensuse.42.1") - echo "opensuse.42.1" - return 0 - ;; - "opensuse.42.3") - echo "opensuse.42.3" - return 0 - ;; - "rhel.7"*) - echo "rhel" - return 0 - ;; - "ubuntu.14.04") - echo "ubuntu" - return 0 - ;; - "ubuntu.16.04") - echo "ubuntu.16.04" - return 0 - ;; - "ubuntu.16.10") - echo "ubuntu.16.10" - return 0 - ;; - "ubuntu.18.04") - echo "ubuntu.18.04" - return 0 - ;; - "alpine.3.4.3") - echo "alpine" - return 0 - ;; - esac - return 1 -} - -get_linux_platform_name() { - eval $invocation - - if [ -n "$runtime_id" ]; then - echo "${runtime_id%-*}" - return 0 - else - if [ -e /etc/os-release ]; then - . /etc/os-release - echo "$ID${VERSION_ID:+.${VERSION_ID}}" - return 0 - elif [ -e /etc/redhat-release ]; then - local redhatRelease=$(&1 || true) | grep -q musl -} - -get_current_os_name() { - eval $invocation - - local uname=$(uname) - if [ "$uname" = "Darwin" ]; then - echo "osx" - return 0 - elif [ "$uname" = "FreeBSD" ]; then - echo "freebsd" - return 0 - elif [ "$uname" = "Linux" ]; then - local linux_platform_name - linux_platform_name="$(get_linux_platform_name)" || { echo "linux" && return 0 ; } - - if [ "$linux_platform_name" = "rhel.6" ]; then - echo $linux_platform_name - return 0 - elif is_musl_based_distro; then - echo "linux-musl" - return 0 - else - echo "linux" - return 0 - fi - fi - - say_err "OS name could not be detected: UName = $uname" - return 1 -} - -get_legacy_os_name() { - eval $invocation - - local uname=$(uname) - if [ "$uname" = "Darwin" ]; then - echo "osx" - return 0 - elif [ -n "$runtime_id" ]; then - echo $(get_legacy_os_name_from_platform "${runtime_id%-*}" || echo "${runtime_id%-*}") - return 0 - else - if [ -e /etc/os-release ]; then - . /etc/os-release - os=$(get_legacy_os_name_from_platform "$ID${VERSION_ID:+.${VERSION_ID}}" || echo "") - if [ -n "$os" ]; then - echo "$os" - return 0 - fi - fi - fi - - say_verbose "Distribution specific OS name and version could not be detected: UName = $uname" - return 1 -} - -machine_has() { - eval $invocation - - hash "$1" > /dev/null 2>&1 - return $? -} - - -check_min_reqs() { - local hasMinimum=false - if machine_has "curl"; then - hasMinimum=true - elif machine_has "wget"; then - hasMinimum=true - fi - - if [ "$hasMinimum" = "false" ]; then - say_err "curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed." - return 1 - fi - return 0 -} - -# args: -# input - $1 -to_lowercase() { - #eval $invocation - - echo "$1" | tr '[:upper:]' '[:lower:]' - return 0 -} - -# args: -# input - $1 -remove_trailing_slash() { - #eval $invocation - - local input="${1:-}" - echo "${input%/}" - return 0 -} - -# args: -# input - $1 -remove_beginning_slash() { - #eval $invocation - - local input="${1:-}" - echo "${input#/}" - return 0 -} - -# args: -# root_path - $1 -# child_path - $2 - this parameter can be empty -combine_paths() { - eval $invocation - - # TODO: Consider making it work with any number of paths. For now: - if [ ! -z "${3:-}" ]; then - say_err "combine_paths: Function takes two parameters." - return 1 - fi - - local root_path="$(remove_trailing_slash "$1")" - local child_path="$(remove_beginning_slash "${2:-}")" - say_verbose "combine_paths: root_path=$root_path" - say_verbose "combine_paths: child_path=$child_path" - echo "$root_path/$child_path" - return 0 -} - -get_machine_architecture() { - eval $invocation - - if command -v uname > /dev/null; then - CPUName=$(uname -m) - case $CPUName in - armv7l) - echo "arm" - return 0 - ;; - aarch64) - echo "arm64" - return 0 - ;; - esac - fi - - # Always default to 'x64' - echo "x64" - return 0 -} - -# args: -# architecture - $1 -get_normalized_architecture_from_architecture() { - eval $invocation - - local architecture="$(to_lowercase "$1")" - case "$architecture" in - \) - echo "$(get_normalized_architecture_from_architecture "$(get_machine_architecture)")" - return 0 - ;; - amd64|x64) - echo "x64" - return 0 - ;; - arm) - echo "arm" - return 0 - ;; - arm64) - echo "arm64" - return 0 - ;; - esac - - say_err "Architecture \`$architecture\` not supported. If you think this is a bug, report it at https://github.com/dotnet/install-scripts/issues" - return 1 -} - -# The version text returned from the feeds is a 1-line or 2-line string: -# For the SDK and the dotnet runtime (2 lines): -# Line 1: # commit_hash -# Line 2: # 4-part version -# For the aspnetcore runtime (1 line): -# Line 1: # 4-part version - -# args: -# version_text - stdin -get_version_from_version_info() { - eval $invocation - - cat | tail -n 1 | sed 's/\r$//' - return 0 -} - -# args: -# install_root - $1 -# relative_path_to_package - $2 -# specific_version - $3 -is_dotnet_package_installed() { - eval $invocation - - local install_root="$1" - local relative_path_to_package="$2" - local specific_version="${3//[$'\t\r\n']}" - - local dotnet_package_path="$(combine_paths "$(combine_paths "$install_root" "$relative_path_to_package")" "$specific_version")" - say_verbose "is_dotnet_package_installed: dotnet_package_path=$dotnet_package_path" - - if [ -d "$dotnet_package_path" ]; then - return 0 - else - return 1 - fi -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# coherent - $4 -get_latest_version_info() { - eval $invocation - - local azure_feed="$1" - local channel="$2" - local normalized_architecture="$3" - local coherent="$4" - - local version_file_url=null - if [[ "$runtime" == "dotnet" ]]; then - version_file_url="$uncached_feed/Runtime/$channel/latest.version" - elif [[ "$runtime" == "aspnetcore" ]]; then - version_file_url="$uncached_feed/aspnetcore/Runtime/$channel/latest.version" - elif [ -z "$runtime" ]; then - if [ "$coherent" = true ]; then - version_file_url="$uncached_feed/Sdk/$channel/latest.coherent.version" - else - version_file_url="$uncached_feed/Sdk/$channel/latest.version" - fi - else - say_err "Invalid value for \$runtime" - return 1 - fi - say_verbose "get_latest_version_info: latest url: $version_file_url" - - download "$version_file_url" - return $? -} - -# args: -# json_file - $1 -parse_jsonfile_for_version() { - eval $invocation - - local json_file="$1" - if [ ! -f "$json_file" ]; then - say_err "Unable to find \`$json_file\`" - return 1 - fi - - sdk_section=$(cat $json_file | awk '/"sdk"/,/}/') - if [ -z "$sdk_section" ]; then - say_err "Unable to parse the SDK node in \`$json_file\`" - return 1 - fi - - sdk_list=$(echo $sdk_section | awk -F"[{}]" '{print $2}') - sdk_list=${sdk_list//[\" ]/} - sdk_list=${sdk_list//,/$'\n'} - - local version_info="" - while read -r line; do - IFS=: - while read -r key value; do - if [[ "$key" == "version" ]]; then - version_info=$value - fi - done <<< "$line" - done <<< "$sdk_list" - if [ -z "$version_info" ]; then - say_err "Unable to find the SDK:version node in \`$json_file\`" - return 1 - fi - - unset IFS; - echo "$version_info" - return 0 -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# version - $4 -# json_file - $5 -get_specific_version_from_version() { - eval $invocation - - local azure_feed="$1" - local channel="$2" - local normalized_architecture="$3" - local version="$(to_lowercase "$4")" - local json_file="$5" - - if [ -z "$json_file" ]; then - case "$version" in - latest) - local version_info - version_info="$(get_latest_version_info "$azure_feed" "$channel" "$normalized_architecture" false)" || return 1 - say_verbose "get_specific_version_from_version: version_info=$version_info" - echo "$version_info" | get_version_from_version_info - return 0 - ;; - coherent) - local version_info - version_info="$(get_latest_version_info "$azure_feed" "$channel" "$normalized_architecture" true)" || return 1 - say_verbose "get_specific_version_from_version: version_info=$version_info" - echo "$version_info" | get_version_from_version_info - return 0 - ;; - *) - echo "$version" - return 0 - ;; - esac - else - local version_info - version_info="$(parse_jsonfile_for_version "$json_file")" || return 1 - echo "$version_info" - return 0 - fi -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# specific_version - $4 -construct_download_link() { - eval $invocation - - local azure_feed="$1" - local channel="$2" - local normalized_architecture="$3" - local specific_version="${4//[$'\t\r\n']}" - local specific_product_version="$(get_specific_product_version "$1" "$4")" - - local osname - osname="$(get_current_os_name)" || return 1 - - local download_link=null - if [[ "$runtime" == "dotnet" ]]; then - download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_product_version-$osname-$normalized_architecture.tar.gz" - elif [[ "$runtime" == "aspnetcore" ]]; then - download_link="$azure_feed/aspnetcore/Runtime/$specific_version/aspnetcore-runtime-$specific_product_version-$osname-$normalized_architecture.tar.gz" - elif [ -z "$runtime" ]; then - download_link="$azure_feed/Sdk/$specific_version/dotnet-sdk-$specific_product_version-$osname-$normalized_architecture.tar.gz" - else - return 1 - fi - - echo "$download_link" - return 0 -} - -# args: -# azure_feed - $1 -# specific_version - $2 -get_specific_product_version() { - # If we find a 'productVersion.txt' at the root of any folder, we'll use its contents - # to resolve the version of what's in the folder, superseding the specified version. - eval $invocation - - local azure_feed="$1" - local specific_version="${2//[$'\t\r\n']}" - local specific_product_version=$specific_version - - local download_link=null - if [[ "$runtime" == "dotnet" ]]; then - download_link="$azure_feed/Runtime/$specific_version/productVersion.txt${feed_credential}" - elif [[ "$runtime" == "aspnetcore" ]]; then - download_link="$azure_feed/aspnetcore/Runtime/$specific_version/productVersion.txt${feed_credential}" - elif [ -z "$runtime" ]; then - download_link="$azure_feed/Sdk/$specific_version/productVersion.txt${feed_credential}" - else - return 1 - fi - - if machine_has "curl" - then - specific_product_version=$(curl -s --fail "$download_link") - if [ $? -ne 0 ] - then - specific_product_version=$specific_version - fi - elif machine_has "wget" - then - specific_product_version=$(wget -qO- "$download_link") - if [ $? -ne 0 ] - then - specific_product_version=$specific_version - fi - fi - specific_product_version="${specific_product_version//[$'\t\r\n']}" - - echo "$specific_product_version" - return 0 -} - -# args: -# azure_feed - $1 -# channel - $2 -# normalized_architecture - $3 -# specific_version - $4 -construct_legacy_download_link() { - eval $invocation - - local azure_feed="$1" - local channel="$2" - local normalized_architecture="$3" - local specific_version="${4//[$'\t\r\n']}" - - local distro_specific_osname - distro_specific_osname="$(get_legacy_os_name)" || return 1 - - local legacy_download_link=null - if [[ "$runtime" == "dotnet" ]]; then - legacy_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" - elif [ -z "$runtime" ]; then - legacy_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz" - else - return 1 - fi - - echo "$legacy_download_link" - return 0 -} - -get_user_install_path() { - eval $invocation - - if [ ! -z "${DOTNET_INSTALL_DIR:-}" ]; then - echo "$DOTNET_INSTALL_DIR" - else - echo "$HOME/.dotnet" - fi - return 0 -} - -# args: -# install_dir - $1 -resolve_installation_path() { - eval $invocation - - local install_dir=$1 - if [ "$install_dir" = "" ]; then - local user_install_path="$(get_user_install_path)" - say_verbose "resolve_installation_path: user_install_path=$user_install_path" - echo "$user_install_path" - return 0 - fi - - echo "$install_dir" - return 0 -} - -# args: -# relative_or_absolute_path - $1 -get_absolute_path() { - eval $invocation - - local relative_or_absolute_path=$1 - echo "$(cd "$(dirname "$1")" && pwd -P)/$(basename "$1")" - return 0 -} - -# args: -# input_files - stdin -# root_path - $1 -# out_path - $2 -# override - $3 -copy_files_or_dirs_from_list() { - eval $invocation - - local root_path="$(remove_trailing_slash "$1")" - local out_path="$(remove_trailing_slash "$2")" - local override="$3" - local osname="$(get_current_os_name)" - local override_switch=$( - if [ "$override" = false ]; then - if [ "$osname" = "linux-musl" ]; then - printf -- "-u"; - else - printf -- "-n"; - fi - fi) - - cat | uniq | while read -r file_path; do - local path="$(remove_beginning_slash "${file_path#$root_path}")" - local target="$out_path/$path" - if [ "$override" = true ] || (! ([ -d "$target" ] || [ -e "$target" ])); then - mkdir -p "$out_path/$(dirname "$path")" - if [ -d "$target" ]; then - rm -rf "$target" - fi - cp -R $override_switch "$root_path/$path" "$target" - fi - done -} - -# args: -# zip_path - $1 -# out_path - $2 -extract_dotnet_package() { - eval $invocation - - local zip_path="$1" - local out_path="$2" - - local temp_out_path="$(mktemp -d "$temporary_file_template")" - - local failed=false - tar -xzf "$zip_path" -C "$temp_out_path" > /dev/null || failed=true - - local folders_with_version_regex='^.*/[0-9]+\.[0-9]+[^/]+/' - find "$temp_out_path" -type f | grep -Eo "$folders_with_version_regex" | sort | copy_files_or_dirs_from_list "$temp_out_path" "$out_path" false - find "$temp_out_path" -type f | grep -Ev "$folders_with_version_regex" | copy_files_or_dirs_from_list "$temp_out_path" "$out_path" "$override_non_versioned_files" - - rm -rf "$temp_out_path" - - if [ "$failed" = true ]; then - say_err "Extraction failed" - return 1 - fi -} - -# args: -# remote_path - $1 -# [out_path] - $2 - stdout if not provided -download() { - eval $invocation - - local remote_path="$1" - local out_path="${2:-}" - - if [[ "$remote_path" != "http"* ]]; then - cp "$remote_path" "$out_path" - return $? - fi - - local failed=false - if machine_has "curl"; then - downloadcurl "$remote_path" "$out_path" || failed=true - elif machine_has "wget"; then - downloadwget "$remote_path" "$out_path" || failed=true - else - failed=true - fi - if [ "$failed" = true ]; then - say_verbose "Download failed: $remote_path" - return 1 - fi - return 0 -} - -downloadcurl() { - eval $invocation - local remote_path="$1" - local out_path="${2:-}" - - # Append feed_credential as late as possible before calling curl to avoid logging feed_credential - remote_path="${remote_path}${feed_credential}" - - local curl_options="--retry 20 --retry-delay 2 --connect-timeout 15 -sSL -f --create-dirs " - local failed=false - if [ -z "$out_path" ]; then - curl $curl_options "$remote_path" || failed=true - else - curl $curl_options -o "$out_path" "$remote_path" || failed=true - fi - if [ "$failed" = true ]; then - say_verbose "Curl download failed" - return 1 - fi - return 0 -} - -downloadwget() { - eval $invocation - local remote_path="$1" - local out_path="${2:-}" - - # Append feed_credential as late as possible before calling wget to avoid logging feed_credential - remote_path="${remote_path}${feed_credential}" - local wget_options="--tries 20 --waitretry 2 --connect-timeout 15 " - local failed=false - if [ -z "$out_path" ]; then - wget -q $wget_options -O - "$remote_path" || failed=true - else - wget $wget_options -O "$out_path" "$remote_path" || failed=true - fi - if [ "$failed" = true ]; then - say_verbose "Wget download failed" - return 1 - fi - return 0 -} - -calculate_vars() { - eval $invocation - valid_legacy_download_link=true - - normalized_architecture="$(get_normalized_architecture_from_architecture "$architecture")" - say_verbose "normalized_architecture=$normalized_architecture" - - specific_version="$(get_specific_version_from_version "$azure_feed" "$channel" "$normalized_architecture" "$version" "$json_file")" - specific_product_version="$(get_specific_product_version "$azure_feed" "$specific_version")" - say_verbose "specific_version=$specific_version" - if [ -z "$specific_version" ]; then - say_err "Could not resolve version information." - return 1 - fi - - download_link="$(construct_download_link "$azure_feed" "$channel" "$normalized_architecture" "$specific_version")" - say_verbose "Constructed primary named payload URL: $download_link" - - legacy_download_link="$(construct_legacy_download_link "$azure_feed" "$channel" "$normalized_architecture" "$specific_version")" || valid_legacy_download_link=false - - if [ "$valid_legacy_download_link" = true ]; then - say_verbose "Constructed legacy named payload URL: $legacy_download_link" - else - say_verbose "Cound not construct a legacy_download_link; omitting..." - fi - - install_root="$(resolve_installation_path "$install_dir")" - say_verbose "InstallRoot: $install_root" -} - -install_dotnet() { - eval $invocation - local download_failed=false - local asset_name='' - local asset_relative_path='' - - if [[ "$runtime" == "dotnet" ]]; then - asset_relative_path="shared/Microsoft.NETCore.App" - asset_name=".NET Core Runtime" - elif [[ "$runtime" == "aspnetcore" ]]; then - asset_relative_path="shared/Microsoft.AspNetCore.App" - asset_name="ASP.NET Core Runtime" - elif [ -z "$runtime" ]; then - asset_relative_path="sdk" - asset_name=".NET Core SDK" - else - say_err "Invalid value for \$runtime" - return 1 - fi - - # Check if the SDK version is already installed. - if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$specific_version"; then - say "$asset_name version $specific_version is already installed." - return 0 - fi - - mkdir -p "$install_root" - zip_path="$(mktemp "$temporary_file_template")" - say_verbose "Zip path: $zip_path" - - say "Downloading link: $download_link" - - # Failures are normal in the non-legacy case for ultimately legacy downloads. - # Do not output to stderr, since output to stderr is considered an error. - download "$download_link" "$zip_path" 2>&1 || download_failed=true - - # if the download fails, download the legacy_download_link - if [ "$download_failed" = true ]; then - say "Cannot download: $download_link" - - if [ "$valid_legacy_download_link" = true ]; then - download_failed=false - download_link="$legacy_download_link" - zip_path="$(mktemp "$temporary_file_template")" - say_verbose "Legacy zip path: $zip_path" - say "Downloading legacy link: $download_link" - download "$download_link" "$zip_path" 2>&1 || download_failed=true - - if [ "$download_failed" = true ]; then - say "Cannot download: $download_link" - fi - fi - fi - - if [ "$download_failed" = true ]; then - say_err "Could not find/download: \`$asset_name\` with version = $specific_version" - say_err "Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support" - return 1 - fi - - say "Extracting zip from $download_link" - extract_dotnet_package "$zip_path" "$install_root" - - # Check if the SDK version is installed; if not, fail the installation. - # if the version contains "RTM" or "servicing"; check if a 'release-type' SDK version is installed. - if [[ $specific_version == *"rtm"* || $specific_version == *"servicing"* ]]; then - IFS='-' - read -ra verArr <<< "$specific_version" - release_version="${verArr[0]}" - unset IFS; - say_verbose "Checking installation: version = $release_version" - if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$release_version"; then - return 0 - fi - fi - - # Check if the standard SDK version is installed. - say_verbose "Checking installation: version = $specific_product_version" - if is_dotnet_package_installed "$install_root" "$asset_relative_path" "$specific_product_version"; then - return 0 - fi - - say_err "\`$asset_name\` with version = $specific_product_version failed to install with an unknown error." - return 1 -} - -args=("$@") - -local_version_file_relative_path="/.version" -bin_folder_relative_path="" -temporary_file_template="${TMPDIR:-/tmp}/dotnet.XXXXXXXXX" - -channel="LTS" -version="Latest" -json_file="" -install_dir="" -architecture="" -dry_run=false -no_path=false -no_cdn=false -azure_feed="https://dotnetcli.azureedge.net/dotnet" -uncached_feed="https://dotnetcli.blob.core.windows.net/dotnet" -feed_credential="" -verbose=false -runtime="" -runtime_id="" -override_non_versioned_files=true -non_dynamic_parameters="" - -while [ $# -ne 0 ] -do - name="$1" - case "$name" in - -c|--channel|-[Cc]hannel) - shift - channel="$1" - ;; - -v|--version|-[Vv]ersion) - shift - version="$1" - ;; - -i|--install-dir|-[Ii]nstall[Dd]ir) - shift - install_dir="$1" - ;; - --arch|--architecture|-[Aa]rch|-[Aa]rchitecture) - shift - architecture="$1" - ;; - --shared-runtime|-[Ss]hared[Rr]untime) - say_warning "The --shared-runtime flag is obsolete and may be removed in a future version of this script. The recommended usage is to specify '--runtime dotnet'." - if [ -z "$runtime" ]; then - runtime="dotnet" - fi - ;; - --runtime|-[Rr]untime) - shift - runtime="$1" - if [[ "$runtime" != "dotnet" ]] && [[ "$runtime" != "aspnetcore" ]]; then - say_err "Unsupported value for --runtime: '$1'. Valid values are 'dotnet' and 'aspnetcore'." - if [[ "$runtime" == "windowsdesktop" ]]; then - say_err "WindowsDesktop archives are manufactured for Windows platforms only." - fi - exit 1 - fi - ;; - --dry-run|-[Dd]ry[Rr]un) - dry_run=true - ;; - --no-path|-[Nn]o[Pp]ath) - no_path=true - non_dynamic_parameters+=" $name" - ;; - --verbose|-[Vv]erbose) - verbose=true - non_dynamic_parameters+=" $name" - ;; - --no-cdn|-[Nn]o[Cc]dn) - no_cdn=true - non_dynamic_parameters+=" $name" - ;; - --azure-feed|-[Aa]zure[Ff]eed) - shift - azure_feed="$1" - non_dynamic_parameters+=" $name "\""$1"\""" - ;; - --uncached-feed|-[Uu]ncached[Ff]eed) - shift - uncached_feed="$1" - non_dynamic_parameters+=" $name "\""$1"\""" - ;; - --feed-credential|-[Ff]eed[Cc]redential) - shift - feed_credential="$1" - non_dynamic_parameters+=" $name "\""$1"\""" - ;; - --runtime-id|-[Rr]untime[Ii]d) - shift - runtime_id="$1" - non_dynamic_parameters+=" $name "\""$1"\""" - ;; - --jsonfile|-[Jj][Ss]on[Ff]ile) - shift - json_file="$1" - ;; - --skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles) - override_non_versioned_files=false - non_dynamic_parameters+=" $name" - ;; - -?|--?|-h|--help|-[Hh]elp) - script_name="$(basename "$0")" - echo ".NET Tools Installer" - echo "Usage: $script_name [-c|--channel ] [-v|--version ] [-p|--prefix ]" - echo " $script_name -h|-?|--help" - echo "" - echo "$script_name is a simple command line interface for obtaining dotnet cli." - echo "" - echo "Options:" - echo " -c,--channel Download from the channel specified, Defaults to \`$channel\`." - echo " -Channel" - echo " Possible values:" - echo " - Current - most current release" - echo " - LTS - most current supported release" - echo " - 2-part version in a format A.B - represents a specific release" - echo " examples: 2.0; 1.0" - echo " - Branch name" - echo " examples: release/2.0.0; Master" - echo " Note: The version parameter overrides the channel parameter." - echo " -v,--version Use specific VERSION, Defaults to \`$version\`." - echo " -Version" - echo " Possible values:" - echo " - latest - most latest build on specific channel" - echo " - coherent - most latest coherent build on specific channel" - echo " coherent applies only to SDK downloads" - echo " - 3-part version in a format A.B.C - represents specific version of build" - echo " examples: 2.0.0-preview2-006120; 1.1.0" - echo " -i,--install-dir Install under specified location (see Install Location below)" - echo " -InstallDir" - echo " --architecture Architecture of dotnet binaries to be installed, Defaults to \`$architecture\`." - echo " --arch,-Architecture,-Arch" - echo " Possible values: x64, arm, and arm64" - echo " --runtime Installs a shared runtime only, without the SDK." - echo " -Runtime" - echo " Possible values:" - echo " - dotnet - the Microsoft.NETCore.App shared runtime" - echo " - aspnetcore - the Microsoft.AspNetCore.App shared runtime" - echo " --dry-run,-DryRun Do not perform installation. Display download link." - echo " --no-path, -NoPath Do not set PATH for the current process." - echo " --verbose,-Verbose Display diagnostics information." - echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user." - echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user." - echo " --feed-credential,-FeedCredential Azure feed shared access token. This parameter typically is not specified." - echo " --skip-non-versioned-files Skips non-versioned files if they already exist, such as the dotnet executable." - echo " -SkipNonVersionedFiles" - echo " --no-cdn,-NoCdn Disable downloading from the Azure CDN, and use the uncached feed directly." - echo " --jsonfile Determines the SDK version from a user specified global.json file." - echo " Note: global.json must have a value for 'SDK:Version'" - echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)." - echo " -RuntimeId" - echo " -?,--?,-h,--help,-Help Shows this help message" - echo "" - echo "Obsolete parameters:" - echo " --shared-runtime The recommended alternative is '--runtime dotnet'." - echo " This parameter is obsolete and may be removed in a future version of this script." - echo " Installs just the shared runtime bits, not the entire SDK." - echo "" - echo "Install Location:" - echo " Location is chosen in following order:" - echo " - --install-dir option" - echo " - Environmental variable DOTNET_INSTALL_DIR" - echo " - $HOME/.dotnet" - exit 0 - ;; - *) - say_err "Unknown argument \`$name\`" - exit 1 - ;; - esac - - shift -done - -if [ "$no_cdn" = true ]; then - azure_feed="$uncached_feed" -fi - -say "Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:" -say "- The SDK needs to be installed without user interaction and without admin rights." -say "- The SDK installation doesn't need to persist across multiple CI runs." -say "To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.\n" - -check_min_reqs -calculate_vars -script_name=$(basename "$0") - -if [ "$dry_run" = true ]; then - say "Payload URLs:" - say "Primary named payload URL: $download_link" - if [ "$valid_legacy_download_link" = true ]; then - say "Legacy named payload URL: $legacy_download_link" - fi - repeatable_command="./$script_name --version "\""$specific_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\""" - if [[ "$runtime" == "dotnet" ]]; then - repeatable_command+=" --runtime "\""dotnet"\""" - elif [[ "$runtime" == "aspnetcore" ]]; then - repeatable_command+=" --runtime "\""aspnetcore"\""" - fi - repeatable_command+="$non_dynamic_parameters" - say "Repeatable invocation: $repeatable_command" - exit 0 -fi - -install_dotnet - -bin_path="$(get_absolute_path "$(combine_paths "$install_root" "$bin_folder_relative_path")")" -if [ "$no_path" = false ]; then - say "Adding to current process PATH: \`$bin_path\`. Note: This change will be visible only when sourcing script." - export PATH="$bin_path":"$PATH" -else - say "Binaries of dotnet can be found in $bin_path" -fi - -say "Note that the script does not resolve dependencies during installation." -say "To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install, select your operating system and check the \"Dependencies\" section." -say "Installation finished successfully." - diff --git a/.travis/run-tests-cpp.sh b/.travis/run-tests-cpp.sh deleted file mode 100755 index e95dc8922d..0000000000 --- a/.travis/run-tests-cpp.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -if [ $GROUP == "LEXER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=cpp.* test -elif [ $GROUP == "PARSER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=cpp.* test -elif [ $GROUP == "RECURSION" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=cpp.* test -else - mvn -q -Dtest=cpp.* test -fi - diff --git a/.travis/run-tests-dart.sh b/.travis/run-tests-dart.sh deleted file mode 100755 index 8053a90d71..0000000000 --- a/.travis/run-tests-dart.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -set -euo pipefail -mvn -q -Dparallel=classes -DthreadCount=4 -Dtest=dart.* test diff --git a/.travis/run-tests-dotnet.sh b/.travis/run-tests-dotnet.sh deleted file mode 100755 index 2b3f615b7c..0000000000 --- a/.travis/run-tests-dotnet.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -export PATH=$PATH:/Users/travis/.dotnet - -# we need to build the runtime before test run, since we used "--no-dependencies" -# when we call dotnet cli for restore and build, in order to speed up - -dotnet build -c Release -f netstandard2.0 ../runtime/CSharp/src/Antlr4.csproj - -# call test - -if [ $GROUP == "LEXER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dparallel=classes -DthreadCount=4 -Dtest=csharp.* test -elif [ $GROUP == "PARSER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dparallel=classes -DthreadCount=4 -Dtest=csharp.* test -elif [ $GROUP == "RECURSION" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dparallel=classes -DthreadCount=4 -Dtest=csharp.* test -else - mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=csharp.* test -fi diff --git a/.travis/run-tests-go.sh b/.travis/run-tests-go.sh deleted file mode 100755 index 1a127ce864..0000000000 --- a/.travis/run-tests-go.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=go.* test diff --git a/.travis/run-tests-java.sh b/.travis/run-tests-java.sh deleted file mode 100755 index b2fde3660d..0000000000 --- a/.travis/run-tests-java.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=java.* test -cd ../tool-testsuite -mvn test diff --git a/.travis/run-tests-javascript.sh b/.travis/run-tests-javascript.sh deleted file mode 100755 index ae8a7e8bcc..0000000000 --- a/.travis/run-tests-javascript.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -cd ../runtime/JavaScript -npm install -npm link -cd ../../runtime-testsuite -mvn -q -Dparallel=methods -DthreadCount=1 -Dtest=javascript.* test diff --git a/.travis/run-tests-php.sh b/.travis/run-tests-php.sh deleted file mode 100755 index 853efbd86a..0000000000 --- a/.travis/run-tests-php.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -php_path=$(which php) - -composer install -d ../runtime/PHP - -mvn -q -DPHP_PATH="${php_path}" -Dparallel=methods -DthreadCount=4 -Dtest=php.* test diff --git a/.travis/run-tests-python2.sh b/.travis/run-tests-python2.sh deleted file mode 100755 index c5cd0ca998..0000000000 --- a/.travis/run-tests-python2.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -python --version - -mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=python2.* test - -cd ../runtime/Python2/tests - -python run.py diff --git a/.travis/run-tests-python3.sh b/.travis/run-tests-python3.sh deleted file mode 100755 index 8b74928c5c..0000000000 --- a/.travis/run-tests-python3.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -python3 --version - -mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=python3.* test - -cd ../runtime/Python3/test - -python3 run.py diff --git a/.travis/run-tests-swift.sh b/.travis/run-tests-swift.sh deleted file mode 100755 index 677f356b2c..0000000000 --- a/.travis/run-tests-swift.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -# linux specific setup, those setup have to be -# here since environment variables doesn't pass -# across scripts -if [ $TRAVIS_OS_NAME == "linux" ]; then - export SWIFT_VERSION=swift-5.0.1 - export SWIFT_HOME=$(pwd)/swift/$SWIFT_VERSION-RELEASE-ubuntu16.04/usr/bin/ - export PATH=$SWIFT_HOME:$PATH - - # download swift - mkdir swift - curl https://swift.org/builds/$SWIFT_VERSION-release/ubuntu1604/$SWIFT_VERSION-RELEASE/$SWIFT_VERSION-RELEASE-ubuntu16.04.tar.gz -s | tar xz -C swift &> /dev/null -fi - -if [ -z "${JAVA_HOME-}" ] -then - export JAVA_HOME="$(java -XshowSettings:properties -version 2>&1 | - grep 'java\.home' | awk '{ print $3 }')" - echo "export JAVA_HOME=$JAVA_HOME" -fi - -# check swift -swift --version -swift build --version - -pushd ../runtime/Swift -./boot.py --test -popd - -if [ $GROUP == "LEXER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LexerTests" -Dtest=swift.* test -elif [ $GROUP == "PARSER" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.ParserTests" -Dtest=swift.* test -elif [ $GROUP == "RECURSION" ]; then - mvn -q -Dgroups="org.antlr.v4.test.runtime.category.LeftRecursionTests" -Dtest=swift.* test -else - mvn -q -Dtest=swift.* test -fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c5336e7ca7..8a095fe3f7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,11 +2,21 @@ 1. [Fork](https://help.github.com/articles/fork-a-repo) the [antlr/antlr4 repo](https://github.com/antlr/antlr4), which will give you both key branches, `master` and `dev` 2. Make sure to `git checkout dev` in your fork so that you are working from the latest development branch -2. Install and configure [EditorConfig](http://editorconfig.org/) so your text editor or IDE uses the ANTLR 4 coding style -3. [Build ANTLR 4](doc/building-antlr.md) -4. [Run the ANTLR project unit tests](doc/antlr-project-testing.md) -5. Create a [pull request](https://help.github.com/articles/using-pull-requests/) with your changes and make sure you're comparing the `dev` branch in your fork to the `dev` branch from the `antlr/antlr4` repo: +3. Create and work from a branch from `dev` such as `git checkout -b your-branch-name` +4. Install and configure [EditorConfig](http://editorconfig.org/) so your text editor or IDE uses the ANTLR 4 coding style +5. [Build ANTLR 4](doc/building-antlr.md) +6. [Run the ANTLR project unit tests](doc/antlr-project-testing.md) +7. Create a [pull request](https://help.github.com/articles/using-pull-requests/) with your changes and make sure you're comparing your `dev`-derived branch in your fork to the `dev` branch from the `antlr/antlr4` repo: -**Note:** You must sign the `contributors.txt` certificate of origin with your pull request if you've not done so before. +**Note:** Each commit requires a "signature", which is simple as using `-s` (not +`-S`) to the git commit command: + +``` +git commit -s -m 'This is my commit message' +``` + +Github's pull request process enforces the sig and gives instructions on how to +fix any commits that lack the sig. See [Github DCO app](https://github.com/apps/dco) +for more info. diff --git a/runtime/Swift/Package.swift b/Package.swift similarity index 52% rename from runtime/Swift/Package.swift rename to Package.swift index 0d72a47dda..b8ec930c22 100644 --- a/runtime/Swift/Package.swift +++ b/Package.swift @@ -1,7 +1,5 @@ -// swift-tools-version:4.0 -// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. -// Use of this file is governed by the BSD 3-clause license that -// can be found in the LICENSE.txt file in the project root. +// swift-tools-version:5.3 + import PackageDescription @@ -16,9 +14,11 @@ let package = Package( targets: [ .target( name: "Antlr4", - dependencies: []), + dependencies: [], + path: "./runtime/Swift/Sources/Antlr4"), .testTarget( name: "Antlr4Tests", - dependencies: ["Antlr4"]), + dependencies: ["Antlr4"], + path:"./runtime/Swift/Tests/Antlr4Tests"), ] ) diff --git a/README.md b/README.md index 9ec6b762e4..7617215bc9 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,6 @@ Targets such as Go that pull directly from the repository can use the default `m $ go get github.com/antlr/antlr4/runtime/Go/antlr@dev ``` - - ## Authors and major contributors * [Terence Parr](http://www.cs.usfca.edu/~parrt/), parrt@cs.usfca.edu diff --git a/antlr4-maven-plugin/pom.xml b/antlr4-maven-plugin/pom.xml index 92b1608757..233a15e094 100644 --- a/antlr4-maven-plugin/pom.xml +++ b/antlr4-maven-plugin/pom.xml @@ -8,23 +8,18 @@ org.antlr antlr4-master - 4.9.4-SNAPSHOT + 4.10-SNAPSHOT antlr4-maven-plugin maven-plugin ANTLR 4 Maven plugin Maven plugin for ANTLR 4 grammars - - 3.0 - - 2009 - 3.3.9 - 1.11.12 + 3.8.4 @@ -39,13 +34,13 @@ org.apache.maven maven-plugin-api - 3.0.5 - compile + 3.8.4 + provided org.codehaus.plexus plexus-compiler-api - 2.2 + 2.9.0 org.sonatype.plexus @@ -64,26 +59,26 @@ junit junit - 4.13.1 + 4.13.2 test org.apache.maven.plugin-tools maven-plugin-annotations - 3.2 + 3.6.2 provided io.takari.maven.plugins takari-plugin-testing - 2.9.0 + 3.0.0 test org.apache.maven maven-core ${mavenVersion} - test + provided org.apache.maven @@ -94,14 +89,19 @@ org.codehaus.plexus plexus-utils - 3.0.15 + 3.4.1 provided - - org.apache.maven - maven-project - 2.2.1 - + + org.slf4j + slf4j-api + 1.7.32 + + + org.slf4j + slf4j-simple + 1.7.32 + @@ -120,7 +120,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.6.0 + 3.6.2 true @@ -143,7 +143,6 @@ io.takari.maven.plugins takari-lifecycle-plugin - ${takariLifecycleVersion} true @@ -155,6 +154,13 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + + @@ -168,7 +174,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.4 + 3.3.1 true @@ -176,8 +182,8 @@ org.apache.maven.plugins maven-jxr-plugin - 2.5 + 3.1.1 - + \ No newline at end of file diff --git a/antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4Mojo.java b/antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4Mojo.java index 472b0147c4..3fb37a8e0e 100644 --- a/antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4Mojo.java +++ b/antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/Antlr4Mojo.java @@ -276,7 +276,7 @@ public void execute() throws MojoExecutionException, MojoFailureException { for (List args : argumentSets) { try { // Create an instance of the ANTLR 4 build tool - tool = new CustomTool(args.toArray(new String[args.size()])); + tool = new CustomTool(args.toArray(new String[0])); } catch (Exception e) { log.error("The attempt to create the ANTLR 4 build tool failed, see exception report for details", e); throw new MojoFailureException("Error creating an instanceof the ANTLR tool.", e); diff --git a/developer-cert-of-origin.txt b/developer-cert-of-origin.txt new file mode 100644 index 0000000000..7274c56507 --- /dev/null +++ b/developer-cert-of-origin.txt @@ -0,0 +1,52 @@ +As of 4.10, ANTLR uses the Linux Foundation's Developer +Certificate of Origin, DCO, version 1.1. See either +https://developercertificate.org/ or the text below. + +Each commit requires a "signature", which is simple as +using `-s` (not `-S`) to the git commit command: + +git commit -s -m 'This is my commit message' + +Github's pull request process enforces the sig and gives +instructions on how to fix any commits that lack the sig. +See https://github.com/apps/dco for more info. + +No signature is required in this file (unlike the +previous ANTLR contributor's certificate of origin.) + +----- https://developercertificate.org/ ------ + +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/doc/actions.md b/doc/actions.md index 9eb61eb52f..35455cb2f2 100644 --- a/doc/actions.md +++ b/doc/actions.md @@ -81,7 +81,7 @@ returnStat : 'return' expr {System.out.println("matched "+$expr.text);} ; Using a rule label looks like this: ``` -returnStat : 'return' e=expr {System.out.println("matched "+e.text);} ; +returnStat : 'return' e=expr {System.out.println("matched "+$e.text);} ; ``` You can also use `$` followed by the name of the attribute to access the value associated with the currently executing rule. For example, `$start` is the starting token of the current rule. diff --git a/doc/antlr-project-testing.md b/doc/antlr-project-testing.md index 3e14eac73e..2cb11938ca 100644 --- a/doc/antlr-project-testing.md +++ b/doc/antlr-project-testing.md @@ -6,37 +6,41 @@ Because ANTLR supports multiple target languages, the unit tests are broken into The runtime tests must be specified in a generic fashion to work across language targets. Furthermore, we must test the various targets from Java. This usually means Java launching processes to compile, say, C++ and run parsers. -As of 4.6, we use [a Java descriptor object](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/RuntimeTestDescriptor.java) to describe each runtime test. Unit tests are grouped together into categories such as [ParserExecDescriptors](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserExecDescriptors.java), which has multiple nested descriptor objects, one per test. For example, here is the start of that file: - -```java -public class ParserExecDescriptors { - public static class APlus extends BaseParserTestDescriptor { - public String input = "a b c"; - public String output = "abc\n"; - public String errors = ""; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ID+ { - - }; - ID : 'a'..'z'+; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - } +As of 4.10, we use a Java descriptor file held as an [UniversalRuntimeTestDescriptor.java object](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/UniversalRuntimeTestDescriptor.java) to represent each runtime test. Each test is described with a text file with various sections and resides in a group directory; see [directories under descriptors dir](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors). Here is a sample test descriptor: + ``` +[notes] +This is a regression test for blah blah blah... + +[type] +Parser + +[grammar] +grammar T; +a : ID* { + +}; +ID : 'a'..'z'+; +WS : (' '|'\n') -> skip; + +[start] +a -The mysterious `@CommentHasStringValue` annotation is a bit of a hack that allows multi-line strings in Java. This kung fu is required so that we can use Java classes rather than StringTemplate group files to specify runtime tests (the legacy system used those and it was hard to get them right). Here are all the [Runtime test descriptors](https://github.com/antlr/antlr4/tree/master/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors) organized into groups. +[input] +a b c + +[output] +"""abc +""" +``` The grammars are strings representing StringTemplates (`ST` objects) so `` will get replace when the unit test file is generated (`Test.java`, `Test.cs`, ...). The `writeln` template must be defined per target. Here are all of the -[Target templates for runtime tests](https://github.com/antlr/antlr4/tree/master/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates). +[Target templates for runtime tests](https://github.com/antlr/antlr4/tree/master/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates). Use triple-quotes `"""` when whitespace matters (usually input/output sections). ## Requirements +*out of date, at least for mono* + In order to perform the tests on all target languages, you need to have the following languages installed: * `mono` (e.g., `brew install mono`) on non-Windows boxes (on Windows it uses the Microsoft .net stack). Also must [`xbuild` the runtime](https://github.com/antlr/antlr4/blob/master/doc/releasing-antlr.md) before tests will run; see below @@ -44,14 +48,14 @@ In order to perform the tests on all target languages, you need to have the foll * Python 2.7 * Python 3.6 * Go -* Swift 4 (via XCode 10.x) tested currently only osx +* Swift (via XCode) tested currently only osx * clang (for C++ target) -* + To **install into local repository** `~/.m2/repository/org/antlr`, do this: ```bash -$ export MAVEN_OPTS="-Xmx1G" # don't forget this on linux -$ mvn install -DskipTests=true # make sure all artifacts are visible on this machine +$ export MAVEN_OPTS="-Xmx1G" # don't forget this on linux +$ mvn install -DskipTests # make sure all artifacts are visible on this machine ``` Now, make sure C# runtime is built and installed locally. @@ -76,51 +80,6 @@ And the result of testing the entire subdirectory: -From `mvn`, on the commandline, you will see: - -```bash -$ cd antlr4 -$ mvn test -... -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running org.antlr.v4.test.runtime.csharp.TestCompositeLexers -dir /var/folders/s1/h3qgww1x0ks3pb30l8t1wgd80000gn/T/TestCompositeLexers-1446068612451 -Starting build /usr/bin/xbuild /p:Configuration=Release /var/folders/s1/h3qgww1x0ks3pb30l8t1wgd80000gn/T/TestCompositeLexers-1446068612451/Antlr4.Test.mono.csproj -dir /var/folders/s1/h3qgww1x0ks3pb30l8t1wgd80000gn/T/TestCompositeLexers-1446068615081 -Starting build /usr/bin/xbuild /p:Configuration=Release /var/folders/s1/h3qgww1x0ks3pb30l8t1wgd80000gn/T/TestCompositeLexers-1446068615081/Antlr4.Test.mono.csproj -Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.451 sec -Running org.antlr.v4.test.runtime.csharp.TestCompositeParsers -dir /var/folders/s1/h3qgww1x0ks3pb30l8t1wgd80000gn/T/TestCompositeParsers-1446068615864 -antlr reports warnings from [-visitor, -Dlanguage=CSharp, -o, /var/folders/s1/h3qgww1x0ks3pb30l8t1wgd80000gn/T/TestCompositeParsers-1446068615864, -lib, /var/folders/s1/h3qgww1x0ks3pb30l8t1wgd80000gn/T/TestCompositeParsers-1446068615864, -encoding, UTF-8, /var/folders/s1/h3qgww1x0ks3pb30l8t1wgd80000gn/T/TestCompositeParsers-1446068615864/M.g4] -... -[INFO] ------------------------------------------------------------------------ -[INFO] Reactor Summary: -[INFO] -[INFO] ANTLR 4 ............................................ SUCCESS [ 0.445 s] -[INFO] ANTLR 4 Runtime .................................... SUCCESS [ 3.392 s] -[INFO] ANTLR 4 Tool ....................................... SUCCESS [ 1.373 s] -[INFO] ANTLR 4 Maven plugin ............................... SUCCESS [ 1.519 s] -[INFO] ANTLR 4 Runtime Test Annotations ................... SUCCESS [ 0.086 s] -[INFO] ANTLR 4 Runtime Test Processors .................... SUCCESS [ 0.014 s] -[INFO] ANTLR 4 Runtime Tests (2nd generation) ............. SUCCESS [06:39 min] -[INFO] ANTLR 4 Tool Tests ................................. SUCCESS [ 6.922 s] -[INFO] ------------------------------------------------------------------------ -[INFO] BUILD SUCCESS -[INFO] ------------------------------------------------------------------------ -[INFO] Total time: 06:53 min -[INFO] Finished at: 2016-11-16T15:36:56-08:00 -[INFO] Final Memory: 44M/458M -[INFO] ------------------------------------------------------------------------ -``` - -Note: That is actually result of running the much faster: - -```bash -mvn -Dparallel=methods -DthreadCount=4 install -``` - ## Running test subsets *From the `runtime-testsuite` dir* @@ -157,7 +116,7 @@ Running org.antlr.v4.test.runtime.cpp.TestCompositeLexers ```bash $ cd runtime-testsuite -$ mvn -Dtest=java.* test +$ mvn -Dtest=java.** test ... ``` @@ -190,12 +149,12 @@ Use this to run tests in parallel: ```bash $ export MAVEN_OPTS="-Xmx1G" -$ mvn -Dparallel=methods -DthreadCount=4 test +$ mvn -Dparallel=classes -DthreadCount=4 test ... ------------------------------------------------------- T E S T S ------------------------------------------------------- -Concurrency config is parallel='methods', perCoreThreadCount=true, threadCount=4, useUnlimitedThreads=false +Concurrency config is parallel='classes', perCoreThreadCount=true, threadCount=4, useUnlimitedThreads=false ... ``` @@ -203,55 +162,42 @@ This can be combined with other `-D` above. ## Adding a runtime test -To add a new runtime test, first determine which [group of tests](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors) it belongs to. Then, add a new [RuntimeTestDescriptor](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/RuntimeTestDescriptor.java) implementation by subclassing one of: - -* [BaseParserTestDescriptor](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseParserTestDescriptor.java); see example [APlus](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserExecDescriptors.java#L7). -* [BaseDiagnosticParserTestDescriptor](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseDiagnosticParserTestDescriptor) if you want to test parser diagnostic output; see [example output](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/FullContextParsingDescriptors.java#L16). -* [BaseCompositeParserTestDescriptor](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseCompositeParserTestDescriptor.java); see example [BringInLiteralsFromDelegate](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/CompositeParsersDescriptors.java#L11) -* [BaseLexerTestDescriptor](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseLexerTestDescriptor.java); see example [ActionPlacement](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/LexerExecDescriptors.java#L12). -* [BaseCompositeLexerTestDescriptor](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseCompositeLexerTestDescriptor.java); see example [LexerDelegatorInvokesDelegateRule](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/CompositeLexersDescriptors.java#L11) +To add a new runtime test, first determine which [group (dir) of tests](https://github.com/antlr/antlr4/blob/master/runtime-testsuite/descriptors/org/antlr/v4/test/runtime/descriptors) it belongs to. Then, add a new descriptor file implementation by filling in one of these (omitting unused sections): +``` +[notes] + +[type] -Each descriptor object describes the following mandatory elements for the test: +[grammar] - * the test type - * the grammar - * the start rule - * the input text to parse or lex - * the expected output - * the expected errors +[slaveGrammar] -Your best bet is to find a similar test in the appropriate group and then copy and paste the descriptor object, creating a new nested class within the test group class. Modify the field definitions to suit your new problem. +[start] -If you need to create a whole new group of tests, it requires a new descriptor class; call it `XDescriptors`. Then, in each [target subdirectory](https://github.com/antlr/antlr4/tree/master/runtime-testsuite/test/org/antlr/v4/test/runtime), you need to create a new test rig `TestX.java` file: +[input] -```java -package org.antlr.v4.test.runtime.java; +[output] -import org.antlr.v4.test.runtime.BaseRuntimeTest; -import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +[errors] -@RunWith(Parameterized.class) -public class TestX extends BaseRuntimeTest { - public TestX(RuntimeTestDescriptor descriptor) { - super(descriptor,new BaseTest()); - } +[flags] - @Parameterized.Parameters(name="{0}") - public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(XDescriptors.class, ""); - } -} +[skip] ``` -where `` is replaced with Java, Cpp, CSharp, Python2, ... in the various subdirectories. + +Your best bet is to find a similar test in the appropriate group and then copy and paste the descriptor file, creating a new file within the test group dir. Modify the sections to suit your new problem. ### Ignoring tests -In order to turn off a test for a particular target, we need to use the `ignore` method. Given a target name, a descriptor object can decide whether to ignore the test. This is not always convenient but it is fully general and works well for the one case we have now where we have to ignore `Visitor` tests in all targets except JavaScript. +In order to turn off a test for a particular target, we need to use the `skip` section in the descriptor file. For example, the following skips PHP and Dart targets: + +``` +[skip] +PHP +Dart +``` ### Target API/library testing diff --git a/doc/building-antlr.md b/doc/building-antlr.md index 15ff6ff8e6..17091f9d76 100644 --- a/doc/building-antlr.md +++ b/doc/building-antlr.md @@ -7,7 +7,7 @@ Most programmers do not need the information on this page because they will simp I will assume that the root directory is `/tmp` for the purposes of explaining how to build ANTLR in this document. -*As of 4.6, ANTLR tool and Java-target runtime requires Java 7.* +*As of 4.6, ANTLR tool and Java-target runtime requires Java 7. As of 4.10, we have verified that the tool itself builds with Java 8 and 11.* # Get the source @@ -43,41 +43,35 @@ $ if [[ "$?" != "0" ]]; then sudo apt install -y maven; fi # Compile -```bash -$ cd /tmp/antlr4 -$ export MAVEN_OPTS="-Xmx1G" # don't forget this on linux -$ mvn clean # must be separate, not part of install/compile -$ mvn -DskipTests install +The current maven build seems complicated to me because there is a dependency of the project on itself. The runtime tests naturally depend on the current version being available but it won't compile without the current version. Once you have the generated/installed jar, mvn builds but otherwise there's a dependency on what you are going to build. You will get this error when you try to clean but you can ignore it: + +``` +[INFO] ANTLR 4 Runtime Tests (3rd generation) ............. FAILURE [ 0.073 s] ... -[INFO] ------------------------------------------------------------------------ -[INFO] Reactor Summary: -[INFO] -[INFO] ANTLR 4 ............................................ SUCCESS [ 0.287 s] -[INFO] ANTLR 4 Runtime .................................... SUCCESS [ 4.915 s] -[INFO] ANTLR 4 Tool ....................................... SUCCESS [ 1.315 s] -[INFO] ANTLR 4 Maven plugin ............................... SUCCESS [ 2.393 s] -[INFO] ANTLR 4 Runtime Test Annotations ................... SUCCESS [ 0.078 s] -[INFO] ANTLR 4 Runtime Test Processors .................... SUCCESS [ 0.019 s] -[INFO] ANTLR 4 Runtime Tests (2nd generation) ............. SUCCESS [ 1.986 s] -[INFO] ANTLR 4 Tool Tests ................................. SUCCESS [ 0.513 s] -[INFO] ------------------------------------------------------------------------ -[INFO] BUILD SUCCESS -[INFO] ------------------------------------------------------------------------ -[INFO] Total time: 12.005 s -[INFO] Finished at: 2016-11-21T11:42:42-08:00 -[INFO] Final Memory: 52M/434M -[INFO] ------------------------------------------------------------------------ +[ERROR] Plugin org.antlr:antlr4-maven-plugin:4.10-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact org.antlr:antlr4-maven-plugin:jar:4.10-SNAPSHOT -> [Help 1] +``` + +To be super squeaky clean, you can wipe out the repository cache, then do the build: + +``` +$ export MAVEN_OPTS="-Xmx1G" # don't forget this on linux +cd /tmp/antlr4 # or wherever you have the software +rm -rf ~/.m2/repository/org/antlr* +mvn clean +mvn -DskipTests install ``` **NOTE:** We do `install` not `compile` as tool tests and such refer to modules that must be pulled from the maven install local cache. +Once you have completed this process once and there is a jar hanging around in the repository cache. + # Installing libs to mvn cache locally To skip the tests (which require all the target languages be installed) and **install into local repository** `~/.m2/repository/org/antlr`, do this: ```bash $ export MAVEN_OPTS="-Xmx1G" # don't forget this on linux -$ mvn install -DskipTests=true # make sure all artifacts are visible on this machine +$ mvn install -DskipTests # make sure all artifacts are visible on this machine ``` You should see these jars (when building 4.6-SNAPSHOT): @@ -85,8 +79,6 @@ You should see these jars (when building 4.6-SNAPSHOT): ```bash /Users/parrt/.m2/repository/org/antlr $ find antlr4* -name '*.jar' antlr4-maven-plugin/4.6-SNAPSHOT/antlr4-maven-plugin-4.6-SNAPSHOT.jar -antlr4-runtime-test-annotation-processors/4.6-SNAPSHOT/antlr4-runtime-test-annotation-processors-4.6-SNAPSHOT.jar -antlr4-runtime-test-annotations/4.6-SNAPSHOT/antlr4-runtime-test-annotations-4.6-SNAPSHOT.jar antlr4-runtime-testsuite/4.6-SNAPSHOT/antlr4-runtime-testsuite-4.6-SNAPSHOT-tests.jar antlr4-runtime-testsuite/4.6-SNAPSHOT/antlr4-runtime-testsuite-4.6-SNAPSHOT.jar antlr4-runtime/4.6-SNAPSHOT/antlr4-runtime-4.6-SNAPSHOT.jar diff --git a/doc/case-insensitive-lexing.md b/doc/case-insensitive-lexing.md deleted file mode 100644 index 9eecf3be4b..0000000000 --- a/doc/case-insensitive-lexing.md +++ /dev/null @@ -1,80 +0,0 @@ -# Case-Insensitive Lexing - -In some languages, keywords are case insensitive meaning that `BeGiN` means the same thing as `begin` or `BEGIN`. ANTLR has two mechanisms to support building grammars for such languages: - -1. Build lexical rules that match either upper or lower case. - * **Advantage**: no changes required to ANTLR, makes it clear in the grammar that the language in this case insensitive. - * **Disadvantage**: might have a small efficiency cost and grammar is a more verbose and more of a hassle to write. - -2. Build lexical rules that match keywords in all uppercase and then parse with a custom [character stream](https://github.com/antlr/antlr4/blob/master/runtime/Java/src/org/antlr/v4/runtime/CharStream.java) that converts all characters to uppercase before sending them to the lexer (via the `LA()` method). Care must be taken not to convert all characters in the stream to uppercase because characters within strings and comments should be unaffected. All we really want is to trick the lexer into thinking the input is all uppercase. - * **Advantage**: Could have a speed advantage depending on implementation, no change required to the grammar. - * **Disadvantage**: Requires that the case-insensitive stream and grammar are used in correctly in conjunction with each other, makes all characters appear as uppercase/lowercase to the lexer but some grammars are case sensitive outside of keywords, errors new case insensitive streams and language output targets (java, C#, C++, ...). - -For the 4.7.1 release, we discussed both approaches in [detail](https://github.com/antlr/antlr4/pull/2046) and even possibly altering the ANTLR metalanguage to directly support case-insensitive lexing. We discussed including the case insensitive streams into the runtime but not all would be immediately supported. I decided to simply make documentation that clearly states how to handle this and include the appropriate snippets that people can cut-and-paste into their grammars. - -## Case-insensitive grammars - -As a prime example of a grammar that specifically describes case insensitive keywords, see the -[SQLite grammar](https://github.com/antlr/grammars-v4/blob/master/sqlite/SQLite.g4). To match a case insensitive keyword, there are rules such as - -``` -K_UPDATE : U P D A T E; -``` - -that will match `UpdaTE` and `upDATE` etc... as the `update` keyword. This rule makes use of some generically useful fragment rules that you can cut-and-paste into your grammars: - -``` -fragment A : [aA]; // match either an 'a' or 'A' -fragment B : [bB]; -fragment C : [cC]; -fragment D : [dD]; -fragment E : [eE]; -fragment F : [fF]; -fragment G : [gG]; -fragment H : [hH]; -fragment I : [iI]; -fragment J : [jJ]; -fragment K : [kK]; -fragment L : [lL]; -fragment M : [mM]; -fragment N : [nN]; -fragment O : [oO]; -fragment P : [pP]; -fragment Q : [qQ]; -fragment R : [rR]; -fragment S : [sS]; -fragment T : [tT]; -fragment U : [uU]; -fragment V : [vV]; -fragment W : [wW]; -fragment X : [xX]; -fragment Y : [yY]; -fragment Z : [zZ]; -``` - -No special streams are required to use this mechanism for case insensitivity. - -## Custom character streams approach - -The other approach is to use lexical rules that match either all uppercase or all lowercase, such as: - -``` -K_UPDATE : 'UPDATE'; -``` - -Then, when creating the character stream to parse from, we need a custom class that overrides methods used by the lexer. Below you will find custom character streams for a number of the targets that you can copy into your projects, but here is how to use the streams in Java as an example: - -```java -CharStream s = CharStreams.fromPath(Paths.get('test.sql')); -CaseChangingCharStream upper = new CaseChangingCharStream(s, true); -Lexer lexer = new SomeSQLLexer(upper); -``` - -Here are implementations of `CaseChangingCharStream` in various target languages: - -* [C#](https://github.com/antlr/antlr4/blob/master/doc/resources/CaseChangingCharStream.cs) -* [Dart](https://github.com/antlr/antlr4/blob/master/doc/resources/case_changing_char_stream.dart) -* [Go](https://github.com/antlr/antlr4/blob/master/doc/resources/case_changing_stream.go) -* [Java](https://github.com/antlr/antlr4/blob/master/doc/resources/CaseChangingCharStream.java) -* [JavaScript](https://github.com/antlr/antlr4/blob/master/doc/resources/CaseChangingStream.js) -* [Python2/3](https://github.com/antlr/antlr4/blob/master/doc/resources/CaseChangingStream.py) diff --git a/doc/dart-target.md b/doc/dart-target.md index 58ff668ccc..399379f9f1 100644 --- a/doc/dart-target.md +++ b/doc/dart-target.md @@ -1,6 +1,6 @@ # ANTLR4 Runtime for Dart -From version 4.9.3 onwards antlr's dart generated code is null sound safety compatible and sets the minimum dart sdk version to 2.12.0. +From version 4.10 onwards antlr's dart generated code is null sound safety compatible and sets the minimum dart sdk version to 2.12.0. ### First steps diff --git a/doc/getting-started.md b/doc/getting-started.md index 0528883d3d..02f5b39d05 100644 --- a/doc/getting-started.md +++ b/doc/getting-started.md @@ -6,7 +6,7 @@ Hi and welcome to the version 4 release of ANTLR! It's named after the fearless ANTLR is really two things: a tool that translates your grammar to a parser/lexer in Java (or other target language) and the runtime needed by the generated parsers/lexers. Even if you are using the ANTLR Intellij plug-in or ANTLRWorks to run the ANTLR tool, the generated code will still need the runtime library. -The first thing you should do is probably download and install a development tool plug-in. Even if you only use such tools for editing, they are great. Then, follow the instructions below to get the runtime environment available to your system to run generated parsers/lexers. In what follows, I talk about antlr-4.9-complete.jar, which has the tool and the runtime and any other support libraries (e.g., ANTLR v4 is written in v3). +The first thing you should do is probably download and install a development tool plug-in. Even if you only use such tools for editing, they are great. Then, follow the instructions below to get the runtime environment available to your system to run generated parsers/lexers. In what follows, I talk about antlr-4.10-complete.jar, which has the tool and the runtime and any other support libraries (e.g., ANTLR v4 is written in v3). If you are going to integrate ANTLR into your existing build system using mvn, ant, or want to get ANTLR into your IDE such as eclipse or intellij, see [Integrating ANTLR into Development Systems](https://github.com/antlr/antlr4/blob/master/doc/IDEs.md). @@ -16,22 +16,22 @@ If you are going to integrate ANTLR into your existing build system using mvn, a 1. Download ``` $ cd /usr/local/lib -$ curl -O https://www.antlr.org/download/antlr-4.9-complete.jar +$ curl -O https://www.antlr.org/download/antlr-4.10-complete.jar ``` Or just download in browser from website: [https://www.antlr.org/download.html](https://www.antlr.org/download.html) and put it somewhere rational like `/usr/local/lib`. -2. Add `antlr-4.9-complete.jar` to your `CLASSPATH`: +2. Add `antlr-4.10-complete.jar` to your `CLASSPATH`: ``` -$ export CLASSPATH=".:/usr/local/lib/antlr-4.9-complete.jar:$CLASSPATH" +$ export CLASSPATH=".:/usr/local/lib/antlr-4.10-complete.jar:$CLASSPATH" ``` It's also a good idea to put this in your `.bash_profile` or whatever your startup script is. 3. Create aliases for the ANTLR Tool, and `TestRig`. ``` -$ alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.9-complete.jar:$CLASSPATH" org.antlr.v4.Tool' -$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.9-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig' +$ alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.10-complete.jar:$CLASSPATH" org.antlr.v4.Tool' +$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.10-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig' ``` ### WINDOWS @@ -39,13 +39,13 @@ $ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.9-complete.jar:$CLASSPAT (*Thanks to Graham Wideman*) 0. Install Java (version 1.7 or higher) -1. Download antlr-4.9-complete.jar (or whatever version) from [https://www.antlr.org/download/](https://www.antlr.org/download/) +1. Download antlr-4.10-complete.jar (or whatever version) from [https://www.antlr.org/download/](https://www.antlr.org/download/) Save to your directory for 3rd party Java libraries, say `C:\Javalib` -2. Add `antlr-4.9-complete.jar` to CLASSPATH, either: +2. Add `antlr-4.10-complete.jar` to CLASSPATH, either: * Permanently: Using System Properties dialog > Environment variables > Create or append to `CLASSPATH` variable * Temporarily, at command line: ``` -SET CLASSPATH=.;C:\Javalib\antlr-4.9-complete.jar;%CLASSPATH% +SET CLASSPATH=.;C:\Javalib\antlr-4.10-complete.jar;%CLASSPATH% ``` 3. Create short convenient commands for the ANTLR Tool, and TestRig, using batch files or doskey commands: * Batch files (in directory in system PATH) antlr4.bat and grun.bat @@ -71,7 +71,7 @@ Either launch org.antlr.v4.Tool directly: ``` $ java org.antlr.v4.Tool -ANTLR Parser Generator Version 4.9 +ANTLR Parser Generator Version 4.10 -o ___ specify output directory where all output is generated -lib ___ specify location of .tokens files ... @@ -80,8 +80,8 @@ ANTLR Parser Generator Version 4.9 or use -jar option on java: ``` -$ java -jar /usr/local/lib/antlr-4.9-complete.jar -ANTLR Parser Generator Version 4.9 +$ java -jar /usr/local/lib/antlr-4.10-complete.jar +ANTLR Parser Generator Version 4.10 -o ___ specify output directory where all output is generated -lib ___ specify location of .tokens files ... diff --git a/doc/go-target.md b/doc/go-target.md index 695f1564fc..6bdac133b3 100644 --- a/doc/go-target.md +++ b/doc/go-target.md @@ -20,11 +20,11 @@ go get github.com/antlr/antlr4/runtime/Go/antlr `go get` has no native way to specify a branch or commit. So, when you run it, you'll download the latest commits. This may or may not be your preference. -You'll need to use git to set the release. For example, to set the release tag for release 4.6.0: +You'll need to use git to set the release. For example, to set the release tag for release 4.9.3: ```bash cd $GOPATH/src/github.com/antlr/antlr4 # enter the antlr4 source directory -git checkout tags/4.6.0 # the go runtime was added in release 4.6.0 +git checkout tags/4.9.3 # the go runtime was added in release 4.9.3 ``` A complete list of releases can be found on [the release page](https://github.com/antlr/antlr4/releases). diff --git a/doc/index.md b/doc/index.md index 2ecb5099f4..d3bde038ea 100644 --- a/doc/index.md +++ b/doc/index.md @@ -57,8 +57,6 @@ For those using Java, here's a great [set of ANTLR in Intellij notes](https://do * [Parsing binary streams](parsing-binary-files.md) -* [Case-Insensitive Lexing](case-insensitive-lexing.md) - * [Parser and lexer interpreters](interpreters.md) * [Resources](resources.md) diff --git a/doc/java-target.md b/doc/java-target.md index eb73a3d6f1..1760dccbcb 100644 --- a/doc/java-target.md +++ b/doc/java-target.md @@ -134,7 +134,7 @@ Edit the pom.xml file. Now we need to extensively modify the pom.xml file. The f org.antlr antlr4-runtime - 4.5 + 4.9.3 junit @@ -150,8 +150,8 @@ Edit the pom.xml file. Now we need to extensively modify the pom.xml file. The f maven-compiler-plugin 3.1 - 1.7 - 1.7 + 1.8 + 1.8 + +Once it's done, you must do the following manually: + +``` +git commit -a -m 'add 4.10 jars' +git push origin gh-pages +``` + + ## Update Intellij plug-in diff --git a/doc/resources/CaseChangingCharStream.cs b/doc/resources/CaseChangingCharStream.cs deleted file mode 100644 index 9f73a03826..0000000000 --- a/doc/resources/CaseChangingCharStream.cs +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ -using System; -using Antlr4.Runtime.Misc; - -namespace Antlr4.Runtime -{ - /// - /// This class supports case-insensitive lexing by wrapping an existing - /// and forcing the lexer to see either upper or - /// lowercase characters. Grammar literals should then be either upper or - /// lower case such as 'BEGIN' or 'begin'. The text of the character - /// stream is unaffected. Example: input 'BeGiN' would match lexer rule - /// 'BEGIN' if constructor parameter upper=true but getText() would return - /// 'BeGiN'. - /// - public class CaseChangingCharStream : ICharStream - { - private ICharStream stream; - private bool upper; - - /// - /// Constructs a new CaseChangingCharStream wrapping the given forcing - /// all characters to upper case or lower case. - /// - /// The stream to wrap. - /// If true force each symbol to upper case, otherwise force to lower. - public CaseChangingCharStream(ICharStream stream, bool upper) - { - this.stream = stream; - this.upper = upper; - } - - public int Index - { - get - { - return stream.Index; - } - } - - public int Size - { - get - { - return stream.Size; - } - } - - public string SourceName - { - get - { - return stream.SourceName; - } - } - - public void Consume() - { - stream.Consume(); - } - - [return: NotNull] - public string GetText(Interval interval) - { - return stream.GetText(interval); - } - - public int LA(int i) - { - int c = stream.LA(i); - - if (c <= 0) - { - return c; - } - - char o = (char)c; - - if (upper) - { - return (int)char.ToUpperInvariant(o); - } - - return (int)char.ToLowerInvariant(o); - } - - public int Mark() - { - return stream.Mark(); - } - - public void Release(int marker) - { - stream.Release(marker); - } - - public void Seek(int index) - { - stream.Seek(index); - } - } -} diff --git a/doc/resources/CaseChangingCharStream.java b/doc/resources/CaseChangingCharStream.java deleted file mode 100644 index d069d0188a..0000000000 --- a/doc/resources/CaseChangingCharStream.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.antlr.v4.runtime; - -import org.antlr.v4.runtime.misc.Interval; - -/** - * This class supports case-insensitive lexing by wrapping an existing - * {@link CharStream} and forcing the lexer to see either upper or - * lowercase characters. Grammar literals should then be either upper or - * lower case such as 'BEGIN' or 'begin'. The text of the character - * stream is unaffected. Example: input 'BeGiN' would match lexer rule - * 'BEGIN' if constructor parameter upper=true but getText() would return - * 'BeGiN'. - */ -public class CaseChangingCharStream implements CharStream { - - final CharStream stream; - final boolean upper; - - /** - * Constructs a new CaseChangingCharStream wrapping the given {@link CharStream} forcing - * all characters to upper case or lower case. - * @param stream The stream to wrap. - * @param upper If true force each symbol to upper case, otherwise force to lower. - */ - public CaseChangingCharStream(CharStream stream, boolean upper) { - this.stream = stream; - this.upper = upper; - } - - @Override - public String getText(Interval interval) { - return stream.getText(interval); - } - - @Override - public void consume() { - stream.consume(); - } - - @Override - public int LA(int i) { - int c = stream.LA(i); - if (c <= 0) { - return c; - } - if (upper) { - return Character.toUpperCase(c); - } - return Character.toLowerCase(c); - } - - @Override - public int mark() { - return stream.mark(); - } - - @Override - public void release(int marker) { - stream.release(marker); - } - - @Override - public int index() { - return stream.index(); - } - - @Override - public void seek(int index) { - stream.seek(index); - } - - @Override - public int size() { - return stream.size(); - } - - @Override - public String getSourceName() { - return stream.getSourceName(); - } -} diff --git a/doc/resources/CaseChangingStream.js b/doc/resources/CaseChangingStream.js deleted file mode 100644 index 3af1ad6127..0000000000 --- a/doc/resources/CaseChangingStream.js +++ /dev/null @@ -1,65 +0,0 @@ -// -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ -// - -function CaseChangingStream(stream, upper) { - this._stream = stream; - this._upper = upper; -} - -CaseChangingStream.prototype.LA = function(offset) { - var c = this._stream.LA(offset); - if (c <= 0) { - return c; - } - return String.fromCodePoint(c)[this._upper ? "toUpperCase" : "toLowerCase"]().codePointAt(0); -}; - -CaseChangingStream.prototype.reset = function() { - return this._stream.reset(); -}; - -CaseChangingStream.prototype.consume = function() { - return this._stream.consume(); -}; - -CaseChangingStream.prototype.LT = function(offset) { - return this._stream.LT(offset); -}; - -CaseChangingStream.prototype.mark = function() { - return this._stream.mark(); -}; - -CaseChangingStream.prototype.release = function(marker) { - return this._stream.release(marker); -}; - -CaseChangingStream.prototype.seek = function(_index) { - return this._stream.seek(_index); -}; - -CaseChangingStream.prototype.getText = function(start, stop) { - return this._stream.getText(start, stop); -}; - -CaseChangingStream.prototype.toString = function() { - return this._stream.toString(); -}; - -Object.defineProperty(CaseChangingStream.prototype, "index", { - get: function() { - return this._stream.index; - } -}); - -Object.defineProperty(CaseChangingStream.prototype, "size", { - get: function() { - return this._stream.size; - } -}); - -exports.CaseChangingStream = CaseChangingStream; diff --git a/doc/resources/CaseChangingStream.py b/doc/resources/CaseChangingStream.py deleted file mode 100644 index 6d2815de41..0000000000 --- a/doc/resources/CaseChangingStream.py +++ /dev/null @@ -1,13 +0,0 @@ -class CaseChangingStream(): - def __init__(self, stream, upper): - self._stream = stream - self._upper = upper - - def __getattr__(self, name): - return self._stream.__getattribute__(name) - - def LA(self, offset): - c = self._stream.LA(offset) - if c <= 0: - return c - return ord(chr(c).upper() if self._upper else chr(c).lower()) diff --git a/doc/resources/case_changing_char_stream.dart b/doc/resources/case_changing_char_stream.dart deleted file mode 100644 index b7133ded49..0000000000 --- a/doc/resources/case_changing_char_stream.dart +++ /dev/null @@ -1,64 +0,0 @@ -// @dart=2.12 - -import '../../runtime/Dart/lib/antlr4.dart'; -import '../../runtime/Dart/lib/src/interval_set.dart'; - -/// This class supports case-insensitive lexing by wrapping an existing -/// {@link CharStream} and forcing the lexer to see either upper or -/// lowercase characters. Grammar literals should then be either upper or -/// lower case such as 'BEGIN' or 'begin'. The text of the character -/// stream is unaffected. Example: input 'BeGiN' would match lexer rule -/// 'BEGIN' if constructor parameter upper=true but getText() would return -/// 'BeGiN'. -class CaseChangingCharStream extends CharStream { - final CharStream stream; - final bool upper; - - /// Constructs a new CaseChangingCharStream wrapping the given [stream] forcing - /// all characters to upper case or lower case depending on [upper]. - CaseChangingCharStream(this.stream, this.upper); - - @override - int? LA(int i) { - int? c = stream.LA(i); - if (c == null || c <= 0) { - return c; - } - String newCaseStr; - if (upper) { - newCaseStr = String.fromCharCode(c).toUpperCase(); - } else { - newCaseStr = String.fromCharCode(c).toLowerCase(); - } - // Skip changing case if length changes (e.g., ß -> SS). - if (newCaseStr.length != 1) { - return c; - } else { - return newCaseStr.codeUnitAt(0); - } - } - - @override - String get sourceName => stream.sourceName; - - @override - void consume() => stream.consume(); - - @override - String getText(Interval interval) => stream.getText(interval); - - @override - int get index => stream.index; - - @override - int mark() => stream.mark(); - - @override - void release(int marker) => stream.release(marker); - - @override - void seek(int index) => stream.seek(index); - - @override - int get size => stream.size; -} diff --git a/doc/resources/case_changing_stream.go b/doc/resources/case_changing_stream.go deleted file mode 100644 index 5b510fa321..0000000000 --- a/doc/resources/case_changing_stream.go +++ /dev/null @@ -1,37 +0,0 @@ -package antlr_resource - -import ( - "unicode" - - "github.com/antlr/antlr4/runtime/Go/antlr" -) - -// CaseChangingStream wraps an existing CharStream, but upper cases, or -// lower cases the input before it is tokenized. -type CaseChangingStream struct { - antlr.CharStream - - upper bool -} - -// NewCaseChangingStream returns a new CaseChangingStream that forces -// all tokens read from the underlying stream to be either upper case -// or lower case based on the upper argument. -func NewCaseChangingStream(in antlr.CharStream, upper bool) *CaseChangingStream { - return &CaseChangingStream{in, upper} -} - -// LA gets the value of the symbol at offset from the current position -// from the underlying CharStream and converts it to either upper case -// or lower case. -func (is *CaseChangingStream) LA(offset int) int { - in := is.CharStream.LA(offset) - if in < 0 { - // Such as antlr.TokenEOF which is -1 - return in - } - if is.upper { - return int(unicode.ToUpper(rune(in))) - } - return int(unicode.ToLower(rune(in))) -} diff --git a/doc/swift-target.md b/doc/swift-target.md index 9dce16e422..21313deef9 100644 --- a/doc/swift-target.md +++ b/doc/swift-target.md @@ -1,15 +1,10 @@ # ANTLR4 Language Target, Runtime for Swift -## Requirements - -ANTLR 4.7.2 requires Swift 4.2. It works on Swift 4.2.1 also. - -ANTLR 4.7.1 requires Swift 4.0, and does not work on Swift 4.2. (The status of -Swift 4.1 support is unknown.) - ## Performance Note -To use ANTLR4 Swift target in production environment, make sure to turn on compiler optimizations by following [these instructions](https://github.com/apple/swift-package-manager/blob/master/Documentation/Usage.md#build-configurations) if you use SwiftPM to build your project. If you are using Xcode to build your project, it's unlikely you will not use `release` build for production build. +To use ANTLR4 Swift target in production environment, make sure to turn on compiler optimizations by following [these instructions](https://github.com/apple/swift-package-manager/blob/main/Documentation/Usage.md#setting-the-build-configuration) if you use SwiftPM to build your project. + +If you are using Xcode to build your project, it's unlikely you will not use `release` build for production build. Conclusion is, you need to turn on `release` mode (which will have all the optimization pre configured for you) so the ANTLR4 Swift target can have reasonable parsing speed. @@ -60,10 +55,7 @@ Note that even if you are otherwise using ANTLR from a binary distribution, you should compile the ANTLR Swift runtime from source, because the Swift language does not yet have a stable ABI. -ANTLR uses Swift Package Manager to generate Xcode project files. Note that -Swift Package Manager does not currently support iOS, watchOS, or tvOS, so -if you wish to use those platforms, you will need to alter the project build -settings manually as appropriate. +ANTLR uses Swift Package Manager to generate Xcode project files. #### Download source code for ANTLR @@ -135,30 +127,12 @@ The runtime and generated grammar should now build correctly. ### Swift Package Manager Projects -Since we cannot have a separate repository for Swift target (see issue [#1774](https://github.com/antlr/antlr4/issues/1774)), -and Swift is currently not ABI stable. We currently support SPM-based -projects by creating temporary local repository. +Add Antlr4 as a dependency to your `Package.swift` file. For more information, please see the [Swift Package Manager documentation](https://github.com/apple/swift-package-manager/tree/master/Documentation). -For people using [Swift Package Manager](https://swift.org/package-manager/), -the __boot.py__ script supports generating local repository that can be used -as a dependency to your project. Simply run: +```swift +.package(name: "Antlr4", url: "https://github.com/antlr/antlr4", from: "4.10" ``` -python boot.py --gen-spm-module -``` - -The prompt will show something like below: - - - -Put the SPM directive that contains the url to temporary repository to your -project's Package.swift. And run `swift build` in your project. - -The project is generated in your system's `/tmp/` directory, if you find it -inconvenient, consider copy that generated ANTLR repository to some place -that won't be cleaned automatically and update `url` parameter in your -`Package.swift` file. - ## Swift access levels You may use the `accessLevel` option to control the access levels on generated diff --git a/docker/Dockerfile b/docker/Dockerfile index 26229afcba..7ff0ddc6f3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,7 @@ FROM adoptopenjdk/openjdk11:alpine AS builder WORKDIR /opt/antlr4 -ARG ANTLR_VERSION="4.9.3" +ARG ANTLR_VERSION="4.10" ARG MAVEN_OPTS="-Xmx1G" diff --git a/contributors.txt b/historical-contributors-agreement.txt similarity index 95% rename from contributors.txt rename to historical-contributors-agreement.txt index ccd9304934..3ed11c57ca 100644 --- a/contributors.txt +++ b/historical-contributors-agreement.txt @@ -1,9 +1,5 @@ ANTLR Project Contributors Certification of Origin and Rights -NOTE: This tool is mature and Terence is mostly occupied elsewhere. We -can't accept any changes that could have widespread effects on thousands -of existing projects. Sorry! - All contributors to ANTLR v4 must formally agree to abide by this certificate of origin by signing on the bottom with their github userid, full name, email address (you can obscure your e-mail, but it @@ -222,6 +218,7 @@ YYYY/MM/DD, github id, Full name, email 2019/01/01, khoroshilov, Alexey Khoroshilov, khoroshilov@ispras.ru 2019/01/02, wkhemir, Wail Khemir, khemirwail@gmail.com 2019/01/16, kuegi, Markus Zancolo, markus.zancolo@roomle.com +2019/01/29, hc-codersatlas, Harry Chan, harry.chan@codersatlas.com 2019/02/06, ralucado, Cristina Raluca Vijulie, ralucris.v[at]gmail[dot]com 2019/02/23, gedimitr, Gerasimos Dimitriadis, gedimitr@gmail.com 2019/03/13, base698, Justin Thomas, justin.thomas1@gmail.com @@ -296,6 +293,7 @@ YYYY/MM/DD, github id, Full name, email 2021/02/28, Dante-Broggi, Dante Broggi, 34220985+Dante-Broggi@users.noreply.github.com 2021/03/02, hackeris 2021/03/03, xTachyon, Damian Andrei, xTachyon@users.noreply.github.com +2021/03/22, 100mango, Fangqiu Fang, 100mango@gmail.com 2021/04/07, b1f6c1c4, Jinzheng Tu, b1f6c1c4@gmail.com 2021/04/17, jaggerjo, Josua Jäger, mail@jaggerjo.com 2021/04/24, bigerl, Alexander Bigerl, alexander [äät] bigerl [pkt] eu @@ -305,9 +303,11 @@ YYYY/MM/DD, github id, Full name, email 2021/05/04, joakker, Joaquín León, joaquinandresleon108@gmail.com 2021/05/06, renancaraujo, Renan C. Araújo, renancaraujo@users.noreply.github.com 2021/05/06, canastro, Ricardo Canastro, ricardocanastro@users.noreply.github.com +2021/06/19, abe149, Abe Skolnik, abe 149 at gmail . com 2021/07/01, appel1, Johan Appelgren, johan.appelgren@gmail.com 2021/07/01, marcauberer, Marc Auberer, marc.auberer@chillibits.com 2021/07/14, renzhentaxibaerde, Renzhentaxi Baerde, renzhentaxibaerde@gmail.com +2021/07/21, skittlepox, Benjamin Spiegel, bspiegel@cs.brown.edu 2021/07/29, ksyx, Qixing Xue, qixingxue@outlook.com 2021/07/29, rachidlamouri, Rachid Lamouri, rachidlamouri@gmail.com 2021/08/02, minjoosur, Minjoo Sur, msur@salesforce.com @@ -316,6 +316,15 @@ YYYY/MM/DD, github id, Full name, email 2021/08/25, XenoAmess, Jin Xu, xenoamess@gmail.com 2021/09/08, jmcken8, Joel McKenzie, joel.b.mckenzie@gmail.com 2021/09/23, skalt, Steven Kalt, kalt.steven@gmail.com +2021/09/26, idraper, Isaac Draper, idraper@byu.edu 2021/10/10, tools4origins, Erwan Guyomarc'h, contact@erwan-guyomarch.fr 2021/10/19, jcking, Justin King, jcking@google.com -2021/10/31, skef, Skef Iterum, github@skef.org \ No newline at end of file +2021/10/31, skef, Skef Iterum, github@skef.org +2021/10/31, hlstwizard, h.l.s.t@163.com +2021/11/30, bollwyvl, Nick Bollweg, bollwyvl@users.noreply.github.com +2021/12/03, eneko, Eneko Alonso, eneko.alonso@gmail.com +2021/12/16, Ketler13, Oleksandr Martyshchenko, oleksandr.martyshchenko@gmail.com +2021/12/25, Tinker1024, Tinker1024, tinker@huawei.com +2021/12/31, Biswa96, Biswapriyo Nath, nathbappai@gmail.com +2022/03/07, chenquan, chenquan, chenquan.dev@gmail.com +2022/03/15, hzeller, Henner Zeller, h.zeller@acm.org diff --git a/pom.xml b/pom.xml index b93103ea71..ca85f9580b 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ org.antlr antlr4-master - 4.9.4-SNAPSHOT + 4.10-SNAPSHOT pom ANTLR 4 @@ -25,7 +25,11 @@ http://www.antlr.org - + + 3.8 + + + The BSD License http://www.antlr.org/license.html @@ -87,8 +91,6 @@ tool antlr4-maven-plugin tool-testsuite - runtime-testsuite/annotations - runtime-testsuite/processors runtime-testsuite @@ -96,8 +98,8 @@ UTF-8 UTF-8 true - 1.7 - 1.7 + 11 + 11 @@ -133,7 +135,7 @@ maven-clean-plugin - 3.0.0 + 3.1.0 diff --git a/runtime-testsuite/annotations/pom.xml b/runtime-testsuite/annotations/pom.xml deleted file mode 100644 index fd476ed807..0000000000 --- a/runtime-testsuite/annotations/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - 4.0.0 - - org.antlr - antlr4-master - 4.9.4-SNAPSHOT - ../../pom.xml - - antlr4-runtime-test-annotations - ANTLR 4 Runtime Test Annotations - The ANTLR 4 Runtime - - - src - - - org.apache.felix - maven-bundle-plugin - 2.5.4 - - - bundle-manifest - process-classes - - - org.antlr.antlr4-runtime-osgi - ANTLR 4 Runtime - ANTLR - org.antlr - ${project.version} - - - - manifest - - - - - - maven-jar-plugin - 2.4 - - - - diff --git a/runtime-testsuite/annotations/src/org/antlr/v4/test/runtime/CommentHasStringValue.java b/runtime-testsuite/annotations/src/org/antlr/v4/test/runtime/CommentHasStringValue.java deleted file mode 100644 index 8b48eb1569..0000000000 --- a/runtime-testsuite/annotations/src/org/antlr/v4/test/runtime/CommentHasStringValue.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** This is just a tag that indicates the javadoc comment has a multi-line string */ -@Retention(RetentionPolicy.SOURCE) -@Target({ElementType.FIELD, ElementType.METHOD}) -@Inherited -public @interface CommentHasStringValue { -} diff --git a/runtime-testsuite/pom.xml b/runtime-testsuite/pom.xml index 5b4e304440..bcba9ceae2 100644 --- a/runtime-testsuite/pom.xml +++ b/runtime-testsuite/pom.xml @@ -10,14 +10,14 @@ org.antlr antlr4-master - 4.9.4-SNAPSHOT + 4.10-SNAPSHOT antlr4-runtime-testsuite - ANTLR 4 Runtime Tests (2nd generation) + ANTLR 4 Runtime Tests (3rd generation) A collection of tests for ANTLR 4 Runtime libraries. - 3.0 + 3.8 2009 @@ -41,34 +41,22 @@ ${project.version} test - - org.antlr - antlr4-runtime-test-annotations - ${project.version} - test - - - org.antlr - antlr4-runtime-test-annotation-processors - ${project.version} - test - junit junit - 4.13.1 + 4.13.2 test org.glassfish javax.json - 1.0.4 + 1.1.4 test org.openjdk.jol jol-core - 0.8 + 0.16 @@ -91,13 +79,14 @@ org.apache.maven.plugins maven-surefire-plugin - 2.19.1 + 2.22.0 -Dfile.encoding=UTF-8 **/csharp/Test*.java **/java/Test*.java + **/java/api/Test*.java **/go/Test*.java **/javascript/Test*.java **/python2/Test*.java @@ -106,12 +95,12 @@ **/dart/Test*.java ${antlr.tests.swift} - + org.apache.maven.plugins maven-jar-plugin - 2.4 + 3.2.0 @@ -138,7 +127,16 @@ - + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 9 + 9 + + + diff --git a/runtime-testsuite/processors/pom.xml b/runtime-testsuite/processors/pom.xml deleted file mode 100644 index 7d97882c95..0000000000 --- a/runtime-testsuite/processors/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - 4.0.0 - - org.antlr - antlr4-master - 4.9.4-SNAPSHOT - ../../pom.xml - - antlr4-runtime-test-annotation-processors - ANTLR 4 Runtime Test Processors - The ANTLR 4 Runtime - - - - com.github.olivergondza - maven-jdk-tools-wrapper - 0.1 - - - org.antlr - antlr4-runtime-test-annotations - ${project.version} - - - - - src - - - resources - - - - - org.apache.maven.plugins - maven-compiler-plugin - - true - ${maven.compiler.source} - ${maven.compiler.target} - - -proc:none - - - - - - diff --git a/runtime-testsuite/processors/resources/META-INF/services/javax.annotation.processing.Processor b/runtime-testsuite/processors/resources/META-INF/services/javax.annotation.processing.Processor deleted file mode 100644 index 95b9a3a03a..0000000000 --- a/runtime-testsuite/processors/resources/META-INF/services/javax.annotation.processing.Processor +++ /dev/null @@ -1,7 +0,0 @@ -# -# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. -# Use of this file is governed by the BSD 3-clause license that -# can be found in the LICENSE.txt file in the project root. -# - -org.antlr.v4.test.runtime.CommentHasStringValueProcessor diff --git a/runtime-testsuite/processors/src/org/antlr/v4/test/runtime/CommentHasStringValueProcessor.java b/runtime-testsuite/processors/src/org/antlr/v4/test/runtime/CommentHasStringValueProcessor.java deleted file mode 100644 index a22ce9fc0d..0000000000 --- a/runtime-testsuite/processors/src/org/antlr/v4/test/runtime/CommentHasStringValueProcessor.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime; - -import com.sun.tools.javac.main.JavaCompiler; -import com.sun.tools.javac.model.JavacElements; -import com.sun.tools.javac.tree.JCTree; -import com.sun.tools.javac.tree.TreeMaker; -import com.sun.tools.javac.util.Context; -import com.sun.tools.javac.util.List; - -import javax.annotation.processing.AbstractProcessor; -import javax.annotation.processing.ProcessingEnvironment; -import javax.annotation.processing.RoundEnvironment; -import javax.annotation.processing.SupportedAnnotationTypes; -import javax.annotation.processing.SupportedSourceVersion; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.Element; -import javax.lang.model.element.TypeElement; -import java.lang.reflect.Field; -import java.util.Set; - -/** - I think I figured out how to use annotation processors in maven. It's - more or less automatic and you don't even need to tell maven, with one minor - exception. The idea is to create a project for the annotation and another - for the annotation processor. Then, a project that uses the annotation - can simply set up the dependency on the other projects. You have to turn - off processing, -proc:none on the processor project itself but other than - that, java 6+ more or less tries to apply any processors it finds during - compilation. maven just works. - - Also you need a META-INF/services/javax.annotation.processing.Processor file - with "org.antlr.v4.test.runtime.CommentHasStringValueProcessor" in it. - */ -@SupportedAnnotationTypes({"org.antlr.v4.test.runtime.CommentHasStringValue"}) -@SupportedSourceVersion(SourceVersion.RELEASE_7) -public class CommentHasStringValueProcessor extends AbstractProcessor { - - protected JavacElements utilities; - protected TreeMaker treeMaker; - - @Override - public synchronized void init(ProcessingEnvironment processingEnv) { - super.init(processingEnv); -// Messager messager = processingEnv.getMessager(); -// messager.printMessage(Diagnostic.Kind.NOTE, "WOW INIT--------------------"); - utilities = (JavacElements)processingEnv.getElementUtils(); - treeMaker = TreeMaker.instance(extractContext(utilities)); - } - - private static Context extractContext(JavacElements utilities) { - try { - Field compilerField = JavacElements.class.getDeclaredField("javaCompiler"); - compilerField.setAccessible(true); - JavaCompiler compiler = (JavaCompiler)compilerField.get(utilities); - Field contextField = JavaCompiler.class.getDeclaredField("context"); - contextField.setAccessible(true); - return (Context)contextField.get(compiler); - } catch (NoSuchFieldException | IllegalAccessException e) { - throw new IllegalStateException(e); - } - } - - @Override - public boolean process(Set annotations, RoundEnvironment roundEnv) { -// Messager messager = processingEnv.getMessager(); -// messager.printMessage(Diagnostic.Kind.NOTE, "PROCESS--------------------"); - Set annotatedElements = roundEnv.getElementsAnnotatedWith(CommentHasStringValue.class); - for (Element annotatedElement : annotatedElements) { - String docComment = utilities.getDocComment(annotatedElement); - JCTree.JCLiteral literal = treeMaker.Literal(docComment!=null ? docComment : ""); - JCTree elementTree = utilities.getTree(annotatedElement); - if ( elementTree instanceof JCTree.JCVariableDecl ) { - ((JCTree.JCVariableDecl)elementTree).init = literal; - } - else if ( elementTree instanceof JCTree.JCMethodDecl ) { - JCTree.JCStatement[] statements = new JCTree.JCStatement[1]; - statements[0] = treeMaker.Return(literal); - ((JCTree.JCMethodDecl)elementTree).body = treeMaker.Block(0, List.from(statements)); - } - } - return true; - } - - @Override - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latestSupported(); - } -} diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/LargeLexer.g4 b/runtime-testsuite/resources/org/antlr/v4/test/runtime/LargeLexer.g4 deleted file mode 100644 index 07572dae8e..0000000000 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/LargeLexer.g4 +++ /dev/null @@ -1,4003 +0,0 @@ -/** Has to be in separate file; LexerExec group loads this as resource */ -lexer grammar L; -WS : [ \t\r\n]+ -> skip; -KW0 : 'KW' '0'; -KW1 : 'KW' '1'; -KW2 : 'KW' '2'; -KW3 : 'KW' '3'; -KW4 : 'KW' '4'; -KW5 : 'KW' '5'; -KW6 : 'KW' '6'; -KW7 : 'KW' '7'; -KW8 : 'KW' '8'; -KW9 : 'KW' '9'; -KW10 : 'KW' '10'; -KW11 : 'KW' '11'; -KW12 : 'KW' '12'; -KW13 : 'KW' '13'; -KW14 : 'KW' '14'; -KW15 : 'KW' '15'; -KW16 : 'KW' '16'; -KW17 : 'KW' '17'; -KW18 : 'KW' '18'; -KW19 : 'KW' '19'; -KW20 : 'KW' '20'; -KW21 : 'KW' '21'; -KW22 : 'KW' '22'; -KW23 : 'KW' '23'; -KW24 : 'KW' '24'; -KW25 : 'KW' '25'; -KW26 : 'KW' '26'; -KW27 : 'KW' '27'; -KW28 : 'KW' '28'; -KW29 : 'KW' '29'; -KW30 : 'KW' '30'; -KW31 : 'KW' '31'; -KW32 : 'KW' '32'; -KW33 : 'KW' '33'; -KW34 : 'KW' '34'; -KW35 : 'KW' '35'; -KW36 : 'KW' '36'; -KW37 : 'KW' '37'; -KW38 : 'KW' '38'; -KW39 : 'KW' '39'; -KW40 : 'KW' '40'; -KW41 : 'KW' '41'; -KW42 : 'KW' '42'; -KW43 : 'KW' '43'; -KW44 : 'KW' '44'; -KW45 : 'KW' '45'; -KW46 : 'KW' '46'; -KW47 : 'KW' '47'; -KW48 : 'KW' '48'; -KW49 : 'KW' '49'; -KW50 : 'KW' '50'; -KW51 : 'KW' '51'; -KW52 : 'KW' '52'; -KW53 : 'KW' '53'; -KW54 : 'KW' '54'; -KW55 : 'KW' '55'; -KW56 : 'KW' '56'; -KW57 : 'KW' '57'; -KW58 : 'KW' '58'; -KW59 : 'KW' '59'; -KW60 : 'KW' '60'; -KW61 : 'KW' '61'; -KW62 : 'KW' '62'; -KW63 : 'KW' '63'; -KW64 : 'KW' '64'; -KW65 : 'KW' '65'; -KW66 : 'KW' '66'; -KW67 : 'KW' '67'; -KW68 : 'KW' '68'; -KW69 : 'KW' '69'; -KW70 : 'KW' '70'; -KW71 : 'KW' '71'; -KW72 : 'KW' '72'; -KW73 : 'KW' '73'; -KW74 : 'KW' '74'; -KW75 : 'KW' '75'; -KW76 : 'KW' '76'; -KW77 : 'KW' '77'; -KW78 : 'KW' '78'; -KW79 : 'KW' '79'; -KW80 : 'KW' '80'; -KW81 : 'KW' '81'; -KW82 : 'KW' '82'; -KW83 : 'KW' '83'; -KW84 : 'KW' '84'; -KW85 : 'KW' '85'; -KW86 : 'KW' '86'; -KW87 : 'KW' '87'; -KW88 : 'KW' '88'; -KW89 : 'KW' '89'; -KW90 : 'KW' '90'; -KW91 : 'KW' '91'; -KW92 : 'KW' '92'; -KW93 : 'KW' '93'; -KW94 : 'KW' '94'; -KW95 : 'KW' '95'; -KW96 : 'KW' '96'; -KW97 : 'KW' '97'; -KW98 : 'KW' '98'; -KW99 : 'KW' '99'; -KW100 : 'KW' '100'; -KW101 : 'KW' '101'; -KW102 : 'KW' '102'; -KW103 : 'KW' '103'; -KW104 : 'KW' '104'; -KW105 : 'KW' '105'; -KW106 : 'KW' '106'; -KW107 : 'KW' '107'; -KW108 : 'KW' '108'; -KW109 : 'KW' '109'; -KW110 : 'KW' '110'; -KW111 : 'KW' '111'; -KW112 : 'KW' '112'; -KW113 : 'KW' '113'; -KW114 : 'KW' '114'; -KW115 : 'KW' '115'; -KW116 : 'KW' '116'; -KW117 : 'KW' '117'; -KW118 : 'KW' '118'; -KW119 : 'KW' '119'; -KW120 : 'KW' '120'; -KW121 : 'KW' '121'; -KW122 : 'KW' '122'; -KW123 : 'KW' '123'; -KW124 : 'KW' '124'; -KW125 : 'KW' '125'; -KW126 : 'KW' '126'; -KW127 : 'KW' '127'; -KW128 : 'KW' '128'; -KW129 : 'KW' '129'; -KW130 : 'KW' '130'; -KW131 : 'KW' '131'; -KW132 : 'KW' '132'; -KW133 : 'KW' '133'; -KW134 : 'KW' '134'; -KW135 : 'KW' '135'; -KW136 : 'KW' '136'; -KW137 : 'KW' '137'; -KW138 : 'KW' '138'; -KW139 : 'KW' '139'; -KW140 : 'KW' '140'; -KW141 : 'KW' '141'; -KW142 : 'KW' '142'; -KW143 : 'KW' '143'; -KW144 : 'KW' '144'; -KW145 : 'KW' '145'; -KW146 : 'KW' '146'; -KW147 : 'KW' '147'; -KW148 : 'KW' '148'; -KW149 : 'KW' '149'; -KW150 : 'KW' '150'; -KW151 : 'KW' '151'; -KW152 : 'KW' '152'; -KW153 : 'KW' '153'; -KW154 : 'KW' '154'; -KW155 : 'KW' '155'; -KW156 : 'KW' '156'; -KW157 : 'KW' '157'; -KW158 : 'KW' '158'; -KW159 : 'KW' '159'; -KW160 : 'KW' '160'; -KW161 : 'KW' '161'; -KW162 : 'KW' '162'; -KW163 : 'KW' '163'; -KW164 : 'KW' '164'; -KW165 : 'KW' '165'; -KW166 : 'KW' '166'; -KW167 : 'KW' '167'; -KW168 : 'KW' '168'; -KW169 : 'KW' '169'; -KW170 : 'KW' '170'; -KW171 : 'KW' '171'; -KW172 : 'KW' '172'; -KW173 : 'KW' '173'; -KW174 : 'KW' '174'; -KW175 : 'KW' '175'; -KW176 : 'KW' '176'; -KW177 : 'KW' '177'; -KW178 : 'KW' '178'; -KW179 : 'KW' '179'; -KW180 : 'KW' '180'; -KW181 : 'KW' '181'; -KW182 : 'KW' '182'; -KW183 : 'KW' '183'; -KW184 : 'KW' '184'; -KW185 : 'KW' '185'; -KW186 : 'KW' '186'; -KW187 : 'KW' '187'; -KW188 : 'KW' '188'; -KW189 : 'KW' '189'; -KW190 : 'KW' '190'; -KW191 : 'KW' '191'; -KW192 : 'KW' '192'; -KW193 : 'KW' '193'; -KW194 : 'KW' '194'; -KW195 : 'KW' '195'; -KW196 : 'KW' '196'; -KW197 : 'KW' '197'; -KW198 : 'KW' '198'; -KW199 : 'KW' '199'; -KW200 : 'KW' '200'; -KW201 : 'KW' '201'; -KW202 : 'KW' '202'; -KW203 : 'KW' '203'; -KW204 : 'KW' '204'; -KW205 : 'KW' '205'; -KW206 : 'KW' '206'; -KW207 : 'KW' '207'; -KW208 : 'KW' '208'; -KW209 : 'KW' '209'; -KW210 : 'KW' '210'; -KW211 : 'KW' '211'; -KW212 : 'KW' '212'; -KW213 : 'KW' '213'; -KW214 : 'KW' '214'; -KW215 : 'KW' '215'; -KW216 : 'KW' '216'; -KW217 : 'KW' '217'; -KW218 : 'KW' '218'; -KW219 : 'KW' '219'; -KW220 : 'KW' '220'; -KW221 : 'KW' '221'; -KW222 : 'KW' '222'; -KW223 : 'KW' '223'; -KW224 : 'KW' '224'; -KW225 : 'KW' '225'; -KW226 : 'KW' '226'; -KW227 : 'KW' '227'; -KW228 : 'KW' '228'; -KW229 : 'KW' '229'; -KW230 : 'KW' '230'; -KW231 : 'KW' '231'; -KW232 : 'KW' '232'; -KW233 : 'KW' '233'; -KW234 : 'KW' '234'; -KW235 : 'KW' '235'; -KW236 : 'KW' '236'; -KW237 : 'KW' '237'; -KW238 : 'KW' '238'; -KW239 : 'KW' '239'; -KW240 : 'KW' '240'; -KW241 : 'KW' '241'; -KW242 : 'KW' '242'; -KW243 : 'KW' '243'; -KW244 : 'KW' '244'; -KW245 : 'KW' '245'; -KW246 : 'KW' '246'; -KW247 : 'KW' '247'; -KW248 : 'KW' '248'; -KW249 : 'KW' '249'; -KW250 : 'KW' '250'; -KW251 : 'KW' '251'; -KW252 : 'KW' '252'; -KW253 : 'KW' '253'; -KW254 : 'KW' '254'; -KW255 : 'KW' '255'; -KW256 : 'KW' '256'; -KW257 : 'KW' '257'; -KW258 : 'KW' '258'; -KW259 : 'KW' '259'; -KW260 : 'KW' '260'; -KW261 : 'KW' '261'; -KW262 : 'KW' '262'; -KW263 : 'KW' '263'; -KW264 : 'KW' '264'; -KW265 : 'KW' '265'; -KW266 : 'KW' '266'; -KW267 : 'KW' '267'; -KW268 : 'KW' '268'; -KW269 : 'KW' '269'; -KW270 : 'KW' '270'; -KW271 : 'KW' '271'; -KW272 : 'KW' '272'; -KW273 : 'KW' '273'; -KW274 : 'KW' '274'; -KW275 : 'KW' '275'; -KW276 : 'KW' '276'; -KW277 : 'KW' '277'; -KW278 : 'KW' '278'; -KW279 : 'KW' '279'; -KW280 : 'KW' '280'; -KW281 : 'KW' '281'; -KW282 : 'KW' '282'; -KW283 : 'KW' '283'; -KW284 : 'KW' '284'; -KW285 : 'KW' '285'; -KW286 : 'KW' '286'; -KW287 : 'KW' '287'; -KW288 : 'KW' '288'; -KW289 : 'KW' '289'; -KW290 : 'KW' '290'; -KW291 : 'KW' '291'; -KW292 : 'KW' '292'; -KW293 : 'KW' '293'; -KW294 : 'KW' '294'; -KW295 : 'KW' '295'; -KW296 : 'KW' '296'; -KW297 : 'KW' '297'; -KW298 : 'KW' '298'; -KW299 : 'KW' '299'; -KW300 : 'KW' '300'; -KW301 : 'KW' '301'; -KW302 : 'KW' '302'; -KW303 : 'KW' '303'; -KW304 : 'KW' '304'; -KW305 : 'KW' '305'; -KW306 : 'KW' '306'; -KW307 : 'KW' '307'; -KW308 : 'KW' '308'; -KW309 : 'KW' '309'; -KW310 : 'KW' '310'; -KW311 : 'KW' '311'; -KW312 : 'KW' '312'; -KW313 : 'KW' '313'; -KW314 : 'KW' '314'; -KW315 : 'KW' '315'; -KW316 : 'KW' '316'; -KW317 : 'KW' '317'; -KW318 : 'KW' '318'; -KW319 : 'KW' '319'; -KW320 : 'KW' '320'; -KW321 : 'KW' '321'; -KW322 : 'KW' '322'; -KW323 : 'KW' '323'; -KW324 : 'KW' '324'; -KW325 : 'KW' '325'; -KW326 : 'KW' '326'; -KW327 : 'KW' '327'; -KW328 : 'KW' '328'; -KW329 : 'KW' '329'; -KW330 : 'KW' '330'; -KW331 : 'KW' '331'; -KW332 : 'KW' '332'; -KW333 : 'KW' '333'; -KW334 : 'KW' '334'; -KW335 : 'KW' '335'; -KW336 : 'KW' '336'; -KW337 : 'KW' '337'; -KW338 : 'KW' '338'; -KW339 : 'KW' '339'; -KW340 : 'KW' '340'; -KW341 : 'KW' '341'; -KW342 : 'KW' '342'; -KW343 : 'KW' '343'; -KW344 : 'KW' '344'; -KW345 : 'KW' '345'; -KW346 : 'KW' '346'; -KW347 : 'KW' '347'; -KW348 : 'KW' '348'; -KW349 : 'KW' '349'; -KW350 : 'KW' '350'; -KW351 : 'KW' '351'; -KW352 : 'KW' '352'; -KW353 : 'KW' '353'; -KW354 : 'KW' '354'; -KW355 : 'KW' '355'; -KW356 : 'KW' '356'; -KW357 : 'KW' '357'; -KW358 : 'KW' '358'; -KW359 : 'KW' '359'; -KW360 : 'KW' '360'; -KW361 : 'KW' '361'; -KW362 : 'KW' '362'; -KW363 : 'KW' '363'; -KW364 : 'KW' '364'; -KW365 : 'KW' '365'; -KW366 : 'KW' '366'; -KW367 : 'KW' '367'; -KW368 : 'KW' '368'; -KW369 : 'KW' '369'; -KW370 : 'KW' '370'; -KW371 : 'KW' '371'; -KW372 : 'KW' '372'; -KW373 : 'KW' '373'; -KW374 : 'KW' '374'; -KW375 : 'KW' '375'; -KW376 : 'KW' '376'; -KW377 : 'KW' '377'; -KW378 : 'KW' '378'; -KW379 : 'KW' '379'; -KW380 : 'KW' '380'; -KW381 : 'KW' '381'; -KW382 : 'KW' '382'; -KW383 : 'KW' '383'; -KW384 : 'KW' '384'; -KW385 : 'KW' '385'; -KW386 : 'KW' '386'; -KW387 : 'KW' '387'; -KW388 : 'KW' '388'; -KW389 : 'KW' '389'; -KW390 : 'KW' '390'; -KW391 : 'KW' '391'; -KW392 : 'KW' '392'; -KW393 : 'KW' '393'; -KW394 : 'KW' '394'; -KW395 : 'KW' '395'; -KW396 : 'KW' '396'; -KW397 : 'KW' '397'; -KW398 : 'KW' '398'; -KW399 : 'KW' '399'; -KW400 : 'KW' '400'; -KW401 : 'KW' '401'; -KW402 : 'KW' '402'; -KW403 : 'KW' '403'; -KW404 : 'KW' '404'; -KW405 : 'KW' '405'; -KW406 : 'KW' '406'; -KW407 : 'KW' '407'; -KW408 : 'KW' '408'; -KW409 : 'KW' '409'; -KW410 : 'KW' '410'; -KW411 : 'KW' '411'; -KW412 : 'KW' '412'; -KW413 : 'KW' '413'; -KW414 : 'KW' '414'; -KW415 : 'KW' '415'; -KW416 : 'KW' '416'; -KW417 : 'KW' '417'; -KW418 : 'KW' '418'; -KW419 : 'KW' '419'; -KW420 : 'KW' '420'; -KW421 : 'KW' '421'; -KW422 : 'KW' '422'; -KW423 : 'KW' '423'; -KW424 : 'KW' '424'; -KW425 : 'KW' '425'; -KW426 : 'KW' '426'; -KW427 : 'KW' '427'; -KW428 : 'KW' '428'; -KW429 : 'KW' '429'; -KW430 : 'KW' '430'; -KW431 : 'KW' '431'; -KW432 : 'KW' '432'; -KW433 : 'KW' '433'; -KW434 : 'KW' '434'; -KW435 : 'KW' '435'; -KW436 : 'KW' '436'; -KW437 : 'KW' '437'; -KW438 : 'KW' '438'; -KW439 : 'KW' '439'; -KW440 : 'KW' '440'; -KW441 : 'KW' '441'; -KW442 : 'KW' '442'; -KW443 : 'KW' '443'; -KW444 : 'KW' '444'; -KW445 : 'KW' '445'; -KW446 : 'KW' '446'; -KW447 : 'KW' '447'; -KW448 : 'KW' '448'; -KW449 : 'KW' '449'; -KW450 : 'KW' '450'; -KW451 : 'KW' '451'; -KW452 : 'KW' '452'; -KW453 : 'KW' '453'; -KW454 : 'KW' '454'; -KW455 : 'KW' '455'; -KW456 : 'KW' '456'; -KW457 : 'KW' '457'; -KW458 : 'KW' '458'; -KW459 : 'KW' '459'; -KW460 : 'KW' '460'; -KW461 : 'KW' '461'; -KW462 : 'KW' '462'; -KW463 : 'KW' '463'; -KW464 : 'KW' '464'; -KW465 : 'KW' '465'; -KW466 : 'KW' '466'; -KW467 : 'KW' '467'; -KW468 : 'KW' '468'; -KW469 : 'KW' '469'; -KW470 : 'KW' '470'; -KW471 : 'KW' '471'; -KW472 : 'KW' '472'; -KW473 : 'KW' '473'; -KW474 : 'KW' '474'; -KW475 : 'KW' '475'; -KW476 : 'KW' '476'; -KW477 : 'KW' '477'; -KW478 : 'KW' '478'; -KW479 : 'KW' '479'; -KW480 : 'KW' '480'; -KW481 : 'KW' '481'; -KW482 : 'KW' '482'; -KW483 : 'KW' '483'; -KW484 : 'KW' '484'; -KW485 : 'KW' '485'; -KW486 : 'KW' '486'; -KW487 : 'KW' '487'; -KW488 : 'KW' '488'; -KW489 : 'KW' '489'; -KW490 : 'KW' '490'; -KW491 : 'KW' '491'; -KW492 : 'KW' '492'; -KW493 : 'KW' '493'; -KW494 : 'KW' '494'; -KW495 : 'KW' '495'; -KW496 : 'KW' '496'; -KW497 : 'KW' '497'; -KW498 : 'KW' '498'; -KW499 : 'KW' '499'; -KW500 : 'KW' '500'; -KW501 : 'KW' '501'; -KW502 : 'KW' '502'; -KW503 : 'KW' '503'; -KW504 : 'KW' '504'; -KW505 : 'KW' '505'; -KW506 : 'KW' '506'; -KW507 : 'KW' '507'; -KW508 : 'KW' '508'; -KW509 : 'KW' '509'; -KW510 : 'KW' '510'; -KW511 : 'KW' '511'; -KW512 : 'KW' '512'; -KW513 : 'KW' '513'; -KW514 : 'KW' '514'; -KW515 : 'KW' '515'; -KW516 : 'KW' '516'; -KW517 : 'KW' '517'; -KW518 : 'KW' '518'; -KW519 : 'KW' '519'; -KW520 : 'KW' '520'; -KW521 : 'KW' '521'; -KW522 : 'KW' '522'; -KW523 : 'KW' '523'; -KW524 : 'KW' '524'; -KW525 : 'KW' '525'; -KW526 : 'KW' '526'; -KW527 : 'KW' '527'; -KW528 : 'KW' '528'; -KW529 : 'KW' '529'; -KW530 : 'KW' '530'; -KW531 : 'KW' '531'; -KW532 : 'KW' '532'; -KW533 : 'KW' '533'; -KW534 : 'KW' '534'; -KW535 : 'KW' '535'; -KW536 : 'KW' '536'; -KW537 : 'KW' '537'; -KW538 : 'KW' '538'; -KW539 : 'KW' '539'; -KW540 : 'KW' '540'; -KW541 : 'KW' '541'; -KW542 : 'KW' '542'; -KW543 : 'KW' '543'; -KW544 : 'KW' '544'; -KW545 : 'KW' '545'; -KW546 : 'KW' '546'; -KW547 : 'KW' '547'; -KW548 : 'KW' '548'; -KW549 : 'KW' '549'; -KW550 : 'KW' '550'; -KW551 : 'KW' '551'; -KW552 : 'KW' '552'; -KW553 : 'KW' '553'; -KW554 : 'KW' '554'; -KW555 : 'KW' '555'; -KW556 : 'KW' '556'; -KW557 : 'KW' '557'; -KW558 : 'KW' '558'; -KW559 : 'KW' '559'; -KW560 : 'KW' '560'; -KW561 : 'KW' '561'; -KW562 : 'KW' '562'; -KW563 : 'KW' '563'; -KW564 : 'KW' '564'; -KW565 : 'KW' '565'; -KW566 : 'KW' '566'; -KW567 : 'KW' '567'; -KW568 : 'KW' '568'; -KW569 : 'KW' '569'; -KW570 : 'KW' '570'; -KW571 : 'KW' '571'; -KW572 : 'KW' '572'; -KW573 : 'KW' '573'; -KW574 : 'KW' '574'; -KW575 : 'KW' '575'; -KW576 : 'KW' '576'; -KW577 : 'KW' '577'; -KW578 : 'KW' '578'; -KW579 : 'KW' '579'; -KW580 : 'KW' '580'; -KW581 : 'KW' '581'; -KW582 : 'KW' '582'; -KW583 : 'KW' '583'; -KW584 : 'KW' '584'; -KW585 : 'KW' '585'; -KW586 : 'KW' '586'; -KW587 : 'KW' '587'; -KW588 : 'KW' '588'; -KW589 : 'KW' '589'; -KW590 : 'KW' '590'; -KW591 : 'KW' '591'; -KW592 : 'KW' '592'; -KW593 : 'KW' '593'; -KW594 : 'KW' '594'; -KW595 : 'KW' '595'; -KW596 : 'KW' '596'; -KW597 : 'KW' '597'; -KW598 : 'KW' '598'; -KW599 : 'KW' '599'; -KW600 : 'KW' '600'; -KW601 : 'KW' '601'; -KW602 : 'KW' '602'; -KW603 : 'KW' '603'; -KW604 : 'KW' '604'; -KW605 : 'KW' '605'; -KW606 : 'KW' '606'; -KW607 : 'KW' '607'; -KW608 : 'KW' '608'; -KW609 : 'KW' '609'; -KW610 : 'KW' '610'; -KW611 : 'KW' '611'; -KW612 : 'KW' '612'; -KW613 : 'KW' '613'; -KW614 : 'KW' '614'; -KW615 : 'KW' '615'; -KW616 : 'KW' '616'; -KW617 : 'KW' '617'; -KW618 : 'KW' '618'; -KW619 : 'KW' '619'; -KW620 : 'KW' '620'; -KW621 : 'KW' '621'; -KW622 : 'KW' '622'; -KW623 : 'KW' '623'; -KW624 : 'KW' '624'; -KW625 : 'KW' '625'; -KW626 : 'KW' '626'; -KW627 : 'KW' '627'; -KW628 : 'KW' '628'; -KW629 : 'KW' '629'; -KW630 : 'KW' '630'; -KW631 : 'KW' '631'; -KW632 : 'KW' '632'; -KW633 : 'KW' '633'; -KW634 : 'KW' '634'; -KW635 : 'KW' '635'; -KW636 : 'KW' '636'; -KW637 : 'KW' '637'; -KW638 : 'KW' '638'; -KW639 : 'KW' '639'; -KW640 : 'KW' '640'; -KW641 : 'KW' '641'; -KW642 : 'KW' '642'; -KW643 : 'KW' '643'; -KW644 : 'KW' '644'; -KW645 : 'KW' '645'; -KW646 : 'KW' '646'; -KW647 : 'KW' '647'; -KW648 : 'KW' '648'; -KW649 : 'KW' '649'; -KW650 : 'KW' '650'; -KW651 : 'KW' '651'; -KW652 : 'KW' '652'; -KW653 : 'KW' '653'; -KW654 : 'KW' '654'; -KW655 : 'KW' '655'; -KW656 : 'KW' '656'; -KW657 : 'KW' '657'; -KW658 : 'KW' '658'; -KW659 : 'KW' '659'; -KW660 : 'KW' '660'; -KW661 : 'KW' '661'; -KW662 : 'KW' '662'; -KW663 : 'KW' '663'; -KW664 : 'KW' '664'; -KW665 : 'KW' '665'; -KW666 : 'KW' '666'; -KW667 : 'KW' '667'; -KW668 : 'KW' '668'; -KW669 : 'KW' '669'; -KW670 : 'KW' '670'; -KW671 : 'KW' '671'; -KW672 : 'KW' '672'; -KW673 : 'KW' '673'; -KW674 : 'KW' '674'; -KW675 : 'KW' '675'; -KW676 : 'KW' '676'; -KW677 : 'KW' '677'; -KW678 : 'KW' '678'; -KW679 : 'KW' '679'; -KW680 : 'KW' '680'; -KW681 : 'KW' '681'; -KW682 : 'KW' '682'; -KW683 : 'KW' '683'; -KW684 : 'KW' '684'; -KW685 : 'KW' '685'; -KW686 : 'KW' '686'; -KW687 : 'KW' '687'; -KW688 : 'KW' '688'; -KW689 : 'KW' '689'; -KW690 : 'KW' '690'; -KW691 : 'KW' '691'; -KW692 : 'KW' '692'; -KW693 : 'KW' '693'; -KW694 : 'KW' '694'; -KW695 : 'KW' '695'; -KW696 : 'KW' '696'; -KW697 : 'KW' '697'; -KW698 : 'KW' '698'; -KW699 : 'KW' '699'; -KW700 : 'KW' '700'; -KW701 : 'KW' '701'; -KW702 : 'KW' '702'; -KW703 : 'KW' '703'; -KW704 : 'KW' '704'; -KW705 : 'KW' '705'; -KW706 : 'KW' '706'; -KW707 : 'KW' '707'; -KW708 : 'KW' '708'; -KW709 : 'KW' '709'; -KW710 : 'KW' '710'; -KW711 : 'KW' '711'; -KW712 : 'KW' '712'; -KW713 : 'KW' '713'; -KW714 : 'KW' '714'; -KW715 : 'KW' '715'; -KW716 : 'KW' '716'; -KW717 : 'KW' '717'; -KW718 : 'KW' '718'; -KW719 : 'KW' '719'; -KW720 : 'KW' '720'; -KW721 : 'KW' '721'; -KW722 : 'KW' '722'; -KW723 : 'KW' '723'; -KW724 : 'KW' '724'; -KW725 : 'KW' '725'; -KW726 : 'KW' '726'; -KW727 : 'KW' '727'; -KW728 : 'KW' '728'; -KW729 : 'KW' '729'; -KW730 : 'KW' '730'; -KW731 : 'KW' '731'; -KW732 : 'KW' '732'; -KW733 : 'KW' '733'; -KW734 : 'KW' '734'; -KW735 : 'KW' '735'; -KW736 : 'KW' '736'; -KW737 : 'KW' '737'; -KW738 : 'KW' '738'; -KW739 : 'KW' '739'; -KW740 : 'KW' '740'; -KW741 : 'KW' '741'; -KW742 : 'KW' '742'; -KW743 : 'KW' '743'; -KW744 : 'KW' '744'; -KW745 : 'KW' '745'; -KW746 : 'KW' '746'; -KW747 : 'KW' '747'; -KW748 : 'KW' '748'; -KW749 : 'KW' '749'; -KW750 : 'KW' '750'; -KW751 : 'KW' '751'; -KW752 : 'KW' '752'; -KW753 : 'KW' '753'; -KW754 : 'KW' '754'; -KW755 : 'KW' '755'; -KW756 : 'KW' '756'; -KW757 : 'KW' '757'; -KW758 : 'KW' '758'; -KW759 : 'KW' '759'; -KW760 : 'KW' '760'; -KW761 : 'KW' '761'; -KW762 : 'KW' '762'; -KW763 : 'KW' '763'; -KW764 : 'KW' '764'; -KW765 : 'KW' '765'; -KW766 : 'KW' '766'; -KW767 : 'KW' '767'; -KW768 : 'KW' '768'; -KW769 : 'KW' '769'; -KW770 : 'KW' '770'; -KW771 : 'KW' '771'; -KW772 : 'KW' '772'; -KW773 : 'KW' '773'; -KW774 : 'KW' '774'; -KW775 : 'KW' '775'; -KW776 : 'KW' '776'; -KW777 : 'KW' '777'; -KW778 : 'KW' '778'; -KW779 : 'KW' '779'; -KW780 : 'KW' '780'; -KW781 : 'KW' '781'; -KW782 : 'KW' '782'; -KW783 : 'KW' '783'; -KW784 : 'KW' '784'; -KW785 : 'KW' '785'; -KW786 : 'KW' '786'; -KW787 : 'KW' '787'; -KW788 : 'KW' '788'; -KW789 : 'KW' '789'; -KW790 : 'KW' '790'; -KW791 : 'KW' '791'; -KW792 : 'KW' '792'; -KW793 : 'KW' '793'; -KW794 : 'KW' '794'; -KW795 : 'KW' '795'; -KW796 : 'KW' '796'; -KW797 : 'KW' '797'; -KW798 : 'KW' '798'; -KW799 : 'KW' '799'; -KW800 : 'KW' '800'; -KW801 : 'KW' '801'; -KW802 : 'KW' '802'; -KW803 : 'KW' '803'; -KW804 : 'KW' '804'; -KW805 : 'KW' '805'; -KW806 : 'KW' '806'; -KW807 : 'KW' '807'; -KW808 : 'KW' '808'; -KW809 : 'KW' '809'; -KW810 : 'KW' '810'; -KW811 : 'KW' '811'; -KW812 : 'KW' '812'; -KW813 : 'KW' '813'; -KW814 : 'KW' '814'; -KW815 : 'KW' '815'; -KW816 : 'KW' '816'; -KW817 : 'KW' '817'; -KW818 : 'KW' '818'; -KW819 : 'KW' '819'; -KW820 : 'KW' '820'; -KW821 : 'KW' '821'; -KW822 : 'KW' '822'; -KW823 : 'KW' '823'; -KW824 : 'KW' '824'; -KW825 : 'KW' '825'; -KW826 : 'KW' '826'; -KW827 : 'KW' '827'; -KW828 : 'KW' '828'; -KW829 : 'KW' '829'; -KW830 : 'KW' '830'; -KW831 : 'KW' '831'; -KW832 : 'KW' '832'; -KW833 : 'KW' '833'; -KW834 : 'KW' '834'; -KW835 : 'KW' '835'; -KW836 : 'KW' '836'; -KW837 : 'KW' '837'; -KW838 : 'KW' '838'; -KW839 : 'KW' '839'; -KW840 : 'KW' '840'; -KW841 : 'KW' '841'; -KW842 : 'KW' '842'; -KW843 : 'KW' '843'; -KW844 : 'KW' '844'; -KW845 : 'KW' '845'; -KW846 : 'KW' '846'; -KW847 : 'KW' '847'; -KW848 : 'KW' '848'; -KW849 : 'KW' '849'; -KW850 : 'KW' '850'; -KW851 : 'KW' '851'; -KW852 : 'KW' '852'; -KW853 : 'KW' '853'; -KW854 : 'KW' '854'; -KW855 : 'KW' '855'; -KW856 : 'KW' '856'; -KW857 : 'KW' '857'; -KW858 : 'KW' '858'; -KW859 : 'KW' '859'; -KW860 : 'KW' '860'; -KW861 : 'KW' '861'; -KW862 : 'KW' '862'; -KW863 : 'KW' '863'; -KW864 : 'KW' '864'; -KW865 : 'KW' '865'; -KW866 : 'KW' '866'; -KW867 : 'KW' '867'; -KW868 : 'KW' '868'; -KW869 : 'KW' '869'; -KW870 : 'KW' '870'; -KW871 : 'KW' '871'; -KW872 : 'KW' '872'; -KW873 : 'KW' '873'; -KW874 : 'KW' '874'; -KW875 : 'KW' '875'; -KW876 : 'KW' '876'; -KW877 : 'KW' '877'; -KW878 : 'KW' '878'; -KW879 : 'KW' '879'; -KW880 : 'KW' '880'; -KW881 : 'KW' '881'; -KW882 : 'KW' '882'; -KW883 : 'KW' '883'; -KW884 : 'KW' '884'; -KW885 : 'KW' '885'; -KW886 : 'KW' '886'; -KW887 : 'KW' '887'; -KW888 : 'KW' '888'; -KW889 : 'KW' '889'; -KW890 : 'KW' '890'; -KW891 : 'KW' '891'; -KW892 : 'KW' '892'; -KW893 : 'KW' '893'; -KW894 : 'KW' '894'; -KW895 : 'KW' '895'; -KW896 : 'KW' '896'; -KW897 : 'KW' '897'; -KW898 : 'KW' '898'; -KW899 : 'KW' '899'; -KW900 : 'KW' '900'; -KW901 : 'KW' '901'; -KW902 : 'KW' '902'; -KW903 : 'KW' '903'; -KW904 : 'KW' '904'; -KW905 : 'KW' '905'; -KW906 : 'KW' '906'; -KW907 : 'KW' '907'; -KW908 : 'KW' '908'; -KW909 : 'KW' '909'; -KW910 : 'KW' '910'; -KW911 : 'KW' '911'; -KW912 : 'KW' '912'; -KW913 : 'KW' '913'; -KW914 : 'KW' '914'; -KW915 : 'KW' '915'; -KW916 : 'KW' '916'; -KW917 : 'KW' '917'; -KW918 : 'KW' '918'; -KW919 : 'KW' '919'; -KW920 : 'KW' '920'; -KW921 : 'KW' '921'; -KW922 : 'KW' '922'; -KW923 : 'KW' '923'; -KW924 : 'KW' '924'; -KW925 : 'KW' '925'; -KW926 : 'KW' '926'; -KW927 : 'KW' '927'; -KW928 : 'KW' '928'; -KW929 : 'KW' '929'; -KW930 : 'KW' '930'; -KW931 : 'KW' '931'; -KW932 : 'KW' '932'; -KW933 : 'KW' '933'; -KW934 : 'KW' '934'; -KW935 : 'KW' '935'; -KW936 : 'KW' '936'; -KW937 : 'KW' '937'; -KW938 : 'KW' '938'; -KW939 : 'KW' '939'; -KW940 : 'KW' '940'; -KW941 : 'KW' '941'; -KW942 : 'KW' '942'; -KW943 : 'KW' '943'; -KW944 : 'KW' '944'; -KW945 : 'KW' '945'; -KW946 : 'KW' '946'; -KW947 : 'KW' '947'; -KW948 : 'KW' '948'; -KW949 : 'KW' '949'; -KW950 : 'KW' '950'; -KW951 : 'KW' '951'; -KW952 : 'KW' '952'; -KW953 : 'KW' '953'; -KW954 : 'KW' '954'; -KW955 : 'KW' '955'; -KW956 : 'KW' '956'; -KW957 : 'KW' '957'; -KW958 : 'KW' '958'; -KW959 : 'KW' '959'; -KW960 : 'KW' '960'; -KW961 : 'KW' '961'; -KW962 : 'KW' '962'; -KW963 : 'KW' '963'; -KW964 : 'KW' '964'; -KW965 : 'KW' '965'; -KW966 : 'KW' '966'; -KW967 : 'KW' '967'; -KW968 : 'KW' '968'; -KW969 : 'KW' '969'; -KW970 : 'KW' '970'; -KW971 : 'KW' '971'; -KW972 : 'KW' '972'; -KW973 : 'KW' '973'; -KW974 : 'KW' '974'; -KW975 : 'KW' '975'; -KW976 : 'KW' '976'; -KW977 : 'KW' '977'; -KW978 : 'KW' '978'; -KW979 : 'KW' '979'; -KW980 : 'KW' '980'; -KW981 : 'KW' '981'; -KW982 : 'KW' '982'; -KW983 : 'KW' '983'; -KW984 : 'KW' '984'; -KW985 : 'KW' '985'; -KW986 : 'KW' '986'; -KW987 : 'KW' '987'; -KW988 : 'KW' '988'; -KW989 : 'KW' '989'; -KW990 : 'KW' '990'; -KW991 : 'KW' '991'; -KW992 : 'KW' '992'; -KW993 : 'KW' '993'; -KW994 : 'KW' '994'; -KW995 : 'KW' '995'; -KW996 : 'KW' '996'; -KW997 : 'KW' '997'; -KW998 : 'KW' '998'; -KW999 : 'KW' '999'; -KW1000 : 'KW' '1000'; -KW1001 : 'KW' '1001'; -KW1002 : 'KW' '1002'; -KW1003 : 'KW' '1003'; -KW1004 : 'KW' '1004'; -KW1005 : 'KW' '1005'; -KW1006 : 'KW' '1006'; -KW1007 : 'KW' '1007'; -KW1008 : 'KW' '1008'; -KW1009 : 'KW' '1009'; -KW1010 : 'KW' '1010'; -KW1011 : 'KW' '1011'; -KW1012 : 'KW' '1012'; -KW1013 : 'KW' '1013'; -KW1014 : 'KW' '1014'; -KW1015 : 'KW' '1015'; -KW1016 : 'KW' '1016'; -KW1017 : 'KW' '1017'; -KW1018 : 'KW' '1018'; -KW1019 : 'KW' '1019'; -KW1020 : 'KW' '1020'; -KW1021 : 'KW' '1021'; -KW1022 : 'KW' '1022'; -KW1023 : 'KW' '1023'; -KW1024 : 'KW' '1024'; -KW1025 : 'KW' '1025'; -KW1026 : 'KW' '1026'; -KW1027 : 'KW' '1027'; -KW1028 : 'KW' '1028'; -KW1029 : 'KW' '1029'; -KW1030 : 'KW' '1030'; -KW1031 : 'KW' '1031'; -KW1032 : 'KW' '1032'; -KW1033 : 'KW' '1033'; -KW1034 : 'KW' '1034'; -KW1035 : 'KW' '1035'; -KW1036 : 'KW' '1036'; -KW1037 : 'KW' '1037'; -KW1038 : 'KW' '1038'; -KW1039 : 'KW' '1039'; -KW1040 : 'KW' '1040'; -KW1041 : 'KW' '1041'; -KW1042 : 'KW' '1042'; -KW1043 : 'KW' '1043'; -KW1044 : 'KW' '1044'; -KW1045 : 'KW' '1045'; -KW1046 : 'KW' '1046'; -KW1047 : 'KW' '1047'; -KW1048 : 'KW' '1048'; -KW1049 : 'KW' '1049'; -KW1050 : 'KW' '1050'; -KW1051 : 'KW' '1051'; -KW1052 : 'KW' '1052'; -KW1053 : 'KW' '1053'; -KW1054 : 'KW' '1054'; -KW1055 : 'KW' '1055'; -KW1056 : 'KW' '1056'; -KW1057 : 'KW' '1057'; -KW1058 : 'KW' '1058'; -KW1059 : 'KW' '1059'; -KW1060 : 'KW' '1060'; -KW1061 : 'KW' '1061'; -KW1062 : 'KW' '1062'; -KW1063 : 'KW' '1063'; -KW1064 : 'KW' '1064'; -KW1065 : 'KW' '1065'; -KW1066 : 'KW' '1066'; -KW1067 : 'KW' '1067'; -KW1068 : 'KW' '1068'; -KW1069 : 'KW' '1069'; -KW1070 : 'KW' '1070'; -KW1071 : 'KW' '1071'; -KW1072 : 'KW' '1072'; -KW1073 : 'KW' '1073'; -KW1074 : 'KW' '1074'; -KW1075 : 'KW' '1075'; -KW1076 : 'KW' '1076'; -KW1077 : 'KW' '1077'; -KW1078 : 'KW' '1078'; -KW1079 : 'KW' '1079'; -KW1080 : 'KW' '1080'; -KW1081 : 'KW' '1081'; -KW1082 : 'KW' '1082'; -KW1083 : 'KW' '1083'; -KW1084 : 'KW' '1084'; -KW1085 : 'KW' '1085'; -KW1086 : 'KW' '1086'; -KW1087 : 'KW' '1087'; -KW1088 : 'KW' '1088'; -KW1089 : 'KW' '1089'; -KW1090 : 'KW' '1090'; -KW1091 : 'KW' '1091'; -KW1092 : 'KW' '1092'; -KW1093 : 'KW' '1093'; -KW1094 : 'KW' '1094'; -KW1095 : 'KW' '1095'; -KW1096 : 'KW' '1096'; -KW1097 : 'KW' '1097'; -KW1098 : 'KW' '1098'; -KW1099 : 'KW' '1099'; -KW1100 : 'KW' '1100'; -KW1101 : 'KW' '1101'; -KW1102 : 'KW' '1102'; -KW1103 : 'KW' '1103'; -KW1104 : 'KW' '1104'; -KW1105 : 'KW' '1105'; -KW1106 : 'KW' '1106'; -KW1107 : 'KW' '1107'; -KW1108 : 'KW' '1108'; -KW1109 : 'KW' '1109'; -KW1110 : 'KW' '1110'; -KW1111 : 'KW' '1111'; -KW1112 : 'KW' '1112'; -KW1113 : 'KW' '1113'; -KW1114 : 'KW' '1114'; -KW1115 : 'KW' '1115'; -KW1116 : 'KW' '1116'; -KW1117 : 'KW' '1117'; -KW1118 : 'KW' '1118'; -KW1119 : 'KW' '1119'; -KW1120 : 'KW' '1120'; -KW1121 : 'KW' '1121'; -KW1122 : 'KW' '1122'; -KW1123 : 'KW' '1123'; -KW1124 : 'KW' '1124'; -KW1125 : 'KW' '1125'; -KW1126 : 'KW' '1126'; -KW1127 : 'KW' '1127'; -KW1128 : 'KW' '1128'; -KW1129 : 'KW' '1129'; -KW1130 : 'KW' '1130'; -KW1131 : 'KW' '1131'; -KW1132 : 'KW' '1132'; -KW1133 : 'KW' '1133'; -KW1134 : 'KW' '1134'; -KW1135 : 'KW' '1135'; -KW1136 : 'KW' '1136'; -KW1137 : 'KW' '1137'; -KW1138 : 'KW' '1138'; -KW1139 : 'KW' '1139'; -KW1140 : 'KW' '1140'; -KW1141 : 'KW' '1141'; -KW1142 : 'KW' '1142'; -KW1143 : 'KW' '1143'; -KW1144 : 'KW' '1144'; -KW1145 : 'KW' '1145'; -KW1146 : 'KW' '1146'; -KW1147 : 'KW' '1147'; -KW1148 : 'KW' '1148'; -KW1149 : 'KW' '1149'; -KW1150 : 'KW' '1150'; -KW1151 : 'KW' '1151'; -KW1152 : 'KW' '1152'; -KW1153 : 'KW' '1153'; -KW1154 : 'KW' '1154'; -KW1155 : 'KW' '1155'; -KW1156 : 'KW' '1156'; -KW1157 : 'KW' '1157'; -KW1158 : 'KW' '1158'; -KW1159 : 'KW' '1159'; -KW1160 : 'KW' '1160'; -KW1161 : 'KW' '1161'; -KW1162 : 'KW' '1162'; -KW1163 : 'KW' '1163'; -KW1164 : 'KW' '1164'; -KW1165 : 'KW' '1165'; -KW1166 : 'KW' '1166'; -KW1167 : 'KW' '1167'; -KW1168 : 'KW' '1168'; -KW1169 : 'KW' '1169'; -KW1170 : 'KW' '1170'; -KW1171 : 'KW' '1171'; -KW1172 : 'KW' '1172'; -KW1173 : 'KW' '1173'; -KW1174 : 'KW' '1174'; -KW1175 : 'KW' '1175'; -KW1176 : 'KW' '1176'; -KW1177 : 'KW' '1177'; -KW1178 : 'KW' '1178'; -KW1179 : 'KW' '1179'; -KW1180 : 'KW' '1180'; -KW1181 : 'KW' '1181'; -KW1182 : 'KW' '1182'; -KW1183 : 'KW' '1183'; -KW1184 : 'KW' '1184'; -KW1185 : 'KW' '1185'; -KW1186 : 'KW' '1186'; -KW1187 : 'KW' '1187'; -KW1188 : 'KW' '1188'; -KW1189 : 'KW' '1189'; -KW1190 : 'KW' '1190'; -KW1191 : 'KW' '1191'; -KW1192 : 'KW' '1192'; -KW1193 : 'KW' '1193'; -KW1194 : 'KW' '1194'; -KW1195 : 'KW' '1195'; -KW1196 : 'KW' '1196'; -KW1197 : 'KW' '1197'; -KW1198 : 'KW' '1198'; -KW1199 : 'KW' '1199'; -KW1200 : 'KW' '1200'; -KW1201 : 'KW' '1201'; -KW1202 : 'KW' '1202'; -KW1203 : 'KW' '1203'; -KW1204 : 'KW' '1204'; -KW1205 : 'KW' '1205'; -KW1206 : 'KW' '1206'; -KW1207 : 'KW' '1207'; -KW1208 : 'KW' '1208'; -KW1209 : 'KW' '1209'; -KW1210 : 'KW' '1210'; -KW1211 : 'KW' '1211'; -KW1212 : 'KW' '1212'; -KW1213 : 'KW' '1213'; -KW1214 : 'KW' '1214'; -KW1215 : 'KW' '1215'; -KW1216 : 'KW' '1216'; -KW1217 : 'KW' '1217'; -KW1218 : 'KW' '1218'; -KW1219 : 'KW' '1219'; -KW1220 : 'KW' '1220'; -KW1221 : 'KW' '1221'; -KW1222 : 'KW' '1222'; -KW1223 : 'KW' '1223'; -KW1224 : 'KW' '1224'; -KW1225 : 'KW' '1225'; -KW1226 : 'KW' '1226'; -KW1227 : 'KW' '1227'; -KW1228 : 'KW' '1228'; -KW1229 : 'KW' '1229'; -KW1230 : 'KW' '1230'; -KW1231 : 'KW' '1231'; -KW1232 : 'KW' '1232'; -KW1233 : 'KW' '1233'; -KW1234 : 'KW' '1234'; -KW1235 : 'KW' '1235'; -KW1236 : 'KW' '1236'; -KW1237 : 'KW' '1237'; -KW1238 : 'KW' '1238'; -KW1239 : 'KW' '1239'; -KW1240 : 'KW' '1240'; -KW1241 : 'KW' '1241'; -KW1242 : 'KW' '1242'; -KW1243 : 'KW' '1243'; -KW1244 : 'KW' '1244'; -KW1245 : 'KW' '1245'; -KW1246 : 'KW' '1246'; -KW1247 : 'KW' '1247'; -KW1248 : 'KW' '1248'; -KW1249 : 'KW' '1249'; -KW1250 : 'KW' '1250'; -KW1251 : 'KW' '1251'; -KW1252 : 'KW' '1252'; -KW1253 : 'KW' '1253'; -KW1254 : 'KW' '1254'; -KW1255 : 'KW' '1255'; -KW1256 : 'KW' '1256'; -KW1257 : 'KW' '1257'; -KW1258 : 'KW' '1258'; -KW1259 : 'KW' '1259'; -KW1260 : 'KW' '1260'; -KW1261 : 'KW' '1261'; -KW1262 : 'KW' '1262'; -KW1263 : 'KW' '1263'; -KW1264 : 'KW' '1264'; -KW1265 : 'KW' '1265'; -KW1266 : 'KW' '1266'; -KW1267 : 'KW' '1267'; -KW1268 : 'KW' '1268'; -KW1269 : 'KW' '1269'; -KW1270 : 'KW' '1270'; -KW1271 : 'KW' '1271'; -KW1272 : 'KW' '1272'; -KW1273 : 'KW' '1273'; -KW1274 : 'KW' '1274'; -KW1275 : 'KW' '1275'; -KW1276 : 'KW' '1276'; -KW1277 : 'KW' '1277'; -KW1278 : 'KW' '1278'; -KW1279 : 'KW' '1279'; -KW1280 : 'KW' '1280'; -KW1281 : 'KW' '1281'; -KW1282 : 'KW' '1282'; -KW1283 : 'KW' '1283'; -KW1284 : 'KW' '1284'; -KW1285 : 'KW' '1285'; -KW1286 : 'KW' '1286'; -KW1287 : 'KW' '1287'; -KW1288 : 'KW' '1288'; -KW1289 : 'KW' '1289'; -KW1290 : 'KW' '1290'; -KW1291 : 'KW' '1291'; -KW1292 : 'KW' '1292'; -KW1293 : 'KW' '1293'; -KW1294 : 'KW' '1294'; -KW1295 : 'KW' '1295'; -KW1296 : 'KW' '1296'; -KW1297 : 'KW' '1297'; -KW1298 : 'KW' '1298'; -KW1299 : 'KW' '1299'; -KW1300 : 'KW' '1300'; -KW1301 : 'KW' '1301'; -KW1302 : 'KW' '1302'; -KW1303 : 'KW' '1303'; -KW1304 : 'KW' '1304'; -KW1305 : 'KW' '1305'; -KW1306 : 'KW' '1306'; -KW1307 : 'KW' '1307'; -KW1308 : 'KW' '1308'; -KW1309 : 'KW' '1309'; -KW1310 : 'KW' '1310'; -KW1311 : 'KW' '1311'; -KW1312 : 'KW' '1312'; -KW1313 : 'KW' '1313'; -KW1314 : 'KW' '1314'; -KW1315 : 'KW' '1315'; -KW1316 : 'KW' '1316'; -KW1317 : 'KW' '1317'; -KW1318 : 'KW' '1318'; -KW1319 : 'KW' '1319'; -KW1320 : 'KW' '1320'; -KW1321 : 'KW' '1321'; -KW1322 : 'KW' '1322'; -KW1323 : 'KW' '1323'; -KW1324 : 'KW' '1324'; -KW1325 : 'KW' '1325'; -KW1326 : 'KW' '1326'; -KW1327 : 'KW' '1327'; -KW1328 : 'KW' '1328'; -KW1329 : 'KW' '1329'; -KW1330 : 'KW' '1330'; -KW1331 : 'KW' '1331'; -KW1332 : 'KW' '1332'; -KW1333 : 'KW' '1333'; -KW1334 : 'KW' '1334'; -KW1335 : 'KW' '1335'; -KW1336 : 'KW' '1336'; -KW1337 : 'KW' '1337'; -KW1338 : 'KW' '1338'; -KW1339 : 'KW' '1339'; -KW1340 : 'KW' '1340'; -KW1341 : 'KW' '1341'; -KW1342 : 'KW' '1342'; -KW1343 : 'KW' '1343'; -KW1344 : 'KW' '1344'; -KW1345 : 'KW' '1345'; -KW1346 : 'KW' '1346'; -KW1347 : 'KW' '1347'; -KW1348 : 'KW' '1348'; -KW1349 : 'KW' '1349'; -KW1350 : 'KW' '1350'; -KW1351 : 'KW' '1351'; -KW1352 : 'KW' '1352'; -KW1353 : 'KW' '1353'; -KW1354 : 'KW' '1354'; -KW1355 : 'KW' '1355'; -KW1356 : 'KW' '1356'; -KW1357 : 'KW' '1357'; -KW1358 : 'KW' '1358'; -KW1359 : 'KW' '1359'; -KW1360 : 'KW' '1360'; -KW1361 : 'KW' '1361'; -KW1362 : 'KW' '1362'; -KW1363 : 'KW' '1363'; -KW1364 : 'KW' '1364'; -KW1365 : 'KW' '1365'; -KW1366 : 'KW' '1366'; -KW1367 : 'KW' '1367'; -KW1368 : 'KW' '1368'; -KW1369 : 'KW' '1369'; -KW1370 : 'KW' '1370'; -KW1371 : 'KW' '1371'; -KW1372 : 'KW' '1372'; -KW1373 : 'KW' '1373'; -KW1374 : 'KW' '1374'; -KW1375 : 'KW' '1375'; -KW1376 : 'KW' '1376'; -KW1377 : 'KW' '1377'; -KW1378 : 'KW' '1378'; -KW1379 : 'KW' '1379'; -KW1380 : 'KW' '1380'; -KW1381 : 'KW' '1381'; -KW1382 : 'KW' '1382'; -KW1383 : 'KW' '1383'; -KW1384 : 'KW' '1384'; -KW1385 : 'KW' '1385'; -KW1386 : 'KW' '1386'; -KW1387 : 'KW' '1387'; -KW1388 : 'KW' '1388'; -KW1389 : 'KW' '1389'; -KW1390 : 'KW' '1390'; -KW1391 : 'KW' '1391'; -KW1392 : 'KW' '1392'; -KW1393 : 'KW' '1393'; -KW1394 : 'KW' '1394'; -KW1395 : 'KW' '1395'; -KW1396 : 'KW' '1396'; -KW1397 : 'KW' '1397'; -KW1398 : 'KW' '1398'; -KW1399 : 'KW' '1399'; -KW1400 : 'KW' '1400'; -KW1401 : 'KW' '1401'; -KW1402 : 'KW' '1402'; -KW1403 : 'KW' '1403'; -KW1404 : 'KW' '1404'; -KW1405 : 'KW' '1405'; -KW1406 : 'KW' '1406'; -KW1407 : 'KW' '1407'; -KW1408 : 'KW' '1408'; -KW1409 : 'KW' '1409'; -KW1410 : 'KW' '1410'; -KW1411 : 'KW' '1411'; -KW1412 : 'KW' '1412'; -KW1413 : 'KW' '1413'; -KW1414 : 'KW' '1414'; -KW1415 : 'KW' '1415'; -KW1416 : 'KW' '1416'; -KW1417 : 'KW' '1417'; -KW1418 : 'KW' '1418'; -KW1419 : 'KW' '1419'; -KW1420 : 'KW' '1420'; -KW1421 : 'KW' '1421'; -KW1422 : 'KW' '1422'; -KW1423 : 'KW' '1423'; -KW1424 : 'KW' '1424'; -KW1425 : 'KW' '1425'; -KW1426 : 'KW' '1426'; -KW1427 : 'KW' '1427'; -KW1428 : 'KW' '1428'; -KW1429 : 'KW' '1429'; -KW1430 : 'KW' '1430'; -KW1431 : 'KW' '1431'; -KW1432 : 'KW' '1432'; -KW1433 : 'KW' '1433'; -KW1434 : 'KW' '1434'; -KW1435 : 'KW' '1435'; -KW1436 : 'KW' '1436'; -KW1437 : 'KW' '1437'; -KW1438 : 'KW' '1438'; -KW1439 : 'KW' '1439'; -KW1440 : 'KW' '1440'; -KW1441 : 'KW' '1441'; -KW1442 : 'KW' '1442'; -KW1443 : 'KW' '1443'; -KW1444 : 'KW' '1444'; -KW1445 : 'KW' '1445'; -KW1446 : 'KW' '1446'; -KW1447 : 'KW' '1447'; -KW1448 : 'KW' '1448'; -KW1449 : 'KW' '1449'; -KW1450 : 'KW' '1450'; -KW1451 : 'KW' '1451'; -KW1452 : 'KW' '1452'; -KW1453 : 'KW' '1453'; -KW1454 : 'KW' '1454'; -KW1455 : 'KW' '1455'; -KW1456 : 'KW' '1456'; -KW1457 : 'KW' '1457'; -KW1458 : 'KW' '1458'; -KW1459 : 'KW' '1459'; -KW1460 : 'KW' '1460'; -KW1461 : 'KW' '1461'; -KW1462 : 'KW' '1462'; -KW1463 : 'KW' '1463'; -KW1464 : 'KW' '1464'; -KW1465 : 'KW' '1465'; -KW1466 : 'KW' '1466'; -KW1467 : 'KW' '1467'; -KW1468 : 'KW' '1468'; -KW1469 : 'KW' '1469'; -KW1470 : 'KW' '1470'; -KW1471 : 'KW' '1471'; -KW1472 : 'KW' '1472'; -KW1473 : 'KW' '1473'; -KW1474 : 'KW' '1474'; -KW1475 : 'KW' '1475'; -KW1476 : 'KW' '1476'; -KW1477 : 'KW' '1477'; -KW1478 : 'KW' '1478'; -KW1479 : 'KW' '1479'; -KW1480 : 'KW' '1480'; -KW1481 : 'KW' '1481'; -KW1482 : 'KW' '1482'; -KW1483 : 'KW' '1483'; -KW1484 : 'KW' '1484'; -KW1485 : 'KW' '1485'; -KW1486 : 'KW' '1486'; -KW1487 : 'KW' '1487'; -KW1488 : 'KW' '1488'; -KW1489 : 'KW' '1489'; -KW1490 : 'KW' '1490'; -KW1491 : 'KW' '1491'; -KW1492 : 'KW' '1492'; -KW1493 : 'KW' '1493'; -KW1494 : 'KW' '1494'; -KW1495 : 'KW' '1495'; -KW1496 : 'KW' '1496'; -KW1497 : 'KW' '1497'; -KW1498 : 'KW' '1498'; -KW1499 : 'KW' '1499'; -KW1500 : 'KW' '1500'; -KW1501 : 'KW' '1501'; -KW1502 : 'KW' '1502'; -KW1503 : 'KW' '1503'; -KW1504 : 'KW' '1504'; -KW1505 : 'KW' '1505'; -KW1506 : 'KW' '1506'; -KW1507 : 'KW' '1507'; -KW1508 : 'KW' '1508'; -KW1509 : 'KW' '1509'; -KW1510 : 'KW' '1510'; -KW1511 : 'KW' '1511'; -KW1512 : 'KW' '1512'; -KW1513 : 'KW' '1513'; -KW1514 : 'KW' '1514'; -KW1515 : 'KW' '1515'; -KW1516 : 'KW' '1516'; -KW1517 : 'KW' '1517'; -KW1518 : 'KW' '1518'; -KW1519 : 'KW' '1519'; -KW1520 : 'KW' '1520'; -KW1521 : 'KW' '1521'; -KW1522 : 'KW' '1522'; -KW1523 : 'KW' '1523'; -KW1524 : 'KW' '1524'; -KW1525 : 'KW' '1525'; -KW1526 : 'KW' '1526'; -KW1527 : 'KW' '1527'; -KW1528 : 'KW' '1528'; -KW1529 : 'KW' '1529'; -KW1530 : 'KW' '1530'; -KW1531 : 'KW' '1531'; -KW1532 : 'KW' '1532'; -KW1533 : 'KW' '1533'; -KW1534 : 'KW' '1534'; -KW1535 : 'KW' '1535'; -KW1536 : 'KW' '1536'; -KW1537 : 'KW' '1537'; -KW1538 : 'KW' '1538'; -KW1539 : 'KW' '1539'; -KW1540 : 'KW' '1540'; -KW1541 : 'KW' '1541'; -KW1542 : 'KW' '1542'; -KW1543 : 'KW' '1543'; -KW1544 : 'KW' '1544'; -KW1545 : 'KW' '1545'; -KW1546 : 'KW' '1546'; -KW1547 : 'KW' '1547'; -KW1548 : 'KW' '1548'; -KW1549 : 'KW' '1549'; -KW1550 : 'KW' '1550'; -KW1551 : 'KW' '1551'; -KW1552 : 'KW' '1552'; -KW1553 : 'KW' '1553'; -KW1554 : 'KW' '1554'; -KW1555 : 'KW' '1555'; -KW1556 : 'KW' '1556'; -KW1557 : 'KW' '1557'; -KW1558 : 'KW' '1558'; -KW1559 : 'KW' '1559'; -KW1560 : 'KW' '1560'; -KW1561 : 'KW' '1561'; -KW1562 : 'KW' '1562'; -KW1563 : 'KW' '1563'; -KW1564 : 'KW' '1564'; -KW1565 : 'KW' '1565'; -KW1566 : 'KW' '1566'; -KW1567 : 'KW' '1567'; -KW1568 : 'KW' '1568'; -KW1569 : 'KW' '1569'; -KW1570 : 'KW' '1570'; -KW1571 : 'KW' '1571'; -KW1572 : 'KW' '1572'; -KW1573 : 'KW' '1573'; -KW1574 : 'KW' '1574'; -KW1575 : 'KW' '1575'; -KW1576 : 'KW' '1576'; -KW1577 : 'KW' '1577'; -KW1578 : 'KW' '1578'; -KW1579 : 'KW' '1579'; -KW1580 : 'KW' '1580'; -KW1581 : 'KW' '1581'; -KW1582 : 'KW' '1582'; -KW1583 : 'KW' '1583'; -KW1584 : 'KW' '1584'; -KW1585 : 'KW' '1585'; -KW1586 : 'KW' '1586'; -KW1587 : 'KW' '1587'; -KW1588 : 'KW' '1588'; -KW1589 : 'KW' '1589'; -KW1590 : 'KW' '1590'; -KW1591 : 'KW' '1591'; -KW1592 : 'KW' '1592'; -KW1593 : 'KW' '1593'; -KW1594 : 'KW' '1594'; -KW1595 : 'KW' '1595'; -KW1596 : 'KW' '1596'; -KW1597 : 'KW' '1597'; -KW1598 : 'KW' '1598'; -KW1599 : 'KW' '1599'; -KW1600 : 'KW' '1600'; -KW1601 : 'KW' '1601'; -KW1602 : 'KW' '1602'; -KW1603 : 'KW' '1603'; -KW1604 : 'KW' '1604'; -KW1605 : 'KW' '1605'; -KW1606 : 'KW' '1606'; -KW1607 : 'KW' '1607'; -KW1608 : 'KW' '1608'; -KW1609 : 'KW' '1609'; -KW1610 : 'KW' '1610'; -KW1611 : 'KW' '1611'; -KW1612 : 'KW' '1612'; -KW1613 : 'KW' '1613'; -KW1614 : 'KW' '1614'; -KW1615 : 'KW' '1615'; -KW1616 : 'KW' '1616'; -KW1617 : 'KW' '1617'; -KW1618 : 'KW' '1618'; -KW1619 : 'KW' '1619'; -KW1620 : 'KW' '1620'; -KW1621 : 'KW' '1621'; -KW1622 : 'KW' '1622'; -KW1623 : 'KW' '1623'; -KW1624 : 'KW' '1624'; -KW1625 : 'KW' '1625'; -KW1626 : 'KW' '1626'; -KW1627 : 'KW' '1627'; -KW1628 : 'KW' '1628'; -KW1629 : 'KW' '1629'; -KW1630 : 'KW' '1630'; -KW1631 : 'KW' '1631'; -KW1632 : 'KW' '1632'; -KW1633 : 'KW' '1633'; -KW1634 : 'KW' '1634'; -KW1635 : 'KW' '1635'; -KW1636 : 'KW' '1636'; -KW1637 : 'KW' '1637'; -KW1638 : 'KW' '1638'; -KW1639 : 'KW' '1639'; -KW1640 : 'KW' '1640'; -KW1641 : 'KW' '1641'; -KW1642 : 'KW' '1642'; -KW1643 : 'KW' '1643'; -KW1644 : 'KW' '1644'; -KW1645 : 'KW' '1645'; -KW1646 : 'KW' '1646'; -KW1647 : 'KW' '1647'; -KW1648 : 'KW' '1648'; -KW1649 : 'KW' '1649'; -KW1650 : 'KW' '1650'; -KW1651 : 'KW' '1651'; -KW1652 : 'KW' '1652'; -KW1653 : 'KW' '1653'; -KW1654 : 'KW' '1654'; -KW1655 : 'KW' '1655'; -KW1656 : 'KW' '1656'; -KW1657 : 'KW' '1657'; -KW1658 : 'KW' '1658'; -KW1659 : 'KW' '1659'; -KW1660 : 'KW' '1660'; -KW1661 : 'KW' '1661'; -KW1662 : 'KW' '1662'; -KW1663 : 'KW' '1663'; -KW1664 : 'KW' '1664'; -KW1665 : 'KW' '1665'; -KW1666 : 'KW' '1666'; -KW1667 : 'KW' '1667'; -KW1668 : 'KW' '1668'; -KW1669 : 'KW' '1669'; -KW1670 : 'KW' '1670'; -KW1671 : 'KW' '1671'; -KW1672 : 'KW' '1672'; -KW1673 : 'KW' '1673'; -KW1674 : 'KW' '1674'; -KW1675 : 'KW' '1675'; -KW1676 : 'KW' '1676'; -KW1677 : 'KW' '1677'; -KW1678 : 'KW' '1678'; -KW1679 : 'KW' '1679'; -KW1680 : 'KW' '1680'; -KW1681 : 'KW' '1681'; -KW1682 : 'KW' '1682'; -KW1683 : 'KW' '1683'; -KW1684 : 'KW' '1684'; -KW1685 : 'KW' '1685'; -KW1686 : 'KW' '1686'; -KW1687 : 'KW' '1687'; -KW1688 : 'KW' '1688'; -KW1689 : 'KW' '1689'; -KW1690 : 'KW' '1690'; -KW1691 : 'KW' '1691'; -KW1692 : 'KW' '1692'; -KW1693 : 'KW' '1693'; -KW1694 : 'KW' '1694'; -KW1695 : 'KW' '1695'; -KW1696 : 'KW' '1696'; -KW1697 : 'KW' '1697'; -KW1698 : 'KW' '1698'; -KW1699 : 'KW' '1699'; -KW1700 : 'KW' '1700'; -KW1701 : 'KW' '1701'; -KW1702 : 'KW' '1702'; -KW1703 : 'KW' '1703'; -KW1704 : 'KW' '1704'; -KW1705 : 'KW' '1705'; -KW1706 : 'KW' '1706'; -KW1707 : 'KW' '1707'; -KW1708 : 'KW' '1708'; -KW1709 : 'KW' '1709'; -KW1710 : 'KW' '1710'; -KW1711 : 'KW' '1711'; -KW1712 : 'KW' '1712'; -KW1713 : 'KW' '1713'; -KW1714 : 'KW' '1714'; -KW1715 : 'KW' '1715'; -KW1716 : 'KW' '1716'; -KW1717 : 'KW' '1717'; -KW1718 : 'KW' '1718'; -KW1719 : 'KW' '1719'; -KW1720 : 'KW' '1720'; -KW1721 : 'KW' '1721'; -KW1722 : 'KW' '1722'; -KW1723 : 'KW' '1723'; -KW1724 : 'KW' '1724'; -KW1725 : 'KW' '1725'; -KW1726 : 'KW' '1726'; -KW1727 : 'KW' '1727'; -KW1728 : 'KW' '1728'; -KW1729 : 'KW' '1729'; -KW1730 : 'KW' '1730'; -KW1731 : 'KW' '1731'; -KW1732 : 'KW' '1732'; -KW1733 : 'KW' '1733'; -KW1734 : 'KW' '1734'; -KW1735 : 'KW' '1735'; -KW1736 : 'KW' '1736'; -KW1737 : 'KW' '1737'; -KW1738 : 'KW' '1738'; -KW1739 : 'KW' '1739'; -KW1740 : 'KW' '1740'; -KW1741 : 'KW' '1741'; -KW1742 : 'KW' '1742'; -KW1743 : 'KW' '1743'; -KW1744 : 'KW' '1744'; -KW1745 : 'KW' '1745'; -KW1746 : 'KW' '1746'; -KW1747 : 'KW' '1747'; -KW1748 : 'KW' '1748'; -KW1749 : 'KW' '1749'; -KW1750 : 'KW' '1750'; -KW1751 : 'KW' '1751'; -KW1752 : 'KW' '1752'; -KW1753 : 'KW' '1753'; -KW1754 : 'KW' '1754'; -KW1755 : 'KW' '1755'; -KW1756 : 'KW' '1756'; -KW1757 : 'KW' '1757'; -KW1758 : 'KW' '1758'; -KW1759 : 'KW' '1759'; -KW1760 : 'KW' '1760'; -KW1761 : 'KW' '1761'; -KW1762 : 'KW' '1762'; -KW1763 : 'KW' '1763'; -KW1764 : 'KW' '1764'; -KW1765 : 'KW' '1765'; -KW1766 : 'KW' '1766'; -KW1767 : 'KW' '1767'; -KW1768 : 'KW' '1768'; -KW1769 : 'KW' '1769'; -KW1770 : 'KW' '1770'; -KW1771 : 'KW' '1771'; -KW1772 : 'KW' '1772'; -KW1773 : 'KW' '1773'; -KW1774 : 'KW' '1774'; -KW1775 : 'KW' '1775'; -KW1776 : 'KW' '1776'; -KW1777 : 'KW' '1777'; -KW1778 : 'KW' '1778'; -KW1779 : 'KW' '1779'; -KW1780 : 'KW' '1780'; -KW1781 : 'KW' '1781'; -KW1782 : 'KW' '1782'; -KW1783 : 'KW' '1783'; -KW1784 : 'KW' '1784'; -KW1785 : 'KW' '1785'; -KW1786 : 'KW' '1786'; -KW1787 : 'KW' '1787'; -KW1788 : 'KW' '1788'; -KW1789 : 'KW' '1789'; -KW1790 : 'KW' '1790'; -KW1791 : 'KW' '1791'; -KW1792 : 'KW' '1792'; -KW1793 : 'KW' '1793'; -KW1794 : 'KW' '1794'; -KW1795 : 'KW' '1795'; -KW1796 : 'KW' '1796'; -KW1797 : 'KW' '1797'; -KW1798 : 'KW' '1798'; -KW1799 : 'KW' '1799'; -KW1800 : 'KW' '1800'; -KW1801 : 'KW' '1801'; -KW1802 : 'KW' '1802'; -KW1803 : 'KW' '1803'; -KW1804 : 'KW' '1804'; -KW1805 : 'KW' '1805'; -KW1806 : 'KW' '1806'; -KW1807 : 'KW' '1807'; -KW1808 : 'KW' '1808'; -KW1809 : 'KW' '1809'; -KW1810 : 'KW' '1810'; -KW1811 : 'KW' '1811'; -KW1812 : 'KW' '1812'; -KW1813 : 'KW' '1813'; -KW1814 : 'KW' '1814'; -KW1815 : 'KW' '1815'; -KW1816 : 'KW' '1816'; -KW1817 : 'KW' '1817'; -KW1818 : 'KW' '1818'; -KW1819 : 'KW' '1819'; -KW1820 : 'KW' '1820'; -KW1821 : 'KW' '1821'; -KW1822 : 'KW' '1822'; -KW1823 : 'KW' '1823'; -KW1824 : 'KW' '1824'; -KW1825 : 'KW' '1825'; -KW1826 : 'KW' '1826'; -KW1827 : 'KW' '1827'; -KW1828 : 'KW' '1828'; -KW1829 : 'KW' '1829'; -KW1830 : 'KW' '1830'; -KW1831 : 'KW' '1831'; -KW1832 : 'KW' '1832'; -KW1833 : 'KW' '1833'; -KW1834 : 'KW' '1834'; -KW1835 : 'KW' '1835'; -KW1836 : 'KW' '1836'; -KW1837 : 'KW' '1837'; -KW1838 : 'KW' '1838'; -KW1839 : 'KW' '1839'; -KW1840 : 'KW' '1840'; -KW1841 : 'KW' '1841'; -KW1842 : 'KW' '1842'; -KW1843 : 'KW' '1843'; -KW1844 : 'KW' '1844'; -KW1845 : 'KW' '1845'; -KW1846 : 'KW' '1846'; -KW1847 : 'KW' '1847'; -KW1848 : 'KW' '1848'; -KW1849 : 'KW' '1849'; -KW1850 : 'KW' '1850'; -KW1851 : 'KW' '1851'; -KW1852 : 'KW' '1852'; -KW1853 : 'KW' '1853'; -KW1854 : 'KW' '1854'; -KW1855 : 'KW' '1855'; -KW1856 : 'KW' '1856'; -KW1857 : 'KW' '1857'; -KW1858 : 'KW' '1858'; -KW1859 : 'KW' '1859'; -KW1860 : 'KW' '1860'; -KW1861 : 'KW' '1861'; -KW1862 : 'KW' '1862'; -KW1863 : 'KW' '1863'; -KW1864 : 'KW' '1864'; -KW1865 : 'KW' '1865'; -KW1866 : 'KW' '1866'; -KW1867 : 'KW' '1867'; -KW1868 : 'KW' '1868'; -KW1869 : 'KW' '1869'; -KW1870 : 'KW' '1870'; -KW1871 : 'KW' '1871'; -KW1872 : 'KW' '1872'; -KW1873 : 'KW' '1873'; -KW1874 : 'KW' '1874'; -KW1875 : 'KW' '1875'; -KW1876 : 'KW' '1876'; -KW1877 : 'KW' '1877'; -KW1878 : 'KW' '1878'; -KW1879 : 'KW' '1879'; -KW1880 : 'KW' '1880'; -KW1881 : 'KW' '1881'; -KW1882 : 'KW' '1882'; -KW1883 : 'KW' '1883'; -KW1884 : 'KW' '1884'; -KW1885 : 'KW' '1885'; -KW1886 : 'KW' '1886'; -KW1887 : 'KW' '1887'; -KW1888 : 'KW' '1888'; -KW1889 : 'KW' '1889'; -KW1890 : 'KW' '1890'; -KW1891 : 'KW' '1891'; -KW1892 : 'KW' '1892'; -KW1893 : 'KW' '1893'; -KW1894 : 'KW' '1894'; -KW1895 : 'KW' '1895'; -KW1896 : 'KW' '1896'; -KW1897 : 'KW' '1897'; -KW1898 : 'KW' '1898'; -KW1899 : 'KW' '1899'; -KW1900 : 'KW' '1900'; -KW1901 : 'KW' '1901'; -KW1902 : 'KW' '1902'; -KW1903 : 'KW' '1903'; -KW1904 : 'KW' '1904'; -KW1905 : 'KW' '1905'; -KW1906 : 'KW' '1906'; -KW1907 : 'KW' '1907'; -KW1908 : 'KW' '1908'; -KW1909 : 'KW' '1909'; -KW1910 : 'KW' '1910'; -KW1911 : 'KW' '1911'; -KW1912 : 'KW' '1912'; -KW1913 : 'KW' '1913'; -KW1914 : 'KW' '1914'; -KW1915 : 'KW' '1915'; -KW1916 : 'KW' '1916'; -KW1917 : 'KW' '1917'; -KW1918 : 'KW' '1918'; -KW1919 : 'KW' '1919'; -KW1920 : 'KW' '1920'; -KW1921 : 'KW' '1921'; -KW1922 : 'KW' '1922'; -KW1923 : 'KW' '1923'; -KW1924 : 'KW' '1924'; -KW1925 : 'KW' '1925'; -KW1926 : 'KW' '1926'; -KW1927 : 'KW' '1927'; -KW1928 : 'KW' '1928'; -KW1929 : 'KW' '1929'; -KW1930 : 'KW' '1930'; -KW1931 : 'KW' '1931'; -KW1932 : 'KW' '1932'; -KW1933 : 'KW' '1933'; -KW1934 : 'KW' '1934'; -KW1935 : 'KW' '1935'; -KW1936 : 'KW' '1936'; -KW1937 : 'KW' '1937'; -KW1938 : 'KW' '1938'; -KW1939 : 'KW' '1939'; -KW1940 : 'KW' '1940'; -KW1941 : 'KW' '1941'; -KW1942 : 'KW' '1942'; -KW1943 : 'KW' '1943'; -KW1944 : 'KW' '1944'; -KW1945 : 'KW' '1945'; -KW1946 : 'KW' '1946'; -KW1947 : 'KW' '1947'; -KW1948 : 'KW' '1948'; -KW1949 : 'KW' '1949'; -KW1950 : 'KW' '1950'; -KW1951 : 'KW' '1951'; -KW1952 : 'KW' '1952'; -KW1953 : 'KW' '1953'; -KW1954 : 'KW' '1954'; -KW1955 : 'KW' '1955'; -KW1956 : 'KW' '1956'; -KW1957 : 'KW' '1957'; -KW1958 : 'KW' '1958'; -KW1959 : 'KW' '1959'; -KW1960 : 'KW' '1960'; -KW1961 : 'KW' '1961'; -KW1962 : 'KW' '1962'; -KW1963 : 'KW' '1963'; -KW1964 : 'KW' '1964'; -KW1965 : 'KW' '1965'; -KW1966 : 'KW' '1966'; -KW1967 : 'KW' '1967'; -KW1968 : 'KW' '1968'; -KW1969 : 'KW' '1969'; -KW1970 : 'KW' '1970'; -KW1971 : 'KW' '1971'; -KW1972 : 'KW' '1972'; -KW1973 : 'KW' '1973'; -KW1974 : 'KW' '1974'; -KW1975 : 'KW' '1975'; -KW1976 : 'KW' '1976'; -KW1977 : 'KW' '1977'; -KW1978 : 'KW' '1978'; -KW1979 : 'KW' '1979'; -KW1980 : 'KW' '1980'; -KW1981 : 'KW' '1981'; -KW1982 : 'KW' '1982'; -KW1983 : 'KW' '1983'; -KW1984 : 'KW' '1984'; -KW1985 : 'KW' '1985'; -KW1986 : 'KW' '1986'; -KW1987 : 'KW' '1987'; -KW1988 : 'KW' '1988'; -KW1989 : 'KW' '1989'; -KW1990 : 'KW' '1990'; -KW1991 : 'KW' '1991'; -KW1992 : 'KW' '1992'; -KW1993 : 'KW' '1993'; -KW1994 : 'KW' '1994'; -KW1995 : 'KW' '1995'; -KW1996 : 'KW' '1996'; -KW1997 : 'KW' '1997'; -KW1998 : 'KW' '1998'; -KW1999 : 'KW' '1999'; -KW2000 : 'KW' '2000'; -KW2001 : 'KW' '2001'; -KW2002 : 'KW' '2002'; -KW2003 : 'KW' '2003'; -KW2004 : 'KW' '2004'; -KW2005 : 'KW' '2005'; -KW2006 : 'KW' '2006'; -KW2007 : 'KW' '2007'; -KW2008 : 'KW' '2008'; -KW2009 : 'KW' '2009'; -KW2010 : 'KW' '2010'; -KW2011 : 'KW' '2011'; -KW2012 : 'KW' '2012'; -KW2013 : 'KW' '2013'; -KW2014 : 'KW' '2014'; -KW2015 : 'KW' '2015'; -KW2016 : 'KW' '2016'; -KW2017 : 'KW' '2017'; -KW2018 : 'KW' '2018'; -KW2019 : 'KW' '2019'; -KW2020 : 'KW' '2020'; -KW2021 : 'KW' '2021'; -KW2022 : 'KW' '2022'; -KW2023 : 'KW' '2023'; -KW2024 : 'KW' '2024'; -KW2025 : 'KW' '2025'; -KW2026 : 'KW' '2026'; -KW2027 : 'KW' '2027'; -KW2028 : 'KW' '2028'; -KW2029 : 'KW' '2029'; -KW2030 : 'KW' '2030'; -KW2031 : 'KW' '2031'; -KW2032 : 'KW' '2032'; -KW2033 : 'KW' '2033'; -KW2034 : 'KW' '2034'; -KW2035 : 'KW' '2035'; -KW2036 : 'KW' '2036'; -KW2037 : 'KW' '2037'; -KW2038 : 'KW' '2038'; -KW2039 : 'KW' '2039'; -KW2040 : 'KW' '2040'; -KW2041 : 'KW' '2041'; -KW2042 : 'KW' '2042'; -KW2043 : 'KW' '2043'; -KW2044 : 'KW' '2044'; -KW2045 : 'KW' '2045'; -KW2046 : 'KW' '2046'; -KW2047 : 'KW' '2047'; -KW2048 : 'KW' '2048'; -KW2049 : 'KW' '2049'; -KW2050 : 'KW' '2050'; -KW2051 : 'KW' '2051'; -KW2052 : 'KW' '2052'; -KW2053 : 'KW' '2053'; -KW2054 : 'KW' '2054'; -KW2055 : 'KW' '2055'; -KW2056 : 'KW' '2056'; -KW2057 : 'KW' '2057'; -KW2058 : 'KW' '2058'; -KW2059 : 'KW' '2059'; -KW2060 : 'KW' '2060'; -KW2061 : 'KW' '2061'; -KW2062 : 'KW' '2062'; -KW2063 : 'KW' '2063'; -KW2064 : 'KW' '2064'; -KW2065 : 'KW' '2065'; -KW2066 : 'KW' '2066'; -KW2067 : 'KW' '2067'; -KW2068 : 'KW' '2068'; -KW2069 : 'KW' '2069'; -KW2070 : 'KW' '2070'; -KW2071 : 'KW' '2071'; -KW2072 : 'KW' '2072'; -KW2073 : 'KW' '2073'; -KW2074 : 'KW' '2074'; -KW2075 : 'KW' '2075'; -KW2076 : 'KW' '2076'; -KW2077 : 'KW' '2077'; -KW2078 : 'KW' '2078'; -KW2079 : 'KW' '2079'; -KW2080 : 'KW' '2080'; -KW2081 : 'KW' '2081'; -KW2082 : 'KW' '2082'; -KW2083 : 'KW' '2083'; -KW2084 : 'KW' '2084'; -KW2085 : 'KW' '2085'; -KW2086 : 'KW' '2086'; -KW2087 : 'KW' '2087'; -KW2088 : 'KW' '2088'; -KW2089 : 'KW' '2089'; -KW2090 : 'KW' '2090'; -KW2091 : 'KW' '2091'; -KW2092 : 'KW' '2092'; -KW2093 : 'KW' '2093'; -KW2094 : 'KW' '2094'; -KW2095 : 'KW' '2095'; -KW2096 : 'KW' '2096'; -KW2097 : 'KW' '2097'; -KW2098 : 'KW' '2098'; -KW2099 : 'KW' '2099'; -KW2100 : 'KW' '2100'; -KW2101 : 'KW' '2101'; -KW2102 : 'KW' '2102'; -KW2103 : 'KW' '2103'; -KW2104 : 'KW' '2104'; -KW2105 : 'KW' '2105'; -KW2106 : 'KW' '2106'; -KW2107 : 'KW' '2107'; -KW2108 : 'KW' '2108'; -KW2109 : 'KW' '2109'; -KW2110 : 'KW' '2110'; -KW2111 : 'KW' '2111'; -KW2112 : 'KW' '2112'; -KW2113 : 'KW' '2113'; -KW2114 : 'KW' '2114'; -KW2115 : 'KW' '2115'; -KW2116 : 'KW' '2116'; -KW2117 : 'KW' '2117'; -KW2118 : 'KW' '2118'; -KW2119 : 'KW' '2119'; -KW2120 : 'KW' '2120'; -KW2121 : 'KW' '2121'; -KW2122 : 'KW' '2122'; -KW2123 : 'KW' '2123'; -KW2124 : 'KW' '2124'; -KW2125 : 'KW' '2125'; -KW2126 : 'KW' '2126'; -KW2127 : 'KW' '2127'; -KW2128 : 'KW' '2128'; -KW2129 : 'KW' '2129'; -KW2130 : 'KW' '2130'; -KW2131 : 'KW' '2131'; -KW2132 : 'KW' '2132'; -KW2133 : 'KW' '2133'; -KW2134 : 'KW' '2134'; -KW2135 : 'KW' '2135'; -KW2136 : 'KW' '2136'; -KW2137 : 'KW' '2137'; -KW2138 : 'KW' '2138'; -KW2139 : 'KW' '2139'; -KW2140 : 'KW' '2140'; -KW2141 : 'KW' '2141'; -KW2142 : 'KW' '2142'; -KW2143 : 'KW' '2143'; -KW2144 : 'KW' '2144'; -KW2145 : 'KW' '2145'; -KW2146 : 'KW' '2146'; -KW2147 : 'KW' '2147'; -KW2148 : 'KW' '2148'; -KW2149 : 'KW' '2149'; -KW2150 : 'KW' '2150'; -KW2151 : 'KW' '2151'; -KW2152 : 'KW' '2152'; -KW2153 : 'KW' '2153'; -KW2154 : 'KW' '2154'; -KW2155 : 'KW' '2155'; -KW2156 : 'KW' '2156'; -KW2157 : 'KW' '2157'; -KW2158 : 'KW' '2158'; -KW2159 : 'KW' '2159'; -KW2160 : 'KW' '2160'; -KW2161 : 'KW' '2161'; -KW2162 : 'KW' '2162'; -KW2163 : 'KW' '2163'; -KW2164 : 'KW' '2164'; -KW2165 : 'KW' '2165'; -KW2166 : 'KW' '2166'; -KW2167 : 'KW' '2167'; -KW2168 : 'KW' '2168'; -KW2169 : 'KW' '2169'; -KW2170 : 'KW' '2170'; -KW2171 : 'KW' '2171'; -KW2172 : 'KW' '2172'; -KW2173 : 'KW' '2173'; -KW2174 : 'KW' '2174'; -KW2175 : 'KW' '2175'; -KW2176 : 'KW' '2176'; -KW2177 : 'KW' '2177'; -KW2178 : 'KW' '2178'; -KW2179 : 'KW' '2179'; -KW2180 : 'KW' '2180'; -KW2181 : 'KW' '2181'; -KW2182 : 'KW' '2182'; -KW2183 : 'KW' '2183'; -KW2184 : 'KW' '2184'; -KW2185 : 'KW' '2185'; -KW2186 : 'KW' '2186'; -KW2187 : 'KW' '2187'; -KW2188 : 'KW' '2188'; -KW2189 : 'KW' '2189'; -KW2190 : 'KW' '2190'; -KW2191 : 'KW' '2191'; -KW2192 : 'KW' '2192'; -KW2193 : 'KW' '2193'; -KW2194 : 'KW' '2194'; -KW2195 : 'KW' '2195'; -KW2196 : 'KW' '2196'; -KW2197 : 'KW' '2197'; -KW2198 : 'KW' '2198'; -KW2199 : 'KW' '2199'; -KW2200 : 'KW' '2200'; -KW2201 : 'KW' '2201'; -KW2202 : 'KW' '2202'; -KW2203 : 'KW' '2203'; -KW2204 : 'KW' '2204'; -KW2205 : 'KW' '2205'; -KW2206 : 'KW' '2206'; -KW2207 : 'KW' '2207'; -KW2208 : 'KW' '2208'; -KW2209 : 'KW' '2209'; -KW2210 : 'KW' '2210'; -KW2211 : 'KW' '2211'; -KW2212 : 'KW' '2212'; -KW2213 : 'KW' '2213'; -KW2214 : 'KW' '2214'; -KW2215 : 'KW' '2215'; -KW2216 : 'KW' '2216'; -KW2217 : 'KW' '2217'; -KW2218 : 'KW' '2218'; -KW2219 : 'KW' '2219'; -KW2220 : 'KW' '2220'; -KW2221 : 'KW' '2221'; -KW2222 : 'KW' '2222'; -KW2223 : 'KW' '2223'; -KW2224 : 'KW' '2224'; -KW2225 : 'KW' '2225'; -KW2226 : 'KW' '2226'; -KW2227 : 'KW' '2227'; -KW2228 : 'KW' '2228'; -KW2229 : 'KW' '2229'; -KW2230 : 'KW' '2230'; -KW2231 : 'KW' '2231'; -KW2232 : 'KW' '2232'; -KW2233 : 'KW' '2233'; -KW2234 : 'KW' '2234'; -KW2235 : 'KW' '2235'; -KW2236 : 'KW' '2236'; -KW2237 : 'KW' '2237'; -KW2238 : 'KW' '2238'; -KW2239 : 'KW' '2239'; -KW2240 : 'KW' '2240'; -KW2241 : 'KW' '2241'; -KW2242 : 'KW' '2242'; -KW2243 : 'KW' '2243'; -KW2244 : 'KW' '2244'; -KW2245 : 'KW' '2245'; -KW2246 : 'KW' '2246'; -KW2247 : 'KW' '2247'; -KW2248 : 'KW' '2248'; -KW2249 : 'KW' '2249'; -KW2250 : 'KW' '2250'; -KW2251 : 'KW' '2251'; -KW2252 : 'KW' '2252'; -KW2253 : 'KW' '2253'; -KW2254 : 'KW' '2254'; -KW2255 : 'KW' '2255'; -KW2256 : 'KW' '2256'; -KW2257 : 'KW' '2257'; -KW2258 : 'KW' '2258'; -KW2259 : 'KW' '2259'; -KW2260 : 'KW' '2260'; -KW2261 : 'KW' '2261'; -KW2262 : 'KW' '2262'; -KW2263 : 'KW' '2263'; -KW2264 : 'KW' '2264'; -KW2265 : 'KW' '2265'; -KW2266 : 'KW' '2266'; -KW2267 : 'KW' '2267'; -KW2268 : 'KW' '2268'; -KW2269 : 'KW' '2269'; -KW2270 : 'KW' '2270'; -KW2271 : 'KW' '2271'; -KW2272 : 'KW' '2272'; -KW2273 : 'KW' '2273'; -KW2274 : 'KW' '2274'; -KW2275 : 'KW' '2275'; -KW2276 : 'KW' '2276'; -KW2277 : 'KW' '2277'; -KW2278 : 'KW' '2278'; -KW2279 : 'KW' '2279'; -KW2280 : 'KW' '2280'; -KW2281 : 'KW' '2281'; -KW2282 : 'KW' '2282'; -KW2283 : 'KW' '2283'; -KW2284 : 'KW' '2284'; -KW2285 : 'KW' '2285'; -KW2286 : 'KW' '2286'; -KW2287 : 'KW' '2287'; -KW2288 : 'KW' '2288'; -KW2289 : 'KW' '2289'; -KW2290 : 'KW' '2290'; -KW2291 : 'KW' '2291'; -KW2292 : 'KW' '2292'; -KW2293 : 'KW' '2293'; -KW2294 : 'KW' '2294'; -KW2295 : 'KW' '2295'; -KW2296 : 'KW' '2296'; -KW2297 : 'KW' '2297'; -KW2298 : 'KW' '2298'; -KW2299 : 'KW' '2299'; -KW2300 : 'KW' '2300'; -KW2301 : 'KW' '2301'; -KW2302 : 'KW' '2302'; -KW2303 : 'KW' '2303'; -KW2304 : 'KW' '2304'; -KW2305 : 'KW' '2305'; -KW2306 : 'KW' '2306'; -KW2307 : 'KW' '2307'; -KW2308 : 'KW' '2308'; -KW2309 : 'KW' '2309'; -KW2310 : 'KW' '2310'; -KW2311 : 'KW' '2311'; -KW2312 : 'KW' '2312'; -KW2313 : 'KW' '2313'; -KW2314 : 'KW' '2314'; -KW2315 : 'KW' '2315'; -KW2316 : 'KW' '2316'; -KW2317 : 'KW' '2317'; -KW2318 : 'KW' '2318'; -KW2319 : 'KW' '2319'; -KW2320 : 'KW' '2320'; -KW2321 : 'KW' '2321'; -KW2322 : 'KW' '2322'; -KW2323 : 'KW' '2323'; -KW2324 : 'KW' '2324'; -KW2325 : 'KW' '2325'; -KW2326 : 'KW' '2326'; -KW2327 : 'KW' '2327'; -KW2328 : 'KW' '2328'; -KW2329 : 'KW' '2329'; -KW2330 : 'KW' '2330'; -KW2331 : 'KW' '2331'; -KW2332 : 'KW' '2332'; -KW2333 : 'KW' '2333'; -KW2334 : 'KW' '2334'; -KW2335 : 'KW' '2335'; -KW2336 : 'KW' '2336'; -KW2337 : 'KW' '2337'; -KW2338 : 'KW' '2338'; -KW2339 : 'KW' '2339'; -KW2340 : 'KW' '2340'; -KW2341 : 'KW' '2341'; -KW2342 : 'KW' '2342'; -KW2343 : 'KW' '2343'; -KW2344 : 'KW' '2344'; -KW2345 : 'KW' '2345'; -KW2346 : 'KW' '2346'; -KW2347 : 'KW' '2347'; -KW2348 : 'KW' '2348'; -KW2349 : 'KW' '2349'; -KW2350 : 'KW' '2350'; -KW2351 : 'KW' '2351'; -KW2352 : 'KW' '2352'; -KW2353 : 'KW' '2353'; -KW2354 : 'KW' '2354'; -KW2355 : 'KW' '2355'; -KW2356 : 'KW' '2356'; -KW2357 : 'KW' '2357'; -KW2358 : 'KW' '2358'; -KW2359 : 'KW' '2359'; -KW2360 : 'KW' '2360'; -KW2361 : 'KW' '2361'; -KW2362 : 'KW' '2362'; -KW2363 : 'KW' '2363'; -KW2364 : 'KW' '2364'; -KW2365 : 'KW' '2365'; -KW2366 : 'KW' '2366'; -KW2367 : 'KW' '2367'; -KW2368 : 'KW' '2368'; -KW2369 : 'KW' '2369'; -KW2370 : 'KW' '2370'; -KW2371 : 'KW' '2371'; -KW2372 : 'KW' '2372'; -KW2373 : 'KW' '2373'; -KW2374 : 'KW' '2374'; -KW2375 : 'KW' '2375'; -KW2376 : 'KW' '2376'; -KW2377 : 'KW' '2377'; -KW2378 : 'KW' '2378'; -KW2379 : 'KW' '2379'; -KW2380 : 'KW' '2380'; -KW2381 : 'KW' '2381'; -KW2382 : 'KW' '2382'; -KW2383 : 'KW' '2383'; -KW2384 : 'KW' '2384'; -KW2385 : 'KW' '2385'; -KW2386 : 'KW' '2386'; -KW2387 : 'KW' '2387'; -KW2388 : 'KW' '2388'; -KW2389 : 'KW' '2389'; -KW2390 : 'KW' '2390'; -KW2391 : 'KW' '2391'; -KW2392 : 'KW' '2392'; -KW2393 : 'KW' '2393'; -KW2394 : 'KW' '2394'; -KW2395 : 'KW' '2395'; -KW2396 : 'KW' '2396'; -KW2397 : 'KW' '2397'; -KW2398 : 'KW' '2398'; -KW2399 : 'KW' '2399'; -KW2400 : 'KW' '2400'; -KW2401 : 'KW' '2401'; -KW2402 : 'KW' '2402'; -KW2403 : 'KW' '2403'; -KW2404 : 'KW' '2404'; -KW2405 : 'KW' '2405'; -KW2406 : 'KW' '2406'; -KW2407 : 'KW' '2407'; -KW2408 : 'KW' '2408'; -KW2409 : 'KW' '2409'; -KW2410 : 'KW' '2410'; -KW2411 : 'KW' '2411'; -KW2412 : 'KW' '2412'; -KW2413 : 'KW' '2413'; -KW2414 : 'KW' '2414'; -KW2415 : 'KW' '2415'; -KW2416 : 'KW' '2416'; -KW2417 : 'KW' '2417'; -KW2418 : 'KW' '2418'; -KW2419 : 'KW' '2419'; -KW2420 : 'KW' '2420'; -KW2421 : 'KW' '2421'; -KW2422 : 'KW' '2422'; -KW2423 : 'KW' '2423'; -KW2424 : 'KW' '2424'; -KW2425 : 'KW' '2425'; -KW2426 : 'KW' '2426'; -KW2427 : 'KW' '2427'; -KW2428 : 'KW' '2428'; -KW2429 : 'KW' '2429'; -KW2430 : 'KW' '2430'; -KW2431 : 'KW' '2431'; -KW2432 : 'KW' '2432'; -KW2433 : 'KW' '2433'; -KW2434 : 'KW' '2434'; -KW2435 : 'KW' '2435'; -KW2436 : 'KW' '2436'; -KW2437 : 'KW' '2437'; -KW2438 : 'KW' '2438'; -KW2439 : 'KW' '2439'; -KW2440 : 'KW' '2440'; -KW2441 : 'KW' '2441'; -KW2442 : 'KW' '2442'; -KW2443 : 'KW' '2443'; -KW2444 : 'KW' '2444'; -KW2445 : 'KW' '2445'; -KW2446 : 'KW' '2446'; -KW2447 : 'KW' '2447'; -KW2448 : 'KW' '2448'; -KW2449 : 'KW' '2449'; -KW2450 : 'KW' '2450'; -KW2451 : 'KW' '2451'; -KW2452 : 'KW' '2452'; -KW2453 : 'KW' '2453'; -KW2454 : 'KW' '2454'; -KW2455 : 'KW' '2455'; -KW2456 : 'KW' '2456'; -KW2457 : 'KW' '2457'; -KW2458 : 'KW' '2458'; -KW2459 : 'KW' '2459'; -KW2460 : 'KW' '2460'; -KW2461 : 'KW' '2461'; -KW2462 : 'KW' '2462'; -KW2463 : 'KW' '2463'; -KW2464 : 'KW' '2464'; -KW2465 : 'KW' '2465'; -KW2466 : 'KW' '2466'; -KW2467 : 'KW' '2467'; -KW2468 : 'KW' '2468'; -KW2469 : 'KW' '2469'; -KW2470 : 'KW' '2470'; -KW2471 : 'KW' '2471'; -KW2472 : 'KW' '2472'; -KW2473 : 'KW' '2473'; -KW2474 : 'KW' '2474'; -KW2475 : 'KW' '2475'; -KW2476 : 'KW' '2476'; -KW2477 : 'KW' '2477'; -KW2478 : 'KW' '2478'; -KW2479 : 'KW' '2479'; -KW2480 : 'KW' '2480'; -KW2481 : 'KW' '2481'; -KW2482 : 'KW' '2482'; -KW2483 : 'KW' '2483'; -KW2484 : 'KW' '2484'; -KW2485 : 'KW' '2485'; -KW2486 : 'KW' '2486'; -KW2487 : 'KW' '2487'; -KW2488 : 'KW' '2488'; -KW2489 : 'KW' '2489'; -KW2490 : 'KW' '2490'; -KW2491 : 'KW' '2491'; -KW2492 : 'KW' '2492'; -KW2493 : 'KW' '2493'; -KW2494 : 'KW' '2494'; -KW2495 : 'KW' '2495'; -KW2496 : 'KW' '2496'; -KW2497 : 'KW' '2497'; -KW2498 : 'KW' '2498'; -KW2499 : 'KW' '2499'; -KW2500 : 'KW' '2500'; -KW2501 : 'KW' '2501'; -KW2502 : 'KW' '2502'; -KW2503 : 'KW' '2503'; -KW2504 : 'KW' '2504'; -KW2505 : 'KW' '2505'; -KW2506 : 'KW' '2506'; -KW2507 : 'KW' '2507'; -KW2508 : 'KW' '2508'; -KW2509 : 'KW' '2509'; -KW2510 : 'KW' '2510'; -KW2511 : 'KW' '2511'; -KW2512 : 'KW' '2512'; -KW2513 : 'KW' '2513'; -KW2514 : 'KW' '2514'; -KW2515 : 'KW' '2515'; -KW2516 : 'KW' '2516'; -KW2517 : 'KW' '2517'; -KW2518 : 'KW' '2518'; -KW2519 : 'KW' '2519'; -KW2520 : 'KW' '2520'; -KW2521 : 'KW' '2521'; -KW2522 : 'KW' '2522'; -KW2523 : 'KW' '2523'; -KW2524 : 'KW' '2524'; -KW2525 : 'KW' '2525'; -KW2526 : 'KW' '2526'; -KW2527 : 'KW' '2527'; -KW2528 : 'KW' '2528'; -KW2529 : 'KW' '2529'; -KW2530 : 'KW' '2530'; -KW2531 : 'KW' '2531'; -KW2532 : 'KW' '2532'; -KW2533 : 'KW' '2533'; -KW2534 : 'KW' '2534'; -KW2535 : 'KW' '2535'; -KW2536 : 'KW' '2536'; -KW2537 : 'KW' '2537'; -KW2538 : 'KW' '2538'; -KW2539 : 'KW' '2539'; -KW2540 : 'KW' '2540'; -KW2541 : 'KW' '2541'; -KW2542 : 'KW' '2542'; -KW2543 : 'KW' '2543'; -KW2544 : 'KW' '2544'; -KW2545 : 'KW' '2545'; -KW2546 : 'KW' '2546'; -KW2547 : 'KW' '2547'; -KW2548 : 'KW' '2548'; -KW2549 : 'KW' '2549'; -KW2550 : 'KW' '2550'; -KW2551 : 'KW' '2551'; -KW2552 : 'KW' '2552'; -KW2553 : 'KW' '2553'; -KW2554 : 'KW' '2554'; -KW2555 : 'KW' '2555'; -KW2556 : 'KW' '2556'; -KW2557 : 'KW' '2557'; -KW2558 : 'KW' '2558'; -KW2559 : 'KW' '2559'; -KW2560 : 'KW' '2560'; -KW2561 : 'KW' '2561'; -KW2562 : 'KW' '2562'; -KW2563 : 'KW' '2563'; -KW2564 : 'KW' '2564'; -KW2565 : 'KW' '2565'; -KW2566 : 'KW' '2566'; -KW2567 : 'KW' '2567'; -KW2568 : 'KW' '2568'; -KW2569 : 'KW' '2569'; -KW2570 : 'KW' '2570'; -KW2571 : 'KW' '2571'; -KW2572 : 'KW' '2572'; -KW2573 : 'KW' '2573'; -KW2574 : 'KW' '2574'; -KW2575 : 'KW' '2575'; -KW2576 : 'KW' '2576'; -KW2577 : 'KW' '2577'; -KW2578 : 'KW' '2578'; -KW2579 : 'KW' '2579'; -KW2580 : 'KW' '2580'; -KW2581 : 'KW' '2581'; -KW2582 : 'KW' '2582'; -KW2583 : 'KW' '2583'; -KW2584 : 'KW' '2584'; -KW2585 : 'KW' '2585'; -KW2586 : 'KW' '2586'; -KW2587 : 'KW' '2587'; -KW2588 : 'KW' '2588'; -KW2589 : 'KW' '2589'; -KW2590 : 'KW' '2590'; -KW2591 : 'KW' '2591'; -KW2592 : 'KW' '2592'; -KW2593 : 'KW' '2593'; -KW2594 : 'KW' '2594'; -KW2595 : 'KW' '2595'; -KW2596 : 'KW' '2596'; -KW2597 : 'KW' '2597'; -KW2598 : 'KW' '2598'; -KW2599 : 'KW' '2599'; -KW2600 : 'KW' '2600'; -KW2601 : 'KW' '2601'; -KW2602 : 'KW' '2602'; -KW2603 : 'KW' '2603'; -KW2604 : 'KW' '2604'; -KW2605 : 'KW' '2605'; -KW2606 : 'KW' '2606'; -KW2607 : 'KW' '2607'; -KW2608 : 'KW' '2608'; -KW2609 : 'KW' '2609'; -KW2610 : 'KW' '2610'; -KW2611 : 'KW' '2611'; -KW2612 : 'KW' '2612'; -KW2613 : 'KW' '2613'; -KW2614 : 'KW' '2614'; -KW2615 : 'KW' '2615'; -KW2616 : 'KW' '2616'; -KW2617 : 'KW' '2617'; -KW2618 : 'KW' '2618'; -KW2619 : 'KW' '2619'; -KW2620 : 'KW' '2620'; -KW2621 : 'KW' '2621'; -KW2622 : 'KW' '2622'; -KW2623 : 'KW' '2623'; -KW2624 : 'KW' '2624'; -KW2625 : 'KW' '2625'; -KW2626 : 'KW' '2626'; -KW2627 : 'KW' '2627'; -KW2628 : 'KW' '2628'; -KW2629 : 'KW' '2629'; -KW2630 : 'KW' '2630'; -KW2631 : 'KW' '2631'; -KW2632 : 'KW' '2632'; -KW2633 : 'KW' '2633'; -KW2634 : 'KW' '2634'; -KW2635 : 'KW' '2635'; -KW2636 : 'KW' '2636'; -KW2637 : 'KW' '2637'; -KW2638 : 'KW' '2638'; -KW2639 : 'KW' '2639'; -KW2640 : 'KW' '2640'; -KW2641 : 'KW' '2641'; -KW2642 : 'KW' '2642'; -KW2643 : 'KW' '2643'; -KW2644 : 'KW' '2644'; -KW2645 : 'KW' '2645'; -KW2646 : 'KW' '2646'; -KW2647 : 'KW' '2647'; -KW2648 : 'KW' '2648'; -KW2649 : 'KW' '2649'; -KW2650 : 'KW' '2650'; -KW2651 : 'KW' '2651'; -KW2652 : 'KW' '2652'; -KW2653 : 'KW' '2653'; -KW2654 : 'KW' '2654'; -KW2655 : 'KW' '2655'; -KW2656 : 'KW' '2656'; -KW2657 : 'KW' '2657'; -KW2658 : 'KW' '2658'; -KW2659 : 'KW' '2659'; -KW2660 : 'KW' '2660'; -KW2661 : 'KW' '2661'; -KW2662 : 'KW' '2662'; -KW2663 : 'KW' '2663'; -KW2664 : 'KW' '2664'; -KW2665 : 'KW' '2665'; -KW2666 : 'KW' '2666'; -KW2667 : 'KW' '2667'; -KW2668 : 'KW' '2668'; -KW2669 : 'KW' '2669'; -KW2670 : 'KW' '2670'; -KW2671 : 'KW' '2671'; -KW2672 : 'KW' '2672'; -KW2673 : 'KW' '2673'; -KW2674 : 'KW' '2674'; -KW2675 : 'KW' '2675'; -KW2676 : 'KW' '2676'; -KW2677 : 'KW' '2677'; -KW2678 : 'KW' '2678'; -KW2679 : 'KW' '2679'; -KW2680 : 'KW' '2680'; -KW2681 : 'KW' '2681'; -KW2682 : 'KW' '2682'; -KW2683 : 'KW' '2683'; -KW2684 : 'KW' '2684'; -KW2685 : 'KW' '2685'; -KW2686 : 'KW' '2686'; -KW2687 : 'KW' '2687'; -KW2688 : 'KW' '2688'; -KW2689 : 'KW' '2689'; -KW2690 : 'KW' '2690'; -KW2691 : 'KW' '2691'; -KW2692 : 'KW' '2692'; -KW2693 : 'KW' '2693'; -KW2694 : 'KW' '2694'; -KW2695 : 'KW' '2695'; -KW2696 : 'KW' '2696'; -KW2697 : 'KW' '2697'; -KW2698 : 'KW' '2698'; -KW2699 : 'KW' '2699'; -KW2700 : 'KW' '2700'; -KW2701 : 'KW' '2701'; -KW2702 : 'KW' '2702'; -KW2703 : 'KW' '2703'; -KW2704 : 'KW' '2704'; -KW2705 : 'KW' '2705'; -KW2706 : 'KW' '2706'; -KW2707 : 'KW' '2707'; -KW2708 : 'KW' '2708'; -KW2709 : 'KW' '2709'; -KW2710 : 'KW' '2710'; -KW2711 : 'KW' '2711'; -KW2712 : 'KW' '2712'; -KW2713 : 'KW' '2713'; -KW2714 : 'KW' '2714'; -KW2715 : 'KW' '2715'; -KW2716 : 'KW' '2716'; -KW2717 : 'KW' '2717'; -KW2718 : 'KW' '2718'; -KW2719 : 'KW' '2719'; -KW2720 : 'KW' '2720'; -KW2721 : 'KW' '2721'; -KW2722 : 'KW' '2722'; -KW2723 : 'KW' '2723'; -KW2724 : 'KW' '2724'; -KW2725 : 'KW' '2725'; -KW2726 : 'KW' '2726'; -KW2727 : 'KW' '2727'; -KW2728 : 'KW' '2728'; -KW2729 : 'KW' '2729'; -KW2730 : 'KW' '2730'; -KW2731 : 'KW' '2731'; -KW2732 : 'KW' '2732'; -KW2733 : 'KW' '2733'; -KW2734 : 'KW' '2734'; -KW2735 : 'KW' '2735'; -KW2736 : 'KW' '2736'; -KW2737 : 'KW' '2737'; -KW2738 : 'KW' '2738'; -KW2739 : 'KW' '2739'; -KW2740 : 'KW' '2740'; -KW2741 : 'KW' '2741'; -KW2742 : 'KW' '2742'; -KW2743 : 'KW' '2743'; -KW2744 : 'KW' '2744'; -KW2745 : 'KW' '2745'; -KW2746 : 'KW' '2746'; -KW2747 : 'KW' '2747'; -KW2748 : 'KW' '2748'; -KW2749 : 'KW' '2749'; -KW2750 : 'KW' '2750'; -KW2751 : 'KW' '2751'; -KW2752 : 'KW' '2752'; -KW2753 : 'KW' '2753'; -KW2754 : 'KW' '2754'; -KW2755 : 'KW' '2755'; -KW2756 : 'KW' '2756'; -KW2757 : 'KW' '2757'; -KW2758 : 'KW' '2758'; -KW2759 : 'KW' '2759'; -KW2760 : 'KW' '2760'; -KW2761 : 'KW' '2761'; -KW2762 : 'KW' '2762'; -KW2763 : 'KW' '2763'; -KW2764 : 'KW' '2764'; -KW2765 : 'KW' '2765'; -KW2766 : 'KW' '2766'; -KW2767 : 'KW' '2767'; -KW2768 : 'KW' '2768'; -KW2769 : 'KW' '2769'; -KW2770 : 'KW' '2770'; -KW2771 : 'KW' '2771'; -KW2772 : 'KW' '2772'; -KW2773 : 'KW' '2773'; -KW2774 : 'KW' '2774'; -KW2775 : 'KW' '2775'; -KW2776 : 'KW' '2776'; -KW2777 : 'KW' '2777'; -KW2778 : 'KW' '2778'; -KW2779 : 'KW' '2779'; -KW2780 : 'KW' '2780'; -KW2781 : 'KW' '2781'; -KW2782 : 'KW' '2782'; -KW2783 : 'KW' '2783'; -KW2784 : 'KW' '2784'; -KW2785 : 'KW' '2785'; -KW2786 : 'KW' '2786'; -KW2787 : 'KW' '2787'; -KW2788 : 'KW' '2788'; -KW2789 : 'KW' '2789'; -KW2790 : 'KW' '2790'; -KW2791 : 'KW' '2791'; -KW2792 : 'KW' '2792'; -KW2793 : 'KW' '2793'; -KW2794 : 'KW' '2794'; -KW2795 : 'KW' '2795'; -KW2796 : 'KW' '2796'; -KW2797 : 'KW' '2797'; -KW2798 : 'KW' '2798'; -KW2799 : 'KW' '2799'; -KW2800 : 'KW' '2800'; -KW2801 : 'KW' '2801'; -KW2802 : 'KW' '2802'; -KW2803 : 'KW' '2803'; -KW2804 : 'KW' '2804'; -KW2805 : 'KW' '2805'; -KW2806 : 'KW' '2806'; -KW2807 : 'KW' '2807'; -KW2808 : 'KW' '2808'; -KW2809 : 'KW' '2809'; -KW2810 : 'KW' '2810'; -KW2811 : 'KW' '2811'; -KW2812 : 'KW' '2812'; -KW2813 : 'KW' '2813'; -KW2814 : 'KW' '2814'; -KW2815 : 'KW' '2815'; -KW2816 : 'KW' '2816'; -KW2817 : 'KW' '2817'; -KW2818 : 'KW' '2818'; -KW2819 : 'KW' '2819'; -KW2820 : 'KW' '2820'; -KW2821 : 'KW' '2821'; -KW2822 : 'KW' '2822'; -KW2823 : 'KW' '2823'; -KW2824 : 'KW' '2824'; -KW2825 : 'KW' '2825'; -KW2826 : 'KW' '2826'; -KW2827 : 'KW' '2827'; -KW2828 : 'KW' '2828'; -KW2829 : 'KW' '2829'; -KW2830 : 'KW' '2830'; -KW2831 : 'KW' '2831'; -KW2832 : 'KW' '2832'; -KW2833 : 'KW' '2833'; -KW2834 : 'KW' '2834'; -KW2835 : 'KW' '2835'; -KW2836 : 'KW' '2836'; -KW2837 : 'KW' '2837'; -KW2838 : 'KW' '2838'; -KW2839 : 'KW' '2839'; -KW2840 : 'KW' '2840'; -KW2841 : 'KW' '2841'; -KW2842 : 'KW' '2842'; -KW2843 : 'KW' '2843'; -KW2844 : 'KW' '2844'; -KW2845 : 'KW' '2845'; -KW2846 : 'KW' '2846'; -KW2847 : 'KW' '2847'; -KW2848 : 'KW' '2848'; -KW2849 : 'KW' '2849'; -KW2850 : 'KW' '2850'; -KW2851 : 'KW' '2851'; -KW2852 : 'KW' '2852'; -KW2853 : 'KW' '2853'; -KW2854 : 'KW' '2854'; -KW2855 : 'KW' '2855'; -KW2856 : 'KW' '2856'; -KW2857 : 'KW' '2857'; -KW2858 : 'KW' '2858'; -KW2859 : 'KW' '2859'; -KW2860 : 'KW' '2860'; -KW2861 : 'KW' '2861'; -KW2862 : 'KW' '2862'; -KW2863 : 'KW' '2863'; -KW2864 : 'KW' '2864'; -KW2865 : 'KW' '2865'; -KW2866 : 'KW' '2866'; -KW2867 : 'KW' '2867'; -KW2868 : 'KW' '2868'; -KW2869 : 'KW' '2869'; -KW2870 : 'KW' '2870'; -KW2871 : 'KW' '2871'; -KW2872 : 'KW' '2872'; -KW2873 : 'KW' '2873'; -KW2874 : 'KW' '2874'; -KW2875 : 'KW' '2875'; -KW2876 : 'KW' '2876'; -KW2877 : 'KW' '2877'; -KW2878 : 'KW' '2878'; -KW2879 : 'KW' '2879'; -KW2880 : 'KW' '2880'; -KW2881 : 'KW' '2881'; -KW2882 : 'KW' '2882'; -KW2883 : 'KW' '2883'; -KW2884 : 'KW' '2884'; -KW2885 : 'KW' '2885'; -KW2886 : 'KW' '2886'; -KW2887 : 'KW' '2887'; -KW2888 : 'KW' '2888'; -KW2889 : 'KW' '2889'; -KW2890 : 'KW' '2890'; -KW2891 : 'KW' '2891'; -KW2892 : 'KW' '2892'; -KW2893 : 'KW' '2893'; -KW2894 : 'KW' '2894'; -KW2895 : 'KW' '2895'; -KW2896 : 'KW' '2896'; -KW2897 : 'KW' '2897'; -KW2898 : 'KW' '2898'; -KW2899 : 'KW' '2899'; -KW2900 : 'KW' '2900'; -KW2901 : 'KW' '2901'; -KW2902 : 'KW' '2902'; -KW2903 : 'KW' '2903'; -KW2904 : 'KW' '2904'; -KW2905 : 'KW' '2905'; -KW2906 : 'KW' '2906'; -KW2907 : 'KW' '2907'; -KW2908 : 'KW' '2908'; -KW2909 : 'KW' '2909'; -KW2910 : 'KW' '2910'; -KW2911 : 'KW' '2911'; -KW2912 : 'KW' '2912'; -KW2913 : 'KW' '2913'; -KW2914 : 'KW' '2914'; -KW2915 : 'KW' '2915'; -KW2916 : 'KW' '2916'; -KW2917 : 'KW' '2917'; -KW2918 : 'KW' '2918'; -KW2919 : 'KW' '2919'; -KW2920 : 'KW' '2920'; -KW2921 : 'KW' '2921'; -KW2922 : 'KW' '2922'; -KW2923 : 'KW' '2923'; -KW2924 : 'KW' '2924'; -KW2925 : 'KW' '2925'; -KW2926 : 'KW' '2926'; -KW2927 : 'KW' '2927'; -KW2928 : 'KW' '2928'; -KW2929 : 'KW' '2929'; -KW2930 : 'KW' '2930'; -KW2931 : 'KW' '2931'; -KW2932 : 'KW' '2932'; -KW2933 : 'KW' '2933'; -KW2934 : 'KW' '2934'; -KW2935 : 'KW' '2935'; -KW2936 : 'KW' '2936'; -KW2937 : 'KW' '2937'; -KW2938 : 'KW' '2938'; -KW2939 : 'KW' '2939'; -KW2940 : 'KW' '2940'; -KW2941 : 'KW' '2941'; -KW2942 : 'KW' '2942'; -KW2943 : 'KW' '2943'; -KW2944 : 'KW' '2944'; -KW2945 : 'KW' '2945'; -KW2946 : 'KW' '2946'; -KW2947 : 'KW' '2947'; -KW2948 : 'KW' '2948'; -KW2949 : 'KW' '2949'; -KW2950 : 'KW' '2950'; -KW2951 : 'KW' '2951'; -KW2952 : 'KW' '2952'; -KW2953 : 'KW' '2953'; -KW2954 : 'KW' '2954'; -KW2955 : 'KW' '2955'; -KW2956 : 'KW' '2956'; -KW2957 : 'KW' '2957'; -KW2958 : 'KW' '2958'; -KW2959 : 'KW' '2959'; -KW2960 : 'KW' '2960'; -KW2961 : 'KW' '2961'; -KW2962 : 'KW' '2962'; -KW2963 : 'KW' '2963'; -KW2964 : 'KW' '2964'; -KW2965 : 'KW' '2965'; -KW2966 : 'KW' '2966'; -KW2967 : 'KW' '2967'; -KW2968 : 'KW' '2968'; -KW2969 : 'KW' '2969'; -KW2970 : 'KW' '2970'; -KW2971 : 'KW' '2971'; -KW2972 : 'KW' '2972'; -KW2973 : 'KW' '2973'; -KW2974 : 'KW' '2974'; -KW2975 : 'KW' '2975'; -KW2976 : 'KW' '2976'; -KW2977 : 'KW' '2977'; -KW2978 : 'KW' '2978'; -KW2979 : 'KW' '2979'; -KW2980 : 'KW' '2980'; -KW2981 : 'KW' '2981'; -KW2982 : 'KW' '2982'; -KW2983 : 'KW' '2983'; -KW2984 : 'KW' '2984'; -KW2985 : 'KW' '2985'; -KW2986 : 'KW' '2986'; -KW2987 : 'KW' '2987'; -KW2988 : 'KW' '2988'; -KW2989 : 'KW' '2989'; -KW2990 : 'KW' '2990'; -KW2991 : 'KW' '2991'; -KW2992 : 'KW' '2992'; -KW2993 : 'KW' '2993'; -KW2994 : 'KW' '2994'; -KW2995 : 'KW' '2995'; -KW2996 : 'KW' '2996'; -KW2997 : 'KW' '2997'; -KW2998 : 'KW' '2998'; -KW2999 : 'KW' '2999'; -KW3000 : 'KW' '3000'; -KW3001 : 'KW' '3001'; -KW3002 : 'KW' '3002'; -KW3003 : 'KW' '3003'; -KW3004 : 'KW' '3004'; -KW3005 : 'KW' '3005'; -KW3006 : 'KW' '3006'; -KW3007 : 'KW' '3007'; -KW3008 : 'KW' '3008'; -KW3009 : 'KW' '3009'; -KW3010 : 'KW' '3010'; -KW3011 : 'KW' '3011'; -KW3012 : 'KW' '3012'; -KW3013 : 'KW' '3013'; -KW3014 : 'KW' '3014'; -KW3015 : 'KW' '3015'; -KW3016 : 'KW' '3016'; -KW3017 : 'KW' '3017'; -KW3018 : 'KW' '3018'; -KW3019 : 'KW' '3019'; -KW3020 : 'KW' '3020'; -KW3021 : 'KW' '3021'; -KW3022 : 'KW' '3022'; -KW3023 : 'KW' '3023'; -KW3024 : 'KW' '3024'; -KW3025 : 'KW' '3025'; -KW3026 : 'KW' '3026'; -KW3027 : 'KW' '3027'; -KW3028 : 'KW' '3028'; -KW3029 : 'KW' '3029'; -KW3030 : 'KW' '3030'; -KW3031 : 'KW' '3031'; -KW3032 : 'KW' '3032'; -KW3033 : 'KW' '3033'; -KW3034 : 'KW' '3034'; -KW3035 : 'KW' '3035'; -KW3036 : 'KW' '3036'; -KW3037 : 'KW' '3037'; -KW3038 : 'KW' '3038'; -KW3039 : 'KW' '3039'; -KW3040 : 'KW' '3040'; -KW3041 : 'KW' '3041'; -KW3042 : 'KW' '3042'; -KW3043 : 'KW' '3043'; -KW3044 : 'KW' '3044'; -KW3045 : 'KW' '3045'; -KW3046 : 'KW' '3046'; -KW3047 : 'KW' '3047'; -KW3048 : 'KW' '3048'; -KW3049 : 'KW' '3049'; -KW3050 : 'KW' '3050'; -KW3051 : 'KW' '3051'; -KW3052 : 'KW' '3052'; -KW3053 : 'KW' '3053'; -KW3054 : 'KW' '3054'; -KW3055 : 'KW' '3055'; -KW3056 : 'KW' '3056'; -KW3057 : 'KW' '3057'; -KW3058 : 'KW' '3058'; -KW3059 : 'KW' '3059'; -KW3060 : 'KW' '3060'; -KW3061 : 'KW' '3061'; -KW3062 : 'KW' '3062'; -KW3063 : 'KW' '3063'; -KW3064 : 'KW' '3064'; -KW3065 : 'KW' '3065'; -KW3066 : 'KW' '3066'; -KW3067 : 'KW' '3067'; -KW3068 : 'KW' '3068'; -KW3069 : 'KW' '3069'; -KW3070 : 'KW' '3070'; -KW3071 : 'KW' '3071'; -KW3072 : 'KW' '3072'; -KW3073 : 'KW' '3073'; -KW3074 : 'KW' '3074'; -KW3075 : 'KW' '3075'; -KW3076 : 'KW' '3076'; -KW3077 : 'KW' '3077'; -KW3078 : 'KW' '3078'; -KW3079 : 'KW' '3079'; -KW3080 : 'KW' '3080'; -KW3081 : 'KW' '3081'; -KW3082 : 'KW' '3082'; -KW3083 : 'KW' '3083'; -KW3084 : 'KW' '3084'; -KW3085 : 'KW' '3085'; -KW3086 : 'KW' '3086'; -KW3087 : 'KW' '3087'; -KW3088 : 'KW' '3088'; -KW3089 : 'KW' '3089'; -KW3090 : 'KW' '3090'; -KW3091 : 'KW' '3091'; -KW3092 : 'KW' '3092'; -KW3093 : 'KW' '3093'; -KW3094 : 'KW' '3094'; -KW3095 : 'KW' '3095'; -KW3096 : 'KW' '3096'; -KW3097 : 'KW' '3097'; -KW3098 : 'KW' '3098'; -KW3099 : 'KW' '3099'; -KW3100 : 'KW' '3100'; -KW3101 : 'KW' '3101'; -KW3102 : 'KW' '3102'; -KW3103 : 'KW' '3103'; -KW3104 : 'KW' '3104'; -KW3105 : 'KW' '3105'; -KW3106 : 'KW' '3106'; -KW3107 : 'KW' '3107'; -KW3108 : 'KW' '3108'; -KW3109 : 'KW' '3109'; -KW3110 : 'KW' '3110'; -KW3111 : 'KW' '3111'; -KW3112 : 'KW' '3112'; -KW3113 : 'KW' '3113'; -KW3114 : 'KW' '3114'; -KW3115 : 'KW' '3115'; -KW3116 : 'KW' '3116'; -KW3117 : 'KW' '3117'; -KW3118 : 'KW' '3118'; -KW3119 : 'KW' '3119'; -KW3120 : 'KW' '3120'; -KW3121 : 'KW' '3121'; -KW3122 : 'KW' '3122'; -KW3123 : 'KW' '3123'; -KW3124 : 'KW' '3124'; -KW3125 : 'KW' '3125'; -KW3126 : 'KW' '3126'; -KW3127 : 'KW' '3127'; -KW3128 : 'KW' '3128'; -KW3129 : 'KW' '3129'; -KW3130 : 'KW' '3130'; -KW3131 : 'KW' '3131'; -KW3132 : 'KW' '3132'; -KW3133 : 'KW' '3133'; -KW3134 : 'KW' '3134'; -KW3135 : 'KW' '3135'; -KW3136 : 'KW' '3136'; -KW3137 : 'KW' '3137'; -KW3138 : 'KW' '3138'; -KW3139 : 'KW' '3139'; -KW3140 : 'KW' '3140'; -KW3141 : 'KW' '3141'; -KW3142 : 'KW' '3142'; -KW3143 : 'KW' '3143'; -KW3144 : 'KW' '3144'; -KW3145 : 'KW' '3145'; -KW3146 : 'KW' '3146'; -KW3147 : 'KW' '3147'; -KW3148 : 'KW' '3148'; -KW3149 : 'KW' '3149'; -KW3150 : 'KW' '3150'; -KW3151 : 'KW' '3151'; -KW3152 : 'KW' '3152'; -KW3153 : 'KW' '3153'; -KW3154 : 'KW' '3154'; -KW3155 : 'KW' '3155'; -KW3156 : 'KW' '3156'; -KW3157 : 'KW' '3157'; -KW3158 : 'KW' '3158'; -KW3159 : 'KW' '3159'; -KW3160 : 'KW' '3160'; -KW3161 : 'KW' '3161'; -KW3162 : 'KW' '3162'; -KW3163 : 'KW' '3163'; -KW3164 : 'KW' '3164'; -KW3165 : 'KW' '3165'; -KW3166 : 'KW' '3166'; -KW3167 : 'KW' '3167'; -KW3168 : 'KW' '3168'; -KW3169 : 'KW' '3169'; -KW3170 : 'KW' '3170'; -KW3171 : 'KW' '3171'; -KW3172 : 'KW' '3172'; -KW3173 : 'KW' '3173'; -KW3174 : 'KW' '3174'; -KW3175 : 'KW' '3175'; -KW3176 : 'KW' '3176'; -KW3177 : 'KW' '3177'; -KW3178 : 'KW' '3178'; -KW3179 : 'KW' '3179'; -KW3180 : 'KW' '3180'; -KW3181 : 'KW' '3181'; -KW3182 : 'KW' '3182'; -KW3183 : 'KW' '3183'; -KW3184 : 'KW' '3184'; -KW3185 : 'KW' '3185'; -KW3186 : 'KW' '3186'; -KW3187 : 'KW' '3187'; -KW3188 : 'KW' '3188'; -KW3189 : 'KW' '3189'; -KW3190 : 'KW' '3190'; -KW3191 : 'KW' '3191'; -KW3192 : 'KW' '3192'; -KW3193 : 'KW' '3193'; -KW3194 : 'KW' '3194'; -KW3195 : 'KW' '3195'; -KW3196 : 'KW' '3196'; -KW3197 : 'KW' '3197'; -KW3198 : 'KW' '3198'; -KW3199 : 'KW' '3199'; -KW3200 : 'KW' '3200'; -KW3201 : 'KW' '3201'; -KW3202 : 'KW' '3202'; -KW3203 : 'KW' '3203'; -KW3204 : 'KW' '3204'; -KW3205 : 'KW' '3205'; -KW3206 : 'KW' '3206'; -KW3207 : 'KW' '3207'; -KW3208 : 'KW' '3208'; -KW3209 : 'KW' '3209'; -KW3210 : 'KW' '3210'; -KW3211 : 'KW' '3211'; -KW3212 : 'KW' '3212'; -KW3213 : 'KW' '3213'; -KW3214 : 'KW' '3214'; -KW3215 : 'KW' '3215'; -KW3216 : 'KW' '3216'; -KW3217 : 'KW' '3217'; -KW3218 : 'KW' '3218'; -KW3219 : 'KW' '3219'; -KW3220 : 'KW' '3220'; -KW3221 : 'KW' '3221'; -KW3222 : 'KW' '3222'; -KW3223 : 'KW' '3223'; -KW3224 : 'KW' '3224'; -KW3225 : 'KW' '3225'; -KW3226 : 'KW' '3226'; -KW3227 : 'KW' '3227'; -KW3228 : 'KW' '3228'; -KW3229 : 'KW' '3229'; -KW3230 : 'KW' '3230'; -KW3231 : 'KW' '3231'; -KW3232 : 'KW' '3232'; -KW3233 : 'KW' '3233'; -KW3234 : 'KW' '3234'; -KW3235 : 'KW' '3235'; -KW3236 : 'KW' '3236'; -KW3237 : 'KW' '3237'; -KW3238 : 'KW' '3238'; -KW3239 : 'KW' '3239'; -KW3240 : 'KW' '3240'; -KW3241 : 'KW' '3241'; -KW3242 : 'KW' '3242'; -KW3243 : 'KW' '3243'; -KW3244 : 'KW' '3244'; -KW3245 : 'KW' '3245'; -KW3246 : 'KW' '3246'; -KW3247 : 'KW' '3247'; -KW3248 : 'KW' '3248'; -KW3249 : 'KW' '3249'; -KW3250 : 'KW' '3250'; -KW3251 : 'KW' '3251'; -KW3252 : 'KW' '3252'; -KW3253 : 'KW' '3253'; -KW3254 : 'KW' '3254'; -KW3255 : 'KW' '3255'; -KW3256 : 'KW' '3256'; -KW3257 : 'KW' '3257'; -KW3258 : 'KW' '3258'; -KW3259 : 'KW' '3259'; -KW3260 : 'KW' '3260'; -KW3261 : 'KW' '3261'; -KW3262 : 'KW' '3262'; -KW3263 : 'KW' '3263'; -KW3264 : 'KW' '3264'; -KW3265 : 'KW' '3265'; -KW3266 : 'KW' '3266'; -KW3267 : 'KW' '3267'; -KW3268 : 'KW' '3268'; -KW3269 : 'KW' '3269'; -KW3270 : 'KW' '3270'; -KW3271 : 'KW' '3271'; -KW3272 : 'KW' '3272'; -KW3273 : 'KW' '3273'; -KW3274 : 'KW' '3274'; -KW3275 : 'KW' '3275'; -KW3276 : 'KW' '3276'; -KW3277 : 'KW' '3277'; -KW3278 : 'KW' '3278'; -KW3279 : 'KW' '3279'; -KW3280 : 'KW' '3280'; -KW3281 : 'KW' '3281'; -KW3282 : 'KW' '3282'; -KW3283 : 'KW' '3283'; -KW3284 : 'KW' '3284'; -KW3285 : 'KW' '3285'; -KW3286 : 'KW' '3286'; -KW3287 : 'KW' '3287'; -KW3288 : 'KW' '3288'; -KW3289 : 'KW' '3289'; -KW3290 : 'KW' '3290'; -KW3291 : 'KW' '3291'; -KW3292 : 'KW' '3292'; -KW3293 : 'KW' '3293'; -KW3294 : 'KW' '3294'; -KW3295 : 'KW' '3295'; -KW3296 : 'KW' '3296'; -KW3297 : 'KW' '3297'; -KW3298 : 'KW' '3298'; -KW3299 : 'KW' '3299'; -KW3300 : 'KW' '3300'; -KW3301 : 'KW' '3301'; -KW3302 : 'KW' '3302'; -KW3303 : 'KW' '3303'; -KW3304 : 'KW' '3304'; -KW3305 : 'KW' '3305'; -KW3306 : 'KW' '3306'; -KW3307 : 'KW' '3307'; -KW3308 : 'KW' '3308'; -KW3309 : 'KW' '3309'; -KW3310 : 'KW' '3310'; -KW3311 : 'KW' '3311'; -KW3312 : 'KW' '3312'; -KW3313 : 'KW' '3313'; -KW3314 : 'KW' '3314'; -KW3315 : 'KW' '3315'; -KW3316 : 'KW' '3316'; -KW3317 : 'KW' '3317'; -KW3318 : 'KW' '3318'; -KW3319 : 'KW' '3319'; -KW3320 : 'KW' '3320'; -KW3321 : 'KW' '3321'; -KW3322 : 'KW' '3322'; -KW3323 : 'KW' '3323'; -KW3324 : 'KW' '3324'; -KW3325 : 'KW' '3325'; -KW3326 : 'KW' '3326'; -KW3327 : 'KW' '3327'; -KW3328 : 'KW' '3328'; -KW3329 : 'KW' '3329'; -KW3330 : 'KW' '3330'; -KW3331 : 'KW' '3331'; -KW3332 : 'KW' '3332'; -KW3333 : 'KW' '3333'; -KW3334 : 'KW' '3334'; -KW3335 : 'KW' '3335'; -KW3336 : 'KW' '3336'; -KW3337 : 'KW' '3337'; -KW3338 : 'KW' '3338'; -KW3339 : 'KW' '3339'; -KW3340 : 'KW' '3340'; -KW3341 : 'KW' '3341'; -KW3342 : 'KW' '3342'; -KW3343 : 'KW' '3343'; -KW3344 : 'KW' '3344'; -KW3345 : 'KW' '3345'; -KW3346 : 'KW' '3346'; -KW3347 : 'KW' '3347'; -KW3348 : 'KW' '3348'; -KW3349 : 'KW' '3349'; -KW3350 : 'KW' '3350'; -KW3351 : 'KW' '3351'; -KW3352 : 'KW' '3352'; -KW3353 : 'KW' '3353'; -KW3354 : 'KW' '3354'; -KW3355 : 'KW' '3355'; -KW3356 : 'KW' '3356'; -KW3357 : 'KW' '3357'; -KW3358 : 'KW' '3358'; -KW3359 : 'KW' '3359'; -KW3360 : 'KW' '3360'; -KW3361 : 'KW' '3361'; -KW3362 : 'KW' '3362'; -KW3363 : 'KW' '3363'; -KW3364 : 'KW' '3364'; -KW3365 : 'KW' '3365'; -KW3366 : 'KW' '3366'; -KW3367 : 'KW' '3367'; -KW3368 : 'KW' '3368'; -KW3369 : 'KW' '3369'; -KW3370 : 'KW' '3370'; -KW3371 : 'KW' '3371'; -KW3372 : 'KW' '3372'; -KW3373 : 'KW' '3373'; -KW3374 : 'KW' '3374'; -KW3375 : 'KW' '3375'; -KW3376 : 'KW' '3376'; -KW3377 : 'KW' '3377'; -KW3378 : 'KW' '3378'; -KW3379 : 'KW' '3379'; -KW3380 : 'KW' '3380'; -KW3381 : 'KW' '3381'; -KW3382 : 'KW' '3382'; -KW3383 : 'KW' '3383'; -KW3384 : 'KW' '3384'; -KW3385 : 'KW' '3385'; -KW3386 : 'KW' '3386'; -KW3387 : 'KW' '3387'; -KW3388 : 'KW' '3388'; -KW3389 : 'KW' '3389'; -KW3390 : 'KW' '3390'; -KW3391 : 'KW' '3391'; -KW3392 : 'KW' '3392'; -KW3393 : 'KW' '3393'; -KW3394 : 'KW' '3394'; -KW3395 : 'KW' '3395'; -KW3396 : 'KW' '3396'; -KW3397 : 'KW' '3397'; -KW3398 : 'KW' '3398'; -KW3399 : 'KW' '3399'; -KW3400 : 'KW' '3400'; -KW3401 : 'KW' '3401'; -KW3402 : 'KW' '3402'; -KW3403 : 'KW' '3403'; -KW3404 : 'KW' '3404'; -KW3405 : 'KW' '3405'; -KW3406 : 'KW' '3406'; -KW3407 : 'KW' '3407'; -KW3408 : 'KW' '3408'; -KW3409 : 'KW' '3409'; -KW3410 : 'KW' '3410'; -KW3411 : 'KW' '3411'; -KW3412 : 'KW' '3412'; -KW3413 : 'KW' '3413'; -KW3414 : 'KW' '3414'; -KW3415 : 'KW' '3415'; -KW3416 : 'KW' '3416'; -KW3417 : 'KW' '3417'; -KW3418 : 'KW' '3418'; -KW3419 : 'KW' '3419'; -KW3420 : 'KW' '3420'; -KW3421 : 'KW' '3421'; -KW3422 : 'KW' '3422'; -KW3423 : 'KW' '3423'; -KW3424 : 'KW' '3424'; -KW3425 : 'KW' '3425'; -KW3426 : 'KW' '3426'; -KW3427 : 'KW' '3427'; -KW3428 : 'KW' '3428'; -KW3429 : 'KW' '3429'; -KW3430 : 'KW' '3430'; -KW3431 : 'KW' '3431'; -KW3432 : 'KW' '3432'; -KW3433 : 'KW' '3433'; -KW3434 : 'KW' '3434'; -KW3435 : 'KW' '3435'; -KW3436 : 'KW' '3436'; -KW3437 : 'KW' '3437'; -KW3438 : 'KW' '3438'; -KW3439 : 'KW' '3439'; -KW3440 : 'KW' '3440'; -KW3441 : 'KW' '3441'; -KW3442 : 'KW' '3442'; -KW3443 : 'KW' '3443'; -KW3444 : 'KW' '3444'; -KW3445 : 'KW' '3445'; -KW3446 : 'KW' '3446'; -KW3447 : 'KW' '3447'; -KW3448 : 'KW' '3448'; -KW3449 : 'KW' '3449'; -KW3450 : 'KW' '3450'; -KW3451 : 'KW' '3451'; -KW3452 : 'KW' '3452'; -KW3453 : 'KW' '3453'; -KW3454 : 'KW' '3454'; -KW3455 : 'KW' '3455'; -KW3456 : 'KW' '3456'; -KW3457 : 'KW' '3457'; -KW3458 : 'KW' '3458'; -KW3459 : 'KW' '3459'; -KW3460 : 'KW' '3460'; -KW3461 : 'KW' '3461'; -KW3462 : 'KW' '3462'; -KW3463 : 'KW' '3463'; -KW3464 : 'KW' '3464'; -KW3465 : 'KW' '3465'; -KW3466 : 'KW' '3466'; -KW3467 : 'KW' '3467'; -KW3468 : 'KW' '3468'; -KW3469 : 'KW' '3469'; -KW3470 : 'KW' '3470'; -KW3471 : 'KW' '3471'; -KW3472 : 'KW' '3472'; -KW3473 : 'KW' '3473'; -KW3474 : 'KW' '3474'; -KW3475 : 'KW' '3475'; -KW3476 : 'KW' '3476'; -KW3477 : 'KW' '3477'; -KW3478 : 'KW' '3478'; -KW3479 : 'KW' '3479'; -KW3480 : 'KW' '3480'; -KW3481 : 'KW' '3481'; -KW3482 : 'KW' '3482'; -KW3483 : 'KW' '3483'; -KW3484 : 'KW' '3484'; -KW3485 : 'KW' '3485'; -KW3486 : 'KW' '3486'; -KW3487 : 'KW' '3487'; -KW3488 : 'KW' '3488'; -KW3489 : 'KW' '3489'; -KW3490 : 'KW' '3490'; -KW3491 : 'KW' '3491'; -KW3492 : 'KW' '3492'; -KW3493 : 'KW' '3493'; -KW3494 : 'KW' '3494'; -KW3495 : 'KW' '3495'; -KW3496 : 'KW' '3496'; -KW3497 : 'KW' '3497'; -KW3498 : 'KW' '3498'; -KW3499 : 'KW' '3499'; -KW3500 : 'KW' '3500'; -KW3501 : 'KW' '3501'; -KW3502 : 'KW' '3502'; -KW3503 : 'KW' '3503'; -KW3504 : 'KW' '3504'; -KW3505 : 'KW' '3505'; -KW3506 : 'KW' '3506'; -KW3507 : 'KW' '3507'; -KW3508 : 'KW' '3508'; -KW3509 : 'KW' '3509'; -KW3510 : 'KW' '3510'; -KW3511 : 'KW' '3511'; -KW3512 : 'KW' '3512'; -KW3513 : 'KW' '3513'; -KW3514 : 'KW' '3514'; -KW3515 : 'KW' '3515'; -KW3516 : 'KW' '3516'; -KW3517 : 'KW' '3517'; -KW3518 : 'KW' '3518'; -KW3519 : 'KW' '3519'; -KW3520 : 'KW' '3520'; -KW3521 : 'KW' '3521'; -KW3522 : 'KW' '3522'; -KW3523 : 'KW' '3523'; -KW3524 : 'KW' '3524'; -KW3525 : 'KW' '3525'; -KW3526 : 'KW' '3526'; -KW3527 : 'KW' '3527'; -KW3528 : 'KW' '3528'; -KW3529 : 'KW' '3529'; -KW3530 : 'KW' '3530'; -KW3531 : 'KW' '3531'; -KW3532 : 'KW' '3532'; -KW3533 : 'KW' '3533'; -KW3534 : 'KW' '3534'; -KW3535 : 'KW' '3535'; -KW3536 : 'KW' '3536'; -KW3537 : 'KW' '3537'; -KW3538 : 'KW' '3538'; -KW3539 : 'KW' '3539'; -KW3540 : 'KW' '3540'; -KW3541 : 'KW' '3541'; -KW3542 : 'KW' '3542'; -KW3543 : 'KW' '3543'; -KW3544 : 'KW' '3544'; -KW3545 : 'KW' '3545'; -KW3546 : 'KW' '3546'; -KW3547 : 'KW' '3547'; -KW3548 : 'KW' '3548'; -KW3549 : 'KW' '3549'; -KW3550 : 'KW' '3550'; -KW3551 : 'KW' '3551'; -KW3552 : 'KW' '3552'; -KW3553 : 'KW' '3553'; -KW3554 : 'KW' '3554'; -KW3555 : 'KW' '3555'; -KW3556 : 'KW' '3556'; -KW3557 : 'KW' '3557'; -KW3558 : 'KW' '3558'; -KW3559 : 'KW' '3559'; -KW3560 : 'KW' '3560'; -KW3561 : 'KW' '3561'; -KW3562 : 'KW' '3562'; -KW3563 : 'KW' '3563'; -KW3564 : 'KW' '3564'; -KW3565 : 'KW' '3565'; -KW3566 : 'KW' '3566'; -KW3567 : 'KW' '3567'; -KW3568 : 'KW' '3568'; -KW3569 : 'KW' '3569'; -KW3570 : 'KW' '3570'; -KW3571 : 'KW' '3571'; -KW3572 : 'KW' '3572'; -KW3573 : 'KW' '3573'; -KW3574 : 'KW' '3574'; -KW3575 : 'KW' '3575'; -KW3576 : 'KW' '3576'; -KW3577 : 'KW' '3577'; -KW3578 : 'KW' '3578'; -KW3579 : 'KW' '3579'; -KW3580 : 'KW' '3580'; -KW3581 : 'KW' '3581'; -KW3582 : 'KW' '3582'; -KW3583 : 'KW' '3583'; -KW3584 : 'KW' '3584'; -KW3585 : 'KW' '3585'; -KW3586 : 'KW' '3586'; -KW3587 : 'KW' '3587'; -KW3588 : 'KW' '3588'; -KW3589 : 'KW' '3589'; -KW3590 : 'KW' '3590'; -KW3591 : 'KW' '3591'; -KW3592 : 'KW' '3592'; -KW3593 : 'KW' '3593'; -KW3594 : 'KW' '3594'; -KW3595 : 'KW' '3595'; -KW3596 : 'KW' '3596'; -KW3597 : 'KW' '3597'; -KW3598 : 'KW' '3598'; -KW3599 : 'KW' '3599'; -KW3600 : 'KW' '3600'; -KW3601 : 'KW' '3601'; -KW3602 : 'KW' '3602'; -KW3603 : 'KW' '3603'; -KW3604 : 'KW' '3604'; -KW3605 : 'KW' '3605'; -KW3606 : 'KW' '3606'; -KW3607 : 'KW' '3607'; -KW3608 : 'KW' '3608'; -KW3609 : 'KW' '3609'; -KW3610 : 'KW' '3610'; -KW3611 : 'KW' '3611'; -KW3612 : 'KW' '3612'; -KW3613 : 'KW' '3613'; -KW3614 : 'KW' '3614'; -KW3615 : 'KW' '3615'; -KW3616 : 'KW' '3616'; -KW3617 : 'KW' '3617'; -KW3618 : 'KW' '3618'; -KW3619 : 'KW' '3619'; -KW3620 : 'KW' '3620'; -KW3621 : 'KW' '3621'; -KW3622 : 'KW' '3622'; -KW3623 : 'KW' '3623'; -KW3624 : 'KW' '3624'; -KW3625 : 'KW' '3625'; -KW3626 : 'KW' '3626'; -KW3627 : 'KW' '3627'; -KW3628 : 'KW' '3628'; -KW3629 : 'KW' '3629'; -KW3630 : 'KW' '3630'; -KW3631 : 'KW' '3631'; -KW3632 : 'KW' '3632'; -KW3633 : 'KW' '3633'; -KW3634 : 'KW' '3634'; -KW3635 : 'KW' '3635'; -KW3636 : 'KW' '3636'; -KW3637 : 'KW' '3637'; -KW3638 : 'KW' '3638'; -KW3639 : 'KW' '3639'; -KW3640 : 'KW' '3640'; -KW3641 : 'KW' '3641'; -KW3642 : 'KW' '3642'; -KW3643 : 'KW' '3643'; -KW3644 : 'KW' '3644'; -KW3645 : 'KW' '3645'; -KW3646 : 'KW' '3646'; -KW3647 : 'KW' '3647'; -KW3648 : 'KW' '3648'; -KW3649 : 'KW' '3649'; -KW3650 : 'KW' '3650'; -KW3651 : 'KW' '3651'; -KW3652 : 'KW' '3652'; -KW3653 : 'KW' '3653'; -KW3654 : 'KW' '3654'; -KW3655 : 'KW' '3655'; -KW3656 : 'KW' '3656'; -KW3657 : 'KW' '3657'; -KW3658 : 'KW' '3658'; -KW3659 : 'KW' '3659'; -KW3660 : 'KW' '3660'; -KW3661 : 'KW' '3661'; -KW3662 : 'KW' '3662'; -KW3663 : 'KW' '3663'; -KW3664 : 'KW' '3664'; -KW3665 : 'KW' '3665'; -KW3666 : 'KW' '3666'; -KW3667 : 'KW' '3667'; -KW3668 : 'KW' '3668'; -KW3669 : 'KW' '3669'; -KW3670 : 'KW' '3670'; -KW3671 : 'KW' '3671'; -KW3672 : 'KW' '3672'; -KW3673 : 'KW' '3673'; -KW3674 : 'KW' '3674'; -KW3675 : 'KW' '3675'; -KW3676 : 'KW' '3676'; -KW3677 : 'KW' '3677'; -KW3678 : 'KW' '3678'; -KW3679 : 'KW' '3679'; -KW3680 : 'KW' '3680'; -KW3681 : 'KW' '3681'; -KW3682 : 'KW' '3682'; -KW3683 : 'KW' '3683'; -KW3684 : 'KW' '3684'; -KW3685 : 'KW' '3685'; -KW3686 : 'KW' '3686'; -KW3687 : 'KW' '3687'; -KW3688 : 'KW' '3688'; -KW3689 : 'KW' '3689'; -KW3690 : 'KW' '3690'; -KW3691 : 'KW' '3691'; -KW3692 : 'KW' '3692'; -KW3693 : 'KW' '3693'; -KW3694 : 'KW' '3694'; -KW3695 : 'KW' '3695'; -KW3696 : 'KW' '3696'; -KW3697 : 'KW' '3697'; -KW3698 : 'KW' '3698'; -KW3699 : 'KW' '3699'; -KW3700 : 'KW' '3700'; -KW3701 : 'KW' '3701'; -KW3702 : 'KW' '3702'; -KW3703 : 'KW' '3703'; -KW3704 : 'KW' '3704'; -KW3705 : 'KW' '3705'; -KW3706 : 'KW' '3706'; -KW3707 : 'KW' '3707'; -KW3708 : 'KW' '3708'; -KW3709 : 'KW' '3709'; -KW3710 : 'KW' '3710'; -KW3711 : 'KW' '3711'; -KW3712 : 'KW' '3712'; -KW3713 : 'KW' '3713'; -KW3714 : 'KW' '3714'; -KW3715 : 'KW' '3715'; -KW3716 : 'KW' '3716'; -KW3717 : 'KW' '3717'; -KW3718 : 'KW' '3718'; -KW3719 : 'KW' '3719'; -KW3720 : 'KW' '3720'; -KW3721 : 'KW' '3721'; -KW3722 : 'KW' '3722'; -KW3723 : 'KW' '3723'; -KW3724 : 'KW' '3724'; -KW3725 : 'KW' '3725'; -KW3726 : 'KW' '3726'; -KW3727 : 'KW' '3727'; -KW3728 : 'KW' '3728'; -KW3729 : 'KW' '3729'; -KW3730 : 'KW' '3730'; -KW3731 : 'KW' '3731'; -KW3732 : 'KW' '3732'; -KW3733 : 'KW' '3733'; -KW3734 : 'KW' '3734'; -KW3735 : 'KW' '3735'; -KW3736 : 'KW' '3736'; -KW3737 : 'KW' '3737'; -KW3738 : 'KW' '3738'; -KW3739 : 'KW' '3739'; -KW3740 : 'KW' '3740'; -KW3741 : 'KW' '3741'; -KW3742 : 'KW' '3742'; -KW3743 : 'KW' '3743'; -KW3744 : 'KW' '3744'; -KW3745 : 'KW' '3745'; -KW3746 : 'KW' '3746'; -KW3747 : 'KW' '3747'; -KW3748 : 'KW' '3748'; -KW3749 : 'KW' '3749'; -KW3750 : 'KW' '3750'; -KW3751 : 'KW' '3751'; -KW3752 : 'KW' '3752'; -KW3753 : 'KW' '3753'; -KW3754 : 'KW' '3754'; -KW3755 : 'KW' '3755'; -KW3756 : 'KW' '3756'; -KW3757 : 'KW' '3757'; -KW3758 : 'KW' '3758'; -KW3759 : 'KW' '3759'; -KW3760 : 'KW' '3760'; -KW3761 : 'KW' '3761'; -KW3762 : 'KW' '3762'; -KW3763 : 'KW' '3763'; -KW3764 : 'KW' '3764'; -KW3765 : 'KW' '3765'; -KW3766 : 'KW' '3766'; -KW3767 : 'KW' '3767'; -KW3768 : 'KW' '3768'; -KW3769 : 'KW' '3769'; -KW3770 : 'KW' '3770'; -KW3771 : 'KW' '3771'; -KW3772 : 'KW' '3772'; -KW3773 : 'KW' '3773'; -KW3774 : 'KW' '3774'; -KW3775 : 'KW' '3775'; -KW3776 : 'KW' '3776'; -KW3777 : 'KW' '3777'; -KW3778 : 'KW' '3778'; -KW3779 : 'KW' '3779'; -KW3780 : 'KW' '3780'; -KW3781 : 'KW' '3781'; -KW3782 : 'KW' '3782'; -KW3783 : 'KW' '3783'; -KW3784 : 'KW' '3784'; -KW3785 : 'KW' '3785'; -KW3786 : 'KW' '3786'; -KW3787 : 'KW' '3787'; -KW3788 : 'KW' '3788'; -KW3789 : 'KW' '3789'; -KW3790 : 'KW' '3790'; -KW3791 : 'KW' '3791'; -KW3792 : 'KW' '3792'; -KW3793 : 'KW' '3793'; -KW3794 : 'KW' '3794'; -KW3795 : 'KW' '3795'; -KW3796 : 'KW' '3796'; -KW3797 : 'KW' '3797'; -KW3798 : 'KW' '3798'; -KW3799 : 'KW' '3799'; -KW3800 : 'KW' '3800'; -KW3801 : 'KW' '3801'; -KW3802 : 'KW' '3802'; -KW3803 : 'KW' '3803'; -KW3804 : 'KW' '3804'; -KW3805 : 'KW' '3805'; -KW3806 : 'KW' '3806'; -KW3807 : 'KW' '3807'; -KW3808 : 'KW' '3808'; -KW3809 : 'KW' '3809'; -KW3810 : 'KW' '3810'; -KW3811 : 'KW' '3811'; -KW3812 : 'KW' '3812'; -KW3813 : 'KW' '3813'; -KW3814 : 'KW' '3814'; -KW3815 : 'KW' '3815'; -KW3816 : 'KW' '3816'; -KW3817 : 'KW' '3817'; -KW3818 : 'KW' '3818'; -KW3819 : 'KW' '3819'; -KW3820 : 'KW' '3820'; -KW3821 : 'KW' '3821'; -KW3822 : 'KW' '3822'; -KW3823 : 'KW' '3823'; -KW3824 : 'KW' '3824'; -KW3825 : 'KW' '3825'; -KW3826 : 'KW' '3826'; -KW3827 : 'KW' '3827'; -KW3828 : 'KW' '3828'; -KW3829 : 'KW' '3829'; -KW3830 : 'KW' '3830'; -KW3831 : 'KW' '3831'; -KW3832 : 'KW' '3832'; -KW3833 : 'KW' '3833'; -KW3834 : 'KW' '3834'; -KW3835 : 'KW' '3835'; -KW3836 : 'KW' '3836'; -KW3837 : 'KW' '3837'; -KW3838 : 'KW' '3838'; -KW3839 : 'KW' '3839'; -KW3840 : 'KW' '3840'; -KW3841 : 'KW' '3841'; -KW3842 : 'KW' '3842'; -KW3843 : 'KW' '3843'; -KW3844 : 'KW' '3844'; -KW3845 : 'KW' '3845'; -KW3846 : 'KW' '3846'; -KW3847 : 'KW' '3847'; -KW3848 : 'KW' '3848'; -KW3849 : 'KW' '3849'; -KW3850 : 'KW' '3850'; -KW3851 : 'KW' '3851'; -KW3852 : 'KW' '3852'; -KW3853 : 'KW' '3853'; -KW3854 : 'KW' '3854'; -KW3855 : 'KW' '3855'; -KW3856 : 'KW' '3856'; -KW3857 : 'KW' '3857'; -KW3858 : 'KW' '3858'; -KW3859 : 'KW' '3859'; -KW3860 : 'KW' '3860'; -KW3861 : 'KW' '3861'; -KW3862 : 'KW' '3862'; -KW3863 : 'KW' '3863'; -KW3864 : 'KW' '3864'; -KW3865 : 'KW' '3865'; -KW3866 : 'KW' '3866'; -KW3867 : 'KW' '3867'; -KW3868 : 'KW' '3868'; -KW3869 : 'KW' '3869'; -KW3870 : 'KW' '3870'; -KW3871 : 'KW' '3871'; -KW3872 : 'KW' '3872'; -KW3873 : 'KW' '3873'; -KW3874 : 'KW' '3874'; -KW3875 : 'KW' '3875'; -KW3876 : 'KW' '3876'; -KW3877 : 'KW' '3877'; -KW3878 : 'KW' '3878'; -KW3879 : 'KW' '3879'; -KW3880 : 'KW' '3880'; -KW3881 : 'KW' '3881'; -KW3882 : 'KW' '3882'; -KW3883 : 'KW' '3883'; -KW3884 : 'KW' '3884'; -KW3885 : 'KW' '3885'; -KW3886 : 'KW' '3886'; -KW3887 : 'KW' '3887'; -KW3888 : 'KW' '3888'; -KW3889 : 'KW' '3889'; -KW3890 : 'KW' '3890'; -KW3891 : 'KW' '3891'; -KW3892 : 'KW' '3892'; -KW3893 : 'KW' '3893'; -KW3894 : 'KW' '3894'; -KW3895 : 'KW' '3895'; -KW3896 : 'KW' '3896'; -KW3897 : 'KW' '3897'; -KW3898 : 'KW' '3898'; -KW3899 : 'KW' '3899'; -KW3900 : 'KW' '3900'; -KW3901 : 'KW' '3901'; -KW3902 : 'KW' '3902'; -KW3903 : 'KW' '3903'; -KW3904 : 'KW' '3904'; -KW3905 : 'KW' '3905'; -KW3906 : 'KW' '3906'; -KW3907 : 'KW' '3907'; -KW3908 : 'KW' '3908'; -KW3909 : 'KW' '3909'; -KW3910 : 'KW' '3910'; -KW3911 : 'KW' '3911'; -KW3912 : 'KW' '3912'; -KW3913 : 'KW' '3913'; -KW3914 : 'KW' '3914'; -KW3915 : 'KW' '3915'; -KW3916 : 'KW' '3916'; -KW3917 : 'KW' '3917'; -KW3918 : 'KW' '3918'; -KW3919 : 'KW' '3919'; -KW3920 : 'KW' '3920'; -KW3921 : 'KW' '3921'; -KW3922 : 'KW' '3922'; -KW3923 : 'KW' '3923'; -KW3924 : 'KW' '3924'; -KW3925 : 'KW' '3925'; -KW3926 : 'KW' '3926'; -KW3927 : 'KW' '3927'; -KW3928 : 'KW' '3928'; -KW3929 : 'KW' '3929'; -KW3930 : 'KW' '3930'; -KW3931 : 'KW' '3931'; -KW3932 : 'KW' '3932'; -KW3933 : 'KW' '3933'; -KW3934 : 'KW' '3934'; -KW3935 : 'KW' '3935'; -KW3936 : 'KW' '3936'; -KW3937 : 'KW' '3937'; -KW3938 : 'KW' '3938'; -KW3939 : 'KW' '3939'; -KW3940 : 'KW' '3940'; -KW3941 : 'KW' '3941'; -KW3942 : 'KW' '3942'; -KW3943 : 'KW' '3943'; -KW3944 : 'KW' '3944'; -KW3945 : 'KW' '3945'; -KW3946 : 'KW' '3946'; -KW3947 : 'KW' '3947'; -KW3948 : 'KW' '3948'; -KW3949 : 'KW' '3949'; -KW3950 : 'KW' '3950'; -KW3951 : 'KW' '3951'; -KW3952 : 'KW' '3952'; -KW3953 : 'KW' '3953'; -KW3954 : 'KW' '3954'; -KW3955 : 'KW' '3955'; -KW3956 : 'KW' '3956'; -KW3957 : 'KW' '3957'; -KW3958 : 'KW' '3958'; -KW3959 : 'KW' '3959'; -KW3960 : 'KW' '3960'; -KW3961 : 'KW' '3961'; -KW3962 : 'KW' '3962'; -KW3963 : 'KW' '3963'; -KW3964 : 'KW' '3964'; -KW3965 : 'KW' '3965'; -KW3966 : 'KW' '3966'; -KW3967 : 'KW' '3967'; -KW3968 : 'KW' '3968'; -KW3969 : 'KW' '3969'; -KW3970 : 'KW' '3970'; -KW3971 : 'KW' '3971'; -KW3972 : 'KW' '3972'; -KW3973 : 'KW' '3973'; -KW3974 : 'KW' '3974'; -KW3975 : 'KW' '3975'; -KW3976 : 'KW' '3976'; -KW3977 : 'KW' '3977'; -KW3978 : 'KW' '3978'; -KW3979 : 'KW' '3979'; -KW3980 : 'KW' '3980'; -KW3981 : 'KW' '3981'; -KW3982 : 'KW' '3982'; -KW3983 : 'KW' '3983'; -KW3984 : 'KW' '3984'; -KW3985 : 'KW' '3985'; -KW3986 : 'KW' '3986'; -KW3987 : 'KW' '3987'; -KW3988 : 'KW' '3988'; -KW3989 : 'KW' '3989'; -KW3990 : 'KW' '3990'; -KW3991 : 'KW' '3991'; -KW3992 : 'KW' '3992'; -KW3993 : 'KW' '3993'; -KW3994 : 'KW' '3994'; -KW3995 : 'KW' '3995'; -KW3996 : 'KW' '3996'; -KW3997 : 'KW' '3997'; -KW3998 : 'KW' '3998'; -KW3999 : 'KW' '3999'; \ No newline at end of file diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeLexers/LexerDelegatorInvokesDelegateRule.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeLexers/LexerDelegatorInvokesDelegateRule.txt new file mode 100644 index 0000000000..2113c646f6 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeLexers/LexerDelegatorInvokesDelegateRule.txt @@ -0,0 +1,24 @@ +[type] +CompositeLexer + +[grammar] +lexer grammar M; +import S; +B : 'b'; +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +lexer grammar S; +A : 'a' {}; +C : 'c' ; + +[input] +abc + +[output] +S.A +[@0,0:0='a',<3>,1:0] +[@1,1:1='b',<1>,1:1] +[@2,2:2='c',<4>,1:2] +[@3,3:2='',<-1>,1:3] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeLexers/LexerDelegatorRuleOverridesDelegate.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeLexers/LexerDelegatorRuleOverridesDelegate.txt new file mode 100644 index 0000000000..74d6098a7c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeLexers/LexerDelegatorRuleOverridesDelegate.txt @@ -0,0 +1,22 @@ +[type] +CompositeLexer + +[grammar] +lexer grammar M; +import S; +A : 'a' B {} ; +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +lexer grammar S; +A : 'a' {} ; +B : 'b' {} ; + +[input] +ab + +[output] +M.A +[@0,0:1='ab',<1>,1:0] +[@1,2:1='',<-1>,1:2] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/BringInLiteralsFromDelegate.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/BringInLiteralsFromDelegate.txt new file mode 100644 index 0000000000..43b6e62243 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/BringInLiteralsFromDelegate.txt @@ -0,0 +1,23 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S; +s : a ; +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar S; +a : '=' 'a' {}; + +[start] +s + +[input] +=a + +[output] +"""S.a +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/CombinedImportsCombined.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/CombinedImportsCombined.txt new file mode 100644 index 0000000000..80a446ac32 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/CombinedImportsCombined.txt @@ -0,0 +1,25 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S; +s : x INT; + +[slaveGrammar] +parser grammar S; +tokens { A, B, C } +x : 'x' INT {}; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x 34 9 + +[output] +"""S.x +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatesSeeSameTokenType.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatesSeeSameTokenType.txt new file mode 100644 index 0000000000..5e01124c22 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatesSeeSameTokenType.txt @@ -0,0 +1,44 @@ +[notes] +The lexer will create rules to match letters a, b, c. +The associated token types A, B, C must have the same value +and all import'd parsers. Since ANTLR regenerates all imports +for use with the delegator M, it can generate the same token type +mapping in each parser: +public static final int C=6; +public static final int EOF=-1; +public static final int B=5; +public static final int WS=7; +public static final int A=4; + +[type] +CompositeParser + +[grammar] +grammar M; +import S,T; +s : x y ; // matches AA, which should be 'aa' +B : 'b' ; // another order: B, A, C +A : 'a' ; +C : 'c' ; +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar T; +tokens { C, B, A } // reverse order +y : A {}; + +[slaveGrammar] +parser grammar S; +tokens { A, B, C } +x : A {}; + +[start] +s + +[input] +aa + +[output] +S.x +T.y + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorAccessesDelegateMembers.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorAccessesDelegateMembers.txt new file mode 100644 index 0000000000..d2dafa4117 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorAccessesDelegateMembers.txt @@ -0,0 +1,26 @@ +[type] +CompositeParser + +[grammar] +grammar M; // uses no rules from the import +import S; +s : 'b' {} ; // gS is import pointer +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar S; +@parser::members { + +} +a : B; + +[start] +s + +[input] +b + +[output] +"""foo +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesDelegateRule.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesDelegateRule.txt new file mode 100644 index 0000000000..5b4ad9c2a1 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesDelegateRule.txt @@ -0,0 +1,24 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S; +s : a ; +B : 'b' ; // defines B from inherited token space +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar S; +a : B {}; + +[start] +s + +[input] +b + +[output] +"""S.a +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesDelegateRuleWithArgs.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesDelegateRuleWithArgs.txt new file mode 100644 index 0000000000..96fa718070 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesDelegateRuleWithArgs.txt @@ -0,0 +1,24 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S; +s : label=a[3] {} ; +B : 'b' ; // defines B from inherited token space +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar S; +a[int x] returns [int y] : B {} {$y=1000;} ; + +[start] +s + +[input] +b + +[output] +"""S.a1000 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesDelegateRuleWithReturnStruct.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesDelegateRuleWithReturnStruct.txt new file mode 100644 index 0000000000..82ba1aec11 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesDelegateRuleWithReturnStruct.txt @@ -0,0 +1,24 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S; +s : a {} ; +B : 'b' ; // defines B from inherited token space +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar S; +a : B {} ; + +[start] +s + +[input] +b + +[output] +"""S.ab +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesFirstVersionOfDelegateRule.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesFirstVersionOfDelegateRule.txt new file mode 100644 index 0000000000..a0bab0812d --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorInvokesFirstVersionOfDelegateRule.txt @@ -0,0 +1,29 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S,T; +s : a ; +B : 'b' ; // defines B from inherited token space +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar T; +a : B {}; + +[slaveGrammar] +parser grammar S; +a : b {}; +b : B; + +[start] +s + +[input] +b + +[output] +"""S.a +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorRuleOverridesDelegate.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorRuleOverridesDelegate.txt new file mode 100644 index 0000000000..74d90f55bc --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorRuleOverridesDelegate.txt @@ -0,0 +1,24 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S; +b : 'b'|'c'; +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar S; +a : b {}; +b : B ; + +[start] +a + +[input] +c + +[output] +"""S.a +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorRuleOverridesDelegates.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorRuleOverridesDelegates.txt new file mode 100644 index 0000000000..af5da57869 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorRuleOverridesDelegates.txt @@ -0,0 +1,29 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S, T; +b : 'b'|'c' {}|B|A; +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar T; +tokens { A } +b : 'b' {}; + +[slaveGrammar] +parser grammar S; +a : b {}; +b : 'b' ; + +[start] +a + +[input] +c + +[output] +M.b +S.a + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorRuleOverridesLookaheadInDelegate.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorRuleOverridesLookaheadInDelegate.txt new file mode 100644 index 0000000000..36725be26d --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/DelegatorRuleOverridesLookaheadInDelegate.txt @@ -0,0 +1,29 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S; +prog : decl ; +type_ : 'int' | 'float' ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip; + +[slaveGrammar] +parser grammar S; +type_ : 'int' ; +decl : type_ ID ';' + | type_ ID init_ ';' {}; +init_ : '=' INT; + +[start] +prog + +[input] +float x = 3; + +[output] +"""JavaDecl: floatx=3; +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/ImportLexerWithOnlyFragmentRules.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/ImportLexerWithOnlyFragmentRules.txt new file mode 100644 index 0000000000..fc1d47f2f2 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/ImportLexerWithOnlyFragmentRules.txt @@ -0,0 +1,32 @@ +[notes] +This is a regression test for antlr/antlr4#248 "Including grammar with only +fragments breaks generated lexer". https://github.com/antlr/antlr4/issues/248 + +[type] +CompositeParser + +[grammar] +grammar Test; +import Unicode; + +program : 'test' 'test'; + +WS : (UNICODE_CLASS_Zs)+ -> skip; + +[slaveGrammar] +"""lexer grammar Unicode; + +fragment +UNICODE_CLASS_Zs : ' ' | ' ' | ' ' | '᠎' + | ' '..' ' + | ' ' | ' ' | ' ' + ; + +""" + +[start] +program + +[input] +test test + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/ImportedGrammarWithEmptyOptions.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/ImportedGrammarWithEmptyOptions.txt new file mode 100644 index 0000000000..00c1065461 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/ImportedGrammarWithEmptyOptions.txt @@ -0,0 +1,21 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S; +s : a ; +B : 'b' ; +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar S; +options {} +a : B ; + +[start] +s + +[input] +b + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/ImportedRuleWithAction.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/ImportedRuleWithAction.txt new file mode 100644 index 0000000000..628cb68418 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/ImportedRuleWithAction.txt @@ -0,0 +1,20 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S; +s : a; +B : 'b'; +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +parser grammar S; +a @after {} : B; + +[start] +s + +[input] +b + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/KeywordVSIDOrder.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/KeywordVSIDOrder.txt new file mode 100644 index 0000000000..80794c81fd --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/CompositeParsers/KeywordVSIDOrder.txt @@ -0,0 +1,24 @@ +[type] +CompositeParser + +[grammar] +grammar M; +import S; +a : A {}; +A : 'abc' {}; +WS : (' '|'\n') -> skip ; + +[slaveGrammar] +lexer grammar S; +ID : 'a'..'z'+; + +[start] +a + +[input] +abc + +[output] +M.A +M.a: [@0,0:2='abc',<1>,1:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/AmbigYieldsCtxSensitiveDFA.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/AmbigYieldsCtxSensitiveDFA.txt new file mode 100644 index 0000000000..d9ab124449 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/AmbigYieldsCtxSensitiveDFA.txt @@ -0,0 +1,27 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} + : ID | ID {} ; +ID : 'a'..'z'+; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +abc + +[output] +Decision 0: +s0-ID->:s1^=>1 + +[errors] +"""line 1:0 reportAttemptingFullContext d=0 (s), input='abc' +""" + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/AmbiguityNoLoop.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/AmbiguityNoLoop.txt new file mode 100644 index 0000000000..b2c0304a41 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/AmbiguityNoLoop.txt @@ -0,0 +1,36 @@ +[type] +Parser + +[grammar] +grammar T; +prog +@init {} + : expr expr {} + | expr + ; +expr: '@' + | ID '@' + | ID + ; +ID : [a-z]+ ; +WS : [ \r\n\t]+ -> skip ; + +[start] +prog + +[input] +a@ + +[output] +"""alt 1 +""" + +[errors] +line 1:2 reportAttemptingFullContext d=0 (prog), input='a@' +line 1:2 reportAmbiguity d=0 (prog): ambigAlts={1, 2}, input='a@' +line 1:2 reportAttemptingFullContext d=1 (expr), input='a@' +line 1:2 reportContextSensitivity d=1 (expr), input='a@' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/CtxSensitiveDFATwoDiffInput.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/CtxSensitiveDFATwoDiffInput.txt new file mode 100644 index 0000000000..b07cc5e717 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/CtxSensitiveDFATwoDiffInput.txt @@ -0,0 +1,34 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} + : ('$' a | '@' b)+ ; +a : e ID ; +b : e INT ID ; +e : INT | ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +$ 34 abc @ 34 abc + +[output] +Decision 2: +s0-INT->s1 +s1-ID->:s2^=>1 + +[errors] +line 1:5 reportAttemptingFullContext d=2 (e), input='34abc' +line 1:2 reportContextSensitivity d=2 (e), input='34' +line 1:14 reportAttemptingFullContext d=2 (e), input='34abc' +line 1:14 reportContextSensitivity d=2 (e), input='34abc' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/CtxSensitiveDFA_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/CtxSensitiveDFA_1.txt new file mode 100644 index 0000000000..7f4b51755f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/CtxSensitiveDFA_1.txt @@ -0,0 +1,32 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} + : '$' a | '@' b ; +a : e ID ; +b : e INT ID ; +e : INT | ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +$ 34 abc + +[output] +Decision 1: +s0-INT->s1 +s1-ID->:s2^=>1 + +[errors] +line 1:5 reportAttemptingFullContext d=1 (e), input='34abc' +line 1:2 reportContextSensitivity d=1 (e), input='34' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/CtxSensitiveDFA_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/CtxSensitiveDFA_2.txt new file mode 100644 index 0000000000..f2cfc226b9 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/CtxSensitiveDFA_2.txt @@ -0,0 +1,32 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} + : '$' a | '@' b ; +a : e ID ; +b : e INT ID ; +e : INT | ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +@ 34 abc + +[output] +Decision 1: +s0-INT->s1 +s1-ID->:s2^=>1 + +[errors] +line 1:5 reportAttemptingFullContext d=1 (e), input='34abc' +line 1:5 reportContextSensitivity d=1 (e), input='34abc' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/ExprAmbiguity_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/ExprAmbiguity_1.txt new file mode 100644 index 0000000000..291be3b0c2 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/ExprAmbiguity_1.txt @@ -0,0 +1,35 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init {} +: expr[0] {}; + expr[int _p] + : ID + ( + {5 >= $_p}? '*' expr[6] + | {4 >= $_p}? '+' expr[5] + )* + ; +ID : [a-zA-Z]+ ; +WS : [ \r\n\t]+ -> skip ; + +[start] +s + +[input] +a+b + +[output] +"""(expr a + (expr b)) +""" + +[errors] +line 1:1 reportAttemptingFullContext d=1 (expr), input='+' +line 1:2 reportContextSensitivity d=1 (expr), input='+b' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/ExprAmbiguity_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/ExprAmbiguity_2.txt new file mode 100644 index 0000000000..fd26dfa50b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/ExprAmbiguity_2.txt @@ -0,0 +1,37 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init {} +: expr[0] {}; + expr[int _p] + : ID + ( + {5 >= $_p}? '*' expr[6] + | {4 >= $_p}? '+' expr[5] + )* + ; +ID : [a-zA-Z]+ ; +WS : [ \r\n\t]+ -> skip ; + +[start] +s + +[input] +a+b*c + +[output] +"""(expr a + (expr b * (expr c))) +""" + +[errors] +line 1:1 reportAttemptingFullContext d=1 (expr), input='+' +line 1:2 reportContextSensitivity d=1 (expr), input='+b' +line 1:3 reportAttemptingFullContext d=1 (expr), input='*' +line 1:5 reportAmbiguity d=1 (expr): ambigAlts={1, 2}, input='*c' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_1.txt new file mode 100644 index 0000000000..ee5a5ff28a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_1.txt @@ -0,0 +1,28 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init {} +@after {} + : '{' stat* '}' ; +stat: 'if' ID 'then' stat ('else' ID)? + | 'return' + ; +ID : 'a'..'z'+ ; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +{ if x then return } + +[output] +Decision 1: +s0-'}'->:s1=>2 + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_2.txt new file mode 100644 index 0000000000..741ab3be3a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_2.txt @@ -0,0 +1,32 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init {} +@after {} + : '{' stat* '}' ; +stat: 'if' ID 'then' stat ('else' ID)? + | 'return' + ; +ID : 'a'..'z'+ ; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +{ if x then return else foo } + +[output] +Decision 1: +s0-'else'->:s1^=>1 + +[errors] +line 1:19 reportAttemptingFullContext d=1 (stat), input='else' +line 1:19 reportContextSensitivity d=1 (stat), input='else' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_3.txt new file mode 100644 index 0000000000..481a446624 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_3.txt @@ -0,0 +1,33 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init {} +@after {} + : '{' stat* '}' ; +stat: 'if' ID 'then' stat ('else' ID)? + | 'return' + ; +ID : 'a'..'z'+ ; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +{ if x then if y then return else foo } + +[output] +Decision 1: +s0-'}'->:s2=>2 +s0-'else'->:s1^=>1 + +[errors] +line 1:29 reportAttemptingFullContext d=1 (stat), input='else' +line 1:38 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_4.txt new file mode 100644 index 0000000000..53278e4fc3 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_4.txt @@ -0,0 +1,34 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init {} +@after {} + : '{' stat* '}' ; +stat: 'if' ID 'then' stat ('else' ID)? + | 'return' + ; +ID : 'a'..'z'+ ; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +{ if x then if y then return else foo else bar } + +[output] +Decision 1: +s0-'else'->:s1^=>1 + +[errors] +line 1:29 reportAttemptingFullContext d=1 (stat), input='else' +line 1:38 reportContextSensitivity d=1 (stat), input='elsefooelse' +line 1:38 reportAttemptingFullContext d=1 (stat), input='else' +line 1:38 reportContextSensitivity d=1 (stat), input='else' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_5.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_5.txt new file mode 100644 index 0000000000..7a140928fa --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_5.txt @@ -0,0 +1,36 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init {} +@after {} + : '{' stat* '}' ; +stat: 'if' ID 'then' stat ('else' ID)? + | 'return' + ; +ID : 'a'..'z'+ ; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +{ if x then return else foo +if x then if y then return else foo } + +[output] +Decision 1: +s0-'}'->:s2=>2 +s0-'else'->:s1^=>1 + +[errors] +line 1:19 reportAttemptingFullContext d=1 (stat), input='else' +line 1:19 reportContextSensitivity d=1 (stat), input='else' +line 2:27 reportAttemptingFullContext d=1 (stat), input='else' +line 2:36 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_6.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_6.txt new file mode 100644 index 0000000000..7a140928fa --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/FullContextIF_THEN_ELSEParse_6.txt @@ -0,0 +1,36 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init {} +@after {} + : '{' stat* '}' ; +stat: 'if' ID 'then' stat ('else' ID)? + | 'return' + ; +ID : 'a'..'z'+ ; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +{ if x then return else foo +if x then if y then return else foo } + +[output] +Decision 1: +s0-'}'->:s2=>2 +s0-'else'->:s1^=>1 + +[errors] +line 1:19 reportAttemptingFullContext d=1 (stat), input='else' +line 1:19 reportContextSensitivity d=1 (stat), input='else' +line 2:27 reportAttemptingFullContext d=1 (stat), input='else' +line 2:36 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/LoopsSimulateTailRecursion.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/LoopsSimulateTailRecursion.txt new file mode 100644 index 0000000000..d708221f72 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/LoopsSimulateTailRecursion.txt @@ -0,0 +1,41 @@ +[notes] +Tests predictions for the following case involving closures. +http://www.antlr.org/wiki/display/~admin/2011/12/29/Flaw+in+ANTLR+v3+LL(*)+analysis+algorithm + +[type] +Parser + +[grammar] +grammar T; +prog +@init {} + : expr_or_assign*; +expr_or_assign + : expr '++' {} + | expr {} + ; +expr: expr_primary ('\<-' ID)?; +expr_primary + : '(' ID ')' + | ID '(' ID ')' + | ID + ; +ID : [a-z]+ ; + +[start] +prog + +[input] +a(i)<-x + +[output] +"""pass: a(i)<-x +""" + +[errors] +line 1:3 reportAttemptingFullContext d=3 (expr_primary), input='a(i)' +line 1:7 reportAmbiguity d=3 (expr_primary): ambigAlts={2, 3}, input='a(i)<-x' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/SLLSeesEOFInLLGrammar.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/SLLSeesEOFInLLGrammar.txt new file mode 100644 index 0000000000..0908de123d --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/FullContextParsing/SLLSeesEOFInLLGrammar.txt @@ -0,0 +1,32 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} + : a; +a : e ID ; +b : e INT ID ; +e : INT | ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\t'|'\n')+ -> skip ; + +[start] +s + +[input] +34 abc + +[output] +Decision 0: +s0-INT->s1 +s1-ID->:s2^=>1 + +[errors] +line 1:3 reportAttemptingFullContext d=0 (e), input='34abc' +line 1:0 reportContextSensitivity d=0 (e), input='34' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_1.txt new file mode 100644 index 0000000000..8dd1e63929 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_1.txt @@ -0,0 +1,33 @@ +[type] +Parser + +[grammar] +grammar Expr; +prog: stat ; +stat: expr NEWLINE # printExpr + | ID '=' expr NEWLINE# assign + | NEWLINE # blank + ; +expr: expr ('*'|'/') expr # MulDiv + | expr ('+'|'-') expr # AddSub + | INT # int + | ID # id + | '(' expr ')' # parens + ; + +MUL : '*' ; // assigns token name to '*' used above in grammar +DIV : '/' ; +ADD : '+' ; +SUB : '-' ; +ID : [a-zA-Z]+ ; // match identifiers +INT : [0-9]+ ;// match integers +NEWLINE:'\r'? '\n' ; // return newlines to parser (is end-statement signal) +WS : [ \t]+ -> skip ; // toss out whitespace + +[start] +prog + +[input] +"""1 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_2.txt new file mode 100644 index 0000000000..a017592e4a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_2.txt @@ -0,0 +1,33 @@ +[type] +Parser + +[grammar] +grammar Expr; +prog: stat ; +stat: expr NEWLINE # printExpr + | ID '=' expr NEWLINE# assign + | NEWLINE # blank + ; +expr: expr ('*'|'/') expr # MulDiv + | expr ('+'|'-') expr # AddSub + | INT # int + | ID # id + | '(' expr ')' # parens + ; + +MUL : '*' ; // assigns token name to '*' used above in grammar +DIV : '/' ; +ADD : '+' ; +SUB : '-' ; +ID : [a-zA-Z]+ ; // match identifiers +INT : [0-9]+ ;// match integers +NEWLINE:'\r'? '\n' ; // return newlines to parser (is end-statement signal) +WS : [ \t]+ -> skip ; // toss out whitespace + +[start] +prog + +[input] +"""a = 5 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_3.txt new file mode 100644 index 0000000000..4fc53bfe85 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_3.txt @@ -0,0 +1,33 @@ +[type] +Parser + +[grammar] +grammar Expr; +prog: stat ; +stat: expr NEWLINE # printExpr + | ID '=' expr NEWLINE# assign + | NEWLINE # blank + ; +expr: expr ('*'|'/') expr # MulDiv + | expr ('+'|'-') expr # AddSub + | INT # int + | ID # id + | '(' expr ')' # parens + ; + +MUL : '*' ; // assigns token name to '*' used above in grammar +DIV : '/' ; +ADD : '+' ; +SUB : '-' ; +ID : [a-zA-Z]+ ; // match identifiers +INT : [0-9]+ ;// match integers +NEWLINE:'\r'? '\n' ; // return newlines to parser (is end-statement signal) +WS : [ \t]+ -> skip ; // toss out whitespace + +[start] +prog + +[input] +"""b = 6 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_4.txt new file mode 100644 index 0000000000..30ee4ed389 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_4.txt @@ -0,0 +1,33 @@ +[type] +Parser + +[grammar] +grammar Expr; +prog: stat ; +stat: expr NEWLINE # printExpr + | ID '=' expr NEWLINE# assign + | NEWLINE # blank + ; +expr: expr ('*'|'/') expr # MulDiv + | expr ('+'|'-') expr # AddSub + | INT # int + | ID # id + | '(' expr ')' # parens + ; + +MUL : '*' ; // assigns token name to '*' used above in grammar +DIV : '/' ; +ADD : '+' ; +SUB : '-' ; +ID : [a-zA-Z]+ ; // match identifiers +INT : [0-9]+ ;// match integers +NEWLINE:'\r'? '\n' ; // return newlines to parser (is end-statement signal) +WS : [ \t]+ -> skip ; // toss out whitespace + +[start] +prog + +[input] +"""a+b*2 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_5.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_5.txt new file mode 100644 index 0000000000..98fba28371 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/AmbigLR_5.txt @@ -0,0 +1,33 @@ +[type] +Parser + +[grammar] +grammar Expr; +prog: stat ; +stat: expr NEWLINE # printExpr + | ID '=' expr NEWLINE# assign + | NEWLINE # blank + ; +expr: expr ('*'|'/') expr # MulDiv + | expr ('+'|'-') expr # AddSub + | INT # int + | ID # id + | '(' expr ')' # parens + ; + +MUL : '*' ; // assigns token name to '*' used above in grammar +DIV : '/' ; +ADD : '+' ; +SUB : '-' ; +ID : [a-zA-Z]+ ; // match identifiers +INT : [0-9]+ ;// match integers +NEWLINE:'\r'? '\n' ; // return newlines to parser (is end-statement signal) +WS : [ \t]+ -> skip ; // toss out whitespace + +[start] +prog + +[input] +"""(1+2)*3 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_1.txt new file mode 100644 index 0000000000..ff41bcf1ad --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_1.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : declarator EOF ; // must indicate EOF can follow +declarator + : declarator '[' e ']' + | declarator '[' ']' + | declarator '(' ')' + | '*' declarator // binds less tight than suffixes + | '(' declarator ')' + | ID + ; +e : INT ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a + +[output] +"""(s (declarator a) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_10.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_10.txt new file mode 100644 index 0000000000..de50a048c6 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_10.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : declarator EOF ; // must indicate EOF can follow +declarator + : declarator '[' e ']' + | declarator '[' ']' + | declarator '(' ')' + | '*' declarator // binds less tight than suffixes + | '(' declarator ')' + | ID + ; +e : INT ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +(*a)[] + +[output] +"""(s (declarator (declarator ( (declarator * (declarator a)) )) [ ]) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_2.txt new file mode 100644 index 0000000000..c1baa1504f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_2.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : declarator EOF ; // must indicate EOF can follow +declarator + : declarator '[' e ']' + | declarator '[' ']' + | declarator '(' ')' + | '*' declarator // binds less tight than suffixes + | '(' declarator ')' + | ID + ; +e : INT ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +*a + +[output] +"""(s (declarator * (declarator a)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_3.txt new file mode 100644 index 0000000000..3b6d324616 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_3.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : declarator EOF ; // must indicate EOF can follow +declarator + : declarator '[' e ']' + | declarator '[' ']' + | declarator '(' ')' + | '*' declarator // binds less tight than suffixes + | '(' declarator ')' + | ID + ; +e : INT ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +**a + +[output] +"""(s (declarator * (declarator * (declarator a))) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_4.txt new file mode 100644 index 0000000000..1f642b4d39 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_4.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : declarator EOF ; // must indicate EOF can follow +declarator + : declarator '[' e ']' + | declarator '[' ']' + | declarator '(' ')' + | '*' declarator // binds less tight than suffixes + | '(' declarator ')' + | ID + ; +e : INT ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a[3] + +[output] +"""(s (declarator (declarator a) [ (e 3) ]) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_5.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_5.txt new file mode 100644 index 0000000000..a64c3234ec --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_5.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : declarator EOF ; // must indicate EOF can follow +declarator + : declarator '[' e ']' + | declarator '[' ']' + | declarator '(' ')' + | '*' declarator // binds less tight than suffixes + | '(' declarator ')' + | ID + ; +e : INT ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +b[] + +[output] +"""(s (declarator (declarator b) [ ]) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_6.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_6.txt new file mode 100644 index 0000000000..afd017fce5 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_6.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : declarator EOF ; // must indicate EOF can follow +declarator + : declarator '[' e ']' + | declarator '[' ']' + | declarator '(' ')' + | '*' declarator // binds less tight than suffixes + | '(' declarator ')' + | ID + ; +e : INT ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +(a) + +[output] +"""(s (declarator ( (declarator a) )) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_7.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_7.txt new file mode 100644 index 0000000000..d62df17019 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_7.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : declarator EOF ; // must indicate EOF can follow +declarator + : declarator '[' e ']' + | declarator '[' ']' + | declarator '(' ')' + | '*' declarator // binds less tight than suffixes + | '(' declarator ')' + | ID + ; +e : INT ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a[]() + +[output] +"""(s (declarator (declarator (declarator a) [ ]) ( )) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_8.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_8.txt new file mode 100644 index 0000000000..b76e2fe79b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_8.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : declarator EOF ; // must indicate EOF can follow +declarator + : declarator '[' e ']' + | declarator '[' ']' + | declarator '(' ')' + | '*' declarator // binds less tight than suffixes + | '(' declarator ')' + | ID + ; +e : INT ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a[][] + +[output] +"""(s (declarator (declarator (declarator a) [ ]) [ ]) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_9.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_9.txt new file mode 100644 index 0000000000..9f9a8e40ad --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Declarations_9.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : declarator EOF ; // must indicate EOF can follow +declarator + : declarator '[' e ']' + | declarator '[' ']' + | declarator '(' ')' + | '*' declarator // binds less tight than suffixes + | '(' declarator ')' + | ID + ; +e : INT ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +*a[] + +[output] +"""(s (declarator * (declarator (declarator a) [ ])) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/DirectCallToLeftRecursiveRule_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/DirectCallToLeftRecursiveRule_1.txt new file mode 100644 index 0000000000..9ccf4c3108 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/DirectCallToLeftRecursiveRule_1.txt @@ -0,0 +1,25 @@ +[notes] +This is a regression test for "Support direct calls to left-recursive +rules". https://github.com/antlr/antlr4/issues/161 + +[type] +Parser + +[grammar] +grammar T; +a @after {} : a ID + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +a + +[input] +x + +[output] +"""(a x) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/DirectCallToLeftRecursiveRule_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/DirectCallToLeftRecursiveRule_2.txt new file mode 100644 index 0000000000..2dccce6352 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/DirectCallToLeftRecursiveRule_2.txt @@ -0,0 +1,25 @@ +[notes] +This is a regression test for "Support direct calls to left-recursive +rules". https://github.com/antlr/antlr4/issues/161 + +[type] +Parser + +[grammar] +grammar T; +a @after {} : a ID + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +a + +[input] +x y + +[output] +"""(a (a x) y) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/DirectCallToLeftRecursiveRule_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/DirectCallToLeftRecursiveRule_3.txt new file mode 100644 index 0000000000..bc67fab7e8 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/DirectCallToLeftRecursiveRule_3.txt @@ -0,0 +1,25 @@ +[notes] +This is a regression test for "Support direct calls to left-recursive +rules". https://github.com/antlr/antlr4/issues/161 + +[type] +Parser + +[grammar] +grammar T; +a @after {} : a ID + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +a + +[input] +x y z + +[output] +"""(a (a (a x) y) z) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_1.txt new file mode 100644 index 0000000000..c65e2a0265 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_1.txt @@ -0,0 +1,28 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +e : e '.' ID + | e '.' 'this' + | '-' e + | e '*' e + | e ('+'|'-') e + | INT + | ID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a + +[output] +"""(s (e a) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_2.txt new file mode 100644 index 0000000000..61490cf815 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_2.txt @@ -0,0 +1,28 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +e : e '.' ID + | e '.' 'this' + | '-' e + | e '*' e + | e ('+'|'-') e + | INT + | ID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +1 + +[output] +"""(s (e 1) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_3.txt new file mode 100644 index 0000000000..355cf4ffc3 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_3.txt @@ -0,0 +1,28 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +e : e '.' ID + | e '.' 'this' + | '-' e + | e '*' e + | e ('+'|'-') e + | INT + | ID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a-1 + +[output] +"""(s (e (e a) - (e 1)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_4.txt new file mode 100644 index 0000000000..82823bc802 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_4.txt @@ -0,0 +1,28 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +e : e '.' ID + | e '.' 'this' + | '-' e + | e '*' e + | e ('+'|'-') e + | INT + | ID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a.b + +[output] +"""(s (e (e a) . b) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_5.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_5.txt new file mode 100644 index 0000000000..2fecad1eac --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_5.txt @@ -0,0 +1,28 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +e : e '.' ID + | e '.' 'this' + | '-' e + | e '*' e + | e ('+'|'-') e + | INT + | ID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a.this + +[output] +"""(s (e (e a) . this) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_6.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_6.txt new file mode 100644 index 0000000000..f36e03d1f6 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_6.txt @@ -0,0 +1,28 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +e : e '.' ID + | e '.' 'this' + | '-' e + | e '*' e + | e ('+'|'-') e + | INT + | ID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +-a + +[output] +"""(s (e - (e a)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_7.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_7.txt new file mode 100644 index 0000000000..69c9a28d60 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Expressions_7.txt @@ -0,0 +1,28 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +e : e '.' ID + | e '.' 'this' + | '-' e + | e '*' e + | e ('+'|'-') e + | INT + | ID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +-a+b + +[output] +"""(s (e (e - (e a)) + (e b)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_1.txt new file mode 100644 index 0000000000..f770f3cbfb --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_1.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a|b&c + +[output] +"""(s (e (e a) | (e (e b) & (e c))) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_10.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_10.txt new file mode 100644 index 0000000000..05bf8eb6fc --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_10.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a.f(x)==T.c + +[output] +"""(s (e (e (e (e a) . f) ( (expressionList (e x)) )) == (e (e T) . c)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_11.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_11.txt new file mode 100644 index 0000000000..d6ff972f3f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_11.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a.f().g(x,1) + +[output] +"""(s (e (e (e (e (e a) . f) ( )) . g) ( (expressionList (e x) , (e 1)) )) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_12.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_12.txt new file mode 100644 index 0000000000..4fd312b0fd --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_12.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +new T[((n-1) * x) + 1] + +[output] +"""(s (e new (typespec T) [ (e (e ( (e (e ( (e (e n) - (e 1)) )) * (e x)) )) + (e 1)) ]) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_2.txt new file mode 100644 index 0000000000..ae082d450e --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_2.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +(a|b)&c + +[output] +"""(s (e (e ( (e (e a) | (e b)) )) & (e c)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_3.txt new file mode 100644 index 0000000000..da0aba1d89 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_3.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a > b + +[output] +"""(s (e (e a) > (e b)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_4.txt new file mode 100644 index 0000000000..f0b826c0d5 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_4.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a >> b + +[output] +"""(s (e (e a) >> (e b)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_5.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_5.txt new file mode 100644 index 0000000000..c6b0b80d6e --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_5.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a=b=c + +[output] +"""(s (e (e a) = (e (e b) = (e c))) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_6.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_6.txt new file mode 100644 index 0000000000..bff6065322 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_6.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a^b^c + +[output] +"""(s (e (e a) ^ (e (e b) ^ (e c))) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_7.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_7.txt new file mode 100644 index 0000000000..4728aa4b50 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_7.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +(T)x + +[output] +"""(s (e ( (typespec T) ) (e x)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_8.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_8.txt new file mode 100644 index 0000000000..0a5860edee --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_8.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +new A().b + +[output] +"""(s (e (e new (typespec A) ( )) . b) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_9.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_9.txt new file mode 100644 index 0000000000..1d85d91e86 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/JavaExpressions_9.txt @@ -0,0 +1,72 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow +expressionList + : e (',' e)* + ; +e : '(' e ')' + | 'this' + | 'super' + | INT + | ID + | typespec '.' 'class' + | e '.' ID + | e '.' 'this' + | e '.' 'super' '(' expressionList? ')' + | e '.' 'new' ID '(' expressionList? ')' + | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) + | e '[' e ']' + | '(' typespec ')' e + | e ('++' | '--') + | e '(' expressionList? ')' + | ('+'|'-'|'++'|'--') e + | ('~'|'!') e + | e ('*'|'/'|'%') e + | e ('+'|'-') e + | e ('\<\<' | '>>>' | '>>') e + | e ('\<=' | '>=' | '>' | '\<') e + | e 'instanceof' e + | e ('==' | '!=') e + | e '&' e + |\ e '^' e + | e '|' e + | e '&&' e + | e '||' e + | e '?' e ':' e + |\ + e ('=' + |'+=' + |'-=' + |'*=' + |'/=' + |'&=' + |'|=' + |'^=' + |'>>=' + |'>>>=' + |'\<\<=' + |'%=') e + ; +typespec + : ID + | ID '[' ']' + | 'int' + | 'int' '[' ']' + ; +ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +(T)t.f() + +[output] +"""(s (e (e ( (typespec T) ) (e (e t) . f)) ( )) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/LabelsOnOpSubrule_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/LabelsOnOpSubrule_1.txt new file mode 100644 index 0000000000..d7fe95127c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/LabelsOnOpSubrule_1.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e; +e : a=e op=('*'|'/') b=e {} + | INT {} + | '(' x=e ')' {} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +4 + +[output] +"""(s (e 4)) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/LabelsOnOpSubrule_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/LabelsOnOpSubrule_2.txt new file mode 100644 index 0000000000..0ca7d3fd9c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/LabelsOnOpSubrule_2.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e; +e : a=e op=('*'|'/') b=e {} + | INT {} + | '(' x=e ')' {} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +1*2/3 + +[output] +"""(s (e (e (e 1) * (e 2)) / (e 3))) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/LabelsOnOpSubrule_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/LabelsOnOpSubrule_3.txt new file mode 100644 index 0000000000..20238f95a5 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/LabelsOnOpSubrule_3.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e; +e : a=e op=('*'|'/') b=e {} + | INT {} + | '(' x=e ')' {} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +(1/2)*3 + +[output] +"""(s (e (e ( (e (e 1) / (e 2)) )) * (e 3))) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActionsPredicatesOptions_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActionsPredicatesOptions_1.txt new file mode 100644 index 0000000000..c67586699b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActionsPredicatesOptions_1.txt @@ -0,0 +1,28 @@ +[notes] +This is a regression test for antlr/antlr4#625 "Duplicate action breaks +operator precedence" https://github.com/antlr/antlr4/issues/625 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e ; +e : a=e op=('*'|'/') b=e {}{}? + | a=e op=('+'|'-') b=e {}\{}?\ + | INT {}{} + | '(' x=e ')' {}{} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip; + +[start] +s + +[input] +4 + +[output] +"""(s (e 4)) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActionsPredicatesOptions_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActionsPredicatesOptions_2.txt new file mode 100644 index 0000000000..61fabe9d85 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActionsPredicatesOptions_2.txt @@ -0,0 +1,28 @@ +[notes] +This is a regression test for antlr/antlr4#625 "Duplicate action breaks +operator precedence" https://github.com/antlr/antlr4/issues/625 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e ; +e : a=e op=('*'|'/') b=e {}{}? + | a=e op=('+'|'-') b=e {}\{}?\ + | INT {}{} + | '(' x=e ')' {}{} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip; + +[start] +s + +[input] +1*2/3 + +[output] +"""(s (e (e (e 1) * (e 2)) / (e 3))) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActionsPredicatesOptions_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActionsPredicatesOptions_3.txt new file mode 100644 index 0000000000..689a65f174 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActionsPredicatesOptions_3.txt @@ -0,0 +1,28 @@ +[notes] +This is a regression test for antlr/antlr4#625 "Duplicate action breaks +operator precedence" https://github.com/antlr/antlr4/issues/625 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e ; +e : a=e op=('*'|'/') b=e {}{}? + | a=e op=('+'|'-') b=e {}\{}?\ + | INT {}{} + | '(' x=e ')' {}{} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip; + +[start] +s + +[input] +(1/2)*3 + +[output] +"""(s (e (e ( (e (e 1) / (e 2)) )) * (e 3))) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActions_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActions_1.txt new file mode 100644 index 0000000000..671b11ffda --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActions_1.txt @@ -0,0 +1,27 @@ +[notes] +This is a regression test for antlr/antlr4#625 "Duplicate action breaks +operator precedence" https://github.com/antlr/antlr4/issues/625 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e ; +e : a=e op=('*'|'/') b=e {}{} + | INT {}{} + | '(' x=e ')' {}{} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +4 + +[output] +"""(s (e 4)) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActions_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActions_2.txt new file mode 100644 index 0000000000..752d000ccc --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActions_2.txt @@ -0,0 +1,27 @@ +[notes] +This is a regression test for antlr/antlr4#625 "Duplicate action breaks +operator precedence" https://github.com/antlr/antlr4/issues/625 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e ; +e : a=e op=('*'|'/') b=e {}{} + | INT {}{} + | '(' x=e ')' {}{} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +1*2/3 + +[output] +"""(s (e (e (e 1) * (e 2)) / (e 3))) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActions_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActions_3.txt new file mode 100644 index 0000000000..6fc361bce3 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleActions_3.txt @@ -0,0 +1,27 @@ +[notes] +This is a regression test for antlr/antlr4#625 "Duplicate action breaks +operator precedence" https://github.com/antlr/antlr4/issues/625 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e ; +e : a=e op=('*'|'/') b=e {}{} + | INT {}{} + | '(' x=e ')' {}{} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +(1/2)*3 + +[output] +"""(s (e (e ( (e (e 1) / (e 2)) )) * (e 3))) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_1.txt new file mode 100644 index 0000000000..2b31327fbd --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_1.txt @@ -0,0 +1,36 @@ +[notes] +This is a regression test for antlr/antlr4#433 "Not all context accessor +methods are generated when an alternative rule label is used for multiple +alternatives". https://github.com/antlr/antlr4/issues/433 + +[type] +Parser + +[grammar] +grammar T; +s : e {}; +e returns [int v] + : e '*' e {$v = (0)}, {})> * (1)}, {})>;} # binary + | e '+' e {$v = (0)}, {})> + (1)}, {})>;} # binary + | INT{$v = $INT.int;} # anInt + | '(' e ')' {$v = $e.v;} # parens + | left=e INC {$v = $left.v + 1;} # unary + | left=e DEC {$v = $left.v - 1;} # unary + | ID {} # anID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +INC : '++' ; +DEC : '--' ; +WS : (' '|'\n') -> skip; + +[start] +s + +[input] +4 + +[output] +"""4 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_2.txt new file mode 100644 index 0000000000..3622327c4e --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_2.txt @@ -0,0 +1,36 @@ +[notes] +This is a regression test for antlr/antlr4#433 "Not all context accessor +methods are generated when an alternative rule label is used for multiple +alternatives". https://github.com/antlr/antlr4/issues/433 + +[type] +Parser + +[grammar] +grammar T; +s : e {}; +e returns [int v] + : e '*' e {$v = (0)}, {})> * (1)}, {})>;} # binary + | e '+' e {$v = (0)}, {})> + (1)}, {})>;} # binary + | INT{$v = $INT.int;} # anInt + | '(' e ')' {$v = $e.v;} # parens + | left=e INC {$v = $left.v + 1;} # unary + | left=e DEC {$v = $left.v - 1;} # unary + | ID {} # anID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +INC : '++' ; +DEC : '--' ; +WS : (' '|'\n') -> skip; + +[start] +s + +[input] +1+2 + +[output] +"""3 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_3.txt new file mode 100644 index 0000000000..bf885194eb --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_3.txt @@ -0,0 +1,36 @@ +[notes] +This is a regression test for antlr/antlr4#433 "Not all context accessor +methods are generated when an alternative rule label is used for multiple +alternatives". https://github.com/antlr/antlr4/issues/433 + +[type] +Parser + +[grammar] +grammar T; +s : e {}; +e returns [int v] + : e '*' e {$v = (0)}, {})> * (1)}, {})>;} # binary + | e '+' e {$v = (0)}, {})> + (1)}, {})>;} # binary + | INT{$v = $INT.int;} # anInt + | '(' e ')' {$v = $e.v;} # parens + | left=e INC {$v = $left.v + 1;} # unary + | left=e DEC {$v = $left.v - 1;} # unary + | ID {} # anID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +INC : '++' ; +DEC : '--' ; +WS : (' '|'\n') -> skip; + +[start] +s + +[input] +1+2*3 + +[output] +"""7 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_4.txt new file mode 100644 index 0000000000..091b00455a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_4.txt @@ -0,0 +1,36 @@ +[notes] +This is a regression test for antlr/antlr4#433 "Not all context accessor +methods are generated when an alternative rule label is used for multiple +alternatives". https://github.com/antlr/antlr4/issues/433 + +[type] +Parser + +[grammar] +grammar T; +s : e {}; +e returns [int v] + : e '*' e {$v = (0)}, {})> * (1)}, {})>;} # binary + | e '+' e {$v = (0)}, {})> + (1)}, {})>;} # binary + | INT{$v = $INT.int;} # anInt + | '(' e ')' {$v = $e.v;} # parens + | left=e INC {$v = $left.v + 1;} # unary + | left=e DEC {$v = $left.v - 1;} # unary + | ID {} # anID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +INC : '++' ; +DEC : '--' ; +WS : (' '|'\n') -> skip; + +[start] +s + +[input] +i++*3 + +[output] +"""12 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_5.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_5.txt new file mode 100644 index 0000000000..97c93d7ed1 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/MultipleAlternativesWithCommonLabel_5.txt @@ -0,0 +1,36 @@ +[notes] +This is a regression test for antlr/antlr4#433 "Not all context accessor +methods are generated when an alternative rule label is used for multiple +alternatives". https://github.com/antlr/antlr4/issues/433 + +[type] +Parser + +[grammar] +grammar T; +s : e {}; +e returns [int v] + : e '*' e {$v = (0)}, {})> * (1)}, {})>;} # binary + | e '+' e {$v = (0)}, {})> + (1)}, {})>;} # binary + | INT{$v = $INT.int;} # anInt + | '(' e ')' {$v = $e.v;} # parens + | left=e INC {$v = $left.v + 1;} # unary + | left=e DEC {$v = $left.v - 1;} # unary + | ID {} # anID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +INC : '++' ; +DEC : '--' ; +WS : (' '|'\n') -> skip; + +[start] +s + +[input] +(99)+3 + +[output] +"""102 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrecedenceFilterConsidersContext.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrecedenceFilterConsidersContext.txt new file mode 100644 index 0000000000..67d1bdde33 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrecedenceFilterConsidersContext.txt @@ -0,0 +1,25 @@ +[notes] +This is a regression test for antlr/antlr4#509 "Incorrect rule chosen in +unambiguous grammar". https://github.com/antlr/antlr4/issues/509 + +[type] +Parser + +[grammar] +grammar T; +prog +@after {} +: statement* EOF {}; +statement: letterA | statement letterA 'b' ; +letterA: 'a'; + +[start] +prog + +[input] +aa + +[output] +"""(prog (statement (letterA a)) (statement (letterA a)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixAndOtherAlt_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixAndOtherAlt_1.txt new file mode 100644 index 0000000000..30a38f6447 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixAndOtherAlt_1.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : expr EOF ; +expr : literal + | op expr + | expr op expr + ; +literal : '-'? Integer ; +op : '+' | '-' ; +Integer : [0-9]+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +-1 + +[output] +"""(s (expr (literal - 1)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixAndOtherAlt_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixAndOtherAlt_2.txt new file mode 100644 index 0000000000..8002cdabb9 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixAndOtherAlt_2.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : expr EOF ; +expr : literal + | op expr + | expr op expr + ; +literal : '-'? Integer ; +op : '+' | '-' ; +Integer : [0-9]+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +-1 + -1 + +[output] +"""(s (expr (expr (literal - 1)) (op +) (expr (literal - 1))) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixOpWithActionAndLabel_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixOpWithActionAndLabel_1.txt new file mode 100644 index 0000000000..1395ce3060 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixOpWithActionAndLabel_1.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : e {} ; +e returns [ result] + : ID '=' e1=e {$result = ;} + | ID {$result = $ID.text;} + | e1=e '+' e2=e {$result = ;} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a + +[output] +"""a +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixOpWithActionAndLabel_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixOpWithActionAndLabel_2.txt new file mode 100644 index 0000000000..54e8d888ff --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixOpWithActionAndLabel_2.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : e {} ; +e returns [ result] + : ID '=' e1=e {$result = ;} + | ID {$result = $ID.text;} + | e1=e '+' e2=e {$result = ;} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a+b + +[output] +"""(a+b) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixOpWithActionAndLabel_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixOpWithActionAndLabel_3.txt new file mode 100644 index 0000000000..034019f7bc --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/PrefixOpWithActionAndLabel_3.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : e {} ; +e returns [ result] + : ID '=' e1=e {$result = ;} + | ID {$result = $ID.text;} + | e1=e '+' e2=e {$result = ;} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a=b+c + +[output] +"""((a=b)+c) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_1.txt new file mode 100644 index 0000000000..9cf6bb44ee --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_1.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s : q=e {}; +e returns [int v] + : a=e op='*' b=e {$v = $a.v * $b.v;} # mult + | a=e '+' b=e {$v = $a.v + $b.v;} # add + | INT{$v = $INT.int;} # anInt + | '(' x=e ')' {$v = $x.v;} # parens + | x=e '++' {$v = $x.v+1;} # inc + | e '--' # dec + | ID {$v = 3;} # anID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +4 + +[output] +"""4 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_2.txt new file mode 100644 index 0000000000..ba490abc13 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_2.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s : q=e {}; +e returns [int v] + : a=e op='*' b=e {$v = $a.v * $b.v;} # mult + | a=e '+' b=e {$v = $a.v + $b.v;} # add + | INT{$v = $INT.int;} # anInt + | '(' x=e ')' {$v = $x.v;} # parens + | x=e '++' {$v = $x.v+1;} # inc + | e '--' # dec + | ID {$v = 3;} # anID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +1+2 + +[output] +"""3 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_3.txt new file mode 100644 index 0000000000..10b39b825b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_3.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s : q=e {}; +e returns [int v] + : a=e op='*' b=e {$v = $a.v * $b.v;} # mult + | a=e '+' b=e {$v = $a.v + $b.v;} # add + | INT{$v = $INT.int;} # anInt + | '(' x=e ')' {$v = $x.v;} # parens + | x=e '++' {$v = $x.v+1;} # inc + | e '--' # dec + | ID {$v = 3;} # anID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +1+2*3 + +[output] +"""7 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_4.txt new file mode 100644 index 0000000000..0d7f923820 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsAndLabels_4.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +s : q=e {}; +e returns [int v] + : a=e op='*' b=e {$v = $a.v * $b.v;} # mult + | a=e '+' b=e {$v = $a.v + $b.v;} # add + | INT{$v = $INT.int;} # anInt + | '(' x=e ')' {$v = $x.v;} # parens + | x=e '++' {$v = $x.v+1;} # inc + | e '--' # dec + | ID {$v = 3;} # anID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +i++*3 + +[output] +"""12 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_1.txt new file mode 100644 index 0000000000..1cfb886d7d --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_1.txt @@ -0,0 +1,34 @@ +[notes] +This is a regression test for antlr/antlr4#677 "labels not working in grammar +file". https://github.com/antlr/antlr4/issues/677 +This test treats `,` and `>>` as part of a single compound operator (similar +to a ternary operator). + +[type] +Parser + +[grammar] +grammar T; +s @after {} : expr EOF; +expr: + a=expr '*' a=expr #Factor + | b+=expr (',' b+=expr)* '>>' c=expr #Send + | ID #JustId //semantic check on modifiers +; + +ID : ('a'..'z'|'A'..'Z'|'_') + ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* +; + +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +a*b + +[output] +"""(s (expr (expr a) * (expr b)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_2.txt new file mode 100644 index 0000000000..06dc777133 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_2.txt @@ -0,0 +1,34 @@ +[notes] +This is a regression test for antlr/antlr4#677 "labels not working in grammar +file". https://github.com/antlr/antlr4/issues/677 +This test treats `,` and `>>` as part of a single compound operator (similar +to a ternary operator). + +[type] +Parser + +[grammar] +grammar T; +s @after {} : expr EOF; +expr: + a=expr '*' a=expr #Factor + | b+=expr (',' b+=expr)* '>>' c=expr #Send + | ID #JustId //semantic check on modifiers +; + +ID : ('a'..'z'|'A'..'Z'|'_') + ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* +; + +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +a,c>>x + +[output] +"""(s (expr (expr a) , (expr c) >> (expr x)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_3.txt new file mode 100644 index 0000000000..55fc5f9d47 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_3.txt @@ -0,0 +1,34 @@ +[notes] +This is a regression test for antlr/antlr4#677 "labels not working in grammar +file". https://github.com/antlr/antlr4/issues/677 +This test treats `,` and `>>` as part of a single compound operator (similar +to a ternary operator). + +[type] +Parser + +[grammar] +grammar T; +s @after {} : expr EOF; +expr: + a=expr '*' a=expr #Factor + | b+=expr (',' b+=expr)* '>>' c=expr #Send + | ID #JustId //semantic check on modifiers +; + +ID : ('a'..'z'|'A'..'Z'|'_') + ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* +; + +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +x + +[output] +"""(s (expr x) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_4.txt new file mode 100644 index 0000000000..ac7eddea64 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList1_4.txt @@ -0,0 +1,34 @@ +[notes] +This is a regression test for antlr/antlr4#677 "labels not working in grammar +file". https://github.com/antlr/antlr4/issues/677 +This test treats `,` and `>>` as part of a single compound operator (similar +to a ternary operator). + +[type] +Parser + +[grammar] +grammar T; +s @after {} : expr EOF; +expr: + a=expr '*' a=expr #Factor + | b+=expr (',' b+=expr)* '>>' c=expr #Send + | ID #JustId //semantic check on modifiers +; + +ID : ('a'..'z'|'A'..'Z'|'_') + ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* +; + +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +a*b,c,x*y>>r + +[output] +"""(s (expr (expr (expr a) * (expr b)) , (expr c) , (expr (expr x) * (expr y)) >> (expr r)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_1.txt new file mode 100644 index 0000000000..83ca371af9 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_1.txt @@ -0,0 +1,33 @@ +[notes] +This is a regression test for antlr/antlr4#677 "labels not working in grammar +file". https://github.com/antlr/antlr4/issues/677 +This test treats `,` and `>>` as part of a single compound operator (similar +to a ternary operator). + +[type] +Parser + +[grammar] +grammar T; +s @after {} : expr EOF; +expr: + a=expr '*' a=expr #Factor + | b+=expr ',' b+=expr #Comma + | b+=expr '>>' c=expr #Send + | ID #JustId //semantic check on modifiers + ; +ID : ('a'..'z'|'A'..'Z'|'_') + ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* +; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +a*b + +[output] +"""(s (expr (expr a) * (expr b)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_2.txt new file mode 100644 index 0000000000..e72fc249df --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_2.txt @@ -0,0 +1,33 @@ +[notes] +This is a regression test for antlr/antlr4#677 "labels not working in grammar +file". https://github.com/antlr/antlr4/issues/677 +This test treats `,` and `>>` as part of a single compound operator (similar +to a ternary operator). + +[type] +Parser + +[grammar] +grammar T; +s @after {} : expr EOF; +expr: + a=expr '*' a=expr #Factor + | b+=expr ',' b+=expr #Comma + | b+=expr '>>' c=expr #Send + | ID #JustId //semantic check on modifiers + ; +ID : ('a'..'z'|'A'..'Z'|'_') + ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* +; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +a,c>>x + +[output] +"""(s (expr (expr (expr a) , (expr c)) >> (expr x)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_3.txt new file mode 100644 index 0000000000..0f60f72ea4 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_3.txt @@ -0,0 +1,33 @@ +[notes] +This is a regression test for antlr/antlr4#677 "labels not working in grammar +file". https://github.com/antlr/antlr4/issues/677 +This test treats `,` and `>>` as part of a single compound operator (similar +to a ternary operator). + +[type] +Parser + +[grammar] +grammar T; +s @after {} : expr EOF; +expr: + a=expr '*' a=expr #Factor + | b+=expr ',' b+=expr #Comma + | b+=expr '>>' c=expr #Send + | ID #JustId //semantic check on modifiers + ; +ID : ('a'..'z'|'A'..'Z'|'_') + ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* +; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +x + +[output] +"""(s (expr x) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_4.txt new file mode 100644 index 0000000000..235577bbc7 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActionsList2_4.txt @@ -0,0 +1,33 @@ +[notes] +This is a regression test for antlr/antlr4#677 "labels not working in grammar +file". https://github.com/antlr/antlr4/issues/677 +This test treats `,` and `>>` as part of a single compound operator (similar +to a ternary operator). + +[type] +Parser + +[grammar] +grammar T; +s @after {} : expr EOF; +expr: + a=expr '*' a=expr #Factor + | b+=expr ',' b+=expr #Comma + | b+=expr '>>' c=expr #Send + | ID #JustId //semantic check on modifiers + ; +ID : ('a'..'z'|'A'..'Z'|'_') + ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* +; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +a*b,c,x*y>>r + +[output] +"""(s (expr (expr (expr (expr (expr a) * (expr b)) , (expr c)) , (expr (expr x) * (expr y))) >> (expr r)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_1.txt new file mode 100644 index 0000000000..2bf914ac7d --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_1.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : e {}; +e returns [int v, ignored] + : a=e '*' b=e {$v = $a.v * $b.v;} + | a=e '+' b=e {$v = $a.v + $b.v;} + | INT {$v = $INT.int;} + | '(' x=e ')' {$v = $x.v;} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +4 + +[output] +"""4 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_2.txt new file mode 100644 index 0000000000..268582148a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_2.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : e {}; +e returns [int v, ignored] + : a=e '*' b=e {$v = $a.v * $b.v;} + | a=e '+' b=e {$v = $a.v + $b.v;} + | INT {$v = $INT.int;} + | '(' x=e ')' {$v = $x.v;} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +1+2 + +[output] +"""3 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_3.txt new file mode 100644 index 0000000000..67b00890d7 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_3.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : e {}; +e returns [int v, ignored] + : a=e '*' b=e {$v = $a.v * $b.v;} + | a=e '+' b=e {$v = $a.v + $b.v;} + | INT {$v = $INT.int;} + | '(' x=e ')' {$v = $x.v;} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +1+2*3 + +[output] +"""7 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_4.txt new file mode 100644 index 0000000000..9f9fb785e0 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/ReturnValueAndActions_4.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : e {}; +e returns [int v, ignored] + : a=e '*' b=e {$v = $a.v * $b.v;} + | a=e '+' b=e {$v = $a.v + $b.v;} + | INT {$v = $INT.int;} + | '(' x=e ')' {$v = $x.v;} + ; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +(1+2)*3 + +[output] +"""9 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/SemPred.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/SemPred.txt new file mode 100644 index 0000000000..f932b83d85 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/SemPred.txt @@ -0,0 +1,22 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : a ; +a : a {}? ID + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x y z + +[output] +"""(s (a (a (a x) y) z)) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/SemPredFailOption.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/SemPredFailOption.txt new file mode 100644 index 0000000000..5d3008e855 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/SemPredFailOption.txt @@ -0,0 +1,26 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : a ; +a : a ID {}?\ + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x y z + +[output] +"""(s (a (a x) y z)) +""" + +[errors] +"""line 1:4 rule a custom message +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Simple_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Simple_1.txt new file mode 100644 index 0000000000..16aa2d233d --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Simple_1.txt @@ -0,0 +1,22 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : a ; +a : a ID + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x + +[output] +"""(s (a x)) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Simple_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Simple_2.txt new file mode 100644 index 0000000000..bf9ec64e90 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Simple_2.txt @@ -0,0 +1,22 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : a ; +a : a ID + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x y + +[output] +"""(s (a (a x) y)) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Simple_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Simple_3.txt new file mode 100644 index 0000000000..3f95b714d9 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/Simple_3.txt @@ -0,0 +1,22 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : a ; +a : a ID + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x y z + +[output] +"""(s (a (a (a x) y) z)) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_1.txt new file mode 100644 index 0000000000..d2e0701e9a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_1.txt @@ -0,0 +1,29 @@ +[notes] +This is a regression test for antlr/antlr4#542 "First alternative cannot +be right-associative". https://github.com/antlr/antlr4/issues/542 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF; // must indicate EOF can follow or 'a\' won't match +e :\ e '*' e + |\ e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a + +[output] +"""(s (e a) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_2.txt new file mode 100644 index 0000000000..58d81f3c2f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_2.txt @@ -0,0 +1,29 @@ +[notes] +This is a regression test for antlr/antlr4#542 "First alternative cannot +be right-associative". https://github.com/antlr/antlr4/issues/542 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF; // must indicate EOF can follow or 'a\' won't match +e :\ e '*' e + |\ e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a+b + +[output] +"""(s (e (e a) + (e b)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_3.txt new file mode 100644 index 0000000000..bdb50285a4 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_3.txt @@ -0,0 +1,29 @@ +[notes] +This is a regression test for antlr/antlr4#542 "First alternative cannot +be right-associative". https://github.com/antlr/antlr4/issues/542 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF; // must indicate EOF can follow or 'a\' won't match +e :\ e '*' e + |\ e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a*b + +[output] +"""(s (e (e a) * (e b)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_4.txt new file mode 100644 index 0000000000..390e126179 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_4.txt @@ -0,0 +1,29 @@ +[notes] +This is a regression test for antlr/antlr4#542 "First alternative cannot +be right-associative". https://github.com/antlr/antlr4/issues/542 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF; // must indicate EOF can follow or 'a\' won't match +e :\ e '*' e + |\ e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a?b:c + +[output] +"""(s (e (e a) ? (e b) : (e c)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_5.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_5.txt new file mode 100644 index 0000000000..b9fe9d5aeb --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_5.txt @@ -0,0 +1,29 @@ +[notes] +This is a regression test for antlr/antlr4#542 "First alternative cannot +be right-associative". https://github.com/antlr/antlr4/issues/542 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF; // must indicate EOF can follow or 'a\' won't match +e :\ e '*' e + |\ e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a=b=c + +[output] +"""(s (e (e a) = (e (e b) = (e c))) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_6.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_6.txt new file mode 100644 index 0000000000..a6ccc3e3ed --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_6.txt @@ -0,0 +1,29 @@ +[notes] +This is a regression test for antlr/antlr4#542 "First alternative cannot +be right-associative". https://github.com/antlr/antlr4/issues/542 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF; // must indicate EOF can follow or 'a\' won't match +e :\ e '*' e + |\ e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a?b+c:d + +[output] +"""(s (e (e a) ? (e (e b) + (e c)) : (e d)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_7.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_7.txt new file mode 100644 index 0000000000..d1c0d16850 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_7.txt @@ -0,0 +1,29 @@ +[notes] +This is a regression test for antlr/antlr4#542 "First alternative cannot +be right-associative". https://github.com/antlr/antlr4/issues/542 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF; // must indicate EOF can follow or 'a\' won't match +e :\ e '*' e + |\ e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a?b=c:d + +[output] +"""(s (e (e a) ? (e (e b) = (e c)) : (e d)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_8.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_8.txt new file mode 100644 index 0000000000..37e9e3d824 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_8.txt @@ -0,0 +1,29 @@ +[notes] +This is a regression test for antlr/antlr4#542 "First alternative cannot +be right-associative". https://github.com/antlr/antlr4/issues/542 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF; // must indicate EOF can follow or 'a\' won't match +e :\ e '*' e + |\ e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a? b?c:d : e + +[output] +"""(s (e (e a) ? (e (e b) ? (e c) : (e d)) : (e e)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_9.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_9.txt new file mode 100644 index 0000000000..3f6796a856 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExprExplicitAssociativity_9.txt @@ -0,0 +1,29 @@ +[notes] +This is a regression test for antlr/antlr4#542 "First alternative cannot +be right-associative". https://github.com/antlr/antlr4/issues/542 + +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF; // must indicate EOF can follow or 'a\' won't match +e :\ e '*' e + |\ e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a?b: c?d:e + +[output] +"""(s (e (e a) ? (e b) : (e (e c) ? (e d) : (e e))) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_1.txt new file mode 100644 index 0000000000..2a6f3017a1 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_1.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow or 'a\' won't match +e : e '*' e + | e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a + +[output] +"""(s (e a) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_2.txt new file mode 100644 index 0000000000..7922cdb982 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_2.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow or 'a\' won't match +e : e '*' e + | e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a+b + +[output] +"""(s (e (e a) + (e b)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_3.txt new file mode 100644 index 0000000000..484e8baee3 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_3.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow or 'a\' won't match +e : e '*' e + | e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a*b + +[output] +"""(s (e (e a) * (e b)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_4.txt new file mode 100644 index 0000000000..0bc4b86d15 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_4.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow or 'a\' won't match +e : e '*' e + | e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a?b:c + +[output] +"""(s (e (e a) ? (e b) : (e c)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_5.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_5.txt new file mode 100644 index 0000000000..1912cc1c2d --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_5.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow or 'a\' won't match +e : e '*' e + | e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a=b=c + +[output] +"""(s (e (e a) = (e (e b) = (e c))) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_6.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_6.txt new file mode 100644 index 0000000000..a4af8ecbd5 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_6.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow or 'a\' won't match +e : e '*' e + | e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a?b+c:d + +[output] +"""(s (e (e a) ? (e (e b) + (e c)) : (e d)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_7.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_7.txt new file mode 100644 index 0000000000..673f87858a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_7.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow or 'a\' won't match +e : e '*' e + | e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a?b=c:d + +[output] +"""(s (e (e a) ? (e (e b) = (e c)) : (e d)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_8.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_8.txt new file mode 100644 index 0000000000..84fe9d2b84 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_8.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow or 'a\' won't match +e : e '*' e + | e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a? b?c:d : e + +[output] +"""(s (e (e a) ? (e (e b) ? (e c) : (e d)) : (e e)) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_9.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_9.txt new file mode 100644 index 0000000000..661bdefd90 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/TernaryExpr_9.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s @after {} : e EOF ; // must indicate EOF can follow or 'a\' won't match +e : e '*' e + | e '+' e + |\ e '?' e ':' e + |\ e '=' e + | ID + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a?b: c?d:e + +[output] +"""(s (e (e a) ? (e b) : (e (e c) ? (e d) : (e e))) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/WhitespaceInfluence_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/WhitespaceInfluence_1.txt new file mode 100644 index 0000000000..afbd927b97 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/WhitespaceInfluence_1.txt @@ -0,0 +1,64 @@ +[notes] +This is a regression test for #239 "recoursive parser using implicit tokens +ignore white space lexer rule". https://github.com/antlr/antlr4/issues/239 + +[type] +Parser + +[grammar] +grammar Expr; +prog : expression EOF; +expression + : ID '(' expression (',' expression)* ')' # doFunction + | '(' expression ')'# doParenthesis + | '!' expression # doNot + | '-' expression # doNegate + | '+' expression # doPositiv + | expression '^' expression # doPower + | expression '*' expression # doMultipy + | expression '/' expression # doDivide + | expression '%' expression # doModulo + | expression '-' expression # doMinus + | expression '+' expression # doPlus + | expression '=' expression # doEqual + | expression '!=' expression # doNotEqual + | expression '>' expression # doGreather + | expression '>=' expression # doGreatherEqual + | expression '\<' expression # doLesser + | expression '\<=' expression # doLesserEqual + | expression K_IN '(' expression (',' expression)* ')' # doIn + | expression ( '&' | K_AND) expression# doAnd + | expression ( '|' | K_OR) expression # doOr + | '[' expression (',' expression)* ']'# newArray + | K_TRUE # newTrueBoolean + | K_FALSE # newFalseBoolean + | NUMBER # newNumber + | DATE # newDateTime + | ID # newIdentifier + | SQ_STRING# newString + | K_NULL # newNull + ; + +// Fragments +fragment DIGIT : '0' .. '9'; +fragment UPPER : 'A' .. 'Z'; +fragment LOWER : 'a' .. 'z'; +fragment LETTER : LOWER | UPPER; +fragment WORD : LETTER | '_' | '$' | '#' | '.'; +fragment ALPHANUM : WORD | DIGIT; + +// Tokens +ID : LETTER ALPHANUM*; +NUMBER : DIGIT+ ('.' DIGIT+)? (('e'|'E')('+'|'-')? DIGIT+)?; +DATE : '\'' DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT (' ' DIGIT DIGIT ':' DIGIT DIGIT ':' DIGIT DIGIT ('.' DIGIT+)?)? '\''; +SQ_STRING : '\'' ('\'\'' | ~'\'')* '\''; +DQ_STRING : '"' ('\\\\"' | ~'"')* '"'; +WS : [ \t\n\r]+ -> skip ; +COMMENTS : ('/*' .*? '*' '/' | '//' ~'\n'* '\n' ) -> skip; + +[start] +prog + +[input] +Test(1,3) + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/WhitespaceInfluence_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/WhitespaceInfluence_2.txt new file mode 100644 index 0000000000..345ae30982 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LeftRecursion/WhitespaceInfluence_2.txt @@ -0,0 +1,64 @@ +[notes] +This is a regression test for #239 "recoursive parser using implicit tokens +ignore white space lexer rule". https://github.com/antlr/antlr4/issues/239 + +[type] +Parser + +[grammar] +grammar Expr; +prog : expression EOF; +expression + : ID '(' expression (',' expression)* ')' # doFunction + | '(' expression ')'# doParenthesis + | '!' expression # doNot + | '-' expression # doNegate + | '+' expression # doPositiv + | expression '^' expression # doPower + | expression '*' expression # doMultipy + | expression '/' expression # doDivide + | expression '%' expression # doModulo + | expression '-' expression # doMinus + | expression '+' expression # doPlus + | expression '=' expression # doEqual + | expression '!=' expression # doNotEqual + | expression '>' expression # doGreather + | expression '>=' expression # doGreatherEqual + | expression '\<' expression # doLesser + | expression '\<=' expression # doLesserEqual + | expression K_IN '(' expression (',' expression)* ')' # doIn + | expression ( '&' | K_AND) expression# doAnd + | expression ( '|' | K_OR) expression # doOr + | '[' expression (',' expression)* ']'# newArray + | K_TRUE # newTrueBoolean + | K_FALSE # newFalseBoolean + | NUMBER # newNumber + | DATE # newDateTime + | ID # newIdentifier + | SQ_STRING# newString + | K_NULL # newNull + ; + +// Fragments +fragment DIGIT : '0' .. '9'; +fragment UPPER : 'A' .. 'Z'; +fragment LOWER : 'a' .. 'z'; +fragment LETTER : LOWER | UPPER; +fragment WORD : LETTER | '_' | '$' | '#' | '.'; +fragment ALPHANUM : WORD | DIGIT; + +// Tokens +ID : LETTER ALPHANUM*; +NUMBER : DIGIT+ ('.' DIGIT+)? (('e'|'E')('+'|'-')? DIGIT+)?; +DATE : '\'' DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT (' ' DIGIT DIGIT ':' DIGIT DIGIT ':' DIGIT DIGIT ('.' DIGIT+)?)? '\''; +SQ_STRING : '\'' ('\'\'' | ~'\'')* '\''; +DQ_STRING : '"' ('\\\\"' | ~'"')* '"'; +WS : [ \t\n\r]+ -> skip ; +COMMENTS : ('/*' .*? '*' '/' | '//' ~'\n'* '\n' ) -> skip; + +[start] +prog + +[input] +Test(1, 3) + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/DFAToATNThatFailsBackToDFA.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/DFAToATNThatFailsBackToDFA.txt new file mode 100644 index 0000000000..ad24098e29 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/DFAToATNThatFailsBackToDFA.txt @@ -0,0 +1,20 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : 'ab' ; +B : 'abc' ; + +[input] +ababx + +[output] +[@0,0:1='ab',<1>,1:0] +[@1,2:3='ab',<1>,1:2] +[@2,5:4='',<-1>,1:5] + +[errors] +"""line 1:4 token recognition error at: 'x' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/DFAToATNThatMatchesThenFailsInATN.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/DFAToATNThatMatchesThenFailsInATN.txt new file mode 100644 index 0000000000..817f7d4cdc --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/DFAToATNThatMatchesThenFailsInATN.txt @@ -0,0 +1,21 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : 'ab' ; +B : 'abc' ; +C : 'abcd' ; + +[input] +ababcx + +[output] +[@0,0:1='ab',<1>,1:0] +[@1,2:4='abc',<2>,1:2] +[@2,6:5='',<-1>,1:6] + +[errors] +"""line 1:5 token recognition error at: 'x' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/EnforcedGreedyNestedBraces_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/EnforcedGreedyNestedBraces_1.txt new file mode 100644 index 0000000000..d5edc22ed0 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/EnforcedGreedyNestedBraces_1.txt @@ -0,0 +1,15 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +ACTION : '{' (ACTION | ~[{}])* '}'; +WS : [ \r\n\t]+ -> skip; + +[input] +{ { } } + +[output] +[@0,0:6='{ { } }',<1>,1:0] +[@1,7:6='',<-1>,1:7] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/EnforcedGreedyNestedBraces_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/EnforcedGreedyNestedBraces_2.txt new file mode 100644 index 0000000000..aa251242af --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/EnforcedGreedyNestedBraces_2.txt @@ -0,0 +1,19 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +ACTION : '{' (ACTION | ~[{}])* '}'; +WS : [ \r\n\t]+ -> skip; + +[input] +{ { } + +[output] +"""[@0,5:4='',<-1>,1:5] +""" + +[errors] +"""line 1:0 token recognition error at: '{ { }' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/ErrorInMiddle.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/ErrorInMiddle.txt new file mode 100644 index 0000000000..e70c91b1a1 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/ErrorInMiddle.txt @@ -0,0 +1,18 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : 'abc' ; + +[input] +abx + +[output] +"""[@0,3:2='',<-1>,1:3] +""" + +[errors] +"""line 1:0 token recognition error at: 'abx' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharAtStart.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharAtStart.txt new file mode 100644 index 0000000000..b8291b8191 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharAtStart.txt @@ -0,0 +1,18 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : 'a' 'b' ; + +[input] +x + +[output] +"""[@0,1:0='',<-1>,1:1] +""" + +[errors] +"""line 1:0 token recognition error at: 'x' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharAtStartAfterDFACache.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharAtStartAfterDFACache.txt new file mode 100644 index 0000000000..ae21517319 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharAtStartAfterDFACache.txt @@ -0,0 +1,18 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : 'a' 'b' ; + +[input] +abx + +[output] +[@0,0:1='ab',<1>,1:0] +[@1,3:2='',<-1>,1:3] + +[errors] +"""line 1:2 token recognition error at: 'x' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharInToken.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharInToken.txt new file mode 100644 index 0000000000..3e0b509f07 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharInToken.txt @@ -0,0 +1,18 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : 'a' 'b' ; + +[input] +ax + +[output] +"""[@0,2:1='',<-1>,1:2] +""" + +[errors] +"""line 1:0 token recognition error at: 'ax' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharInTokenAfterDFACache.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharInTokenAfterDFACache.txt new file mode 100644 index 0000000000..9d014e8d9d --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/InvalidCharInTokenAfterDFACache.txt @@ -0,0 +1,18 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : 'a' 'b' ; + +[input] +abax + +[output] +[@0,0:1='ab',<1>,1:0] +[@1,4:3='',<-1>,1:4] + +[errors] +"""line 1:2 token recognition error at: 'ax' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/LexerExecDFA.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/LexerExecDFA.txt new file mode 100644 index 0000000000..16aa4fdbd2 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/LexerExecDFA.txt @@ -0,0 +1,25 @@ +[notes] +This is a regression test for #45 "NullPointerException in LexerATNSimulator.execDFA". https://github.com/antlr/antlr4/issues/46 + +[type] +Lexer + +[grammar] +lexer grammar L; +COLON : ':' ; +PTR : '->' ; +ID : [a-z]+; + +[input] +x : x + +[output] +[@0,0:0='x',<3>,1:0] +[@1,2:2=':',<1>,1:2] +[@2,4:4='x',<3>,1:4] +[@3,5:4='',<-1>,1:5] + +[errors] +line 1:1 token recognition error at: ' ' +line 1:3 token recognition error at: ' ' + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/StringsEmbeddedInActions_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/StringsEmbeddedInActions_1.txt new file mode 100644 index 0000000000..1c2b65214b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/StringsEmbeddedInActions_1.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +ACTION2 : '[' (STRING | ~'"')*? ']'; +STRING : '"' ('\\\\' '"' | .)*? '"'; +WS : [ \t\r\n]+ -> skip; + +[input] +["foo"] + +[output] +[@0,0:6='["foo"]',<1>,1:0] +[@1,7:6='',<-1>,1:7] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/StringsEmbeddedInActions_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/StringsEmbeddedInActions_2.txt new file mode 100644 index 0000000000..2ce4047472 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerErrors/StringsEmbeddedInActions_2.txt @@ -0,0 +1,20 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +ACTION2 : '[' (STRING | ~'"')*? ']'; +STRING : '"' ('\\\\' '"' | .)*? '"'; +WS : [ \t\r\n]+ -> skip; + +[input] +["foo] + +[output] +"""[@0,6:5='',<-1>,1:6] +""" + +[errors] +"""line 1:0 token recognition error at: '["foo]' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/ActionPlacement.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/ActionPlacement.txt new file mode 100644 index 0000000000..8ec87f8f5a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/ActionPlacement.txt @@ -0,0 +1,24 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +I : ({} 'a' +| {} + 'a' {} + 'b' {}) + {} ; +WS : (' '|'\n') -> skip ; +J : .; + +[input] +ab + +[output] +stuff0: +stuff1: a +stuff2: ab +ab +[@0,0:1='ab',<1>,1:0] +[@1,2:1='',<-1>,1:2] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSet.txt new file mode 100644 index 0000000000..d4ba73ee7c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSet.txt @@ -0,0 +1,19 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +I : '0'..'9'+ {} ; +WS : [ \n\\u000D] -> skip ; + +[input] +"""34 + 34""" + +[output] +I +I +[@0,0:1='34',<1>,1:0] +[@1,4:5='34',<1>,2:1] +[@2,6:5='',<-1>,2:3] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetInSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetInSet.txt new file mode 100644 index 0000000000..84c2bd9fa1 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetInSet.txt @@ -0,0 +1,18 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +I : (~[ab \\n]|'a') {} ; +WS : [ \n\\u000D]+ -> skip ; + +[input] +a x + +[output] +I +I +[@0,0:0='a',<1>,1:0] +[@1,2:2='x',<1>,1:2] +[@2,3:2='',<-1>,1:3] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetNot.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetNot.txt new file mode 100644 index 0000000000..a68132b4c7 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetNot.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +I : ~[ab \n] ~[ \ncd]* {} ; +WS : [ \n\\u000D]+ -> skip ; + +[input] +xaf + +[output] +I +[@0,0:2='xaf',<1>,1:0] +[@1,3:2='',<-1>,1:3] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetPlus.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetPlus.txt new file mode 100644 index 0000000000..24f4585a67 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetPlus.txt @@ -0,0 +1,19 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +I : '0'..'9'+ {} ; +WS : [ \n\\u000D]+ -> skip ; + +[input] +"""34 + 34""" + +[output] +I +I +[@0,0:1='34',<1>,1:0] +[@1,4:5='34',<1>,2:1] +[@2,6:5='',<-1>,2:3] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetRange.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetRange.txt new file mode 100644 index 0000000000..b65a50ce60 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetRange.txt @@ -0,0 +1,25 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +I : [0-9]+ {} ; +ID : [a-zA-Z] [a-zA-Z0-9]* {} ; +WS : [ \n\\u0009\r]+ -> skip ; + +[input] +"""34 + 34 a2 abc + """ + +[output] +I +I +ID +ID +[@0,0:1='34',<1>,1:0] +[@1,4:5='34',<1>,2:1] +[@2,7:8='a2',<2>,2:4] +[@3,10:12='abc',<2>,2:7] +[@4,18:17='',<-1>,3:3] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithEscapedChar.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithEscapedChar.txt new file mode 100644 index 0000000000..3ed621601f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithEscapedChar.txt @@ -0,0 +1,18 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +DASHBRACK : [\\-\]]+ {} ; +WS : [ \n]+ -> skip ; + +[input] +"""- ] """ + +[output] +DASHBRACK +DASHBRACK +[@0,0:0='-',<1>,1:0] +[@1,2:2=']',<1>,1:2] +[@2,4:3='',<-1>,1:4] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithMissingEscapeChar.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithMissingEscapeChar.txt new file mode 100644 index 0000000000..48ef9bc3f7 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithMissingEscapeChar.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +I : [0-9]+ {} ; +WS : [ \n]+ -> skip ; + +[input] +"""34 """ + +[output] +I +[@0,0:1='34',<1>,1:0] +[@1,3:2='',<-1>,1:3] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithQuote1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithQuote1.txt new file mode 100644 index 0000000000..82e1f42a6a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithQuote1.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : ["a-z]+ {} ; +WS : [ \n\t]+ -> skip ; + +[input] +b"a + +[output] +A +[@0,0:2='b"a',<1>,1:0] +[@1,3:2='',<-1>,1:3] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithQuote2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithQuote2.txt new file mode 100644 index 0000000000..9af4d641d2 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/CharSetWithQuote2.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : ["\\\\ab]+ {} ; +WS : [ \n\t]+ -> skip ; + +[input] +b"\a + +[output] +A +[@0,0:3='b"\a',<1>,1:0] +[@1,4:3='',<-1>,1:4] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EOFByItself.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EOFByItself.txt new file mode 100644 index 0000000000..08232bd435 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EOFByItself.txt @@ -0,0 +1,15 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +DONE : EOF ; +A : 'a'; + +[input] + + +[output] +[@0,0:-1='',<1>,1:0] +[@1,0:-1='',<-1>,1:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EOFSuffixInFirstRule_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EOFSuffixInFirstRule_1.txt new file mode 100644 index 0000000000..8ad081813e --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EOFSuffixInFirstRule_1.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : 'a' EOF ; +B : 'a'; +C : 'c'; + +[input] + + +[output] +"""[@0,0:-1='',<-1>,1:0] +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EOFSuffixInFirstRule_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EOFSuffixInFirstRule_2.txt new file mode 100644 index 0000000000..cc9383f7e5 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EOFSuffixInFirstRule_2.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : 'a' EOF ; +B : 'a'; +C : 'c'; + +[input] +a + +[output] +[@0,0:0='a',<1>,1:0] +[@1,1:0='',<-1>,1:1] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EscapeTargetStringLiteral.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EscapeTargetStringLiteral.txt new file mode 100644 index 0000000000..33e7de1c43 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EscapeTargetStringLiteral.txt @@ -0,0 +1,15 @@ +[notes] +This is a regression test for antlr/antlr4#2709 "PHP target generates +invalid output when $ is used as part of the literal in lexer rule" +https://github.com/antlr/antlr4/issues/2709 + +[type] +Lexer + +[grammar] +lexer grammar L; +ACTION_WITH_DOLLAR: '$ACTION'; + +[output] +"""[@0,0:-1='',<-1>,1:0] +""" diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EscapedCharacters.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EscapedCharacters.txt new file mode 100644 index 0000000000..5f62cc8ede --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/EscapedCharacters.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +LF : '\\u000A'; +X : 'x'; + +[input] +"""x +""" + +[output] +[@0,0:0='x',<2>,1:0] +[@1,1:1='\n',<1>,1:1] +[@2,2:1='',<-1>,2:0] diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyClosure.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyClosure.txt new file mode 100644 index 0000000000..960b66ca62 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyClosure.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +CMT : '//' .*? '\n' CMT*; +WS : (' '|'\t')+; + +[input] +//blah +//blah + +[output] +[@0,0:13='//blah\n//blah\n',<1>,1:0] +[@1,14:13='',<-1>,3:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyConfigs.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyConfigs.txt new file mode 100644 index 0000000000..300d97bbcc --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyConfigs.txt @@ -0,0 +1,17 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +I : ('a' | 'ab') {} ; +WS : (' '|'\n') -> skip ; +J : .; + +[input] +ab + +[output] +ab +[@0,0:1='ab',<1>,1:0] +[@1,2:1='',<-1>,1:2] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyOptional.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyOptional.txt new file mode 100644 index 0000000000..5ece832975 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyOptional.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +CMT : '//' .*? '\n' CMT?; +WS : (' '|'\t')+; + +[input] +//blah +//blah + +[output] +[@0,0:13='//blah\n//blah\n',<1>,1:0] +[@1,14:13='',<-1>,3:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyPositiveClosure.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyPositiveClosure.txt new file mode 100644 index 0000000000..f031174d83 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/GreedyPositiveClosure.txt @@ -0,0 +1,16 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +CMT : ('//' .*? '\n')+; +WS : (' '|'\t')+; + +[input] +//blah +//blah + +[output] +[@0,0:13='//blah\n//blah\n',<1>,1:0] +[@1,14:13='',<-1>,3:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/HexVsID.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/HexVsID.txt new file mode 100644 index 0000000000..024bd4c043 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/HexVsID.txt @@ -0,0 +1,32 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +HexLiteral : '0' ('x'|'X') HexDigit+ ; +DecimalLiteral : ('0' | '1'..'9' '0'..'9'*) ; +FloatingPointLiteral : ('0x' | '0X') HexDigit* ('.' HexDigit*)? ; +DOT : '.' ; +ID : 'a'..'z'+ ; +fragment HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ; +WS : (' '|'\n')+; + +[input] +x 0 1 a.b a.l + +[output] +[@0,0:0='x',<5>,1:0] +[@1,1:1=' ',<6>,1:1] +[@2,2:2='0',<2>,1:2] +[@3,3:3=' ',<6>,1:3] +[@4,4:4='1',<2>,1:4] +[@5,5:5=' ',<6>,1:5] +[@6,6:6='a',<5>,1:6] +[@7,7:7='.',<4>,1:7] +[@8,8:8='b',<5>,1:8] +[@9,9:9=' ',<6>,1:9] +[@10,10:10='a',<5>,1:10] +[@11,11:11='.',<4>,1:11] +[@12,12:12='l',<5>,1:12] +[@13,13:12='',<-1>,1:13] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/KeywordID.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/KeywordID.txt new file mode 100644 index 0000000000..d5dba55a83 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/KeywordID.txt @@ -0,0 +1,22 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +KEND : 'end' ; // has priority +ID : 'a'..'z'+ ; +WS : (' '|'\n')+; + +[input] +end eend ending a + +[output] +[@0,0:2='end',<1>,1:0] +[@1,3:3=' ',<3>,1:3] +[@2,4:7='eend',<2>,1:4] +[@3,8:8=' ',<3>,1:8] +[@4,9:14='ending',<2>,1:9] +[@5,15:15=' ',<3>,1:15] +[@6,16:16='a',<2>,1:16] +[@7,17:16='',<-1>,1:17] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyClosure.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyClosure.txt new file mode 100644 index 0000000000..11a30c874f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyClosure.txt @@ -0,0 +1,17 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +CMT : '//' .*? '\n' CMT*?; +WS : (' '|'\t')+; + +[input] +//blah +//blah + +[output] +[@0,0:6='//blah\n',<1>,1:0] +[@1,7:13='//blah\n',<1>,2:0] +[@2,14:13='',<-1>,3:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyConfigs.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyConfigs.txt new file mode 100644 index 0000000000..316c5e9c25 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyConfigs.txt @@ -0,0 +1,19 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +I : .*? ('a' | 'ab') {} ; +WS : (' '|'\n') -> skip ; +J : . {}; + +[input] +ab + +[output] +a +b +[@0,0:0='a',<1>,1:0] +[@1,1:1='b',<3>,1:1] +[@2,2:1='',<-1>,1:2] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyOptional.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyOptional.txt new file mode 100644 index 0000000000..21dd16b944 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyOptional.txt @@ -0,0 +1,17 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +CMT : '//' .*? '\n' CMT??; +WS : (' '|'\t')+; + +[input] +//blah +//blah + +[output] +[@0,0:6='//blah\n',<1>,1:0] +[@1,7:13='//blah\n',<1>,2:0] +[@2,14:13='',<-1>,3:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyPositiveClosure.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyPositiveClosure.txt new file mode 100644 index 0000000000..670dc33e7f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyPositiveClosure.txt @@ -0,0 +1,17 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +CMT : ('//' .*? '\n')+?; +WS : (' '|'\t')+; + +[input] +//blah +//blah + +[output] +[@0,0:6='//blah\n',<1>,1:0] +[@1,7:13='//blah\n',<1>,2:0] +[@2,14:13='',<-1>,3:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyTermination1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyTermination1.txt new file mode 100644 index 0000000000..1791cdaca2 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyTermination1.txt @@ -0,0 +1,15 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +STRING : '!' ('!!' | .)*? '!'; + +[input] +!hi!!mom! + +[output] +[@0,0:3='!hi!',<1>,1:0] +[@1,4:8='!mom!',<1>,1:4] +[@2,9:8='',<-1>,1:9] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyTermination2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyTermination2.txt new file mode 100644 index 0000000000..23aa2ad78c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/NonGreedyTermination2.txt @@ -0,0 +1,14 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +STRING : '!' ('!!' | .)+? '!'; + +[input] +!!!mom! + +[output] +[@0,0:6='!!!mom!',<1>,1:0] +[@1,7:6='',<-1>,1:7] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/Parentheses.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/Parentheses.txt new file mode 100644 index 0000000000..be6a7f00ac --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/Parentheses.txt @@ -0,0 +1,25 @@ +[notes] +This is a regression test for antlr/antlr4#224: "Parentheses without +quantifier in lexer rules have unclear effect". +https://github.com/antlr/antlr4/issues/224 + +[type] +Lexer + +[grammar] +lexer grammar L; +START_BLOCK: '-.-.-'; +ID : (LETTER SEPARATOR) (LETTER SEPARATOR)+; +fragment LETTER: L_A|L_K; +fragment L_A: '.-'; +fragment L_K: '-.-'; +SEPARATOR: '!'; + +[input] +-.-.-! + +[output] +[@0,0:4='-.-.-',<1>,1:0] +[@1,5:5='!',<3>,1:5] +[@2,6:5='',<-1>,1:6] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/PositionAdjustingLexer.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/PositionAdjustingLexer.txt new file mode 100644 index 0000000000..f6fa740232 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/PositionAdjustingLexer.txt @@ -0,0 +1,63 @@ +[type] +Lexer + +[grammar] +lexer grammar PositionAdjustingLexer; + +@definitions { + +} + +@members { + +} + +ASSIGN : '=' ; +PLUS_ASSIGN : '+=' ; +LCURLY: '{'; + +// 'tokens' followed by '{' +TOKENS : 'tokens' IGNORED '{'; + +// IDENTIFIER followed by '+=' or '=' +LABEL + : IDENTIFIER IGNORED '+'? '=' + ; + +IDENTIFIER + : [a-zA-Z_] [a-zA-Z0-9_]* + ; + +fragment +IGNORED + : [ \t\r\n]* + ; + +NEWLINE + : [\r\n]+ -> skip + ; + +WS + : [ \t]+ -> skip + ; + +[input] +tokens +tokens { +notLabel +label1 = +label2 += +notLabel + +[output] +[@0,0:5='tokens',<6>,1:0] +[@1,7:12='tokens',<4>,2:0] +[@2,14:14='{',<3>,2:7] +[@3,16:23='notLabel',<6>,3:0] +[@4,25:30='label1',<5>,4:0] +[@5,32:32='=',<1>,4:7] +[@6,34:39='label2',<5>,5:0] +[@7,41:42='+=',<2>,5:7] +[@8,44:51='notLabel',<6>,6:0] +[@9,53:52='',<-1>,7:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/QuoteTranslation.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/QuoteTranslation.txt new file mode 100644 index 0000000000..7053bfe34b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/QuoteTranslation.txt @@ -0,0 +1,14 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +QUOTE : '"' ; // make sure this compiles + +[input] +" + +[output] +[@0,0:0='"',<1>,1:0] +[@1,1:0='',<-1>,1:1] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardPlus_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardPlus_1.txt new file mode 100644 index 0000000000..e617727d6a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardPlus_1.txt @@ -0,0 +1,20 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +CMT : '/*' (CMT | .)+? '*' '/' ; +WS : (' '|'\n')+; + +[input] +/* ick */ +/* /* */ +/* /*nested*/ */ + +[output] +[@0,0:8='/* ick */',<1>,1:0] +[@1,9:9='\n',<2>,1:9] +[@2,10:34='/* /* */\n/* /*nested*/ */',<1>,2:0] +[@3,35:35='\n',<2>,3:16] +[@4,36:35='',<-1>,4:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardPlus_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardPlus_2.txt new file mode 100644 index 0000000000..cdcab0efd6 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardPlus_2.txt @@ -0,0 +1,24 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +CMT : '/*' (CMT | .)+? '*' '/' ; +WS : (' '|'\n')+; + +[input] +/* ick */x +/* /* */x +/* /*nested*/ */x + +[output] +[@0,0:8='/* ick */',<1>,1:0] +[@1,10:10='\n',<2>,1:10] +[@2,11:36='/* /* */x\n/* /*nested*/ */',<1>,2:0] +[@3,38:38='\n',<2>,3:17] +[@4,39:38='',<-1>,4:0] + +[errors] +line 1:9 token recognition error at: 'x' +line 3:16 token recognition error at: 'x' + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardStar_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardStar_1.txt new file mode 100644 index 0000000000..c3dfca374f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardStar_1.txt @@ -0,0 +1,20 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +CMT : '/*' (CMT | .)*? '*' '/' ; +WS : (' '|'\n')+; + +[input] +/* ick */ +/* /* */ +/* /*nested*/ */ + +[output] +[@0,0:8='/* ick */',<1>,1:0] +[@1,9:9='\n',<2>,1:9] +[@2,10:34='/* /* */\n/* /*nested*/ */',<1>,2:0] +[@3,35:35='\n',<2>,3:16] +[@4,36:35='',<-1>,4:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardStar_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardStar_2.txt new file mode 100644 index 0000000000..7e218562f5 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RecursiveLexerRuleRefWithWildcardStar_2.txt @@ -0,0 +1,24 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +CMT : '/*' (CMT | .)*? '*' '/' ; +WS : (' '|'\n')+; + +[input] +/* ick */x +/* /* */x +/* /*nested*/ */x + +[output] +[@0,0:8='/* ick */',<1>,1:0] +[@1,10:10='\n',<2>,1:10] +[@2,11:36='/* /* */x\n/* /*nested*/ */',<1>,2:0] +[@3,38:38='\n',<2>,3:17] +[@4,39:38='',<-1>,4:0] + +[errors] +line 1:9 token recognition error at: 'x' +line 3:16 token recognition error at: 'x' + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RefToRuleDoesNotSetTokenNorEmitAnother.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RefToRuleDoesNotSetTokenNorEmitAnother.txt new file mode 100644 index 0000000000..ce8e67392f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/RefToRuleDoesNotSetTokenNorEmitAnother.txt @@ -0,0 +1,18 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +A : '-' I ; +I : '0'..'9'+ ; +WS : (' '|'\n') -> skip ; + +[input] +34 -21 3 + +[output] +[@0,0:1='34',<2>,1:0] +[@1,3:5='-21',<1>,1:3] +[@2,7:7='3',<2>,1:7] +[@3,8:7='',<-1>,1:8] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/ReservedWordsEscaping.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/ReservedWordsEscaping.txt new file mode 100644 index 0000000000..785f1644e3 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/ReservedWordsEscaping.txt @@ -0,0 +1,23 @@ +[notes] +https://github.com/antlr/antlr4/issues/1070 + +[type] +Lexer + +[grammar] +lexer grammar L; + +channels { break } + +A: 'a' -> mode(for); + +mode for; +B: 'b' -> channel(break); + +[input] +ab + +[output] +[@0,0:0='a',<1>,1:0] +[@1,1:1='b',<2>,channel=2,1:1] +[@2,2:1='',<-1>,1:2] diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/Slashes.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/Slashes.txt new file mode 100644 index 0000000000..c11711b96c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/Slashes.txt @@ -0,0 +1,21 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +Backslash : '\\\\'; +Slash : '/'; +Vee : '\\\\/'; +Wedge : '/\\\\'; +WS : [ \t] -> skip; + +[input] +\ / \/ /\ + +[output] +[@0,0:0='\',<1>,1:0] +[@1,2:2='/',<2>,1:2] +[@2,4:5='\/',<3>,1:4] +[@3,7:8='/\',<4>,1:7] +[@4,9:8='',<-1>,1:9] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/StackoverflowDueToNotEscapedHyphen.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/StackoverflowDueToNotEscapedHyphen.txt new file mode 100644 index 0000000000..56f7e5e1a0 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/StackoverflowDueToNotEscapedHyphen.txt @@ -0,0 +1,17 @@ +[notes] +https://github.com/antlr/antlr4/issues/1943 + +[type] +Lexer + +[grammar] +lexer grammar L; +WORD : [a-z-+]+; + +[input] +word + +[output] +[@0,0:3='word',<1>,1:0] +[@1,4:3='',<-1>,1:4] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/TokenType0xFFFF.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/TokenType0xFFFF.txt new file mode 100644 index 0000000000..9018111fe7 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/TokenType0xFFFF.txt @@ -0,0 +1,13 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +T_FFFF: 'FFFF' -> type(65535); + +[input] +FFFF + +[output] +[@0,0:3='FFFF',<65535>,1:0] +[@1,4:3='',<-1>,1:4] diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/UnicodeCharSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/UnicodeCharSet.txt new file mode 100644 index 0000000000..f697767d92 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/UnicodeCharSet.txt @@ -0,0 +1,17 @@ +[notes] +regression test for antlr/antlr4#1925 + +[type] +Lexer + +[grammar] +lexer grammar L; +ID : ([A-Z_]|'Ā'..'\uFFFC') ([A-Z_0-9]|'Ā'..'\uFFFC')*; // FFFD+ are not valid char + +[input] +均 + +[output] +[@0,0:0='均',<1>,1:0] +[@1,1:0='',<-1>,1:1] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/ZeroLengthToken.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/ZeroLengthToken.txt new file mode 100644 index 0000000000..f83d14a4e6 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/LexerExec/ZeroLengthToken.txt @@ -0,0 +1,28 @@ +[notes] +This is a regression test for antlr/antlr4#687 "Empty zero-length tokens +cannot have lexer commands" and antlr/antlr4#688 "Lexer cannot match +zero-length tokens" +https://github.com/antlr/antlr4/issues/687 +https://github.com/antlr/antlr4/issues/688 + +[type] +Lexer + +[grammar] +lexer grammar L; +BeginString + : '\'' -> more, pushMode(StringMode) + ; +mode StringMode; + StringMode_X : 'x' -> more; + StringMode_Done : -> more, mode(EndStringMode); +mode EndStringMode; + EndString : '\'' -> popMode; + +[input] +'xxx' + +[output] +[@0,0:4=''xxx'',<1>,1:0] +[@1,5:4='',<-1>,1:5] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/Basic.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/Basic.txt new file mode 100644 index 0000000000..e9f4efdbdd --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/Basic.txt @@ -0,0 +1,35 @@ +[type] +Parser + +[grammar] +grammar T; + + + + +s +@after { + + +} + : r=a ; +a : INT INT + | ID + ; +MULT: '*' ; +ADD : '+' ; +INT : [0-9]+ ; +ID : [a-z]+ ; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +1 2 + +[output] +(a 1 2) +1 +2 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/LR.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/LR.txt new file mode 100644 index 0000000000..8871c42145 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/LR.txt @@ -0,0 +1,39 @@ +[type] +Parser + +[grammar] +grammar T; + + + + +s +@after { + + +} + : r=e ; +e : e op='*' e + | e op='+' e + | INT + ; +MULT: '*' ; +ADD : '+' ; +INT : [0-9]+ ; +ID : [a-z]+ ; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +1+2*3 + +[output] +(e (e 1) + (e (e 2) * (e 3))) +1 +2 +3 +2 3 2 +1 2 1 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/LRWithLabels.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/LRWithLabels.txt new file mode 100644 index 0000000000..f5e2035e4c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/LRWithLabels.txt @@ -0,0 +1,38 @@ +[type] +Parser + +[grammar] +grammar T; + + + + +s +@after { + + +} + : r=e ; +e : e '(' eList ')' # Call + | INT # Int + ; +eList : e (',' e)* ; +MULT: '*' ; +ADD : '+' ; +INT : [0-9]+ ; +ID : [a-z]+ ; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +1(2,3) + +[output] +(e (e 1) ( (eList (e 2) , (e 3)) )) +1 +2 +3 +1 [13 6] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/RuleGetters_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/RuleGetters_1.txt new file mode 100644 index 0000000000..0993e38629 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/RuleGetters_1.txt @@ -0,0 +1,35 @@ +[type] +Parser + +[grammar] +grammar T; + + + + +s +@after { + + +} + : r=a ; +a : b b // forces list + | b // a list still + ; +b : ID | INT; +MULT: '*' ; +ADD : '+' ; +INT : [0-9]+ ; +ID : [a-z]+ ; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +1 2 + +[output] +(a (b 1) (b 2)) +1 2 1 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/RuleGetters_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/RuleGetters_2.txt new file mode 100644 index 0000000000..81cffff70e --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/RuleGetters_2.txt @@ -0,0 +1,35 @@ +[type] +Parser + +[grammar] +grammar T; + + + + +s +@after { + + +} + : r=a ; +a : b b // forces list + | b // a list still + ; +b : ID | INT; +MULT: '*' ; +ADD : '+' ; +INT : [0-9]+ ; +ID : [a-z]+ ; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +abc + +[output] +(a (b abc)) +abc + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/TokenGetters_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/TokenGetters_1.txt new file mode 100644 index 0000000000..96657bb41a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/TokenGetters_1.txt @@ -0,0 +1,34 @@ +[type] +Parser + +[grammar] +grammar T; + + + + +s +@after { + + +} + : r=a ; +a : INT INT + | ID + ; +MULT: '*' ; +ADD : '+' ; +INT : [0-9]+ ; +ID : [a-z]+ ; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +1 2 + +[output] +(a 1 2) +1 2 [1, 2] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/TokenGetters_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/TokenGetters_2.txt new file mode 100644 index 0000000000..008e7a7c56 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Listeners/TokenGetters_2.txt @@ -0,0 +1,34 @@ +[type] +Parser + +[grammar] +grammar T; + + + + +s +@after { + + +} + : r=a ; +a : INT INT + | ID + ; +MULT: '*' ; +ADD : '+' ; +INT : [0-9]+ ; +ID : [a-z]+ ; +WS : [ \t\n]+ -> skip ; + +[start] +s + +[input] +abc + +[output] +(a abc) +[@0,0:2='abc',<4>,1:0] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/AltNum.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/AltNum.txt new file mode 100644 index 0000000000..fa81083bf5 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/AltNum.txt @@ -0,0 +1,37 @@ +[type] +Parser + +[grammar] +grammar T; + +options { contextSuperClass=MyRuleNode; } + + + + +s +@init { + +} +@after { + +} + : r=a ; + +a : 'f' + | 'g' + | 'x' b 'z' + ; +b : 'e' {} | 'y' + ; + +[start] +s + +[input] +xyz + +[output] +"""(a:3 x (b:2 y) z) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/ExtraToken.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/ExtraToken.txt new file mode 100644 index 0000000000..172d14a692 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/ExtraToken.txt @@ -0,0 +1,32 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init { + +} +@after { + +} + : r=a ; +a : 'x' 'y' + ; +Z : 'z' + ; + +[start] +s + +[input] +xzy + +[output] +"""(a x z y) +""" + +[errors] +"""line 1:1 extraneous input 'z' expecting 'y' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/ExtraTokensAndAltLabels.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/ExtraTokensAndAltLabels.txt new file mode 100644 index 0000000000..75a49d3333 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/ExtraTokensAndAltLabels.txt @@ -0,0 +1,46 @@ +[type] +Parser + +[grammar] +grammar T; + +s +@init { + +} +@after { + +} + : '${' v '}' + ; + +v : A #altA + | B #altB + ; + +A : 'a' ; +B : 'b' ; + +WHITESPACE : [ \n\t\r]+ -> channel(HIDDEN) ; + +ERROR : . ; + +[start] +s + +[input] +${ ? a ?} + +[output] +"""(s ${ (v ? a) ? }) +""" + +[errors] +line 1:3 extraneous input '?' expecting {'a', 'b'} +line 1:7 extraneous input '?' expecting '}' + +[skip] +Cpp +Go +PHP + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/NoViableAlt.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/NoViableAlt.txt new file mode 100644 index 0000000000..24932bcab4 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/NoViableAlt.txt @@ -0,0 +1,32 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init { + +} +@after { + +} + : r=a ; +a : 'x' | 'y' + ; +Z : 'z' + ; + +[start] +s + +[input] +z + +[output] +"""(a z) +""" + +[errors] +"""line 1:0 mismatched input 'z' expecting {'x', 'y'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/RuleRef.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/RuleRef.txt new file mode 100644 index 0000000000..880749f7b1 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/RuleRef.txt @@ -0,0 +1,28 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init { + +} +@after { + +} + : r=a ; +a : b 'x' + ; +b : 'y' + ; + +[start] +s + +[input] +yx + +[output] +"""(a (b y) x) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/Sync.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/Sync.txt new file mode 100644 index 0000000000..e64edff226 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/Sync.txt @@ -0,0 +1,32 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init { + +} +@after { + +} + : r=a ; +a : 'x' 'y'* '!' + ; +Z : 'z' + ; + +[start] +s + +[input] +xzyy! + +[output] +"""(a x z y y !) +""" + +[errors] +"""line 1:1 extraneous input 'z' expecting {'y', '!'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/Token2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/Token2.txt new file mode 100644 index 0000000000..53eb9fa3ca --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/Token2.txt @@ -0,0 +1,26 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init { + +} +@after { + +} + : r=a ; +a : 'x' 'y' + ; + +[start] +s + +[input] +xy + +[output] +"""(a x y) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/TokenAndRuleContextString.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/TokenAndRuleContextString.txt new file mode 100644 index 0000000000..4bedcc7aee --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/TokenAndRuleContextString.txt @@ -0,0 +1,27 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init { + +} +@after { + +} + : r=a ; +a : 'x' { + +} ; + +[start] +s + +[input] +x + +[output] +[a, s] +(a x) + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/TwoAltLoop.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/TwoAltLoop.txt new file mode 100644 index 0000000000..0c71e39420 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/TwoAltLoop.txt @@ -0,0 +1,26 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init { + +} +@after { + +} + : r=a ; +a : ('x' | 'y')* 'z' + ; + +[start] +s + +[input] +xyyxyxz + +[output] +"""(a x y y x y x z) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/TwoAlts.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/TwoAlts.txt new file mode 100644 index 0000000000..a91cf76ba2 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParseTrees/TwoAlts.txt @@ -0,0 +1,26 @@ +[type] +Parser + +[grammar] +grammar T; +s +@init { + +} +@after { + +} + : r=a ; +a : 'x' | 'y' + ; + +[start] +s + +[input] +y + +[output] +"""(a y) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ConjuringUpToken.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ConjuringUpToken.txt new file mode 100644 index 0000000000..ec932d59b0 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ConjuringUpToken.txt @@ -0,0 +1,21 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' x='b' {} 'c' ; + +[start] +a + +[input] +ac + +[output] +"""conjured=[@-1,-1:-1='',<2>,1:1] +""" + +[errors] +"""line 1:1 missing 'b' at 'c' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ConjuringUpTokenFromSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ConjuringUpTokenFromSet.txt new file mode 100644 index 0000000000..59e9286204 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ConjuringUpTokenFromSet.txt @@ -0,0 +1,21 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' x=('b'|'c') {} 'd' ; + +[start] +a + +[input] +ad + +[output] +"""conjured=[@-1,-1:-1='',<2>,1:1] +""" + +[errors] +"""line 1:1 missing {'b', 'c'} at 'd' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ContextListGetters.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ContextListGetters.txt new file mode 100644 index 0000000000..ce9f4ab7fb --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ContextListGetters.txt @@ -0,0 +1,26 @@ +[notes] +Regression test for "Getter for context is not a list when it should be". +https://github.com/antlr/antlr4/issues/19 + +[type] +Parser + +[grammar] +grammar T; +@parser::members{ + +} +s : (a | b)+; +a : 'a' {}; +b : 'b' {}; + +[start] +s + +[input] +abab + +[output] +"""abab +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_1.txt new file mode 100644 index 0000000000..c1ec872a5b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_1.txt @@ -0,0 +1,16 @@ +[type] +Parser + +[grammar] +grammar T; +start : expr EOF; +expr : 'x' + | expr expr + ; + +[start] +start + +[input] +x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_2.txt new file mode 100644 index 0000000000..a6b4a7a4f7 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_2.txt @@ -0,0 +1,16 @@ +[type] +Parser + +[grammar] +grammar T; +start : expr EOF; +expr : 'x' + | expr expr + ; + +[start] +start + +[input] +xx + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_3.txt new file mode 100644 index 0000000000..46738d3e24 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_3.txt @@ -0,0 +1,16 @@ +[type] +Parser + +[grammar] +grammar T; +start : expr EOF; +expr : 'x' + | expr expr + ; + +[start] +start + +[input] +xxx + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_4.txt new file mode 100644 index 0000000000..e5b8bddc5c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/DuplicatedLeftRecursiveCall_4.txt @@ -0,0 +1,16 @@ +[type] +Parser + +[grammar] +grammar T; +start : expr EOF; +expr : 'x' + | expr expr + ; + +[start] +start + +[input] +xxxx + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ExtraneousInput.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ExtraneousInput.txt new file mode 100644 index 0000000000..7db6198596 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/ExtraneousInput.txt @@ -0,0 +1,31 @@ +[type] +Parser + +[grammar] +grammar T; + +member : 'a'; +body : member*; +file : body EOF; +B : 'b'; + +[start] +file + +[input] +baa + +[output] + +[errors] +"""line 1:0 mismatched input 'b' expecting {, 'a'} +""" + +[skip] +Cpp +CSharp +Go +Node +PHP +Python2 +Python3 diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/InvalidATNStateRemoval.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/InvalidATNStateRemoval.txt new file mode 100644 index 0000000000..f843359231 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/InvalidATNStateRemoval.txt @@ -0,0 +1,23 @@ +[notes] +This is a regression test for #45 "NullPointerException in ATNConfig.hashCode". +https://github.com/antlr/antlr4/issues/45 +The original cause of this issue was an error in the tool's ATN state optimization, +which is now detected early in {@link ATNSerializer} by ensuring that all +serialized transitions point to states which were not removed. + +[type] +Parser + +[grammar] +grammar T; +start : ID ':' expr; +expr : primary expr? {} | expr '->' ID; +primary : ID; +ID : [a-z]+; + +[start] +start + +[input] +x:x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/InvalidEmptyInput.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/InvalidEmptyInput.txt new file mode 100644 index 0000000000..4a149b2d3b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/InvalidEmptyInput.txt @@ -0,0 +1,22 @@ +[notes] +This is a regression test for #6 "NullPointerException in getMissingSymbol". +https://github.com/antlr/antlr4/issues/6 + +[type] +Parser + +[grammar] +grammar T; +start : ID+; +ID : [a-z]+; + +[start] +start + +[input] + + +[errors] +"""line 1:0 mismatched input '' expecting ID +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LL1ErrorInfo.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LL1ErrorInfo.txt new file mode 100644 index 0000000000..958cabc892 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LL1ErrorInfo.txt @@ -0,0 +1,29 @@ +[type] +Parser + +[grammar] +grammar T; +start : animal (AND acClass)? service EOF; +animal : (DOG | CAT ); +service : (HARDWARE | SOFTWARE) ; +AND : 'and'; +DOG : 'dog'; +CAT : 'cat'; +HARDWARE: 'hardware'; +SOFTWARE: 'software'; +WS : ' ' -> skip ; +acClass +@init +{} + : ; + +[start] +start + +[input] +dog and software + +[output] +"""{'hardware', 'software'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LL2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LL2.txt new file mode 100644 index 0000000000..a75c2c9322 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LL2.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' 'b' + | 'a' 'c' +; +q : 'e' ; + +[start] +a + +[input] +ae + +[errors] +"""line 1:1 no viable alternative at input 'ae' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LL3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LL3.txt new file mode 100644 index 0000000000..0d41bb0ce1 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LL3.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' 'b'* 'c' + | 'a' 'b' 'd' +; +q : 'e' ; + +[start] +a + +[input] +abe + +[errors] +"""line 1:2 no viable alternative at input 'abe' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LLStar.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LLStar.txt new file mode 100644 index 0000000000..65ebf91fea --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/LLStar.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a'+ 'b' + | 'a'+ 'c' +; +q : 'e' ; + +[start] +a + +[input] +aaae + +[errors] +"""line 1:3 no viable alternative at input 'aaae' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionBeforeLoop.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionBeforeLoop.txt new file mode 100644 index 0000000000..18791af00b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionBeforeLoop.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' 'b'* 'c'; + +[start] +a + +[input] +aacabc + +[errors] +"""line 1:1 extraneous input 'a' expecting {'b', 'c'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionBeforeLoop2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionBeforeLoop2.txt new file mode 100644 index 0000000000..85cded2dfe --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionBeforeLoop2.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' ('b'|'z'{})* 'c'; + +[start] +a + +[input] +aacabc + +[errors] +"""line 1:1 extraneous input 'a' expecting {'b', 'z', 'c'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionDuringLoop.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionDuringLoop.txt new file mode 100644 index 0000000000..faba53c978 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionDuringLoop.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' 'b'* 'c' ; + +[start] +a + +[input] +abaaababc + +[errors] +line 1:2 extraneous input 'a' expecting {'b', 'c'} +line 1:6 extraneous input 'a' expecting {'b', 'c'} + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionDuringLoop2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionDuringLoop2.txt new file mode 100644 index 0000000000..cf08e3c996 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/MultiTokenDeletionDuringLoop2.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' ('b'|'z'{})* 'c' ; + +[start] +a + +[input] +abaaababc + +[errors] +line 1:2 extraneous input 'a' expecting {'b', 'z', 'c'} +line 1:6 extraneous input 'a' expecting {'b', 'z', 'c'} + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/NoViableAltAvoidance.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/NoViableAltAvoidance.txt new file mode 100644 index 0000000000..3347ec820c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/NoViableAltAvoidance.txt @@ -0,0 +1,22 @@ +[type] +Parser + +[grammar] +grammar T; +s : e '!' ; +e : 'a' 'b' + | 'a' + ; +DOT : '.' ; +WS : [ \t\r\n]+ -> skip; + +[start] +s + +[input] +a. + +[errors] +"""line 1:1 mismatched input '.' expecting '!' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleSetInsertion.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleSetInsertion.txt new file mode 100644 index 0000000000..ce1b18a09f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleSetInsertion.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' ('b'|'c') 'd' ; + +[start] +a + +[input] +ad + +[errors] +"""line 1:1 missing {'b', 'c'} at 'd' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleSetInsertionConsumption.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleSetInsertionConsumption.txt new file mode 100644 index 0000000000..8c93a644e3 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleSetInsertionConsumption.txt @@ -0,0 +1,22 @@ +[type] +Parser + +[grammar] +grammar T; +myset: ('b'|'c') ; +a: 'a' myset 'd' {} ; + +[start] +a + +[input] +ad + +[output] +"""[@0,0:0='a',<3>,1:0] +""" + +[errors] +"""line 1:1 missing {'b', 'c'} at 'd' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletion.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletion.txt new file mode 100644 index 0000000000..8ec847bf61 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletion.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' 'b' ; + +[start] +a + +[input] +aab + +[errors] +"""line 1:1 extraneous input 'a' expecting 'b' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforeAlt.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforeAlt.txt new file mode 100644 index 0000000000..900ac4d8b9 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforeAlt.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : ('b' | 'c') +; +q : 'a' +; + +[start] +a + +[input] +ac + +[errors] +"""line 1:0 extraneous input 'a' expecting {'b', 'c'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforeLoop.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforeLoop.txt new file mode 100644 index 0000000000..5d6b7958bb --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforeLoop.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' 'b'* EOF ; + +[start] +a + +[input] +aabc + +[errors] +line 1:1 extraneous input 'a' expecting {, 'b'} +line 1:3 token recognition error at: 'c' + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforeLoop2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforeLoop2.txt new file mode 100644 index 0000000000..aef8200492 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforeLoop2.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' ('b'|'z'{})* EOF ; + +[start] +a + +[input] +aabc + +[errors] +line 1:1 extraneous input 'a' expecting {, 'b', 'z'} +line 1:3 token recognition error at: 'c' + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforePredict.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforePredict.txt new file mode 100644 index 0000000000..826697e877 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionBeforePredict.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a'+ 'b' + | 'a'+ 'c' +; +q : 'e' ; + +[start] +a + +[input] +caaab + +[errors] +"""line 1:0 extraneous input 'c' expecting 'a' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionConsumption.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionConsumption.txt new file mode 100644 index 0000000000..c9f1b4a1db --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionConsumption.txt @@ -0,0 +1,22 @@ +[type] +Parser + +[grammar] +grammar T; +myset: ('b'|'c') ; +a: 'a' myset 'd' {} ; + +[start] +a + +[input] +aabd + +[output] +"""[@2,2:2='b',<1>,1:2] +""" + +[errors] +"""line 1:1 extraneous input 'a' expecting {'b', 'c'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionDuringLoop.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionDuringLoop.txt new file mode 100644 index 0000000000..c0d99d5aa2 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionDuringLoop.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' 'b'* 'c' ; + +[start] +a + +[input] +ababbc + +[errors] +"""line 1:2 extraneous input 'a' expecting {'b', 'c'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionDuringLoop2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionDuringLoop2.txt new file mode 100644 index 0000000000..aad9f70524 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionDuringLoop2.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' ('b'|'z'{})* 'c' ; + +[start] +a + +[input] +ababbc + +[errors] +"""line 1:2 extraneous input 'a' expecting {'b', 'z', 'c'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionExpectingSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionExpectingSet.txt new file mode 100644 index 0000000000..6715ab68c8 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenDeletionExpectingSet.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' ('b'|'c') ; + +[start] +a + +[input] +aab + +[errors] +"""line 1:1 extraneous input 'a' expecting {'b', 'c'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenInsertion.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenInsertion.txt new file mode 100644 index 0000000000..4e40faf8d3 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/SingleTokenInsertion.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' 'b' 'c' ; + +[start] +a + +[input] +ac + +[errors] +"""line 1:1 missing 'b' at 'c' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/TokenMismatch.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/TokenMismatch.txt new file mode 100644 index 0000000000..2469359247 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/TokenMismatch.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : 'a' 'b' ; + +[start] +a + +[input] +aa + +[errors] +"""line 1:1 mismatched input 'a' expecting 'b' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/TokenMismatch2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/TokenMismatch2.txt new file mode 100644 index 0000000000..7163ec7cef --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/TokenMismatch2.txt @@ -0,0 +1,24 @@ +[type] +Parser + +[grammar] +grammar T; + +stat: ( '(' expr? ')' )? EOF ; +expr: ID '=' STR ; + +ERR : '~FORCE_ERROR~' ; +ID : [a-zA-Z]+ ; +STR : '"' ~["]* '"' ; +WS : [ \t\r\n]+ -> skip ; + +[start] +stat + +[input] +"""( ~FORCE_ERROR~ """ + +[errors] +"""line 1:2 mismatched input '~FORCE_ERROR~' expecting {')', ID} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/TokenMismatch3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/TokenMismatch3.txt new file mode 100644 index 0000000000..afe6fdfe72 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserErrors/TokenMismatch3.txt @@ -0,0 +1,38 @@ +[type] +Parser + +[grammar] +grammar T; + +expression +: value +| expression op=AND expression +| expression op=OR expression +; +value +: BOOLEAN_LITERAL +| ID +| ID1 +| '(' expression ')' +; + +AND : '&&'; +OR : '||'; + +BOOLEAN_LITERAL : 'true' | 'false'; + +ID : [a-z]+; +ID1 : '$'; + +WS : [ \t\r\n]+ -> skip ; + +[start] +expression + +[input] + + +[errors] +"""line 1:0 mismatched input '' expecting {'(', BOOLEAN_LITERAL, ID, '$'} +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/APlus.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/APlus.txt new file mode 100644 index 0000000000..58941a2780 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/APlus.txt @@ -0,0 +1,21 @@ +[type] +Parser + +[grammar] +grammar T; +a : ID+ { + +}; +ID : 'a'..'z'+; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] +a b c + +[output] +"""abc +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AStar_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AStar_1.txt new file mode 100644 index 0000000000..5a398756c3 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AStar_1.txt @@ -0,0 +1,21 @@ +[type] +Parser + +[grammar] +grammar T; +a : ID* { + +}; +ID : 'a'..'z'+; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] + + +[output] +""" +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AStar_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AStar_2.txt new file mode 100644 index 0000000000..a6f3796568 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AStar_2.txt @@ -0,0 +1,21 @@ +[type] +Parser + +[grammar] +grammar T; +a : ID* { + +}; +ID : 'a'..'z'+; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] +a b c + +[output] +"""abc +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorAPlus.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorAPlus.txt new file mode 100644 index 0000000000..1b5ceddc25 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorAPlus.txt @@ -0,0 +1,21 @@ +[type] +Parser + +[grammar] +grammar T; +a : (ID|ID)+ { + +}; +ID : 'a'..'z'+; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] +a b c + +[output] +"""abc +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorAStar_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorAStar_1.txt new file mode 100644 index 0000000000..4f325d695f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorAStar_1.txt @@ -0,0 +1,21 @@ +[type] +Parser + +[grammar] +grammar T; +a : (ID|ID)* { + +}; +ID : 'a'..'z'+; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] + + +[output] +""" +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorAStar_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorAStar_2.txt new file mode 100644 index 0000000000..24d74cb079 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorAStar_2.txt @@ -0,0 +1,21 @@ +[type] +Parser + +[grammar] +grammar T; +a : (ID|ID)* { + +}; +ID : 'a'..'z'+; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] +a b c + +[output] +"""abc +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorB.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorB.txt new file mode 100644 index 0000000000..f32b5e6ccd --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorB.txt @@ -0,0 +1,24 @@ +[type] +Parser + +[grammar] +grammar T; +a : ID { + +} | INT { + +}; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\\n') -> skip ; + +[start] +a + +[input] +34 + +[output] +"""alt 2 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorBPlus.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorBPlus.txt new file mode 100644 index 0000000000..3837de3b49 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorBPlus.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +a : (ID|INT{ +})+ { + +}; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\\n') -> skip ; + +[start] +a + +[input] +a 34 c + +[output] +"""a34c +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorBStar_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorBStar_1.txt new file mode 100644 index 0000000000..3fc94004c6 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorBStar_1.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +a : (ID|INT{ +})* { + +}; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\\n') -> skip ; + +[start] +a + +[input] + + +[output] +""" +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorBStar_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorBStar_2.txt new file mode 100644 index 0000000000..4d854cb691 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/AorBStar_2.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +a : (ID|INT{ +})* { + +}; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\\n') -> skip ; + +[start] +a + +[input] +a 34 c + +[output] +"""a34c +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Basic.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Basic.txt new file mode 100644 index 0000000000..3683a22f4c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Basic.txt @@ -0,0 +1,22 @@ +[type] +Parser + +[grammar] +grammar T; +a : ID INT { + +}; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] +abc 34 + +[output] +"""abc34 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseGreedyBinding1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseGreedyBinding1.txt new file mode 100644 index 0000000000..b29138d048 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseGreedyBinding1.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +start : statement+ ; +statement : 'x' | ifStatement; +ifStatement : 'if' 'y' statement ('else' statement)? { + +}; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> channel(HIDDEN); + +[start] +start + +[input] +if y if y x else x + +[output] +if y x else x +if y if y x else x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseGreedyBinding2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseGreedyBinding2.txt new file mode 100644 index 0000000000..3d5b342fbb --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseGreedyBinding2.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +start : statement+ ; +statement : 'x' | ifStatement; +ifStatement : 'if' 'y' statement ('else' statement|) { + +}; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> channel(HIDDEN); + +[start] +start + +[input] +if y if y x else x + +[output] +if y x else x +if y if y x else x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseNonGreedyBinding1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseNonGreedyBinding1.txt new file mode 100644 index 0000000000..da1583410c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseNonGreedyBinding1.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +start : statement+ ; +statement : 'x' | ifStatement; +ifStatement : 'if' 'y' statement ('else' statement)?? { + +}; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> channel(HIDDEN); + +[start] +start + +[input] +if y if y x else x + +[output] +if y x +if y if y x else x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseNonGreedyBinding2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseNonGreedyBinding2.txt new file mode 100644 index 0000000000..ca8d7826a5 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/IfIfElseNonGreedyBinding2.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +start : statement+ ; +statement : 'x' | ifStatement; +ifStatement : 'if' 'y' statement (|'else' statement) { + +}; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> channel(HIDDEN); + +[start] +start + +[input] +if y if y x else x + +[output] +if y x +if y if y x else x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/LL1OptionalBlock_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/LL1OptionalBlock_1.txt new file mode 100644 index 0000000000..e33efa3aba --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/LL1OptionalBlock_1.txt @@ -0,0 +1,22 @@ +[type] +Parser + +[grammar] +grammar T; +a : (ID|{}INT)? { + +}; +ID : 'a'..'z'+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] + + +[output] +""" +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/LL1OptionalBlock_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/LL1OptionalBlock_2.txt new file mode 100644 index 0000000000..319abe22d4 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/LL1OptionalBlock_2.txt @@ -0,0 +1,22 @@ +[type] +Parser + +[grammar] +grammar T; +a : (ID|{}INT)? { + +}; +ID : 'a'..'z'+; +INT : '0'..'9'+ ; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] +a + +[output] +"""a +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/LabelAliasingAcrossLabeledAlternatives.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/LabelAliasingAcrossLabeledAlternatives.txt new file mode 100644 index 0000000000..88145142c4 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/LabelAliasingAcrossLabeledAlternatives.txt @@ -0,0 +1,28 @@ +[notes] +This is a regression test for antlr/antlr4#195 "label 'label' type +mismatch with previous definition: TOKEN_LABEL!=RULE_LABEL" +https://github.com/antlr/antlr4/issues/195 + +[type] +Parser + +[grammar] +grammar T; +start : a* EOF; +a + : label=subrule {} #One + | label='y' {} #Two + ; +subrule : 'x'; +WS : (' '|'\n') -> skip ; + +[start] +start + +[input] +xy + +[output] +x +y + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Labels.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Labels.txt new file mode 100644 index 0000000000..3b4a534a43 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Labels.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : b1=b b2+=b* b3+=';' ; +b : id_=ID val+=INT*; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +a + +[input] +abc 34; + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ListLabelForClosureContext.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ListLabelForClosureContext.txt new file mode 100644 index 0000000000..6b964f0a9c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ListLabelForClosureContext.txt @@ -0,0 +1,35 @@ +[notes] +This is a regression test for antlr/antlr4#299 "Repeating subtree not +accessible in visitor". https://github.com/antlr/antlr4/issues/299 + +[type] +Parser + +[grammar] +grammar T; +ifStatement +@after { +})> +} + : 'if' expression + ( ( 'then' + executableStatement* + elseIfStatement* // \<--- problem is here; should yield a list not node + elseStatement? + 'end' 'if' + ) | executableStatement ) + ; + +elseIfStatement + : 'else' 'if' expression 'then' executableStatement* + ; +expression : 'a' ; +executableStatement : 'a' ; +elseStatement : 'a' ; + +[start] +expression + +[input] +a + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ListLabelsOnSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ListLabelsOnSet.txt new file mode 100644 index 0000000000..cf4d8dbced --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ListLabelsOnSet.txt @@ -0,0 +1,22 @@ +[notes] +This is a regression test for #270 "Fix operator += applied to a set of +tokens". https://github.com/antlr/antlr4/issues/270 + +[type] +Parser + +[grammar] +grammar T; +a : b b* ';' ; +b : ID val+=(INT | FLOAT)*; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +FLOAT : [0-9]+ '.' [0-9]+; +WS : (' '|'\n') -> skip ; + +[start] +a + +[input] +abc 34; + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/MultipleEOFHandling.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/MultipleEOFHandling.txt new file mode 100644 index 0000000000..3d400f415a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/MultipleEOFHandling.txt @@ -0,0 +1,18 @@ +[notes] +This test ensures that {@link ParserATNSimulator} produces a correct +result when the grammar contains multiple explicit references to +{@code EOF} inside of parser rules. + +[type] +Parser + +[grammar] +grammar T; +prog : ('x' | 'x' 'y') EOF EOF; + +[start] +prog + +[input] +x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OpenDeviceStatement_Case1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OpenDeviceStatement_Case1.txt new file mode 100644 index 0000000000..f7d7f92713 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OpenDeviceStatement_Case1.txt @@ -0,0 +1,28 @@ +[notes] +This is a regression test for antlr/antlr4#1545, case 1. + +[type] +Parser + +[grammar] +grammar OpenDeviceStatement; +program : statement+ '.' ; + +statement : 'OPEN' ( 'DEVICE' ( OPT1 | OPT2 | OPT3 )? )+ {} ; + +OPT1 : 'OPT-1'; +OPT2 : 'OPT-2'; +OPT3 : 'OPT-3'; + +WS : (' '|'\n')+ -> channel(HIDDEN); + +[start] +statement + +[input] +OPEN DEVICE DEVICE + +[output] +"""OPEN DEVICE DEVICE +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OpenDeviceStatement_Case2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OpenDeviceStatement_Case2.txt new file mode 100644 index 0000000000..ee46983ec9 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OpenDeviceStatement_Case2.txt @@ -0,0 +1,28 @@ +[notes] +This is a regression test for antlr/antlr4#1545, case 2. + +[type] +Parser + +[grammar] +grammar OpenDeviceStatement; +program : statement+ '.' ; + +statement : 'OPEN' ( 'DEVICE' ( (OPT1) | OPT2 | OPT3 )? )+ {} ; + +OPT1 : 'OPT-1'; +OPT2 : 'OPT-2'; +OPT3 : 'OPT-3'; + +WS : (' '|'\n')+ -> channel(HIDDEN); + +[start] +statement + +[input] +OPEN DEVICE DEVICE + +[output] +"""OPEN DEVICE DEVICE +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OpenDeviceStatement_Case3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OpenDeviceStatement_Case3.txt new file mode 100644 index 0000000000..bb64b10973 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OpenDeviceStatement_Case3.txt @@ -0,0 +1,28 @@ +[notes] +This is a regression test for antlr/antlr4#1545, case 3. + +[type] +Parser + +[grammar] +grammar OpenDeviceStatement; +program : statement+ '.' ; + +statement : 'OPEN' ( 'DEVICE' ( (OPT1) | OPT2 | OPT3 )? )+ {} ; + +OPT1 : 'OPT-1'; +OPT2 : 'OPT-2'; +OPT3 : 'OPT-3'; + +WS : (' '|'\n')+ -> channel(HIDDEN); + +[start] +statement + +[input] +OPEN DEVICE DEVICE. + +[output] +"""OPEN DEVICE DEVICE +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_1.txt new file mode 100644 index 0000000000..15bc560a4c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_1.txt @@ -0,0 +1,19 @@ +[notes] +This test is meant to detect regressions of bug antlr/antlr4#41. +https://github.com/antlr/antlr4/issues/41 + +[type] +Parser + +[grammar] +grammar T; +stat : ifstat | 'x'; +ifstat : 'if' stat ('else' stat)?; +WS : [ \n\t]+ -> skip ; + +[start] +stat + +[input] +x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_2.txt new file mode 100644 index 0000000000..e12700202a --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_2.txt @@ -0,0 +1,19 @@ +[notes] +This test is meant to detect regressions of bug antlr/antlr4#41. +https://github.com/antlr/antlr4/issues/41 + +[type] +Parser + +[grammar] +grammar T; +stat : ifstat | 'x'; +ifstat : 'if' stat ('else' stat)?; +WS : [ \n\t]+ -> skip ; + +[start] +stat + +[input] +if x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_3.txt new file mode 100644 index 0000000000..f6f1a2e691 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_3.txt @@ -0,0 +1,19 @@ +[notes] +This test is meant to detect regressions of bug antlr/antlr4#41. +https://github.com/antlr/antlr4/issues/41 + +[type] +Parser + +[grammar] +grammar T; +stat : ifstat | 'x'; +ifstat : 'if' stat ('else' stat)?; +WS : [ \n\t]+ -> skip ; + +[start] +stat + +[input] +if x else x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_4.txt new file mode 100644 index 0000000000..257940d939 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Optional_4.txt @@ -0,0 +1,19 @@ +[notes] +This test is meant to detect regressions of bug antlr/antlr4#41. +https://github.com/antlr/antlr4/issues/41 + +[type] +Parser + +[grammar] +grammar T; +stat : ifstat | 'x'; +ifstat : 'if' stat ('else' stat)?; +WS : [ \n\t]+ -> skip ; + +[start] +stat + +[input] +if if x else x + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OrderingPredicates.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OrderingPredicates.txt new file mode 100644 index 0000000000..bc238266b7 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/OrderingPredicates.txt @@ -0,0 +1,33 @@ +[notes] +This is a regression test for antlr/antlr4#2301. + +[type] +Parser + +[grammar] +grammar Issue2301; + +SPACES: [ \t\r\n]+ -> skip; + +AT: 'AT'; +X : 'X'; +Y : 'Y'; + +ID: [A-Z]+; + +constant +: 'DUMMY' +; + +expr +: ID constant? +| expr AT X +| expr AT Y +; + +[start] +expr + +[input] +POINT AT X + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ParserProperty.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ParserProperty.txt new file mode 100644 index 0000000000..6dcc3975dd --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ParserProperty.txt @@ -0,0 +1,25 @@ +[notes] +This is a regression test for antlr/antlr4#561 "Issue with parser +generation in 4.2.2" https://github.com/antlr/antlr4/issues/561 + +[type] +Parser + +[grammar] +grammar T; + +a : {}? ID {} + ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip ; + +[start] +a + +[input] +abc + +[output] +"""valid +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/PredicatedIfIfElse.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/PredicatedIfIfElse.txt new file mode 100644 index 0000000000..b131fbe9de --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/PredicatedIfIfElse.txt @@ -0,0 +1,22 @@ +[notes] +This test is meant to test the expected solution to antlr/antlr4#42. +https://github.com/antlr/antlr4/issues/42 + +[type] +Parser + +[grammar] +grammar T; +s : stmt EOF ; +stmt : ifStmt | ID; +ifStmt : 'if' ID stmt ('else' stmt | { })> }?); +ELSE : 'else'; +ID : [a-zA-Z]+; +WS : [ \\n\\t]+ -> skip; + +[start] +s + +[input] +if x if x a else b + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/PredictionIssue334.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/PredictionIssue334.txt new file mode 100644 index 0000000000..4ec1088bc6 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/PredictionIssue334.txt @@ -0,0 +1,32 @@ +[notes] +This is a regression test for antlr/antlr4#334 "BailErrorStrategy: bails +on proper input". https://github.com/antlr/antlr4/issues/334 + +[type] +Parser + +[grammar] +grammar T; +file_ @init{ + +} +@after { + +} + : item (SEMICOLON item)* SEMICOLON? EOF ; +item : A B?; +SEMICOLON: ';'; +A : 'a'|'A'; +B : 'b'|'B'; +WS : [ \r\t\n]+ -> skip; + +[start] +file_ + +[input] +a + +[output] +"""(file_ (item a) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ReferenceToATN_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ReferenceToATN_1.txt new file mode 100644 index 0000000000..db1855b1ee --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ReferenceToATN_1.txt @@ -0,0 +1,24 @@ +[notes] +This is a regression test for antlr/antlr4#561 "Issue with parser +generation in 4.2.2" https://github.com/antlr/antlr4/issues/561 + +[type] +Parser + +[grammar] +grammar T; +a : (ID|ATN)* ATN? {} ; +ID : 'a'..'z'+ ; +ATN : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +a + +[input] + + +[output] +""" +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ReferenceToATN_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ReferenceToATN_2.txt new file mode 100644 index 0000000000..9e12a9ea3c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ReferenceToATN_2.txt @@ -0,0 +1,24 @@ +[notes] +This is a regression test for antlr/antlr4#561 "Issue with parser +generation in 4.2.2" https://github.com/antlr/antlr4/issues/561 + +[type] +Parser + +[grammar] +grammar T; +a : (ID|ATN)* ATN? {} ; +ID : 'a'..'z'+ ; +ATN : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +a + +[input] +a 34 c + +[output] +"""a34c +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ReservedWordsEscaping.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ReservedWordsEscaping.txt new file mode 100644 index 0000000000..7ae27a5233 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/ReservedWordsEscaping.txt @@ -0,0 +1,39 @@ +[notes] +https://github.com/antlr/antlr4/issues/1070 + +[type] +Parser + +[grammar] +grammar G; + +root + : {0==0}? continue+ {} + ; + +continue returns [int return] + : for for? {1==1}? #else + | break=BREAK BREAK+ (for | IF) #else + | if+=IF if+=IF* #int + | continue CONTINUE_ {} #class + ; + +args[int else] locals [int return] + : for + ; + +for: FOR; +FOR: 'for '; +BREAK: 'break '; +IF: 'if '; +CONTINUE_: 'continue'; + +[start] +root + +[input] +for for break break for if if for continue + +[output] +"""for for break break for if if for continue +""" \ No newline at end of file diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/TokenOffset.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/TokenOffset.txt new file mode 100644 index 0000000000..e80800b594 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/TokenOffset.txt @@ -0,0 +1,29 @@ +[notes] +This is a regression test for antlr/antlr4#2728 +It should generate correct code for grammars with more than 65 tokens. +https://github.com/antlr/antlr4/pull/2728#issuecomment-622940562 + +[type] +Parser + +[grammar] +grammar L; +a : ('1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'|'10'|'11'|'12'|'13'|'14'|'15'|'16' +|'17'|'18'|'19'|'20'|'21'|'22'|'23'|'24'|'25'|'26'|'27'|'28'|'29'|'30'|'31'|'32' +|'33'|'34'|'35'|'36'|'37'|'38'|'39'|'40'|'41'|'42'|'43'|'44'|'45'|'46'|'47'|'48' +|'49'|'50'|'51'|'52'|'53'|'54'|'55'|'56'|'57'|'58'|'59'|'60'|'61'|'62'|'63'|'64' +|'65'|'66')+ { + +}; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] +12 34 56 66 + +[output] +"""12345666 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Wildcard.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Wildcard.txt new file mode 100644 index 0000000000..f84bbd8a64 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/ParserExec/Wildcard.txt @@ -0,0 +1,26 @@ +[notes] +Match assignments, ignore other tokens with wildcard. + +[type] +Parser + +[grammar] +grammar T; +a : (assign|.)+ EOF ; +assign : ID '=' INT ';' { + +} ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip; + +[start] +a + +[input] +x=10; abc;;;; y=99; + +[output] +x=10; +y=99; + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_1.txt new file mode 100644 index 0000000000..25866b809e --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_1.txt @@ -0,0 +1,45 @@ +[notes] +for https://github.com/antlr/antlr4/issues/1398. +Seeing through a large expression takes 5 _minutes_ on +my fast box to complete. After fix, it's instantaneous. + +[type] +Parser + +[grammar] +grammar Expr; + +stat : expr ';' + | expr '.' + ; + +expr + : ID + | 'not' expr + | expr 'and' expr + | expr 'or' expr + | '(' ID ')' expr + | expr '?' expr ':' expr + | 'between' expr 'and' expr + ; + +ID: [a-zA-Z_][a-zA-Z_0-9]*; +WS: [ \t\n\r\f]+ -> skip; + +[start] +stat + +[input] +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 +; + +[skip] +PHP + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_2.txt new file mode 100644 index 0000000000..473fa04762 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_2.txt @@ -0,0 +1,44 @@ +[notes] +for https://github.com/antlr/antlr4/issues/1398. +Seeing through a large expression takes 5 _minutes_ on +my fast box to complete. After fix, it's instantaneous. + +[type] +Parser + +[grammar] +grammar Expr; + +stat : expr ';' + | expr '.' + ; + +expr + : ID + | 'not' expr + | expr 'and' expr + | expr 'or' expr + | '(' ID ')' expr + | expr '?' expr ':' expr + | 'between' expr 'and' expr + ; + +ID: [a-zA-Z_][a-zA-Z_0-9]*; +WS: [ \t\n\r\f]+ -> skip; + +[start] +stat + +[input] +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 or +X1 and X2 and X3 and X4 and X5 and X6 and X7 +. + +[skip] +PHP + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_3.txt new file mode 100644 index 0000000000..6a9c3c1934 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_3.txt @@ -0,0 +1,56 @@ +[notes] +for https://github.com/antlr/antlr4/issues/1398. +Seeing through a large expression takes 5 _minutes_ on +my fast box to complete. After fix, it's instantaneous. + +[type] +Parser + +[grammar] +grammar Expr; + +stat : expr ';' + | expr '.' + ; + +expr + : ID + | 'not' expr + | expr 'and' expr + | expr 'or' expr + | '(' ID ')' expr + | expr '?' expr ':' expr + | 'between' expr 'and' expr + ; + +ID: [a-zA-Z_][a-zA-Z_0-9]*; +WS: [ \t\n\r\f]+ -> skip; + +[start] +stat + +[input] +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 +; + +[skip] +Go +PHP + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_4.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_4.txt new file mode 100644 index 0000000000..7736c7a467 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_4.txt @@ -0,0 +1,56 @@ +[notes] +for https://github.com/antlr/antlr4/issues/1398. +Seeing through a large expression takes 5 _minutes_ on +my fast box to complete. After fix, it's instantaneous. + +[type] +Parser + +[grammar] +grammar Expr; + +stat : expr ';' + | expr '.' + ; + +expr + : ID + | 'not' expr + | expr 'and' expr + | expr 'or' expr + | '(' ID ')' expr + | expr '?' expr ':' expr + | 'between' expr 'and' expr + ; + +ID: [a-zA-Z_][a-zA-Z_0-9]*; +WS: [ \t\n\r\f]+ -> skip; + +[start] +stat + +[input] +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 and +between X1 and X2 or between X3 and X4 +; + +[skip] +Go +Python2 +Python3 +Node +PHP + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_5.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_5.txt new file mode 100644 index 0000000000..acd66709a4 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/DropLoopEntryBranchInLRRule_5.txt @@ -0,0 +1,67 @@ +[notes] +for https://github.com/antlr/antlr4/issues/1398. +Seeing through a large expression takes 5 _minutes_ on +my fast box to complete. After fix, it's instantaneous. + +[type] +Parser + +[grammar] +grammar Expr; + +stat : expr ';' + | expr '.' + ; + +expr + : ID + | 'not' expr + | expr 'and' expr + | expr 'or' expr + | '(' ID ')' expr + | expr '?' expr ':' expr + | 'between' expr 'and' expr + ; + +ID: [a-zA-Z_][a-zA-Z_0-9]*; +WS: [ \t\n\r\f]+ -> skip; + +[start] +stat + +[input] +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z or +X ? Y : Z +; + +[skip] +Go +PHP + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/ExpressionGrammar_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/ExpressionGrammar_1.txt new file mode 100644 index 0000000000..9c1ea39d66 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/ExpressionGrammar_1.txt @@ -0,0 +1,41 @@ +[notes] +This is a regression test for antlr/antlr4#192 "Poor performance of +expression parsing". https://github.com/antlr/antlr4/issues/192 + +[type] +Parser + +[grammar] +grammar Expr; + +program: expr EOF; + +expr + : ID + | 'not' expr + | expr 'and' expr + | expr 'or' expr + ; + +ID: [a-zA-Z_][a-zA-Z_0-9]*; +WS: [ \t\n\r\f]+ -> skip; +ERROR: .; + +[start] +program + +[input] +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or + X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or +not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or +not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or +not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or +not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/ExpressionGrammar_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/ExpressionGrammar_2.txt new file mode 100644 index 0000000000..2d2056fceb --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Performance/ExpressionGrammar_2.txt @@ -0,0 +1,38 @@ +[notes] +This is a regression test for antlr/antlr4#192 "Poor performance of +expression parsing". https://github.com/antlr/antlr4/issues/192 + +[type] +Parser + +[grammar] +grammar Expr; + +program: expr EOF; + +expr + : ID + | 'not' expr + | expr 'and' expr + | expr 'or' expr + ; + +ID: [a-zA-Z_][a-zA-Z_0-9]*; +WS: [ \t\n\r\f]+ -> skip; +ERROR: .; + +[start] +program + +[input] +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or +not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/DisableRule.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/DisableRule.txt new file mode 100644 index 0000000000..52a358b371 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/DisableRule.txt @@ -0,0 +1,28 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +E1 : 'enum' { }? ; +E2 : 'enum' { }? ; // winner not E1 or ID +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip; + +[input] +enum abc + +[output] +[@0,0:3='enum',<2>,1:0] +[@1,5:7='abc',<3>,1:5] +[@2,8:7='',<-1>,1:8] +s0-' '->:s5=>4 +s0-'a'->:s6=>3 +s0-'e'->:s1=>3 +:s1=>3-'n'->:s2=>3 +:s2=>3-'u'->:s3=>3 +:s6=>3-'b'->:s6=>3 +:s6=>3-'c'->:s6=>3 + +[flags] +showDFA + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/EnumNotID.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/EnumNotID.txt new file mode 100644 index 0000000000..7be85967d1 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/EnumNotID.txt @@ -0,0 +1,22 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +ENUM : [a-z]+ { }? ; +ID : [a-z]+ ; +WS : (' '|'\n') -> skip; + +[input] +enum abc enum + +[output] +[@0,0:3='enum',<1>,1:0] +[@1,5:7='abc',<2>,1:5] +[@2,9:12='enum',<1>,1:9] +[@3,13:12='',<-1>,1:13] +s0-' '->:s3=>3 + +[flags] +showDFA + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/IDnotEnum.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/IDnotEnum.txt new file mode 100644 index 0000000000..dd0e871319 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/IDnotEnum.txt @@ -0,0 +1,22 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +ENUM : [a-z]+ { }? ; +ID : [a-z]+ ; +WS : (' '|'\n') -> skip; + +[input] +enum abc enum + +[output] +[@0,0:3='enum',<2>,1:0] +[@1,5:7='abc',<2>,1:5] +[@2,9:12='enum',<2>,1:9] +[@3,13:12='',<-1>,1:13] +s0-' '->:s2=>3 + +[flags] +showDFA + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/IDvsEnum.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/IDvsEnum.txt new file mode 100644 index 0000000000..91a825e6ef --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/IDvsEnum.txt @@ -0,0 +1,28 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +ENUM : 'enum' { }? ; +ID : 'a'..'z'+ ; +WS : (' '|'\n') -> skip; + +[input] +enum abc enum + +[output] +[@0,0:3='enum',<2>,1:0] +[@1,5:7='abc',<2>,1:5] +[@2,9:12='enum',<2>,1:9] +[@3,13:12='',<-1>,1:13] +s0-' '->:s5=>3 +s0-'a'->:s4=>2 +s0-'e'->:s1=>2 +:s1=>2-'n'->:s2=>2 +:s2=>2-'u'->:s3=>2 +:s4=>2-'b'->:s4=>2 +:s4=>2-'c'->:s4=>2 + +[flags] +showDFA + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/Indent.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/Indent.txt new file mode 100644 index 0000000000..dfa5077fed --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/Indent.txt @@ -0,0 +1,37 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +ID : [a-z]+ ; +INDENT : [ \t]+ { }? +{ } ; +NL : '\n'; +WS : [ \t]+ ; + +[input] +"""abc + def +""" + +[output] +INDENT +[@0,0:2='abc',<1>,1:0] +[@1,3:3='\n',<3>,1:3] +[@2,4:5=' ',<2>,2:0] +[@3,6:8='def',<1>,2:2] +[@4,9:10=' ',<4>,2:5] +[@5,11:11='\n',<3>,2:7] +[@6,12:11='',<-1>,3:0] +s0-' +'->:s2=>3 +s0-'a'->:s1=>1 +s0-'d'->:s1=>1 +:s1=>1-'b'->:s1=>1 +:s1=>1-'c'->:s1=>1 +:s1=>1-'e'->:s1=>1 +:s1=>1-'f'->:s1=>1 + +[flags] +showDFA + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/LexerInputPositionSensitivePredicates.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/LexerInputPositionSensitivePredicates.txt new file mode 100644 index 0000000000..5b68133691 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/LexerInputPositionSensitivePredicates.txt @@ -0,0 +1,29 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +WORD1 : ID1+ { } ; +WORD2 : ID2+ { } ; +fragment ID1 : { \< 2 }? [a-zA-Z]; +fragment ID2 : { >= 2 }? [a-zA-Z]; +WS : (' '|'\n') -> skip; + +[input] +a cde +abcde + +[output] +a +cde +ab +cde +[@0,0:0='a',<1>,1:0] +[@1,2:4='cde',<2>,1:2] +[@2,6:7='ab',<1>,2:0] +[@3,8:10='cde',<2>,2:2] +[@4,12:11='',<-1>,3:0] + +[flags] +showDFA + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/PredicatedKeywords.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/PredicatedKeywords.txt new file mode 100644 index 0000000000..9e0eba556b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/PredicatedKeywords.txt @@ -0,0 +1,21 @@ +[type] +Lexer + +[grammar] +lexer grammar L; +ENUM : [a-z]+ { }? { } ; +ID : [a-z]+ { } ; +WS : [ \n] -> skip ; + +[input] +enum enu a + +[output] +enum! +ID enu +ID a +[@0,0:3='enum',<1>,1:0] +[@1,5:7='enu',<2>,1:5] +[@2,9:9='a',<2>,1:9] +[@3,10:9='',<-1>,1:10] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/RuleSempredFunction.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/RuleSempredFunction.txt new file mode 100644 index 0000000000..a86f9077fd --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexer/RuleSempredFunction.txt @@ -0,0 +1,19 @@ +[notes] +Test for https://github.com/antlr/antlr4/issues/958 + +[type] +Lexer + +[grammar] +lexer grammar L; +T : 'a' {}? ; + +[input] +aaa + +[output] +[@0,0:0='a',<1>,1:0] +[@1,1:1='a',<1>,1:1] +[@2,2:2='a',<1>,1:2] +[@3,3:2='',<-1>,1:3] + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ActionHidesPreds.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ActionHidesPreds.txt new file mode 100644 index 0000000000..d3ec008891 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ActionHidesPreds.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +@parser::members {} +s : a+ ; +a : {} ID {}? {} + | {} ID {}? {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x x y + +[output] +alt 1 +alt 1 +alt 1 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ActionsHidePredsInGlobalFOLLOW.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ActionsHidePredsInGlobalFOLLOW.txt new file mode 100644 index 0000000000..151f382988 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ActionsHidePredsInGlobalFOLLOW.txt @@ -0,0 +1,31 @@ +[notes] +Regular non-forced actions can create side effects used by semantic +predicates and so we cannot evaluate any semantic predicate +encountered after having seen a regular action. This includes +during global follow operations. + +[type] +Parser + +[grammar] +grammar T; +@parser::members { + +} +s : e {} {}? {} '!' ; +t : e {} {}? ID ; +e : ID | ; // non-LL(1) so we use ATN +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a! + +[output] +eval=true +parse + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/AtomWithClosureInTranslatedLRRule.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/AtomWithClosureInTranslatedLRRule.txt new file mode 100644 index 0000000000..408cf8a3ca --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/AtomWithClosureInTranslatedLRRule.txt @@ -0,0 +1,21 @@ +[notes] +This is a regression test for antlr/antlr4#196 +"element+ in expression grammar doesn't parse properly" +https://github.com/antlr/antlr4/issues/196 + +[type] +Parser + +[grammar] +grammar T; +start : e[0] EOF; +e[int _p] + : ( 'a' | 'b'+ ) ( {3 >= $_p}? '+' e[4] )* + ; + +[start] +start + +[input] +a+b+a + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/DepedentPredsInGlobalFOLLOW.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/DepedentPredsInGlobalFOLLOW.txt new file mode 100644 index 0000000000..4694a11182 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/DepedentPredsInGlobalFOLLOW.txt @@ -0,0 +1,30 @@ +[notes] +We cannot collect predicates that are dependent on local context if +we are doing a global follow. They appear as if they were not there at all. + +[type] +Parser + +[grammar] +grammar T; +@parser::members { + +} +s : a[99] ; +a[int i] : e {}? {} '!' ; +b[int i] : e {}? ID ; +e : ID | ; // non-LL(1) so we use ATN +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a! + +[output] +eval=true +parse + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/DependentPredNotInOuterCtxShouldBeIgnored.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/DependentPredNotInOuterCtxShouldBeIgnored.txt new file mode 100644 index 0000000000..56a7e216b4 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/DependentPredNotInOuterCtxShouldBeIgnored.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : b[2] ';' | b[2] '.' ; // decision in s drills down to ctx-dependent pred in a; +b[] : a[] ; +a[] + : {}? ID {} + | {}? ID {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a; + +[output] +"""alt 2 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/DisabledAlternative.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/DisabledAlternative.txt new file mode 100644 index 0000000000..9325f07d9f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/DisabledAlternative.txt @@ -0,0 +1,20 @@ +[notes] +This is a regression test for antlr/antlr4#218 "ANTLR4 EOF Related Bug". +https://github.com/antlr/antlr4/issues/218 + +[type] +Parser + +[grammar] +grammar T; +cppCompilationUnit : content+ EOF; +content: anything | {}? .; +anything: ANY_CHAR; +ANY_CHAR: [_a-zA-Z0-9]; + +[start] +cppCompilationUnit + +[input] +hello + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/IndependentPredNotPassedOuterCtxToAvoidCastException.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/IndependentPredNotPassedOuterCtxToAvoidCastException.txt new file mode 100644 index 0000000000..607e990030 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/IndependentPredNotPassedOuterCtxToAvoidCastException.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : b ';' | b '.' ; +b : a ; +a + : {}? ID {} + | {}? ID {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a; + +[output] +"""alt 2 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/NoTruePredsThrowsNoViableAlt.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/NoTruePredsThrowsNoViableAlt.txt new file mode 100644 index 0000000000..0105c71521 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/NoTruePredsThrowsNoViableAlt.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +s : a a; +a : {}? ID INT {} + | {}? ID INT {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +y 3 x 4 + +[errors] +"""line 1:0 no viable alternative at input 'y' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/Order.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/Order.txt new file mode 100644 index 0000000000..fba98c8ffd --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/Order.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : a {} a; // do 2x: once in ATN, next in DFA; +// action blocks lookahead from falling off of 'a' +// and looking into 2nd 'a' ref. !ctx dependent pred +a : ID {} + | {}? ID {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x y + +[output] +alt 1 +alt 1 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredFromAltTestedInLoopBack_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredFromAltTestedInLoopBack_1.txt new file mode 100644 index 0000000000..70ee58e5cd --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredFromAltTestedInLoopBack_1.txt @@ -0,0 +1,44 @@ +[notes] +Loopback doesn't eval predicate at start of alt + +[type] +Parser + +[grammar] +grammar T; +file_ +@after {} + : para para EOF ; +para: paraContent NL NL ; +paraContent : ('s'|'x'|{})>}? NL)+ ; +NL : '\n' ; +s : 's' ; +X : 'x' ; + +[start] +file_ + +[input] +"""s + + +x +""" + +[output] +"""(file_ (para (paraContent s) \n \n) (para (paraContent \n x \n)) ) +""" + +[errors] +"""line 5:0 mismatched input '' expecting {'s', '\n', 'x'} +""" + +[skip] +Cpp +CSharp +Dart +Go +Node +PHP +Python2 +Python3 diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredFromAltTestedInLoopBack_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredFromAltTestedInLoopBack_2.txt new file mode 100644 index 0000000000..ec2e626591 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredFromAltTestedInLoopBack_2.txt @@ -0,0 +1,32 @@ +[notes] +Loopback doesn't eval predicate at start of alt + +[type] +Parser + +[grammar] +grammar T; +file_ +@after {} + : para para EOF ; +para: paraContent NL NL ; +paraContent : ('s'|'x'|{})>}? NL)+ ; +NL : '\n' ; +s : 's' ; +X : 'x' ; + +[start] +file_ + +[input] +"""s + + +x + +""" + +[output] +"""(file_ (para (paraContent s) \n \n) (para (paraContent \n x) \n \n) ) +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredTestedEvenWhenUnAmbig_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredTestedEvenWhenUnAmbig_1.txt new file mode 100644 index 0000000000..72974d2b9f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredTestedEvenWhenUnAmbig_1.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +@parser::members {} +primary + : ID {} + | {}? 'enum' {} + ; +ID : [a-z]+ ; +WS : [ \t\n\r]+ -> skip ; + +[start] +primary + +[input] +abc + +[output] +"""ID abc +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredTestedEvenWhenUnAmbig_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredTestedEvenWhenUnAmbig_2.txt new file mode 100644 index 0000000000..f6a4d5c9b9 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredTestedEvenWhenUnAmbig_2.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +@parser::members {} +primary + : ID {} + | {}? 'enum' {} + ; +ID : [a-z]+ ; +WS : [ \t\n\r]+ -> skip ; + +[start] +primary + +[input] +enum + +[errors] +"""line 1:0 no viable alternative at input 'enum' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredicateDependentOnArg.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredicateDependentOnArg.txt new file mode 100644 index 0000000000..168bdbf924 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredicateDependentOnArg.txt @@ -0,0 +1,31 @@ +[notes] +In this case, we're passing a parameter into a rule that uses that +information to predict the alternatives. This is the special case +where we know exactly which context we are in. The context stack +is empty and we have not dipped into the outer context to make a decision. + +[type] +Parser + +[grammar] +grammar T; +@parser::members {} +s : a[2] a[1]; +a[int i] + : {}? ID {} + | {}? ID {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a b + +[output] +alt 2 +alt 1 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredicateDependentOnArg2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredicateDependentOnArg2.txt new file mode 100644 index 0000000000..b8fa75d735 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredicateDependentOnArg2.txt @@ -0,0 +1,31 @@ +[notes] +In this case, we have to ensure that the predicates are not tested +during the closure after recognizing the 1st ID. The closure will +fall off the end of 'a' 1st time and reach into the a[1] rule +invocation. It should not execute predicates because it does not know +what the parameter is. The context stack will not be empty and so +they should be ignored. It will not affect recognition, however. We +are really making sure the ATN simulation doesn't crash with context +object issues when it encounters preds during FOLLOW. + +[type] +Parser + +[grammar] +grammar T; +@parser::members {} +s : a[2] a[1]; +a[int i] + : {}? ID + | {}? ID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a b + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredsInGlobalFOLLOW.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredsInGlobalFOLLOW.txt new file mode 100644 index 0000000000..bf16fe3826 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/PredsInGlobalFOLLOW.txt @@ -0,0 +1,29 @@ +[notes] +During a global follow operation, we still collect semantic +predicates as long as they are not dependent on local context + +[type] +Parser + +[grammar] +grammar T; +@parser::members { + +} +s : e {}? {} '!' ; +t : e {}? ID ; +e : ID | ; // non-LL(1) so we use ATN +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +a! + +[output] +eval=true +parse + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/RewindBeforePredEval.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/RewindBeforePredEval.txt new file mode 100644 index 0000000000..436583f395 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/RewindBeforePredEval.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +s : a a; +a : {}? ID INT {} + | {}? ID INT {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +y 3 x 4 + +[output] +alt 2 +alt 1 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/Simple.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/Simple.txt new file mode 100644 index 0000000000..4301cdeee6 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/Simple.txt @@ -0,0 +1,25 @@ +[type] +Parser + +[grammar] +grammar T; +s : a a a; // do 3x: once in ATN, next in DFA then INT in ATN +a : {}? ID {} + | {}? ID {} + | INT{} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x y 3 + +[output] +alt 2 +alt 2 +alt 3 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/SimpleValidate.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/SimpleValidate.txt new file mode 100644 index 0000000000..99d7702984 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/SimpleValidate.txt @@ -0,0 +1,23 @@ +[type] +Parser + +[grammar] +grammar T; +s : a ; +a : {}? ID {} + | {}? INT {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x + +[errors] +"""line 1:0 no viable alternative at input 'x' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/SimpleValidate2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/SimpleValidate2.txt new file mode 100644 index 0000000000..46c678a0db --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/SimpleValidate2.txt @@ -0,0 +1,27 @@ +[type] +Parser + +[grammar] +grammar T; +s : a a a; +a : {}? ID {} + | {}? INT {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +3 4 x + +[output] +alt 2 +alt 2 + +[errors] +"""line 1:4 no viable alternative at input 'x' +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ToLeft.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ToLeft.txt new file mode 100644 index 0000000000..5d7dba78c9 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ToLeft.txt @@ -0,0 +1,24 @@ +[type] +Parser + +[grammar] +grammar T; + s : a+ ; +a : {}? ID {} + | {}? ID {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x x y + +[output] +alt 2 +alt 2 +alt 2 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ToLeftWithVaryingPredicate.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ToLeftWithVaryingPredicate.txt new file mode 100644 index 0000000000..2746c2535e --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ToLeftWithVaryingPredicate.txt @@ -0,0 +1,36 @@ +[notes] +In this case, we use predicates that depend on global information +like we would do for a symbol table. We simply execute +the predicates assuming that all necessary information is available. +The i++ action is done outside of the prediction and so it is executed. + +[type] +Parser + +[grammar] +grammar T; +@parser::members {} +s : ({ + +} a)+ ; +a : {}? ID {} + | {}? ID {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x x y + +[output] +i=1 +alt 2 +i=2 +alt 1 +i=3 +alt 2 + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/TwoUnpredicatedAlts.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/TwoUnpredicatedAlts.txt new file mode 100644 index 0000000000..a45cd9a319 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/TwoUnpredicatedAlts.txt @@ -0,0 +1,33 @@ +[type] +Parser + +[grammar] +grammar T; +s : {} a ';' a; // do 2x: once in ATN, next in DFA +a : ID {} + | ID {} + | {}? ID {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x; y + +[output] +alt 1 +alt 1 + +[errors] +line 1:0 reportAttemptingFullContext d=0 (a), input='x' +line 1:0 reportAmbiguity d=0 (a): ambigAlts={1, 2}, input='x' +line 1:3 reportAttemptingFullContext d=0 (a), input='y' +line 1:3 reportAmbiguity d=0 (a): ambigAlts={1, 2}, input='y' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/TwoUnpredicatedAltsAndOneOrthogonalAlt.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/TwoUnpredicatedAltsAndOneOrthogonalAlt.txt new file mode 100644 index 0000000000..88f0d73435 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/TwoUnpredicatedAltsAndOneOrthogonalAlt.txt @@ -0,0 +1,35 @@ +[type] +Parser + +[grammar] +grammar T; +s : {} a ';' a ';' a; +a : INT {} + | ID {} // must pick this one for ID since pred is false + | ID {} + | {}? ID {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +34; x; y + +[output] +alt 1 +alt 2 +alt 2 + +[errors] +line 1:4 reportAttemptingFullContext d=0 (a), input='x' +line 1:4 reportAmbiguity d=0 (a): ambigAlts={2, 3}, input='x' +line 1:7 reportAttemptingFullContext d=0 (a), input='y' +line 1:7 reportAmbiguity d=0 (a): ambigAlts={2, 3}, input='y' + +[flags] +showDiagnosticErrors + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/UnpredicatedPathsInAlt.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/UnpredicatedPathsInAlt.txt new file mode 100644 index 0000000000..f788d880c2 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/UnpredicatedPathsInAlt.txt @@ -0,0 +1,27 @@ +[type] +Parser + +[grammar] +grammar T; +s : a {} + | b {} + ; +a : {}? ID INT + | ID INT + ; +b : ID ID + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x 4 + +[output] +"""alt 1 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ValidateInDFA.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ValidateInDFA.txt new file mode 100644 index 0000000000..eefaa1fb90 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/SemPredEvalParser/ValidateInDFA.txt @@ -0,0 +1,26 @@ +[type] +Parser + +[grammar] +grammar T; +s : a ';' a; +// ';' helps us to resynchronize without consuming +// 2nd 'a' reference. We our testing that the DFA also +// throws an exception if the validating predicate fails +a : {}? ID {} + | {}? INT {} + ; +ID : 'a'..'z'+ ; +INT : '0'..'9'+; +WS : (' '|'\n') -> skip ; + +[start] +s + +[input] +x ; y + +[errors] +line 1:0 no viable alternative at input 'x' +line 1:4 no viable alternative at input 'y' + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/CharSetLiteral.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/CharSetLiteral.txt new file mode 100644 index 0000000000..fc7febd648 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/CharSetLiteral.txt @@ -0,0 +1,21 @@ +[type] +Parser + +[grammar] +grammar T; +a : (A {})+ ; +A : [AaBb] ; +WS : (' '|'\n')+ -> skip ; + +[start] +a + +[input] +A a B b + +[output] +A +a +B +b + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ComplementSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ComplementSet.txt new file mode 100644 index 0000000000..5b3e10c544 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ComplementSet.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +parse : ~NEW_LINE; +NEW_LINE: '\\r'? '\\n'; + +[start] +parse + +[input] +a + +[errors] +line 1:0 token recognition error at: 'a' +line 1:1 missing {} at '' + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/LexerOptionalSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/LexerOptionalSet.txt new file mode 100644 index 0000000000..fb2c9f317b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/LexerOptionalSet.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : A {} ; +A : ('a'|'b')? 'c' ; + +[start] +a + +[input] +ac + +[output] +"""ac +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/LexerPlusSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/LexerPlusSet.txt new file mode 100644 index 0000000000..351b380c39 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/LexerPlusSet.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : A {} ; +A : ('a'|'b')+ 'c' ; + +[start] +a + +[input] +abaac + +[output] +"""abaac +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/LexerStarSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/LexerStarSet.txt new file mode 100644 index 0000000000..1eccbcb059 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/LexerStarSet.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : A {} ; +A : ('a'|'b')* 'c' ; + +[start] +a + +[input] +abaac + +[output] +"""abaac +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/NotChar.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/NotChar.txt new file mode 100644 index 0000000000..fa23e88d27 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/NotChar.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : A {} ; +A : ~'b' ; + +[start] +a + +[input] +x + +[output] +"""x +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/NotCharSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/NotCharSet.txt new file mode 100644 index 0000000000..fc39a5b19c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/NotCharSet.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : A {} ; +A : ~('b'|'c') ; + +[start] +a + +[input] +x + +[output] +"""x +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/NotCharSetWithRuleRef3.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/NotCharSetWithRuleRef3.txt new file mode 100644 index 0000000000..9963097d02 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/NotCharSetWithRuleRef3.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : A {} ; +A : ('a'|B) ; // this doesn't collapse to set but works +fragment +B : ~('a'|'c') ; + +[start] +a + +[input] +x + +[output] +"""x +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/OptionalLexerSingleElement.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/OptionalLexerSingleElement.txt new file mode 100644 index 0000000000..c51c17277c --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/OptionalLexerSingleElement.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : A {} ; +A : 'b'? 'c' ; + +[start] +a + +[input] +bc + +[output] +"""bc +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/OptionalSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/OptionalSet.txt new file mode 100644 index 0000000000..f13145e6af --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/OptionalSet.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : ('a'|'b')? 'c' {} ; + +[start] +a + +[input] +ac + +[output] +"""ac +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/OptionalSingleElement.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/OptionalSingleElement.txt new file mode 100644 index 0000000000..1daa7bcaff --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/OptionalSingleElement.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : A? 'c' {} ; +A : 'b' ; + +[start] +a + +[input] +bc + +[output] +"""bc +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserNotSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserNotSet.txt new file mode 100644 index 0000000000..194cbfb3a1 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserNotSet.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : t=~('x'|'y') 'z' {} ; + +[start] +a + +[input] +zz + +[output] +"""z +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserNotToken.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserNotToken.txt new file mode 100644 index 0000000000..55e41be4aa --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserNotToken.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : ~'x' 'z' {} ; + +[start] +a + +[input] +zz + +[output] +"""zz +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserNotTokenWithLabel.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserNotTokenWithLabel.txt new file mode 100644 index 0000000000..d1f7292736 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserNotTokenWithLabel.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : t=~'x' 'z' {} ; + +[start] +a + +[input] +zz + +[output] +"""z +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserSet.txt new file mode 100644 index 0000000000..14d4e75030 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/ParserSet.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : t=('x'|'y') {} ; + +[start] +a + +[input] +x + +[output] +"""x +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/PlusLexerSingleElement.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/PlusLexerSingleElement.txt new file mode 100644 index 0000000000..3227f5b5c6 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/PlusLexerSingleElement.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : A {} ; +A : 'b'+ 'c' ; + +[start] +a + +[input] +bbbbc + +[output] +"""bbbbc +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/PlusSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/PlusSet.txt new file mode 100644 index 0000000000..7a082936e8 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/PlusSet.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : ('a'|'b')+ 'c' {} ; + +[start] +a + +[input] +abaac + +[output] +"""abaac +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/RuleAsSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/RuleAsSet.txt new file mode 100644 index 0000000000..fdfd6d36c1 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/RuleAsSet.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a @after {} : 'a' | 'b' |'c' ; + +[start] +a + +[input] +b + +[output] +"""b +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/SeqDoesNotBecomeSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/SeqDoesNotBecomeSet.txt new file mode 100644 index 0000000000..63dfdbc101 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/SeqDoesNotBecomeSet.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : C {} ; +fragment A : '1' | '2'; +fragment B : '3' '4'; +C : A | B; + +[start] +a + +[input] +34 + +[output] +"""34 +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/StarLexerSingleElement_1.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/StarLexerSingleElement_1.txt new file mode 100644 index 0000000000..57a4f847aa --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/StarLexerSingleElement_1.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : A {} ; +A : 'b'* 'c' ; + +[start] +a + +[input] +bbbbc + +[output] +"""bbbbc +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/StarLexerSingleElement_2.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/StarLexerSingleElement_2.txt new file mode 100644 index 0000000000..fa54688c38 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/StarLexerSingleElement_2.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : A {} ; +A : 'b'* 'c' ; + +[start] +a + +[input] +c + +[output] +"""c +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/StarSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/StarSet.txt new file mode 100644 index 0000000000..5656509c05 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/StarSet.txt @@ -0,0 +1,17 @@ +[type] +Parser + +[grammar] +grammar T; +a : ('a'|'b')* 'c' {} ; + +[start] +a + +[input] +abaac + +[output] +"""abaac +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedBMPRangeSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedBMPRangeSet.txt new file mode 100644 index 0000000000..f8a591be09 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedBMPRangeSet.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : LETTERS* 'd' {} ; +// Note the double-backslash to avoid Java passing +// unescaped values as part of the grammar. +LETTERS : ('a'|'\\u00E0'..'\\u00E5'); + +[start] +a + +[input] +aáäáâåd + +[output] +"""aáäáâåd +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedBMPSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedBMPSet.txt new file mode 100644 index 0000000000..8f057e46dc --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedBMPSet.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : LETTERS {} ; +// Note the double-backslash to avoid Java passing +// unescaped values as part of the grammar. +LETTERS : ('a'|'\\u00E4'|'\\u4E9C'|'\\u3042')* 'c'; + +[start] +a + +[input] +aäあ亜c + +[output] +"""aäあ亜c +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedSMPRangeSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedSMPRangeSet.txt new file mode 100644 index 0000000000..ab51d94c6f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedSMPRangeSet.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : LETTERS* 'd' {} ; +// Note the double-backslash to avoid Java passing +// unescaped values as part of the grammar. +LETTERS : ('a'|'\\u{1F600}'..'\\u{1F943}'); + +[start] +a + +[input] +a😉🥂🜀d + +[output] +"""a😉🥂🜀d +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedSMPRangeSetMismatch.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedSMPRangeSetMismatch.txt new file mode 100644 index 0000000000..33e6f0a5a5 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedSMPRangeSetMismatch.txt @@ -0,0 +1,24 @@ +[type] +Parser + +[grammar] +grammar T; +a : LETTERS* 'd' {} ; +// Note the double-backslash to avoid Java passing +// unescaped values as part of the grammar. +LETTERS : ('a'|'\\u{1F600}'..'\\u{1F943}'); + +[start] +a + +[input] +a🗿🥄d + +[output] +"""ad +""" + +[errors] +line 1:1 token recognition error at: '🗿' +line 1:2 token recognition error at: '🥄' + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedSMPSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedSMPSet.txt new file mode 100644 index 0000000000..a00b690c0b --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeEscapedSMPSet.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : LETTERS {} ; +// Note the double-backslash to avoid Java passing +// unescaped values as part of the grammar. +LETTERS : ('a'|'\\u{1D5BA}'|'\\u{1D5BE}'|'\\u{1D5C2}'|'\\u{1D5C8}'|'\\u{1D5CE}')* 'c'; + +[start] +a + +[input] +a𝗂𝗎𝖺c + +[output] +"""a𝗂𝗎𝖺c +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeNegatedBMPSetIncludesSMPCodePoints.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeNegatedBMPSetIncludesSMPCodePoints.txt new file mode 100644 index 0000000000..5b1f8ba919 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeNegatedBMPSetIncludesSMPCodePoints.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : LETTERS {} ; +LETTERS : 'a' ~('b')+ 'c'; + +[start] +a + +[input] +a😳😡😝🤓c + +[output] +"""a😳😡😝🤓c +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeNegatedSMPSetIncludesBMPCodePoints.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeNegatedSMPSetIncludesBMPCodePoints.txt new file mode 100644 index 0000000000..fc8990a04f --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeNegatedSMPSetIncludesBMPCodePoints.txt @@ -0,0 +1,18 @@ +[type] +Parser + +[grammar] +grammar T; +a : LETTERS {} ; +LETTERS : 'a' ~('\\u{1F600}'..'\\u{1F943}')+ 'c'; + +[start] +a + +[input] +abc + +[output] +"""abc +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeUnescapedBMPRangeSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeUnescapedBMPRangeSet.txt new file mode 100644 index 0000000000..e8745b35c8 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeUnescapedBMPRangeSet.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : LETTERS* 'd' {} ; +// These are actually not escaped -- Java passes the +// raw unescaped Unicode values to the grammar compiler. +LETTERS : ('a'|'à'..'å'); + +[start] +a + +[input] +aáäáâåd + +[output] +"""aáäáâåd +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeUnescapedBMPSet.txt b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeUnescapedBMPSet.txt new file mode 100644 index 0000000000..4d919419f2 --- /dev/null +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/Sets/UnicodeUnescapedBMPSet.txt @@ -0,0 +1,20 @@ +[type] +Parser + +[grammar] +grammar T; +a : LETTERS {} ; +// These are actually not escaped -- Java passes the +// raw unescaped Unicode values to the grammar compiler. +LETTERS : ('a'|'ä'|'亜'|'あ')* 'c'; + +[start] +a + +[input] +aäあ亜c + +[output] +"""aäあ亜c +""" + diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Cpp.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Cpp.test.stg index a5dab18bd5..5597a9a737 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Cpp.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Cpp.test.stg @@ -47,7 +47,7 @@ TokenStartColumnEquals(i) ::= "tokenStartCharPositionInLine == " ImportListener(X) ::= "" -GetExpectedTokenNames() ::= "getExpectedTokens().toString(_tokenNames)" +GetExpectedTokenNames() ::= "getExpectedTokens().toString(getVocabulary())" RuleInvocationStack() ::= "Arrays::listToString(getRuleInvocationStack(), \", \")" @@ -92,8 +92,11 @@ protected: public: virtual std::unique_ptr\ nextToken() override { if (dynamic_cast\(_interpreter) == nullptr) { + const auto &atn = _interpreter->atn; + auto &decisionToDFA = dynamic_cast\(_interpreter)->_decisionToDFA; + auto &sharedContextCache = dynamic_cast\(_interpreter)->getSharedContextCache(); delete _interpreter; - _interpreter = new PositionAdjustingLexerATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache); + _interpreter = new PositionAdjustingLexerATNSimulator(this, atn, decisionToDFA, sharedContextCache); } return antlr4::Lexer::nextToken(); diff --git a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Go.test.stg b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Go.test.stg index eb8def1959..8ab158d8c5 100644 --- a/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Go.test.stg +++ b/runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Go.test.stg @@ -103,9 +103,7 @@ PositionAdjustingLexerDef() ::= "" PositionAdjustingLexer() ::= << func (p *PositionAdjustingLexer) NextToken() antlr.Token { if _, ok := p.Interpreter.(*PositionAdjustingLexerATNSimulator); !ok { - lexerDeserializer := antlr.NewATNDeserializer(nil) - lexerAtn := lexerDeserializer.DeserializeFromUInt16(serializedLexerAtn) - p.Interpreter = NewPositionAdjustingLexerATNSimulator(p, lexerAtn, p.Interpreter.DecisionToDFA(), p.Interpreter.SharedContextCache()) + p.Interpreter = NewPositionAdjustingLexerATNSimulator(p, p.Interpreter.ATN(), p.Interpreter.DecisionToDFA(), p.Interpreter.SharedContextCache()) p.Virt = p } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseCompositeLexerTestDescriptor.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseCompositeLexerTestDescriptor.java deleted file mode 100644 index c9f603a542..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseCompositeLexerTestDescriptor.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime; - -public class BaseCompositeLexerTestDescriptor extends BaseRuntimeTestDescriptor { - @Override - public String getTestType() { - return "CompositeLexer"; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseCompositeParserTestDescriptor.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseCompositeParserTestDescriptor.java deleted file mode 100644 index 2b5f0ac3c6..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseCompositeParserTestDescriptor.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime; - -public class BaseCompositeParserTestDescriptor extends BaseRuntimeTestDescriptor { - @Override - public String getTestType() { - return "CompositeParser"; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseDiagnosticParserTestDescriptor.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseDiagnosticParserTestDescriptor.java deleted file mode 100644 index 95bcaf7956..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseDiagnosticParserTestDescriptor.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime; - -public abstract class BaseDiagnosticParserTestDescriptor extends BaseParserTestDescriptor { - @Override - public boolean showDiagnosticErrors() { - return true; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseLexerTestDescriptor.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseLexerTestDescriptor.java deleted file mode 100644 index cf215a5d8e..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseLexerTestDescriptor.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime; - -public class BaseLexerTestDescriptor extends BaseRuntimeTestDescriptor { - @Override - public String getTestType() { - return "Lexer"; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseParserTestDescriptor.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseParserTestDescriptor.java deleted file mode 100644 index cb7f7d297b..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseParserTestDescriptor.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime; - -public class BaseParserTestDescriptor extends BaseRuntimeTestDescriptor { - @Override - public String getTestType() { - return "Parser"; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTest.java index 2c060ba42c..fdd476a6f8 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTest.java @@ -22,13 +22,13 @@ import java.io.File; import java.io.IOException; -import java.lang.reflect.Modifier; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.*; -import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.fail; import static junit.framework.TestCase.failNotEquals; import static org.junit.Assume.assumeFalse; @@ -42,29 +42,21 @@ * @since 4.6. */ public abstract class BaseRuntimeTest { - - public final static String[] Targets = { - "Cpp", - "CSharp", - "Dart", - "Go", - "Java", - "Node", - "PHP", - "Python2", "Python3", - "Swift" - }; + final static Set sections = new HashSet<>(Arrays.asList( + "notes", "type", "grammar", "slaveGrammar", "start", "input", "output", "errors", "flags", "skip" + )); @BeforeClass public static void startHeartbeatToAvoidTimeout() { - if(requiresHeartbeat()) + if(requiresHeartbeat()) { startHeartbeat(); + } } private static boolean requiresHeartbeat() { return isTravisCI() || isAppVeyorCI() - || (isCPP() && isRecursion()) + || (isCPP() && isRecursion()) || (isCircleCI() && isGo()) || (isCircleCI() && isDotNet() && isRecursion()); } @@ -155,8 +147,9 @@ public void setUp() throws Exception { public boolean checkIgnored() { boolean ignored = !TestContext.isSupportedTarget(descriptor.getTarget()) || descriptor.ignore(descriptor.getTarget()); - if(ignored) + if (ignored) { System.out.println("Ignore " + descriptor); + } return ignored; } @@ -187,7 +180,7 @@ public void testOne() throws Exception { delegate.afterTest(descriptor); } - public void testParser(RuntimeTestDescriptor descriptor) throws Exception { + public void testParser(RuntimeTestDescriptor descriptor) { RuntimeTestUtils.mkdir(delegate.getTempParserDirPath()); Pair pair = descriptor.getGrammar(); @@ -335,28 +328,206 @@ public static ErrorQueue antlrOnString(String workdir, // ---- support ---- - public static RuntimeTestDescriptor[] getRuntimeTestDescriptors(Class clazz, String targetName) { - if(!TestContext.isSupportedTarget(targetName)) - return new RuntimeTestDescriptor[0]; - Class[] nestedClasses = clazz.getClasses(); - List descriptors = new ArrayList(); - for (Class nestedClass : nestedClasses) { - int modifiers = nestedClass.getModifiers(); - if ( RuntimeTestDescriptor.class.isAssignableFrom(nestedClass) && !Modifier.isAbstract(modifiers) ) { + public static RuntimeTestDescriptor[] getRuntimeTestDescriptors(String group, String targetName) { + final ClassLoader loader = Thread.currentThread().getContextClassLoader(); + final URL descrURL = loader.getResource("org/antlr/v4/test/runtime/descriptors/" +group); + String[] descriptorFilenames = null; + try { + descriptorFilenames = new File(descrURL.toURI()).list(); + } + catch (URISyntaxException e) { + System.err.println("Bad URL:"+descrURL); + } + +// String[] descriptorFilenames = new File("/tmp/descriptors/"+group).list(); + List descriptors = new ArrayList<>(); + for (String fname : descriptorFilenames) { + try { +// String dtext = Files.readString(Path.of("/tmp/descriptors",group,fname)); + final URL dURL = loader.getResource("org/antlr/v4/test/runtime/descriptors/" +group+"/"+fname); + String dtext = null; try { - RuntimeTestDescriptor d = (RuntimeTestDescriptor) nestedClass.newInstance(); - if(!d.ignore(targetName)) { - d.setTarget(targetName); - descriptors.add(d); - } - } catch (Exception e) { - e.printStackTrace(System.err); + URI uri = dURL.toURI(); + dtext = new String(Files.readAllBytes(Paths.get(uri))); } + catch (URISyntaxException e) { + System.err.println("Bad URL:"+dURL); + } + UniversalRuntimeTestDescriptor d = readDescriptor(dtext); + if ( !d.ignore(targetName) ) { + d.name = fname.replace(".txt", ""); + d.targetName = targetName; + descriptors.add(d); + } + } + catch (IOException ioe) { + System.err.println("Can't read descriptor file "+fname); } } + + if (group.equals("LexerExec")) { + descriptors.add(GeneratedLexerDescriptors.getLineSeparatorLfDescriptor(targetName)); + descriptors.add(GeneratedLexerDescriptors.getLineSeparatorCrLfDescriptor(targetName)); + descriptors.add(GeneratedLexerDescriptors.getLargeLexerDescriptor(targetName)); + descriptors.add(GeneratedLexerDescriptors.getAtnStatesSizeMoreThan65535Descriptor(targetName)); + } + return descriptors.toArray(new RuntimeTestDescriptor[0]); } + /** Read stuff like: + [grammar] + grammar T; + s @after {} + : ID | ID {} ; + ID : 'a'..'z'+; + WS : (' '|'\t'|'\n')+ -> skip ; + + [grammarName] + T + + [start] + s + + [input] + abc + + [output] + Decision 0: + s0-ID->:s1^=>1 + + [errors] + """line 1:0 reportAttemptingFullContext d=0 (s), input='abc' + """ + + Some can be missing like [errors]. + + Get gr names automatically "lexer grammar Unicode;" "grammar T;" "parser grammar S;" + + Also handle slave grammars: + + [grammar] + grammar M; + import S,T; + s : a ; + B : 'b' ; // defines B from inherited token space + WS : (' '|'\n') -> skip ; + + [slaveGrammar] + parser grammar T; + a : B {}; + + [slaveGrammar] + parser grammar S; + a : b {}; + b : B; + */ + public static UniversalRuntimeTestDescriptor readDescriptor(String dtext) + throws RuntimeException + { + String currentField = null; + StringBuilder currentValue = new StringBuilder(); + + List> pairs = new ArrayList<>(); + String[] lines = dtext.split("\r?\n"); + + for (String line : lines) { + boolean newSection = false; + String sectionName = null; + if (line.startsWith("[") && line.length() > 2) { + sectionName = line.substring(1, line.length() - 1); + newSection = sections.contains(sectionName); + } + + if (newSection) { + if (currentField != null) { + pairs.add(new Pair<>(currentField, currentValue.toString())); + } + currentField = sectionName; + currentValue.setLength(0); + } + else { + currentValue.append(line); + currentValue.append("\n"); + } + } + pairs.add(new Pair<>(currentField, currentValue.toString())); + + UniversalRuntimeTestDescriptor d = new UniversalRuntimeTestDescriptor(); + for (Pair p : pairs) { + String section = p.a; + String value = ""; + if ( p.b!=null ) { + value = p.b.trim(); + } + if ( value.startsWith("\"\"\"") ) { + value = value.replace("\"\"\"", ""); + } + else if ( value.indexOf('\n')>=0 ) { + value = value + "\n"; // if multi line and not quoted, leave \n on end. + } + switch (section) { + case "notes": + d.notes = value; + break; + case "type": + d.testType = value; + break; + case "grammar": + d.grammarName = getGrammarName(value.split("\n")[0]); + d.grammar = value; + break; + case "slaveGrammar": + String gname = getGrammarName(value.split("\n")[0]); + d.slaveGrammars.add(new Pair<>(gname, value)); + case "start": + d.startRule = value; + break; + case "input": + d.input = value; + break; + case "output": + d.output = value; + break; + case "errors": + d.errors = value; + break; + case "flags": + String[] flags = value.split("\n"); + for (String f : flags) { + switch (f) { + case "showDFA": + d.showDFA = true; + break; + case "showDiagnosticErrors": + d.showDiagnosticErrors = true; + break; + } + } + break; + case "skip": + d.skipTargets = Arrays.asList(value.split("\n")); + break; + default: + throw new RuntimeException("Unknown descriptor section ignored: "+section); + } + } + return d; + } + + /** Get A, B, or C from: + * "lexer grammar A;" "grammar B;" "parser grammar C;" + */ + public static String getGrammarName(String grammarDeclLine) { + int gi = grammarDeclLine.indexOf("grammar "); + if ( gi<0 ) { + return ""; + } + gi += "grammar ".length(); + int gsemi = grammarDeclLine.indexOf(';'); + return grammarDeclLine.substring(gi, gsemi); + } + public static void writeFile(String dir, String fileName, String content) { try { Utils.writeFile(dir+"/"+fileName, content, "UTF-8"); @@ -438,4 +609,174 @@ protected static void assertCorrectOutput(RuntimeTestDescriptor descriptor, Runt ">."); } } + + // ---------------------------------------------------------------------------- + // stuff used during conversion that I don't want to throw away yet and we might lose if + // I squash this branch unless I keep it around in a comment or something + // ---------------------------------------------------------------------------- + +// public static RuntimeTestDescriptor[] OLD_getRuntimeTestDescriptors(Class clazz, String targetName) { +// if(!TestContext.isSupportedTarget(targetName)) +// return new RuntimeTestDescriptor[0]; +// Class[] nestedClasses = clazz.getClasses(); +// List descriptors = new ArrayList(); +// for (Class nestedClass : nestedClasses) { +// int modifiers = nestedClass.getModifiers(); +// if ( RuntimeTestDescriptor.class.isAssignableFrom(nestedClass) && !Modifier.isAbstract(modifiers) ) { +// try { +// RuntimeTestDescriptor d = (RuntimeTestDescriptor) nestedClass.newInstance(); +// if(!d.ignore(targetName)) { +// d.setTarget(targetName); +// descriptors.add(d); +// } +// } catch (Exception e) { +// e.printStackTrace(System.err); +// } +// } +// } +// writeDescriptors(clazz, descriptors); +// return descriptors.toArray(new RuntimeTestDescriptor[0]); +// } + + + /** Write descriptor files. */ +// private static void writeDescriptors(Class clazz, List descriptors) { +// String descrRootDir = "/Users/parrt/antlr/code/antlr4/runtime-testsuite/resources/org/antlr/v4/test/runtime/new_descriptors"; +// new File(descrRootDir).mkdir(); +// String groupName = clazz.getSimpleName(); +// groupName = groupName.replace("Descriptors", ""); +// String groupDir = descrRootDir + "/" + groupName; +// new File(groupDir).mkdir(); +// +// for (RuntimeTestDescriptor d : descriptors) { +// try { +// Pair g = d.getGrammar(); +// String gname = g.a; +// String grammar = g.b; +// String filename = d.getTestName()+".txt"; +// String content = ""; +// String input = quoteForDescriptorFile(d.getInput()); +// String output = quoteForDescriptorFile(d.getOutput()); +// String errors = quoteForDescriptorFile(d.getErrors()); +// content += "[type]\n"; +// content += d.getTestType(); +// content += "\n\n"; +// content += "[grammar]\n"; +// content += grammar; +// if ( !content.endsWith("\n\n") ) content += "\n"; +// if ( d.getSlaveGrammars()!=null ) { +// for (Pair slaveG : d.getSlaveGrammars()) { +// String sg = quoteForDescriptorFile(slaveG.b); +// content += "[slaveGrammar]\n"; +// content += sg; +// content += "\n"; +// } +// } +// if ( d.getStartRule()!=null && d.getStartRule().length()>0 ) { +// content += "[start]\n"; +// content += d.getStartRule(); +// content += "\n\n"; +// } +// if ( input!=null ) { +// content += "[input]\n"; +// content += input; +// content += "\n"; +// } +// if ( output!=null ) { +// content += "[output]\n"; +// content += output; +// content += "\n"; +// } +// if ( errors!=null ) { +// content += "[errors]\n"; +// content += errors; +// content += "\n"; +// } +// if ( d.showDFA() || d.showDiagnosticErrors() ) { +// content += "[flags]\n"; +// if (d.showDFA()) { +// content += "showDFA\n"; +// } +// if (d.showDiagnosticErrors()) { +// content += "showDiagnosticErrors\n"; +// } +// content += '\n'; +// } +// List skip = new ArrayList<>(); +// for (String target : Targets) { +// if ( d.ignore(target) ) { +// skip.add(target); +// } +// } +// if ( skip.size()>0 ) { +// content += "[skip]\n"; +// for (String sk : skip) { +// content += sk+"\n"; +// } +// content += '\n'; +// } +// Files.write(Paths.get(groupDir + "/" + filename), content.getBytes()); +// } +// catch (IOException e) { +// //exception handling left as an exercise for the reader +// System.err.println(e.getMessage()); +// } +// } +// } +// +// /** Rules for strings look like this: +// * +// * [input] if one line, remove all WS before/after +// * a b +// * +// * [input] need whitespace +// * """34 +// * 34""" +// * +// * [input] single quote char, remove all WS before/after +// * " +// * +// * [input] same as "b = 6\n" in java +// * """b = 6 +// * """ +// * +// * [input] +// * """a """ space and no newline inside +// * +// * [input] same as java string "\"aaa" +// * "aaa +// * +// * [input] ignore front/back \n except leave last \n +// * a +// * b +// * c +// * d +// */ +// private static String quoteForDescriptorFile(String s) { +// if ( s==null ) { +// return null; +// } +// long nnl = s.chars().filter(ch -> ch == '\n').count(); +// +// if ( s.endsWith(" ") || // whitespace matters +// (nnl==1&&s.endsWith("\n")) || // "b = 6\n" +// s.startsWith("\n") ) { // whitespace matters +// return "\"\"\"" + s + "\"\"\"\n"; +// } +// if ( s.endsWith(" \n") || s.endsWith("\n\n") ) { +// return "\"\"\"" + s + "\"\"\"\n"; +// } +// if ( nnl==0 ) { // one line input +// return s + "\n"; +// } +// if ( nnl>1 && s.endsWith("\n") ) { +// return s; +// } +// if ( !s.endsWith("\n") ) { // "a\n b" +// return "\"\"\"" + s + "\"\"\"\n"; +// } +// +// return s; +// } + } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTestDescriptor.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTestDescriptor.java deleted file mode 100644 index 0447c78b47..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTestDescriptor.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime; - -import org.antlr.v4.runtime.misc.Pair; -import org.antlr.v4.runtime.misc.Utils; - -import java.lang.reflect.Field; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** An abstract but mostly complete test descriptor that pulls values - * for the various runtime test descriptor methods such as {@link #getInput()} - * from fields using reflection. - * - * @since 4.6 - */ -public abstract class BaseRuntimeTestDescriptor implements RuntimeTestDescriptor { - protected String targetName; - - @Override - public String getTestName() { - return this.getClass().getSimpleName(); - } - - @Override - public String getInput() { - try { - Field f = this.getClass().getField("input"); - return stringIndentation((String)f.get(this)); - } - catch (Exception nsfe) { - ; // we are optional - } - return ""; - } - - @Override - public String getOutput() { - try { - Field f = this.getClass().getField("output"); - String s = stringIndentation((String)f.get(this)); - if ( s.length()==0 ) return null; - return s; - } - catch (Exception nsfe) { - ; // we are optional - } - return null; - } - - @Override - public String getErrors() { - try { - Field f = this.getClass().getField("errors"); - String s = stringIndentation((String)f.get(this)); - if ( s.length()==0 ) return null; - return s; - } - catch (Exception nsfe) { - ; // we are optional - } - return null; - } - - @Override - public String getANTLRToolErrors() { - try { - Field f = this.getClass().getField("toolErrors"); - String s = stringIndentation((String)f.get(this)); - if ( s.length()==0 ) return null; - return s; - } - catch (Exception nsfe) { - ; // we are optional - } - return null; - } - - @Override - public String getStartRule() { - try { - Field f = this.getClass().getField("startRule"); - return (String)f.get(this); - } - catch (Exception nsfe) { - System.err.println("No start rule specified for test "+getTestName()); - } - return null; - } - - @Override - public Pair getGrammar() { - String grammarName = null; - try { - Field f = this.getClass().getField("grammarName"); - grammarName = (String)f.get(this); - } - catch (Exception nsfe) { - System.err.println("No grammar name specified for test "+getTestName()); - } - String grammar = rawGetGrammar(); - return new Pair(grammarName,grammar); - } - - private String rawGetGrammar() { - String grammar = null; - try { - Field f = this.getClass().getField("grammar"); - grammar = (String)f.get(this); - } - catch (Exception nsfe) { - System.err.println("No start rule specified for test "+getTestName()); - } - grammar = stringIndentation(grammar); - return grammar; - } - - /** strip indentation; use first line's indent as prefix to strip */ - public static String stringIndentation(String s) { - if ( s==null ) return ""; - if ( s.equals("\n") ) return s; - s = Utils.expandTabs(s, 4); - String lines[] = s.split("\\r?\\n"); - String first = lines[0]; - Pattern wspat = Pattern.compile("^\\s+"); - Matcher matcher = wspat.matcher(first); - if ( matcher.find() ) { - String indent = matcher.group(0); - s = s.replace(indent, ""); // wack first indent - s = s.replaceAll("\\n"+indent, "\n"); // wack the others - } - return s; - } - - @Override - public List> getSlaveGrammars() { - return null; - } - - @Override - public String getTarget() { - return targetName; - } - - @Override - public void setTarget(String targetName) { - this.targetName = targetName; - } - - @Override - public boolean showDFA() { - return false; - } - - @Override - public boolean showDiagnosticErrors() { - return false; - } - - @Override - public boolean ignore(String targetName) { - return false; - } - - @Override - public String toString() { - return getTarget()+":"+getTestName(); - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTestSupport.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTestSupport.java index 8942ede343..578e0cf3e1 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTestSupport.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/BaseRuntimeTestSupport.java @@ -6,6 +6,7 @@ import org.antlr.v4.runtime.atn.ATN; import org.antlr.v4.runtime.atn.ATNDeserializer; import org.antlr.v4.runtime.atn.ATNSerializer; +import org.antlr.v4.runtime.misc.IntegerList; import org.antlr.v4.semantics.SemanticPipeline; import org.antlr.v4.tool.Grammar; import org.antlr.v4.tool.LexerGrammar; @@ -16,9 +17,7 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; -import java.nio.file.LinkOption; -import java.nio.file.Path; -import java.util.Locale; +import java.util.*; import java.util.logging.Logger; import static org.junit.Assert.assertEquals; @@ -42,6 +41,12 @@ public abstract class BaseRuntimeTestSupport implements RuntimeTestSupport { /** Errors found while running antlr */ private StringBuilder antlrToolErrors; + public static String cachingDirectory; + + static { + cachingDirectory = new File(System.getProperty("java.io.tmpdir"), "ANTLR-runtime-testsuite-cache").getAbsolutePath(); + } + @org.junit.Rule public final TestRule testWatcher = new TestWatcher() { @@ -215,12 +220,14 @@ protected ATN createATN(Grammar g, boolean useSerializer) { ATN atn = g.atn; if ( useSerializer ) { - char[] serialized = ATNSerializer.getSerializedAsChars(atn); - return new ATNDeserializer().deserialize(serialized); + // sets some flags in ATN + IntegerList serialized = ATNSerializer.getSerialized(atn); + return new ATNDeserializer().deserialize(serialized.toArray()); } return atn; } + protected void semanticProcess(Grammar g) { if ( g.ast!=null && !g.ast.hasErrors ) { // System.out.println(g.ast.toStringTree()); diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/GeneratedLexerDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/GeneratedLexerDescriptors.java new file mode 100644 index 0000000000..b489e36142 --- /dev/null +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/GeneratedLexerDescriptors.java @@ -0,0 +1,130 @@ +package org.antlr.v4.test.runtime; + +import java.util.*; + +public class GeneratedLexerDescriptors { + static RuntimeTestDescriptor getLineSeparatorLfDescriptor(String targetName) { + UniversalRuntimeTestDescriptor result = new UniversalRuntimeTestDescriptor(); + result.name = "LineSeparatorLf"; + result.targetName = targetName; + result.testType = "Lexer"; + result.grammar = "lexer grammar L;\n" + + "T: ~'\\n'+;\n" + + "SEPARATOR: '\\n';"; + result.grammarName = "L"; + result.input = "1\n2\n3"; + result.output = "[@0,0:0='1',<1>,1:0]\n" + + "[@1,1:1='\\n',<2>,1:1]\n" + + "[@2,2:2='2',<1>,2:0]\n" + + "[@3,3:3='\\n',<2>,2:1]\n" + + "[@4,4:4='3',<1>,3:0]\n" + + "[@5,5:4='',<-1>,3:1]\n"; + return result; + } + + static RuntimeTestDescriptor getLineSeparatorCrLfDescriptor(String targetName) { + UniversalRuntimeTestDescriptor result = new UniversalRuntimeTestDescriptor(); + result.name = "LineSeparatorCrLf"; + result.targetName = targetName; + result.testType = "Lexer"; + result.grammar = "lexer grammar L;\n" + + "T: ~'\\r'+;\n" + + "SEPARATOR: '\\r\\n';"; + result.grammarName = "L"; + result.input = "1\r\n2\r\n3"; + result.output = "[@0,0:0='1',<1>,1:0]\n" + + "[@1,1:2='\\r\\n',<2>,1:1]\n" + + "[@2,3:3='2',<1>,2:0]\n" + + "[@3,4:5='\\r\\n',<2>,2:1]\n" + + "[@4,6:6='3',<1>,3:0]\n" + + "[@5,7:6='',<-1>,3:1]\n"; + return result; + } + + static RuntimeTestDescriptor getLargeLexerDescriptor(String targetName) { + UniversalRuntimeTestDescriptor result = new UniversalRuntimeTestDescriptor(); + result.name = "LargeLexer"; + result.notes = "This is a regression test for antlr/antlr4#76 \"Serialized ATN strings\n" + + "should be split when longer than 2^16 bytes (class file limitation)\"\n" + + "https://github.com/antlr/antlr4/issues/76"; + result.targetName = targetName; + result.testType = "Lexer"; + + final int tokensCount = 4000; + + String grammarName = "L"; + StringBuilder grammar = new StringBuilder(); + grammar.append("lexer grammar ").append(grammarName).append(";\n"); + grammar.append("WS: [ \\t\\r\\n]+ -> skip;\n"); + for (int i = 0; i < tokensCount; i++) { + grammar.append("KW").append(i).append(" : 'KW' '").append(i).append("';\n"); + } + + result.grammar = grammar.toString(); + result.grammarName = grammarName; + result.input = "KW400"; + result.output = "[@0,0:4='KW400',<402>,1:0]\n" + + "[@1,5:4='',<-1>,1:5]\n"; + return result; + } + + static RuntimeTestDescriptor getAtnStatesSizeMoreThan65535Descriptor(String targetName) { + UniversalRuntimeTestDescriptor result = new UniversalRuntimeTestDescriptor(); + result.name = "AtnStatesSizeMoreThan65535"; + result.notes = "Regression for https://github.com/antlr/antlr4/issues/1863"; + result.targetName = targetName; + result.testType = "Lexer"; + + // I tried playing around with different sizes and I think 1002 works for Go but 1003 does not; + // the executing lexer gets a token syntax error for T208 or something like that + final int tokensCount = 1024; + final String suffix = String.join("", Collections.nCopies(70, "_")); + + String grammarName = "L"; + StringBuilder grammar = new StringBuilder(); + grammar.append("lexer grammar ").append(grammarName).append(";\n"); + grammar.append('\n'); + StringBuilder input = new StringBuilder(); + StringBuilder output = new StringBuilder(); + int startOffset; + int stopOffset = -2; + for (int i = 0; i < tokensCount; i++) { + String ruleName = String.format("T_%06d", i); + String value = ruleName+suffix; + grammar.append(ruleName).append(": '").append(value).append("';\n"); + input.append(value).append('\n'); + + startOffset = stopOffset + 2; + stopOffset += value.length() + 1; + + output.append("[@").append(i).append(',').append(startOffset).append(':').append(stopOffset) + .append("='").append(value).append("',<").append(i + 1).append(">,").append(i + 1) + .append(":0]\n"); + } + + grammar.append("\n"); + grammar.append("WS: [ \\t\\r\\n]+ -> skip;\n"); + + startOffset = stopOffset + 2; + stopOffset = startOffset - 1; + output.append("[@").append(tokensCount).append(',').append(startOffset).append(':').append(stopOffset) + .append("='',<-1>,").append(tokensCount + 1).append(":0]\n"); + + result.grammar = grammar.toString(); + result.grammarName = grammarName; + result.input = input.toString(); + result.output = output.toString(); + + // We seem to get memory errors and so I am turning this off during CI + List all = Arrays.asList( +// "CSharp", "Python2", "Python3", "Cpp", "Go", "PHP", "Swift", "Java", "JavaScript", "Node", "Dart" + "CSharp", "Python2", "Python3", "Go", "PHP", "Swift", "JavaScript", "Node", "Dart" + ); + result.skipTargets.addAll(all); + +// result.skipTargets.add("Node"); // doesn't terminate +// result.skipTargets.add("PHP"); // "Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes)..." +// result.skipTargets.add("Go"); // syntax error + return result; + } +} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/RuntimeTestDescriptor.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/RuntimeTestDescriptor.java index faaaaba932..be4cf26e9f 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/RuntimeTestDescriptor.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/RuntimeTestDescriptor.java @@ -12,16 +12,13 @@ /** This interface describes everything that a runtime test * descriptor can specify. Most testing descriptors will - * subclass {@link BaseRuntimeTestDescriptor} rather than + * subclass {@link UniversalRuntimeTestDescriptor} rather than * implement this directly. The {@link BaseRuntimeTest} * class pulls data from descriptors to execute tests. * * @since 4.6 */ public interface RuntimeTestDescriptor { - /** The name of this test such as TokenAndRuleContextString (see - * {@link org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors.TokenAndRuleContextString}) - */ String getTestName(); /** A type in {"Lexer", "Parser", "CompositeLexer", "CompositeParser"} */ @@ -40,7 +37,7 @@ public interface RuntimeTestDescriptor { String getANTLRToolErrors(); /** The rule at which parsing should start */ - String getStartRule(); // TODO: alter tests to use same default start rule? + String getStartRule(); /** For lexical tests, dump the DFA of the default lexer mode to stdout */ boolean showDFA(); diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/UniversalRuntimeTestDescriptor.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/UniversalRuntimeTestDescriptor.java new file mode 100644 index 0000000000..617a0230bc --- /dev/null +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/UniversalRuntimeTestDescriptor.java @@ -0,0 +1,104 @@ +package org.antlr.v4.test.runtime; + +import org.antlr.v4.runtime.misc.Pair; + +import java.util.ArrayList; +import java.util.List; + +/** This object represents all the information we need about a single test and is the + * in-memory representation of a descriptor file + */ +public class UniversalRuntimeTestDescriptor implements RuntimeTestDescriptor { + public String testType; + public String targetName; + public String name; + public String notes; + public String input = ""; + public String output; + public String errors; + public String startRule; + public String grammarName; + public String grammar; + public List> slaveGrammars = new ArrayList<>(); + public boolean showDFA = false; + public boolean showDiagnosticErrors = false; + + public List skipTargets = new ArrayList<>(); + + @Override + public String getTestName() { + return name; + } + + @Override + public String getTestType() { + return testType; + } + + @Override + public String getInput() { + return input; + } + + @Override + public String getOutput() { + return output; + } + + @Override + public String getErrors() { + return errors; + } + + @Override + public String getANTLRToolErrors() { + return null; + } + + @Override + public String getStartRule() { + return startRule; + } + + @Override + public List> getSlaveGrammars() { + if ( slaveGrammars.size()==0 ) return null; + return slaveGrammars; + } + + @Override + public String getTarget() { + return targetName; + } + + @Override + public void setTarget(String targetName) { + this.targetName = targetName; + } + + @Override + public boolean showDFA() { + return showDFA; + } + + @Override + public boolean showDiagnosticErrors() { + return showDiagnosticErrors; + } + + @Override + public Pair getGrammar() { + return new Pair<>(grammarName,grammar); + } + + @Override + public boolean ignore(String targetName) { + return skipTargets.contains(targetName); + } + + + @Override + public String toString() { + return getTarget()+":"+getTestName(); + } +} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/category/LeftRecursionTests.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/category/LeftRecursionTests.java deleted file mode 100644 index 11c90a9afc..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/category/LeftRecursionTests.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.antlr.v4.test.runtime.category; - -/** - * Created by ericvergnaud on 27/06/2017. - */ -public class LeftRecursionTests { -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/category/LexerTests.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/category/LexerTests.java deleted file mode 100644 index 8e534c0d1f..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/category/LexerTests.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.antlr.v4.test.runtime.category; - -/** - * Created by ericvergnaud on 27/06/2017. - */ -public class LexerTests { -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/category/ParserTests.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/category/ParserTests.java deleted file mode 100644 index 7ad7cd9578..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/category/ParserTests.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.antlr.v4.test.runtime.category; - -/** - * Created by ericvergnaud on 27/06/2017. - */ -public class ParserTests { -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java index 4b13b7ce43..1db9e1b2f1 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/BaseCppTest.java @@ -21,10 +21,6 @@ import static org.antlr.v4.test.runtime.BaseRuntimeTest.antlrOnString; import static org.antlr.v4.test.runtime.BaseRuntimeTest.writeFile; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; public class BaseCppTest extends BaseRuntimeTestSupport implements RuntimeTestSupport { @@ -168,8 +164,8 @@ public List allCppFiles(String path) { ArrayList files = new ArrayList(); File folder = new File(path); File[] listOfFiles = folder.listFiles(); - for (int i = 0; i < listOfFiles.length; i++) { - String file = listOfFiles[i].getAbsolutePath(); + for (File listOfFile : listOfFiles) { + String file = listOfFile.getAbsolutePath(); if (file.endsWith(".cpp")) { files.add(file); } @@ -205,7 +201,7 @@ private String runProcess(ProcessBuilder builder, String description, boolean sh return output; } - private String runCommand(String command[], String workPath, String description, boolean showStderr) throws Exception { + private String runCommand(String[] command, String workPath, String description, boolean showStderr) throws Exception { ProcessBuilder builder = new ProcessBuilder(command); builder.directory(new File(workPath)); @@ -218,7 +214,7 @@ private boolean buildRuntime() { System.out.println("Building ANTLR4 C++ runtime (if necessary) at "+ runtimePath); try { - String command[] = { "cmake", ".", /*"-DCMAKE_CXX_COMPILER=clang++",*/ "-DCMAKE_BUILD_TYPE=release" }; + String[] command = { "cmake", ".", /*"-DCMAKE_CXX_COMPILER=clang++",*/ "-DCMAKE_BUILD_TYPE=release" }; if (runCommand(command, runtimePath, "antlr runtime cmake", false) == null) { return false; } @@ -228,7 +224,7 @@ private boolean buildRuntime() { } try { - String command[] = { "make", "-j", "8" }; // Assuming a reasonable amount of available CPU cores. + String[] command = { "make", "-j", "8" }; // Assuming a reasonable amount of available CPU cores. if (runCommand(command, runtimePath, "building antlr runtime", true) == null) return false; } @@ -236,7 +232,7 @@ private boolean buildRuntime() { System.err.println("can't compile antlr cpp runtime"); e.printStackTrace(System.err); try { - String command[] = { "ls", "-la" }; + String[] command = { "ls", "-la" }; String output = runCommand(command, runtimePath + "/dist/", "printing library folder content", true); System.out.println(output); } @@ -268,11 +264,11 @@ public String execModule(String fileName) { String binPath = new File(getTempTestDir(), "a.out").getAbsolutePath(); String inputPath = new File(getTempTestDir(), "input").getAbsolutePath(); - // Build runtime using cmake once. - synchronized (runtimeBuiltOnce) { + // Build runtime using cmake once per VM. + synchronized (BaseCppTest.class) { if ( !runtimeBuiltOnce ) { try { - String command[] = {"clang++", "--version"}; + String[] command = {"clang++", "--version"}; String output = runCommand(command, getTempDirPath(), "printing compiler version", false); System.out.println("Compiler version is: "+output); } @@ -292,7 +288,7 @@ public String execModule(String fileName) { // Create symlink to the runtime. Currently only used on OSX. String libExtension = (getOS().equals("mac")) ? "dylib" : "so"; try { - String command[] = { "ln", "-s", runtimePath + "/dist/libantlr4-runtime." + libExtension }; + String[] command = { "ln", "-s", runtimePath + "/dist/libantlr4-runtime." + libExtension }; if (runCommand(command, getTempDirPath(), "sym linking C++ runtime", true) == null) return null; } @@ -303,7 +299,7 @@ public String execModule(String fileName) { } try { - List command2 = new ArrayList(Arrays.asList("clang++", "-std=c++11", "-I", includePath, "-L.", "-lantlr4-runtime", "-o", "a.out")); + List command2 = new ArrayList(Arrays.asList("clang++", "-std=c++17", "-I", includePath, "-L.", "-lantlr4-runtime", "-pthread", "-o", "a.out")); command2.addAll(allCppFiles(getTempDirPath())); if (runCommand(command2.toArray(new String[0]), getTempDirPath(), "building test binary", true) == null) { return null; @@ -356,7 +352,7 @@ protected String locateRuntime() { p = Paths.get(runtimeURL.toURI()).toFile().toString(); } catch (URISyntaxException use) { - p = "Can't find runtime at " + runtimeURL.toString(); + p = "Can't find runtime at " + runtimeURL; } return p; } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestCompositeLexers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestCompositeLexers.java index 182d2536ce..64800e84d9 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestCompositeLexers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestCompositeLexers.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.CompositeLexersDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestCompositeLexers extends BaseRuntimeTest { public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeLexersDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeLexers", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestCompositeParsers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestCompositeParsers.java index 98dfbc79a5..ce08ba4b3d 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestCompositeParsers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestCompositeParsers.java @@ -6,16 +6,11 @@ package org.antlr.v4.test.runtime.cpp; -import org.antlr.v4.codegen.model.Parser; import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.CompositeParsersDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestCompositeParsers extends BaseRuntimeTest { public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @@ -24,6 +19,6 @@ public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeParsersDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeParsers", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestFullContextParsing.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestFullContextParsing.java index 96d1d5b637..41e26819e7 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestFullContextParsing.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestFullContextParsing.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.FullContextParsingDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestFullContextParsing extends BaseRuntimeTest { public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(FullContextParsingDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("FullContextParsing", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLeftRecursion.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLeftRecursion.java index 962be4bbec..6e62076f12 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLeftRecursion.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLeftRecursion.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LeftRecursionTests; -import org.antlr.v4.test.runtime.descriptors.LeftRecursionDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LeftRecursionTests.class) @RunWith(Parameterized.class) public class TestLeftRecursion extends BaseRuntimeTest { public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LeftRecursionDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LeftRecursion", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLexerErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLexerErrors.java index 05307d6f7c..015f9d577c 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLexerErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLexerErrors.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.LexerErrorsDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestLexerErrors extends BaseRuntimeTest { public TestLexerErrors(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestLexerErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerErrorsDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerErrors", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLexerExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLexerExec.java index 9c5cc89a96..64ea001509 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLexerExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestLexerExec.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestLexerExec extends BaseRuntimeTest { public TestLexerExec(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestLexerExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerExecDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerExec", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestListeners.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestListeners.java index 75a6d1000c..d575cd74b0 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestListeners.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestListeners.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestListeners extends BaseRuntimeTest { public TestListeners(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestListeners(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ListenersDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Listeners", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParseTrees.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParseTrees.java index ca333afc5c..962f6d1765 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParseTrees.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParseTrees.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestParseTrees extends BaseRuntimeTest { public TestParseTrees(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestParseTrees(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParseTreesDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParseTrees", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParserErrors.java index aa8fc80fd4..1f764f03c7 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParserErrors.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ParserErrorsDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestParserErrors extends BaseRuntimeTest { public TestParserErrors(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestParserErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserErrorsDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserErrors", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParserExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParserExec.java index 999f3116fa..769aea08ff 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParserExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestParserExec.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ParserExecDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestParserExec extends BaseRuntimeTest { public TestParserExec(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestParserExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserExecDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserExec", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestPerformance.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestPerformance.java index 7ab384ce56..81746438b9 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestPerformance.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestPerformance.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestPerformance extends BaseRuntimeTest { public TestPerformance(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestPerformance(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(PerformanceDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Performance", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSemPredEvalLexer.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSemPredEvalLexer.java index 23f90bd83a..cc8d3037f5 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSemPredEvalLexer.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSemPredEvalLexer.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalLexerDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestSemPredEvalLexer extends BaseRuntimeTest { public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalLexerDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalLexer", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSemPredEvalParser.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSemPredEvalParser.java index 3b3eb5ca1a..0909c68a82 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSemPredEvalParser.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSemPredEvalParser.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalParserDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestSemPredEvalParser extends BaseRuntimeTest { public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalParserDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalParser", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSets.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSets.java index a1345ae177..ee4e82c2a0 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSets.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/cpp/TestSets.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.SetsDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestSets extends BaseRuntimeTest { public TestSets(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestSets(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SetsDescriptors.class, "Cpp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Sets", "Cpp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/Antlr4.Test.csproj b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/Antlr4.Test.csproj index b6436700f4..061e2ff69e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/Antlr4.Test.csproj +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/Antlr4.Test.csproj @@ -15,4 +15,10 @@ false + + + Antlr4.Runtime.Standard.dll + + + diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java index e1c713eb76..14ac3bf6f5 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/BaseCSharpTest.java @@ -9,13 +9,10 @@ import org.antlr.v4.test.runtime.*; import org.stringtemplate.v4.ST; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import java.io.*; import java.net.URL; -import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -27,11 +24,14 @@ import static org.antlr.v4.test.runtime.BaseRuntimeTest.antlrOnString; import static org.antlr.v4.test.runtime.BaseRuntimeTest.writeFile; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; public class BaseCSharpTest extends BaseRuntimeTestSupport implements RuntimeTestSupport { + private static Boolean isRuntimeInitialized = false; + private final static String cSharpAntlrRuntimeDllName = "Antlr4.Runtime.Standard.dll"; + private final static String testProjectFileName = "Antlr4.Test.csproj"; + private static String cSharpTestProjectContent; + private static final String cSharpCachingDirectory = Paths.get(cachingDirectory, "CSharp").toString(); @Override protected String getPropertyPrefix() { @@ -141,7 +141,7 @@ protected boolean rawGenerateRecognizer(String grammarFileName, files.add(grammarName + "BaseVisitor.cs"); } } - addSourceFiles(files.toArray(new String[files.size()])); + addSourceFiles(files.toArray(new String[0])); return true; } @@ -177,7 +177,8 @@ public String execRecognizer() { public boolean compile() { try { return buildProject(); - } catch (Exception e) { + } + catch (Exception e) { e.printStackTrace(System.err); return false; } @@ -189,9 +190,34 @@ private String locateExec() { public boolean buildProject() { try { + assertTrue(initializeRuntime()); // save auxiliary files - String pack = BaseCSharpTest.class.getPackage().getName().replace(".", "/") + "/"; - saveResourceAsFile(pack + "Antlr4.Test.csproj", new File(getTempTestDir(), "Antlr4.Test.csproj")); + try (PrintWriter out = new PrintWriter(new File(getTempTestDir(), testProjectFileName))) { + out.print(cSharpTestProjectContent); + } + + // build test + String[] args = new String[] { "dotnet", "build", testProjectFileName, "-c", "Release" }; + boolean success = runProcess(args, getTempDirPath()); + assertTrue(success); + } + catch (Exception e) { + e.printStackTrace(System.err); + return false; + } + + return true; + } + + private boolean initializeRuntime() { + // Compile runtime project once per overall maven test session (assuming forkCount=0) + synchronized (BaseCSharpTest.class) { + if ( isRuntimeInitialized) { +// System.out.println("C# runtime build REUSED\n"); + return true; + } + + System.out.println("Building C# runtime\n"); // find runtime package final ClassLoader loader = Thread.currentThread().getContextClassLoader(); @@ -202,33 +228,42 @@ public boolean buildProject() { File runtimeProjFile = new File(runtimeProj.getFile()); String runtimeProjPath = runtimeProjFile.getPath(); - // add Runtime project reference + RuntimeTestUtils.mkdir(cSharpCachingDirectory); String[] args = new String[]{ - "dotnet", - "add", - "Antlr4.Test.csproj", - "reference", - runtimeProjPath - }; - boolean success = runProcess(args, getTempDirPath()); - assertTrue(success); - - // build test - args = new String[]{ "dotnet", "build", - "Antlr4.Test.csproj", + runtimeProjPath, "-c", - "Release" + "Release", + "-o", + cSharpCachingDirectory }; - success = runProcess(args, getTempDirPath()); - assertTrue(success); - } catch (Exception e) { - e.printStackTrace(System.err); - return false; - } - return true; + boolean success; + try { + String cSharpTestProjectResourceName = BaseCSharpTest.class.getPackage().getName().replace(".", "/") + "/"; + InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(cSharpTestProjectResourceName + testProjectFileName); + int bufferSize = 1024; + char[] buffer = new char[bufferSize]; + StringBuilder out = new StringBuilder(); + Reader in = new InputStreamReader(inputStream, StandardCharsets.UTF_8); + for (int numRead; (numRead = in.read(buffer, 0, buffer.length)) > 0; ) { + out.append(buffer, 0, numRead); + } + cSharpTestProjectContent = out.toString().replace(cSharpAntlrRuntimeDllName, Paths.get(cSharpCachingDirectory, cSharpAntlrRuntimeDllName).toString()); + + success = runProcess(args, cSharpCachingDirectory); + } catch (Exception e) { + e.printStackTrace(System.err); + success = false; + } + + if (success) System.out.println("C# runtime build succeeded\n"); + else System.out.println("C# runtime build failed\n"); + + isRuntimeInitialized = true; // try only once + return success; + } } private boolean runProcess(String[] args, String path) throws Exception { @@ -252,7 +287,7 @@ private boolean runProcess(String[] args, String path, int retries) throws Excep setParseErrors(stderrVacuum.toString()); System.err.println("runProcess command: " + Utils.join(args, " ")); System.err.println("runProcess exitValue: " + exitValue); - System.err.println("runProcess stdoutVacuum: " + stdoutVacuum.toString()); + System.err.println("runProcess stdoutVacuum: " + stdoutVacuum); System.err.println("runProcess stderrVacuum: " + getParseErrors()); } if (exitValue == 132) { @@ -271,27 +306,11 @@ private boolean runProcess(String[] args, String path, int retries) throws Excep return success; } - private void saveResourceAsFile(String resourceName, File file) throws IOException { - InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(resourceName); - if (input == null) { - System.err.println("Can't find " + resourceName + " as resource"); - throw new IOException("Missing resource:" + resourceName); - } - OutputStream output = new FileOutputStream(file.getAbsolutePath()); - while (input.available() > 0) { - output.write(input.read()); - } - output.close(); - input.close(); - } - public String execTest() { String exec = locateExec(); try { File tmpdirFile = new File(getTempDirPath()); - Path output = tmpdirFile.toPath().resolve("output"); - Path errorOutput = tmpdirFile.toPath().resolve("error-output"); - String[] args = getExecTestArgs(exec, output, errorOutput); + String[] args = new String[] { "dotnet", exec, new File(getTempTestDir(), "input").getAbsolutePath() }; ProcessBuilder pb = new ProcessBuilder(args); pb.directory(tmpdirFile); Process process = pb.start(); @@ -302,37 +321,19 @@ public String execTest() { process.waitFor(); stdoutVacuum.join(); stderrVacuum.join(); - String writtenOutput = TestOutputReading.read(output); - setParseErrors(TestOutputReading.read(errorOutput)); - int exitValue = process.exitValue(); - String stdoutString = stdoutVacuum.toString().trim(); - String stderrString = stderrVacuum.toString().trim(); - if (exitValue != 0) { - System.err.println("execTest command: " + Utils.join(args, " ")); - System.err.println("execTest exitValue: " + exitValue); - } - if (!stdoutString.isEmpty()) { - System.err.println("execTest stdoutVacuum: " + stdoutString); - } - if (!stderrString.isEmpty()) { - System.err.println("execTest stderrVacuum: " + stderrString); - } - return writtenOutput; - } catch (Exception e) { + process.exitValue(); + String stdoutString = stdoutVacuum.toString(); + String stderrString = stderrVacuum.toString(); + setParseErrors(stderrString); + return stdoutString; + } + catch (Exception e) { System.err.println("can't exec recognizer"); e.printStackTrace(System.err); } return null; } - private String[] getExecTestArgs(String exec, Path output, Path errorOutput) { - return new String[]{ - "dotnet", exec, new File(getTempTestDir(), "input").getAbsolutePath(), - output.toAbsolutePath().toString(), - errorOutput.toAbsolutePath().toString() - }; - } - protected void writeParserTestFile(String parserName, String lexerName, String parserStartRuleName, @@ -341,46 +342,42 @@ protected void writeParserTestFile(String parserName, "using System;\n" + "using Antlr4.Runtime;\n" + "using Antlr4.Runtime.Tree;\n" + - "using System.IO;\n" + "using System.Text;\n" + "\n" + "public class Test {\n" + " public static void Main(string[] args) {\n" + + " Console.OutputEncoding = Encoding.UTF8;\n" + + " Console.InputEncoding = Encoding.UTF8;\n" + " var input = CharStreams.fromPath(args[0]);\n" + - " using (FileStream fsOut = new FileStream(args[1], FileMode.Create, FileAccess.Write))\n" + - " using (FileStream fsErr = new FileStream(args[2], FileMode.Create, FileAccess.Write))\n" + - " using (TextWriter output = new StreamWriter(fsOut),\n" + - " errorOutput = new StreamWriter(fsErr)) {\n" + - " lex = new (input, output, errorOutput);\n" + - " CommonTokenStream tokens = new CommonTokenStream(lex);\n" + - " \n" + - " parser.BuildParseTree = true;\n" + - " ParserRuleContext tree = parser.();\n" + - " ParseTreeWalker.Default.Walk(new TreeShapeListener(), tree);\n" + - " }\n" + + " lex = new (input);\n" + + " CommonTokenStream tokens = new CommonTokenStream(lex);\n" + + " \n" + + " parser.BuildParseTree = true;\n" + + " ParserRuleContext tree = parser.();\n" + + " ParseTreeWalker.Default.Walk(new TreeShapeListener(), tree);\n" + " }\n" + "}\n" + "\n" + "class TreeShapeListener : IParseTreeListener {\n" + - " public void VisitTerminal(ITerminalNode node) { }\n" + - " public void VisitErrorNode(IErrorNode node) { }\n" + - " public void ExitEveryRule(ParserRuleContext ctx) { }\n" + + " public void VisitTerminal(ITerminalNode node) { }\n" + + " public void VisitErrorNode(IErrorNode node) { }\n" + + " public void ExitEveryRule(ParserRuleContext ctx) { }\n" + "\n" + - " public void EnterEveryRule(ParserRuleContext ctx) {\n" + - " for (int i = 0; i \\< ctx.ChildCount; i++) {\n" + - " IParseTree parent = ctx.GetChild(i).Parent;\n" + - " if (!(parent is IRuleNode) || ((IRuleNode)parent).RuleContext != ctx) {\n" + - " throw new Exception(\"Invalid parse tree shape detected.\");\n" + - " }\n" + - " }\n" + - " }\n" + + " public void EnterEveryRule(ParserRuleContext ctx) {\n" + + " for (int i = 0; i \\< ctx.ChildCount; i++) {\n" + + " IParseTree parent = ctx.GetChild(i).Parent;\n" + + " if (!(parent is IRuleNode) || ((IRuleNode)parent).RuleContext != ctx) {\n" + + " throw new Exception(\"Invalid parse tree shape detected.\");\n" + + " }\n" + + " }\n" + + " }\n" + "}" ); - ST createParserST = new ST(" parser = new (tokens, output, errorOutput);\n"); + ST createParserST = new ST(" parser = new (tokens);\n"); if (debug) { createParserST = new ST( - " parser = new (tokens, output, errorOutput);\n" + + " parser = new (tokens);\n" + " parser.AddErrorListener(new DiagnosticErrorListener());\n"); } outputFileST.add("createParser", createParserST); @@ -399,19 +396,16 @@ protected void writeLexerTestFile(String lexerName, boolean showDFA) { "\n" + "public class Test {\n" + " public static void Main(string[] args) {\n" + + " Console.OutputEncoding = Encoding.UTF8;\n" + + " Console.InputEncoding = Encoding.UTF8;\n" + " var input = CharStreams.fromPath(args[0]);\n" + - " using (FileStream fsOut = new FileStream(args[1], FileMode.Create, FileAccess.Write))\n" + - " using (FileStream fsErr = new FileStream(args[2], FileMode.Create, FileAccess.Write))\n" + - " using (TextWriter output = new StreamWriter(fsOut),\n" + - " errorOutput = new StreamWriter(fsErr)) {\n" + - " lex = new (input, output, errorOutput);\n" + + " lex = new (input);\n" + " CommonTokenStream tokens = new CommonTokenStream(lex);\n" + " tokens.Fill();\n" + " foreach (object t in tokens.GetTokens())\n" + - " output.WriteLine(t);\n" + - (showDFA ? " output.Write(lex.Interpreter.GetDFA(Lexer.DEFAULT_MODE).ToLexerString());\n" : "") + + " Console.Out.WriteLine(t);\n" + + (showDFA ? " Console.Out.Write(lex.Interpreter.GetDFA(Lexer.DEFAULT_MODE).ToLexerString());\n" : "") + " }\n" + - "}\n" + "}" ); diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestCompositeLexers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestCompositeLexers.java index 69ca0ca0f5..75ecb9d111 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestCompositeLexers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestCompositeLexers.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.CompositeLexersDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestCompositeLexers extends BaseRuntimeTest { public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeLexersDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeLexers", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestCompositeParsers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestCompositeParsers.java index 930d408d5d..f27b2aa0b2 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestCompositeParsers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestCompositeParsers.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.CompositeParsersDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestCompositeParsers extends BaseRuntimeTest { public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeParsersDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeParsers", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestFullContextParsing.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestFullContextParsing.java index 543674a978..01e9642616 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestFullContextParsing.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestFullContextParsing.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.FullContextParsingDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestFullContextParsing extends BaseRuntimeTest { public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(FullContextParsingDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("FullContextParsing", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLeftRecursion.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLeftRecursion.java index b5e9994bc5..b9ad2b871a 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLeftRecursion.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLeftRecursion.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LeftRecursionTests; -import org.antlr.v4.test.runtime.descriptors.LeftRecursionDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LeftRecursionTests.class) @RunWith(Parameterized.class) public class TestLeftRecursion extends BaseRuntimeTest { public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LeftRecursionDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LeftRecursion", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLexerErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLexerErrors.java index a49ec51e9c..b21011c40c 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLexerErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLexerErrors.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.LexerErrorsDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestLexerErrors extends BaseRuntimeTest { public TestLexerErrors(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestLexerErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerErrorsDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerErrors", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLexerExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLexerExec.java index 7ba1801190..a6ba3ef2a4 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLexerExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestLexerExec.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestLexerExec extends BaseRuntimeTest { public TestLexerExec(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestLexerExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerExecDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerExec", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestListeners.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestListeners.java index e8d5999981..84058c0e86 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestListeners.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestListeners.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestListeners extends BaseRuntimeTest { public TestListeners(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestListeners(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ListenersDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Listeners", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParseTrees.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParseTrees.java index 22110fa23a..99941d4e2e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParseTrees.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParseTrees.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestParseTrees extends BaseRuntimeTest { public TestParseTrees(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestParseTrees(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParseTreesDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParseTrees", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserErrors.java index b7a2463f05..f4dab02020 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserErrors.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ParserErrorsDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestParserErrors extends BaseRuntimeTest { public TestParserErrors(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestParserErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserErrorsDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserErrors", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserExec.java index 2561dbf107..30c63b97bf 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestParserExec.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ParserExecDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestParserExec extends BaseRuntimeTest { public TestParserExec(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestParserExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserExecDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserExec", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestPerformance.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestPerformance.java index 108ea1878d..b0d5f5f89a 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestPerformance.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestPerformance.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestPerformance extends BaseRuntimeTest { public TestPerformance(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestPerformance(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(PerformanceDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Performance", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSemPredEvalLexer.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSemPredEvalLexer.java index f2fa2d2a33..4c353990bd 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSemPredEvalLexer.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSemPredEvalLexer.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalLexerDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestSemPredEvalLexer extends BaseRuntimeTest { public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalLexerDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalLexer", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSemPredEvalParser.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSemPredEvalParser.java index 5ecab67c89..f1771833d5 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSemPredEvalParser.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSemPredEvalParser.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalParserDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestSemPredEvalParser extends BaseRuntimeTest { public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalParserDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalParser", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSets.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSets.java index 1b970e30b4..b45fadf9bb 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSets.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/csharp/TestSets.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.SetsDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestSets extends BaseRuntimeTest { public TestSets(RuntimeTestDescriptor descriptor) { @@ -23,6 +19,6 @@ public TestSets(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SetsDescriptors.class, "CSharp"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Sets", "CSharp"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java index dd54c2027b..dbfbb278f5 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/BaseDartTest.java @@ -8,8 +8,6 @@ import org.antlr.v4.misc.Utils; import org.antlr.v4.test.runtime.*; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; import org.stringtemplate.v4.ST; import java.io.*; @@ -23,11 +21,6 @@ public class BaseDartTest extends BaseRuntimeTestSupport implements RuntimeTestSupport { - private static final List AOT_COMPILE_TESTS = Arrays.asList( - new PerformanceDescriptors.DropLoopEntryBranchInLRRule_4().input, - new LexerExecDescriptors.LargeLexer().input - ); - private static String cacheDartPackages; private static String cacheDartPackageConfig; @@ -48,7 +41,7 @@ public String execLexer(String grammarFileName, assertTrue(success); writeFile(getTempDirPath(), "input", input); writeLexerTestFile(lexerName, showDFA); - String output = execClass("Test", AOT_COMPILE_TESTS.contains(input)); + String output = execClass("Test", false); return output; } @@ -88,7 +81,7 @@ public String execParser(String grammarFileName, startRuleName, showDiagnosticErrors, profile, - AOT_COMPILE_TESTS.contains(input)); + false); } /** @@ -167,7 +160,7 @@ public void run() { stderrVacuum.join(); String stderrDuringPubGet = stderrVacuum.toString(); if (!stderrDuringPubGet.isEmpty()) { - System.out.println("Pub Get error: " + stderrVacuum.toString()); + System.out.println("Pub Get error: " + stderrVacuum); } } catch (IOException | InterruptedException e) { e.printStackTrace(); @@ -193,7 +186,8 @@ protected String rawExecRecognizer(String parserName, setParseErrors(null); if (parserName == null) { writeLexerTestFile(lexerName, false); - } else { + } + else { writeTestFile(parserName, lexerName, parserStartRuleName, @@ -232,7 +226,7 @@ public void run() { timer.cancel(); if (result != 0) { stderrVacuum.join(); - System.err.print("Error compiling dart file: " + stderrVacuum.toString()); + System.err.print("Error compiling dart file: " + stderrVacuum); } } @@ -302,7 +296,7 @@ private String locateTool(String tool) { final String[] roots = isWindows() ? new String[]{"C:\\tools\\dart-sdk\\bin\\"} - : new String[]{"/usr/local/bin/", "/opt/local/bin/", "/usr/bin/", "/usr/lib/dart/bin/", "/usr/local/opt/dart/libexec"}; + : new String[]{"/usr/local/bin/", "/opt/local/bin/", "/opt/homebrew/bin/", "/usr/bin/", "/usr/lib/dart/bin/", "/usr/local/opt/dart/libexec"}; for (String root : roots) { for (String t : tools) { diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestCompositeLexers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestCompositeLexers.java index 60aa4a35ae..27585f139d 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestCompositeLexers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestCompositeLexers.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeLexersDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeLexers extends BaseRuntimeTest { public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeLexersDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeLexers", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestCompositeParsers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestCompositeParsers.java index 638413f9a5..049f1d8616 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestCompositeParsers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestCompositeParsers.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeParsersDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeParsers extends BaseRuntimeTest { public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeParsersDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeParsers", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestFullContextParsing.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestFullContextParsing.java index a0d7f9c1a6..9b3a45385e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestFullContextParsing.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestFullContextParsing.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.FullContextParsingDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestFullContextParsing extends BaseRuntimeTest { public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(FullContextParsingDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("FullContextParsing", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLeftRecursion.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLeftRecursion.java index e92f1b306a..b1af01a1a6 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLeftRecursion.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLeftRecursion.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LeftRecursionDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLeftRecursion extends BaseRuntimeTest { public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LeftRecursionDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LeftRecursion", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLexerErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLexerErrors.java index b95cd59bf1..668c990d40 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLexerErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLexerErrors.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerErrorsDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerErrors extends BaseRuntimeTest { public TestLexerErrors(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestLexerErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerErrorsDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerErrors", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLexerExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLexerExec.java index 1ed1d84caa..a6d5736a67 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLexerExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestLexerExec.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerExec extends BaseRuntimeTest { public TestLexerExec(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestLexerExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerExecDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerExec", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestListeners.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestListeners.java index e15dee9ae7..314b96f804 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestListeners.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestListeners.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestListeners extends BaseRuntimeTest { public TestListeners(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestListeners(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ListenersDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Listeners", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParseTrees.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParseTrees.java index 0115e384d5..992c33cd08 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParseTrees.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParseTrees.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParseTrees extends BaseRuntimeTest { public TestParseTrees(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestParseTrees(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParseTreesDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParseTrees", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParserErrors.java index 87b850fb90..2f9c423f67 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParserErrors.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserErrorsDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserErrors extends BaseRuntimeTest { public TestParserErrors(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestParserErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserErrorsDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserErrors", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParserExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParserExec.java index c22aa8cebb..a6f3812bf9 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParserExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestParserExec.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserExecDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserExec extends BaseRuntimeTest { public TestParserExec(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestParserExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserExecDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserExec", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestPerformance.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestPerformance.java index 78e6942ac6..fe290bbaa1 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestPerformance.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestPerformance.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestPerformance extends BaseRuntimeTest { public TestPerformance(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestPerformance(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(PerformanceDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Performance", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSemPredEvalLexer.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSemPredEvalLexer.java index 8825042cf6..f6d870427f 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSemPredEvalLexer.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSemPredEvalLexer.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalLexerDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalLexer extends BaseRuntimeTest { public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalLexerDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalLexer", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSemPredEvalParser.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSemPredEvalParser.java index 87d6a9deab..7bee5f541b 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSemPredEvalParser.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSemPredEvalParser.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalParserDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalParser extends BaseRuntimeTest { public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalParserDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalParser", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSets.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSets.java index 4fe603fd4f..aaf3c25632 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSets.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/dart/TestSets.java @@ -8,11 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SetsDescriptors; -import org.antlr.v4.test.runtime.dart.BaseDartTest; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSets extends BaseRuntimeTest { public TestSets(RuntimeTestDescriptor descriptor) { @@ -21,6 +18,6 @@ public TestSets(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SetsDescriptors.class, "Dart"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Sets", "Dart"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/CompositeLexersDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/CompositeLexersDescriptors.java deleted file mode 100644 index 878b9e1f2b..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/CompositeLexersDescriptors.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.runtime.misc.Pair; -import org.antlr.v4.test.runtime.BaseCompositeLexerTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -import java.util.ArrayList; -import java.util.List; - -public class CompositeLexersDescriptors { - public static class LexerDelegatorInvokesDelegateRule extends BaseCompositeLexerTestDescriptor { - public String input = "abc"; - /** - S.A - [@0,0:0='a',<3>,1:0] - [@1,1:1='b',<1>,1:1] - [@2,2:2='c',<4>,1:2] - [@3,3:2='',<-1>,1:3] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "M"; - - /** - lexer grammar M; - import S; - B : 'b'; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - lexer grammar S; - A : 'a' {}; - C : 'c' ; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",slaveGrammarS)); - - return slaves; - } - } - - public static class LexerDelegatorRuleOverridesDelegate extends BaseCompositeLexerTestDescriptor { - public String input = "ab"; - /** - M.A - [@0,0:1='ab',<1>,1:0] - [@1,2:1='',<-1>,1:2] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "M"; - - /** - lexer grammar M; - import S; - A : 'a' B {} ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - lexer grammar S; - A : 'a' {} ; - B : 'b' {} ; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",slaveGrammarS)); - - return slaves; - } - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/CompositeParsersDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/CompositeParsersDescriptors.java deleted file mode 100644 index 6134b265b9..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/CompositeParsersDescriptors.java +++ /dev/null @@ -1,587 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.runtime.misc.Pair; -import org.antlr.v4.test.runtime.BaseCompositeParserTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -import java.util.ArrayList; -import java.util.List; - -public class CompositeParsersDescriptors { - public static class BringInLiteralsFromDelegate extends BaseCompositeParserTestDescriptor { - public String input = "=a"; - public String output = "S.a\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "M"; - - /** - grammar M; - import S; - s : a ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar S; - a : '=' 'a' {}; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class CombinedImportsCombined extends BaseCompositeParserTestDescriptor { - public String input = "x 34 9"; - public String output = "S.x\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "M"; - - /** - grammar M; - import S; - s : x INT; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar S; - tokens { A, B, C } - x : 'x' INT {}; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class DelegatesSeeSameTokenType extends BaseCompositeParserTestDescriptor { - public String input = "aa"; - /** - S.x - T.y - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "M"; - - /** - // The lexer will create rules to match letters a, b, c. - // The associated token types A, B, C must have the same value - // and all import'd parsers. Since ANTLR regenerates all imports - // for use with the delegator M, it can generate the same token type - // mapping in each parser: - // public static final int C=6; - // public static final int EOF=-1; - // public static final int B=5; - // public static final int WS=7; - // public static final int A=4; - grammar M; - import S,T; - s : x y ; // matches AA, which should be 'aa' - B : 'b' ; // another order: B, A, C - A : 'a' ; - C : 'c' ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar T; - tokens { C, B, A } // reverse order - y : A {}; - */ - @CommentHasStringValue - public String slaveGrammarT; - /** - parser grammar S; - tokens { A, B, C } - x : A {}; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("T",stringIndentation(slaveGrammarT))); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class DelegatorAccessesDelegateMembers extends BaseCompositeParserTestDescriptor { - public String input = "b"; - public String output = "foo\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "M"; - - /** - grammar M; // uses no rules from the import - import S; - s : 'b' {} ; // gS is import pointer - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar S; - @parser::members { - - } - a : B; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class DelegatorInvokesDelegateRule extends BaseCompositeParserTestDescriptor { - public String input = "b"; - public String output = "S.a\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "M"; - - /** - grammar M; - import S; - s : a ; - B : 'b' ; // defines B from inherited token space - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar S; - a : B {}; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class DelegatorInvokesDelegateRuleWithArgs extends BaseCompositeParserTestDescriptor { - public String input = "b"; - public String output = "S.a1000\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "M"; - - /** - grammar M; - import S; - s : label=a[3] {} ; - B : 'b' ; // defines B from inherited token space - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar S; - a[int x] returns [int y] : B {} {$y=1000;} ; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class DelegatorInvokesDelegateRuleWithReturnStruct extends BaseCompositeParserTestDescriptor { - public String input = "b"; - public String output = "S.ab\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "M"; - - /** - grammar M; - import S; - s : a {} ; - B : 'b' ; // defines B from inherited token space - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar S; - a : B {} ; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class DelegatorInvokesFirstVersionOfDelegateRule extends BaseCompositeParserTestDescriptor { - public String input = "b"; - public String output = "S.a\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "M"; - - /** - grammar M; - import S,T; - s : a ; - B : 'b' ; // defines B from inherited token space - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar T; - a : B {}; - */ - @CommentHasStringValue - public String slaveGrammarT; - /** - parser grammar S; - a : b {}; - b : B; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("T",stringIndentation(slaveGrammarT))); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class DelegatorRuleOverridesDelegate extends BaseCompositeParserTestDescriptor { - public String input = "c"; - public String output = "S.a\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "M"; - - /** - grammar M; - import S; - b : 'b'|'c'; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar S; - a : b {}; - b : B ; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class DelegatorRuleOverridesDelegates extends BaseCompositeParserTestDescriptor { - public String input = "c"; - /** - M.b - S.a - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "a"; - public String grammarName = "M"; - - /** - grammar M; - import S, T; - b : 'b'|'c' {}|B|A; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar T; - tokens { A } - b : 'b' {}; - */ - @CommentHasStringValue - public String slaveGrammarT; - /** - parser grammar S; - a : b {}; - b : 'b' ; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("T",stringIndentation(slaveGrammarT))); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class DelegatorRuleOverridesLookaheadInDelegate extends BaseCompositeParserTestDescriptor { - public String input = "float x = 3;"; - public String output = "JavaDecl: floatx=3;\n"; - public String errors = null; - public String startRule = "prog"; - public String grammarName = "M"; - - /** - grammar M; - import S; - prog : decl ; - type_ : 'int' | 'float' ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar S; - type_ : 'int' ; - decl : type_ ID ';' - | type_ ID init_ ';' {}; - init_ : '=' INT; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - /* - * This is a regression test for antlr/antlr4#248 "Including grammar with only - * fragments breaks generated lexer". - * https://github.com/antlr/antlr4/issues/248 - */ - public static class ImportLexerWithOnlyFragmentRules extends BaseCompositeParserTestDescriptor { - public String input = "test test"; - public String output = null; - public String errors = null; - public String startRule = "program"; - public String grammarName = "Test"; - - /** - grammar Test; - import Unicode; - - program : 'test' 'test'; - - WS : (UNICODE_CLASS_Zs)+ -> skip; - - */ - @CommentHasStringValue - public String grammar; - - /** - lexer grammar Unicode; - - fragment - UNICODE_CLASS_Zs : '\u0020' | '\u00A0' | '\u1680' | '\u180E' - | '\u2000'..'\u200A' - | '\u202F' | '\u205F' | '\u3000' - ; - - */ - @CommentHasStringValue - public String slaveGrammarUnicode; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("Unicode",stringIndentation(slaveGrammarUnicode))); - - return slaves; - } - } - - public static class ImportedGrammarWithEmptyOptions extends BaseCompositeParserTestDescriptor { - public String input = "b"; - public String output = null; - public String errors = null; - public String startRule = "s"; - public String grammarName = "M"; - - /** - grammar M; - import S; - s : a ; - B : 'b' ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar S; - options {} - a : B ; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class ImportedRuleWithAction extends BaseCompositeParserTestDescriptor { - public String input = "b"; - public String output = null; - public String errors = null; - public String startRule = "s"; - public String grammarName = "M"; - - /** - grammar M; - import S; - s : a; - B : 'b'; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - parser grammar S; - a @after {} : B; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } - - public static class KeywordVSIDOrder extends BaseCompositeParserTestDescriptor { - public String input = "abc"; - /** - M.A - M.a: [@0,0:2='abc',<1>,1:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "a"; - public String grammarName = "M"; - - /** - grammar M; - import S; - a : A {}; - A : 'abc' {}; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - /** - lexer grammar S; - ID : 'a'..'z'+; - */ - @CommentHasStringValue - public String slaveGrammarS; - - @Override - public List> getSlaveGrammars() { - List> slaves = new ArrayList>(); - slaves.add(new Pair("S",stringIndentation(slaveGrammarS))); - - return slaves; - } - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/FullContextParsingDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/FullContextParsingDescriptors.java deleted file mode 100644 index fb71b38632..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/FullContextParsingDescriptors.java +++ /dev/null @@ -1,425 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseDiagnosticParserTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -public class FullContextParsingDescriptors { - public static class AmbigYieldsCtxSensitiveDFA extends BaseDiagnosticParserTestDescriptor { - public String input = "abc"; - /** - Decision 0: - s0-ID->:s1^=>1 - */ - @CommentHasStringValue - public String output; - - public String errors = "line 1:0 reportAttemptingFullContext d=0 (s), input='abc'\n"; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} - : ID | ID {} ; - ID : 'a'..'z'+; - WS : (' '|'\t'|'\n')+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - } - - public static class AmbiguityNoLoop extends BaseDiagnosticParserTestDescriptor { - public String input = "a@"; - public String output = "alt 1\n"; - /** - line 1:2 reportAttemptingFullContext d=0 (prog), input='a@' - line 1:2 reportAmbiguity d=0 (prog): ambigAlts={1, 2}, input='a@' - line 1:2 reportAttemptingFullContext d=1 (expr), input='a@' - line 1:2 reportContextSensitivity d=1 (expr), input='a@' - */ - @CommentHasStringValue - public String errors; - - public String startRule = "prog"; - public String grammarName = "T"; - - /** - grammar T; - prog - @init {} - : expr expr {} - | expr - ; - expr: '@' - | ID '@' - | ID - ; - ID : [a-z]+ ; - WS : [ \r\n\t]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - } - - public static class CtxSensitiveDFATwoDiffInput extends BaseDiagnosticParserTestDescriptor { - public String input = "$ 34 abc @ 34 abc"; - /** - Decision 2: - s0-INT->s1 - s1-ID->:s2^=>1 - */ - @CommentHasStringValue - public String output; - - /** - line 1:5 reportAttemptingFullContext d=2 (e), input='34abc' - line 1:2 reportContextSensitivity d=2 (e), input='34' - line 1:14 reportAttemptingFullContext d=2 (e), input='34abc' - line 1:14 reportContextSensitivity d=2 (e), input='34abc' - */ - @CommentHasStringValue - public String errors; - - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} - : ('$' a | '@' b)+ ; - a : e ID ; - b : e INT ID ; - e : INT | ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+ ; - WS : (' '|'\t'|'\n')+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static abstract class CtxSensitiveDFA extends BaseDiagnosticParserTestDescriptor { - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} - : '$' a | '@' b ; - a : e ID ; - b : e INT ID ; - e : INT | ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+ ; - WS : (' '|'\t'|'\n')+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class CtxSensitiveDFA_1 extends CtxSensitiveDFA { - public String input = "$ 34 abc"; - /** - Decision 1: - s0-INT->s1 - s1-ID->:s2^=>1 - */ - @CommentHasStringValue - public String output; - - /** - line 1:5 reportAttemptingFullContext d=1 (e), input='34abc' - line 1:2 reportContextSensitivity d=1 (e), input='34' - */ - @CommentHasStringValue - public String errors; - - } - - public static class CtxSensitiveDFA_2 extends CtxSensitiveDFA { - public String input = "@ 34 abc"; - /** - Decision 1: - s0-INT->s1 - s1-ID->:s2^=>1 - */ - @CommentHasStringValue - public String output; - - /** - line 1:5 reportAttemptingFullContext d=1 (e), input='34abc' - line 1:5 reportContextSensitivity d=1 (e), input='34abc' - */ - @CommentHasStringValue - public String errors; - } - - public static abstract class ExprAmbiguity extends BaseDiagnosticParserTestDescriptor { - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s - @init {} - : expr[0] {}; - expr[int _p] - : ID - ( - {5 >= $_p}? '*' expr[6] - | {4 >= $_p}? '+' expr[5] - )* - ; - ID : [a-zA-Z]+ ; - WS : [ \r\n\t]+ -> skip ; - - */ - @CommentHasStringValue - public String grammar; - } - - public static class ExprAmbiguity_1 extends ExprAmbiguity { - public String input = "a+b"; - public String output = "(expr a + (expr b))\n"; - /** - line 1:1 reportAttemptingFullContext d=1 (expr), input='+' - line 1:2 reportContextSensitivity d=1 (expr), input='+b' - */ - @CommentHasStringValue - public String errors; - } - - public static class ExprAmbiguity_2 extends ExprAmbiguity { - public String input = "a+b*c"; - public String output = "(expr a + (expr b * (expr c)))\n"; - /** - line 1:1 reportAttemptingFullContext d=1 (expr), input='+' - line 1:2 reportContextSensitivity d=1 (expr), input='+b' - line 1:3 reportAttemptingFullContext d=1 (expr), input='*' - line 1:5 reportAmbiguity d=1 (expr): ambigAlts={1, 2}, input='*c' - */ - @CommentHasStringValue - public String errors; - } - - public static abstract class FullContextIF_THEN_ELSEParse extends BaseDiagnosticParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s - @init {} - @after {} - : '{' stat* '}' ; - stat: 'if' ID 'then' stat ('else' ID)? - | 'return' - ; - ID : 'a'..'z'+ ; - WS : (' '|'\t'|'\n')+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class FullContextIF_THEN_ELSEParse_1 extends FullContextIF_THEN_ELSEParse { - public String input = "{ if x then return }"; - /** - Decision 1: - s0-'}'->:s1=>2 - */ - @CommentHasStringValue - public String output; - } - - public static class FullContextIF_THEN_ELSEParse_2 extends FullContextIF_THEN_ELSEParse { - public String input = "{ if x then return else foo }"; - /** - Decision 1: - s0-'else'->:s1^=>1 - */ - @CommentHasStringValue - public String output; - - /** - line 1:19 reportAttemptingFullContext d=1 (stat), input='else' - line 1:19 reportContextSensitivity d=1 (stat), input='else' - */ - @CommentHasStringValue - public String errors; - } - - public static class FullContextIF_THEN_ELSEParse_3 extends FullContextIF_THEN_ELSEParse { - public String input = "{ if x then if y then return else foo }"; - /** - Decision 1: - s0-'}'->:s2=>2 - s0-'else'->:s1^=>1 - */ - @CommentHasStringValue - public String output; - - /** - line 1:29 reportAttemptingFullContext d=1 (stat), input='else' - line 1:38 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}' - */ - @CommentHasStringValue - public String errors; - } - - public static class FullContextIF_THEN_ELSEParse_4 extends FullContextIF_THEN_ELSEParse { - public String input = "{ if x then if y then return else foo else bar }"; - /** - Decision 1: - s0-'else'->:s1^=>1 - */ - @CommentHasStringValue - public String output; - - /** - line 1:29 reportAttemptingFullContext d=1 (stat), input='else' - line 1:38 reportContextSensitivity d=1 (stat), input='elsefooelse' - line 1:38 reportAttemptingFullContext d=1 (stat), input='else' - line 1:38 reportContextSensitivity d=1 (stat), input='else' - */ - @CommentHasStringValue - public String errors; - } - - public static class FullContextIF_THEN_ELSEParse_5 extends FullContextIF_THEN_ELSEParse { - /** - { if x then return else foo - if x then if y then return else foo } - */ - @CommentHasStringValue - public String input; - - /** - Decision 1: - s0-'}'->:s2=>2 - s0-'else'->:s1^=>1 - */ - @CommentHasStringValue - public String output; - - /** - line 1:19 reportAttemptingFullContext d=1 (stat), input='else' - line 1:19 reportContextSensitivity d=1 (stat), input='else' - line 2:27 reportAttemptingFullContext d=1 (stat), input='else' - line 2:36 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}' - */ - @CommentHasStringValue - public String errors; - } - - public static class FullContextIF_THEN_ELSEParse_6 extends FullContextIF_THEN_ELSEParse { - /** - { if x then return else foo - if x then if y then return else foo } - */ - @CommentHasStringValue - public String input; - - /** - Decision 1: - s0-'}'->:s2=>2 - s0-'else'->:s1^=>1 - */ - @CommentHasStringValue - public String output; - - /** - line 1:19 reportAttemptingFullContext d=1 (stat), input='else' - line 1:19 reportContextSensitivity d=1 (stat), input='else' - line 2:27 reportAttemptingFullContext d=1 (stat), input='else' - line 2:36 reportAmbiguity d=1 (stat): ambigAlts={1, 2}, input='elsefoo}' - */ - @CommentHasStringValue - public String errors; - } - - /* - * Tests predictions for the following case involving closures. - * http://www.antlr.org/wiki/display/~admin/2011/12/29/Flaw+in+ANTLR+v3+LL(*)+analysis+algorithm - */ - public static class LoopsSimulateTailRecursion extends BaseDiagnosticParserTestDescriptor { - public String input = "a(i)<-x"; - public String output = "pass: a(i)<-x\n"; - /** - line 1:3 reportAttemptingFullContext d=3 (expr_primary), input='a(i)' - line 1:7 reportAmbiguity d=3 (expr_primary): ambigAlts={2, 3}, input='a(i)<-x' - */ - @CommentHasStringValue - public String errors; - - public String startRule = "prog"; - public String grammarName = "T"; - - /** - grammar T; - prog - @init {} - : expr_or_assign*; - expr_or_assign - : expr '++' {} - | expr {} - ; - expr: expr_primary ('\<-' ID)?; - expr_primary - : '(' ID ')' - | ID '(' ID ')' - | ID - ; - ID : [a-z]+ ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SLLSeesEOFInLLGrammar extends BaseDiagnosticParserTestDescriptor { - public String input = "34 abc"; - /** - Decision 0: - s0-INT->s1 - s1-ID->:s2^=>1 - */ - @CommentHasStringValue - public String output; - - /** - line 1:3 reportAttemptingFullContext d=0 (e), input='34abc' - line 1:0 reportContextSensitivity d=0 (e), input='34' - */ - @CommentHasStringValue - public String errors; - - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} - : a; - a : e ID ; - b : e INT ID ; - e : INT | ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+ ; - WS : (' '|'\t'|'\n')+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/LeftRecursionDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/LeftRecursionDescriptors.java deleted file mode 100644 index 01e868d6e1..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/LeftRecursionDescriptors.java +++ /dev/null @@ -1,1151 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseParserTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -public class LeftRecursionDescriptors { - public static abstract class AmbigLR extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "prog"; - public String grammarName = "Expr"; - - /** - grammar Expr; - prog: stat ; - stat: expr NEWLINE # printExpr - | ID '=' expr NEWLINE # assign - | NEWLINE # blank - ; - expr: expr ('*'|'/') expr # MulDiv - | expr ('+'|'-') expr # AddSub - | INT # int - | ID # id - | '(' expr ')' # parens - ; - - MUL : '*' ; // assigns token name to '*' used above in grammar - DIV : '/' ; - ADD : '+' ; - SUB : '-' ; - ID : [a-zA-Z]+ ; // match identifiers - INT : [0-9]+ ; // match integers - NEWLINE:'\r'? '\n' ; // return newlines to parser (is end-statement signal) - WS : [ \t]+ -> skip ; // toss out whitespace - */ - @CommentHasStringValue - public String grammar; - } - - public static class AmbigLR_1 extends AmbigLR { - public String input = "1\n"; - public String output = null; - } - - public static class AmbigLR_2 extends AmbigLR { - public String input = "a = 5\n"; - public String output = null; - } - - public static class AmbigLR_3 extends AmbigLR { - public String input = "b = 6\n"; - public String output = null; - } - - public static class AmbigLR_4 extends AmbigLR { - public String input = "a+b*2\n"; - public String output = null; - } - - public static class AmbigLR_5 extends AmbigLR { - public String input = "(1+2)*3\n"; - public String output = null; - } - - public static abstract class Declarations extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : declarator EOF ; // must indicate EOF can follow - declarator - : declarator '[' e ']' - | declarator '[' ']' - | declarator '(' ')' - | '*' declarator // binds less tight than suffixes - | '(' declarator ')' - | ID - ; - e : INT ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Declarations_1 extends Declarations { - public String input = "a"; - public String output = "(s (declarator a) )\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : declarator EOF ; // must indicate EOF can follow - declarator - : declarator '[' e ']' - | declarator '[' ']' - | declarator '(' ')' - | '*' declarator // binds less tight than suffixes - | '(' declarator ')' - | ID - ; - e : INT ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Declarations_2 extends Declarations { - public String input = "*a"; - public String output = "(s (declarator * (declarator a)) )\n"; - } - - public static class Declarations_3 extends Declarations { - public String input = "**a"; - public String output = "(s (declarator * (declarator * (declarator a))) )\n"; - } - - public static class Declarations_4 extends Declarations { - public String input = "a[3]"; - public String output = "(s (declarator (declarator a) [ (e 3) ]) )\n"; - } - - public static class Declarations_5 extends Declarations { - public String input = "b[]"; - public String output = "(s (declarator (declarator b) [ ]) )\n"; - } - - public static class Declarations_6 extends Declarations { - public String input = "(a)"; - public String output = "(s (declarator ( (declarator a) )) )\n"; - } - - public static class Declarations_7 extends Declarations { - public String input = "a[]()"; - public String output = "(s (declarator (declarator (declarator a) [ ]) ( )) )\n"; - } - - public static class Declarations_8 extends Declarations { - public String input = "a[][]"; - public String output = "(s (declarator (declarator (declarator a) [ ]) [ ]) )\n"; - } - - public static class Declarations_9 extends Declarations { - public String input = "*a[]"; - public String output = "(s (declarator * (declarator (declarator a) [ ])) )\n"; - } - - public static class Declarations_10 extends Declarations { - public String input = "(*a)[]"; - public String output = "(s (declarator (declarator ( (declarator * (declarator a)) )) [ ]) )\n"; - } - - /* - * This is a regression test for "Support direct calls to left-recursive - * rules". - * https://github.com/antlr/antlr4/issues/161 - */ - public static abstract class DirectCallToLeftRecursiveRule extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a @after {} : a ID - | ID - ; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class DirectCallToLeftRecursiveRule_1 extends DirectCallToLeftRecursiveRule { - public String input = "x"; - public String output = "(a x)\n"; - } - - public static class DirectCallToLeftRecursiveRule_2 extends DirectCallToLeftRecursiveRule { - public String input = "x y"; - public String output = "(a (a x) y)\n"; - } - - public static class DirectCallToLeftRecursiveRule_3 extends DirectCallToLeftRecursiveRule { - public String input = "x y z"; - public String output = "(a (a (a x) y) z)\n"; - } - - public static abstract class Expressions extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : e EOF ; // must indicate EOF can follow - e : e '.' ID - | e '.' 'this' - | '-' e - | e '*' e - | e ('+'|'-') e - | INT - | ID - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Expressions_1 extends Expressions { - public String input = "a"; - public String output = "(s (e a) )\n"; - } - - public static class Expressions_2 extends Expressions { - public String input = "1"; - public String output = "(s (e 1) )\n"; - } - - public static class Expressions_3 extends Expressions { - public String input = "a-1"; - public String output = "(s (e (e a) - (e 1)) )\n"; - } - - public static class Expressions_4 extends Expressions { - public String input = "a.b"; - public String output = "(s (e (e a) . b) )\n"; - } - - public static class Expressions_5 extends Expressions { - public String input = "a.this"; - public String output = "(s (e (e a) . this) )\n"; - } - - public static class Expressions_6 extends Expressions { - public String input = "-a"; - public String output = "(s (e - (e a)) )\n"; - } - - public static class Expressions_7 extends Expressions { - public String input = "-a+b"; - public String output = "(s (e (e - (e a)) + (e b)) )\n"; - } - - public static abstract class JavaExpressions extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : e EOF ; // must indicate EOF can follow - expressionList - : e (',' e)* - ; - e : '(' e ')' - | 'this' - | 'super' - | INT - | ID - | typespec '.' 'class' - | e '.' ID - | e '.' 'this' - | e '.' 'super' '(' expressionList? ')' - | e '.' 'new' ID '(' expressionList? ')' - | 'new' typespec ( '(' expressionList? ')' | ('[' e ']')+) - | e '[' e ']' - | '(' typespec ')' e - | e ('++' | '--') - | e '(' expressionList? ')' - | ('+'|'-'|'++'|'--') e - | ('~'|'!') e - | e ('*'|'/'|'%') e - | e ('+'|'-') e - | e ('\<\<' | '>>>' | '>>') e - | e ('\<=' | '>=' | '>' | '\<') e - | e 'instanceof' e - | e ('==' | '!=') e - | e '&' e - |\ e '^' e - | e '|' e - | e '&&' e - | e '||' e - | e '?' e ':' e - |\ - e ('=' - |'+=' - |'-=' - |'*=' - |'/=' - |'&=' - |'|=' - |'^=' - |'>>=' - |'>>>=' - |'\<\<=' - |'%=') e - ; - typespec - : ID - | ID '[' ']' - | 'int' - | 'int' '[' ']' - ; - ID : ('a'..'z'|'A'..'Z'|'_'|'$')+; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class JavaExpressions_1 extends JavaExpressions { - public String input = "a|b&c"; - public String output = "(s (e (e a) | (e (e b) & (e c))) )\n"; - } - - public static class JavaExpressions_2 extends JavaExpressions { - public String input = "(a|b)&c"; - public String output = "(s (e (e ( (e (e a) | (e b)) )) & (e c)) )\n"; - } - - public static class JavaExpressions_3 extends JavaExpressions { - public String input = "a > b"; - public String output = "(s (e (e a) > (e b)) )\n"; - } - - public static class JavaExpressions_4 extends JavaExpressions { - public String input = "a >> b"; - public String output = "(s (e (e a) >> (e b)) )\n"; - } - - public static class JavaExpressions_5 extends JavaExpressions { - public String input = "a=b=c"; - public String output = "(s (e (e a) = (e (e b) = (e c))) )\n"; - } - - public static class JavaExpressions_6 extends JavaExpressions { - public String input = "a^b^c"; - public String output = "(s (e (e a) ^ (e (e b) ^ (e c))) )\n"; - } - - public static class JavaExpressions_7 extends JavaExpressions { - public String input = "(T)x"; - public String output = "(s (e ( (typespec T) ) (e x)) )\n"; - } - - public static class JavaExpressions_8 extends JavaExpressions { - public String input = "new A().b"; - public String output = "(s (e (e new (typespec A) ( )) . b) )\n"; - } - - public static class JavaExpressions_9 extends JavaExpressions { - public String input = "(T)t.f()"; - public String output = "(s (e (e ( (typespec T) ) (e (e t) . f)) ( )) )\n"; - } - - public static class JavaExpressions_10 extends JavaExpressions { - public String input = "a.f(x)==T.c"; - public String output = "(s (e (e (e (e a) . f) ( (expressionList (e x)) )) == (e (e T) . c)) )\n"; - } - - public static class JavaExpressions_11 extends JavaExpressions { - public String input = "a.f().g(x,1)"; - public String output = "(s (e (e (e (e (e a) . f) ( )) . g) ( (expressionList (e x) , (e 1)) )) )\n"; - } - - public static class JavaExpressions_12 extends JavaExpressions { - public String input = "new T[((n-1) * x) + 1]"; - public String output = "(s (e new (typespec T) [ (e (e ( (e (e ( (e (e n) - (e 1)) )) * (e x)) )) + (e 1)) ]) )\n"; - } - - public static abstract class LabelsOnOpSubrule extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : e; - e : a=e op=('*'|'/') b=e {} - | INT {} - | '(' x=e ')' {} - ; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LabelsOnOpSubrule_1 extends LabelsOnOpSubrule { - public String input = "4"; - public String output = "(s (e 4))\n"; - } - - public static class LabelsOnOpSubrule_2 extends LabelsOnOpSubrule { - public String input = "1*2/3"; - public String output = "(s (e (e (e 1) * (e 2)) / (e 3)))\n"; - } - - public static class LabelsOnOpSubrule_3 extends LabelsOnOpSubrule { - public String input = "(1/2)*3"; - public String output = "(s (e (e ( (e (e 1) / (e 2)) )) * (e 3)))\n"; - } - - /* - * This is a regression test for antlr/antlr4#625 "Duplicate action breaks - * operator precedence" - * https://github.com/antlr/antlr4/issues/625 - */ - public static abstract class MultipleActionsPredicatesOptions extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : e ; - e : a=e op=('*'|'/') b=e {}{}? - | a=e op=('+'|'-') b=e {}\{}?\ - | INT {}{} - | '(' x=e ')' {}{} - ; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class MultipleActionsPredicatesOptions_1 extends MultipleActionsPredicatesOptions { - public String input = "4"; - public String output = "(s (e 4))\n"; - } - - public static class MultipleActionsPredicatesOptions_2 extends MultipleActionsPredicatesOptions { - public String input = "1*2/3"; - public String output = "(s (e (e (e 1) * (e 2)) / (e 3)))\n"; - } - - public static class MultipleActionsPredicatesOptions_3 extends MultipleActionsPredicatesOptions { - public String input = "(1/2)*3"; - public String output = "(s (e (e ( (e (e 1) / (e 2)) )) * (e 3)))\n"; - } - - /* - * This is a regression test for antlr/antlr4#625 "Duplicate action breaks - * operator precedence" - * https://github.com/antlr/antlr4/issues/625 - */ - public static abstract class MultipleActions extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : e ; - e : a=e op=('*'|'/') b=e {}{} - | INT {}{} - | '(' x=e ')' {}{} - ; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class MultipleActions_1 extends MultipleActions { - public String input = "4"; - public String output = "(s (e 4))\n"; - public String errors = null; - } - - public static class MultipleActions_2 extends MultipleActions { - public String input = "1*2/3"; - public String output = "(s (e (e (e 1) * (e 2)) / (e 3)))\n"; - } - - public static class MultipleActions_3 extends MultipleActions { - public String input = "(1/2)*3"; - public String output = "(s (e (e ( (e (e 1) / (e 2)) )) * (e 3)))\n"; - } - - /* - * This is a regression test for antlr/antlr4#433 "Not all context accessor - * methods are generated when an alternative rule label is used for multiple - * alternatives". - * https://github.com/antlr/antlr4/issues/433 - */ - public static abstract class MultipleAlternativesWithCommonLabel extends BaseParserTestDescriptor { - public String startRule = "s"; - public String grammarName = "T"; - public String errors = null; - - /** - grammar T; - s : e {}; - e returns [int v] - : e '*' e {$v = (0)}, {})> * (1)}, {})>;} # binary - | e '+' e {$v = (0)}, {})> + (1)}, {})>;} # binary - | INT {$v = $INT.int;} # anInt - | '(' e ')' {$v = $e.v;} # parens - | left=e INC {$v = $left.v + 1;} # unary - | left=e DEC {$v = $left.v - 1;} # unary - | ID {} # anID - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+ ; - INC : '++' ; - DEC : '--' ; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class MultipleAlternativesWithCommonLabel_1 extends MultipleAlternativesWithCommonLabel { - public String input = "4"; - public String output = "4\n"; - } - - public static class MultipleAlternativesWithCommonLabel_2 extends MultipleAlternativesWithCommonLabel { - public String input = "1+2"; - public String output = "3\n"; - } - - public static class MultipleAlternativesWithCommonLabel_3 extends MultipleAlternativesWithCommonLabel { - public String input = "1+2*3"; - public String output = "7\n"; - } - - public static class MultipleAlternativesWithCommonLabel_4 extends MultipleAlternativesWithCommonLabel { - public String input = "i++*3"; - public String output = "12\n"; - } - - /** Test for https://github.com/antlr/antlr4/issues/1295 in addition to #433. */ - public static class MultipleAlternativesWithCommonLabel_5 extends MultipleAlternativesWithCommonLabel { - public String input = "(99)+3"; - public String output = "102\n"; - } - - /** - * This is a regression test for antlr/antlr4#509 "Incorrect rule chosen in - * unambiguous grammar". - * https://github.com/antlr/antlr4/issues/509 - */ - public static class PrecedenceFilterConsidersContext extends BaseParserTestDescriptor { - public String input = "aa"; - public String output = "(prog (statement (letterA a)) (statement (letterA a)) )\n"; - public String errors = null; - public String startRule = "prog"; - public String grammarName = "T"; - - /** - grammar T; - prog - @after {} - : statement* EOF {}; - statement: letterA | statement letterA 'b' ; - letterA: 'a'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static abstract class PrefixAndOtherAlt extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : expr EOF ; - expr : literal - | op expr - | expr op expr - ; - literal : '-'? Integer ; - op : '+' | '-' ; - Integer : [0-9]+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class PrefixAndOtherAlt_1 extends PrefixAndOtherAlt { - public String input = "-1"; - public String output = "(s (expr (literal - 1)) )\n"; - } - - public static class PrefixAndOtherAlt_2 extends PrefixAndOtherAlt { - public String input = "-1 + -1"; - public String output = "(s (expr (expr (literal - 1)) (op +) (expr (literal - 1))) )\n"; - } - - public static abstract class PrefixOpWithActionAndLabel extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : e {} ; - e returns [ result] - : ID '=' e1=e {$result = ;} - | ID {$result = $ID.text;} - | e1=e '+' e2=e {$result = ;} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class PrefixOpWithActionAndLabel_1 extends PrefixOpWithActionAndLabel { - public String input = "a"; - public String output = "a\n"; - } - - public static class PrefixOpWithActionAndLabel_2 extends PrefixOpWithActionAndLabel { - public String input = "a+b"; - public String output = "(a+b)\n"; - } - - public static class PrefixOpWithActionAndLabel_3 extends PrefixOpWithActionAndLabel { - public String input = "a=b+c"; - public String output = "((a=b)+c)\n"; - } - - public static abstract class ReturnValueAndActionsAndLabels extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : q=e {}; - e returns [int v] - : a=e op='*' b=e {$v = $a.v * $b.v;} # mult - | a=e '+' b=e {$v = $a.v + $b.v;} # add - | INT {$v = $INT.int;} # anInt - | '(' x=e ')' {$v = $x.v;} # parens - | x=e '++' {$v = $x.v+1;} # inc - | e '--' # dec - | ID {$v = 3;} # anID - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ReturnValueAndActionsAndLabels_1 extends ReturnValueAndActionsAndLabels { - public String input = "4"; - public String output = "4\n"; - } - - public static class ReturnValueAndActionsAndLabels_2 extends ReturnValueAndActionsAndLabels { - public String input = "1+2"; - public String output = "3\n"; - } - - public static class ReturnValueAndActionsAndLabels_3 extends ReturnValueAndActionsAndLabels { - public String input = "1+2*3"; - public String output = "7\n"; - } - - public static class ReturnValueAndActionsAndLabels_4 extends ReturnValueAndActionsAndLabels { - public String input = "i++*3"; - public String output = "12\n"; - } - - /* - * This is a regression test for antlr/antlr4#677 "labels not working in grammar - * file". - * https://github.com/antlr/antlr4/issues/677 - * - * This test treats `,` and `>>` as part of a single compound operator (similar - * to a ternary operator). - */ - public static abstract class ReturnValueAndActionsList extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : expr EOF; - expr: - a=expr '*' a=expr #Factor - | b+=expr (',' b+=expr)* '>>' c=expr #Send - | ID #JustId //semantic check on modifiers - ; - - ID : ('a'..'z'|'A'..'Z'|'_') - ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* - ; - - WS : [ \t\n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ReturnValueAndActionsList1_1 extends ReturnValueAndActionsList { - public String input = "a*b"; - public String output = "(s (expr (expr a) * (expr b)) )\n"; - } - - public static class ReturnValueAndActionsList1_2 extends ReturnValueAndActionsList { - public String input = "a,c>>x"; - public String output = "(s (expr (expr a) , (expr c) >> (expr x)) )\n"; - } - - public static class ReturnValueAndActionsList1_3 extends ReturnValueAndActionsList { - public String input = "x"; - public String output = "(s (expr x) )\n"; - } - - public static class ReturnValueAndActionsList1_4 extends ReturnValueAndActionsList { - public String input = "a*b,c,x*y>>r"; - public String output = "(s (expr (expr (expr a) * (expr b)) , (expr c) , (expr (expr x) * (expr y)) >> (expr r)) )\n"; - } - - /* - * This is a regression test for antlr/antlr4#677 "labels not working in grammar - * file". - * https://github.com/antlr/antlr4/issues/677 - * - * This test treats the `,` and `>>` operators separately. - */ - public static abstract class ReturnValueAndActionsList2 extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : expr EOF; - expr: - a=expr '*' a=expr #Factor - | b+=expr ',' b+=expr #Comma - | b+=expr '>>' c=expr #Send - | ID #JustId //semantic check on modifiers - ; - ID : ('a'..'z'|'A'..'Z'|'_') - ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* - ; - WS : [ \t\n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ReturnValueAndActionsList2_1 extends ReturnValueAndActionsList2 { - public String input = "a*b"; - public String output = "(s (expr (expr a) * (expr b)) )\n"; - } - - public static class ReturnValueAndActionsList2_2 extends ReturnValueAndActionsList2 { - public String input = "a,c>>x"; - public String output = "(s (expr (expr (expr a) , (expr c)) >> (expr x)) )\n"; - } - - public static class ReturnValueAndActionsList2_3 extends ReturnValueAndActionsList2 { - public String input = "x"; - public String output = "(s (expr x) )\n"; - } - - public static class ReturnValueAndActionsList2_4 extends ReturnValueAndActionsList2 { - public String input = "a*b,c,x*y>>r"; - public String output = "(s (expr (expr (expr (expr (expr a) * (expr b)) , (expr c)) , (expr (expr x) * (expr y))) >> (expr r)) )\n"; - } - - public static abstract class ReturnValueAndActions extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : e {}; - e returns [int v, ignored] - : a=e '*' b=e {$v = $a.v * $b.v;} - | a=e '+' b=e {$v = $a.v + $b.v;} - | INT {$v = $INT.int;} - | '(' x=e ')' {$v = $x.v;} - ; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ReturnValueAndActions_1 extends ReturnValueAndActions { - public String input = "4"; - public String output = "4\n"; - } - - public static class ReturnValueAndActions_2 extends ReturnValueAndActions { - public String input = "1+2"; - public String output = "3\n"; - } - - public static class ReturnValueAndActions_3 extends ReturnValueAndActions { - public String input = "1+2*3"; - public String output = "7\n"; - } - - public static class ReturnValueAndActions_4 extends ReturnValueAndActions { - public String input = "(1+2)*3"; - public String output = "9\n"; - } - - public static class SemPred extends BaseParserTestDescriptor { - public String input = "x y z"; - public String output = "(s (a (a (a x) y) z))\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : a ; - a : a {}? ID - | ID - ; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SemPredFailOption extends BaseParserTestDescriptor { - public String input = "x y z"; - public String output = "(s (a (a x) y z))\n"; - public String errors = "line 1:4 rule a custom message\n"; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : a ; - a : a ID {}?\ - | ID - ; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static abstract class Simple extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : a ; - a : a ID - | ID - ; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Simple_1 extends Simple { - public String input = "x"; - public String output = "(s (a x))\n"; - } - - public static class Simple_2 extends Simple { - public String input = "x y"; - public String output = "(s (a (a x) y))\n"; - } - - public static class Simple_3 extends Simple { - public String input = "x y z"; - public String output = "(s (a (a (a x) y) z))\n"; - } - - /** - * This is a regression test for antlr/antlr4#542 "First alternative cannot - * be right-associative". - * https://github.com/antlr/antlr4/issues/542 - */ - public static abstract class TernaryExprExplicitAssociativity extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : e EOF; // must indicate EOF can follow or 'a\' won't match - e :\ e '*' e - |\ e '+' e - |\ e '?' e ':' e - |\ e '=' e - | ID - ; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class TernaryExprExplicitAssociativity_1 extends TernaryExprExplicitAssociativity { - public String input = "a"; - public String output = "(s (e a) )\n"; - } - - public static class TernaryExprExplicitAssociativity_2 extends TernaryExprExplicitAssociativity { - public String input = "a+b"; - public String output = "(s (e (e a) + (e b)) )\n"; - } - - public static class TernaryExprExplicitAssociativity_3 extends TernaryExprExplicitAssociativity { - public String input = "a*b"; - public String output = "(s (e (e a) * (e b)) )\n"; - } - - public static class TernaryExprExplicitAssociativity_4 extends TernaryExprExplicitAssociativity { - public String input = "a?b:c"; - public String output = "(s (e (e a) ? (e b) : (e c)) )\n"; - } - - public static class TernaryExprExplicitAssociativity_5 extends TernaryExprExplicitAssociativity { - public String input = "a=b=c"; - public String output = "(s (e (e a) = (e (e b) = (e c))) )\n"; - } - - public static class TernaryExprExplicitAssociativity_6 extends TernaryExprExplicitAssociativity { - public String input = "a?b+c:d"; - public String output = "(s (e (e a) ? (e (e b) + (e c)) : (e d)) )\n"; - } - - public static class TernaryExprExplicitAssociativity_7 extends TernaryExprExplicitAssociativity { - public String input = "a?b=c:d"; - public String output = "(s (e (e a) ? (e (e b) = (e c)) : (e d)) )\n"; - } - - public static class TernaryExprExplicitAssociativity_8 extends TernaryExprExplicitAssociativity { - public String input = "a? b?c:d : e"; - public String output = "(s (e (e a) ? (e (e b) ? (e c) : (e d)) : (e e)) )\n"; - } - - public static class TernaryExprExplicitAssociativity_9 extends TernaryExprExplicitAssociativity { - public String input = "a?b: c?d:e"; - public String output = "(s (e (e a) ? (e b) : (e (e c) ? (e d) : (e e))) )\n"; - } - - public static abstract class TernaryExpr extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s @after {} : e EOF ; // must indicate EOF can follow or 'a\' won't match - e : e '*' e - | e '+' e - |\ e '?' e ':' e - |\ e '=' e - | ID - ; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class TernaryExpr_1 extends TernaryExpr { - public String input = "a"; - public String output = "(s (e a) )\n"; - } - - public static class TernaryExpr_2 extends TernaryExpr { - public String input = "a+b"; - public String output = "(s (e (e a) + (e b)) )\n"; - } - - public static class TernaryExpr_3 extends TernaryExpr { - public String input = "a*b"; - public String output = "(s (e (e a) * (e b)) )\n"; - } - - public static class TernaryExpr_4 extends TernaryExpr { - public String input = "a?b:c"; - public String output = "(s (e (e a) ? (e b) : (e c)) )\n"; - } - - public static class TernaryExpr_5 extends TernaryExpr { - public String input = "a=b=c"; - public String output = "(s (e (e a) = (e (e b) = (e c))) )\n"; - } - - public static class TernaryExpr_6 extends TernaryExpr { - public String input = "a?b+c:d"; - public String output = "(s (e (e a) ? (e (e b) + (e c)) : (e d)) )\n"; - } - - public static class TernaryExpr_7 extends TernaryExpr { - public String input = "a?b=c:d"; - public String output = "(s (e (e a) ? (e (e b) = (e c)) : (e d)) )\n"; - } - - public static class TernaryExpr_8 extends TernaryExpr { - public String input = "a? b?c:d : e"; - public String output = "(s (e (e a) ? (e (e b) ? (e c) : (e d)) : (e e)) )\n"; - } - - public static class TernaryExpr_9 extends TernaryExpr { - public String input = "a?b: c?d:e"; - public String output = "(s (e (e a) ? (e b) : (e (e c) ? (e d) : (e e))) )\n"; - } - - /* - * This is a regression test for #239 "recoursive parser using implicit tokens - * ignore white space lexer rule". - * https://github.com/antlr/antlr4/issues/239 - */ - public static abstract class WhitespaceInfluence extends BaseParserTestDescriptor { - public String input = "Test(1,3)"; - public String output = null; - public String errors = null; - public String startRule = "prog"; - public String grammarName = "Expr"; - - /** - grammar Expr; - prog : expression EOF; - expression - : ID '(' expression (',' expression)* ')' # doFunction - | '(' expression ')' # doParenthesis - | '!' expression # doNot - | '-' expression # doNegate - | '+' expression # doPositiv - | expression '^' expression # doPower - | expression '*' expression # doMultipy - | expression '/' expression # doDivide - | expression '%' expression # doModulo - | expression '-' expression # doMinus - | expression '+' expression # doPlus - | expression '=' expression # doEqual - | expression '!=' expression # doNotEqual - | expression '>' expression # doGreather - | expression '>=' expression # doGreatherEqual - | expression '\<' expression # doLesser - | expression '\<=' expression # doLesserEqual - | expression K_IN '(' expression (',' expression)* ')' # doIn - | expression ( '&' | K_AND) expression # doAnd - | expression ( '|' | K_OR) expression # doOr - | '[' expression (',' expression)* ']' # newArray - | K_TRUE # newTrueBoolean - | K_FALSE # newFalseBoolean - | NUMBER # newNumber - | DATE # newDateTime - | ID # newIdentifier - | SQ_STRING # newString - | K_NULL # newNull - ; - - // Fragments - fragment DIGIT : '0' .. '9'; - fragment UPPER : 'A' .. 'Z'; - fragment LOWER : 'a' .. 'z'; - fragment LETTER : LOWER | UPPER; - fragment WORD : LETTER | '_' | '$' | '#' | '.'; - fragment ALPHANUM : WORD | DIGIT; - - // Tokens - ID : LETTER ALPHANUM*; - NUMBER : DIGIT+ ('.' DIGIT+)? (('e'|'E')('+'|'-')? DIGIT+)?; - DATE : '\'' DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT (' ' DIGIT DIGIT ':' DIGIT DIGIT ':' DIGIT DIGIT ('.' DIGIT+)?)? '\''; - SQ_STRING : '\'' ('\'\'' | ~'\'')* '\''; - DQ_STRING : '"' ('\\\\"' | ~'"')* '"'; - WS : [ \t\n\r]+ -> skip ; - COMMENTS : ('/*' .*? '*' '/' | '//' ~'\n'* '\n' ) -> skip; - */ - @CommentHasStringValue - public String grammar; - } - - public static class WhitespaceInfluence_1 extends WhitespaceInfluence { - public String input = "Test(1,3)"; - public String output = null; - } - - public static class WhitespaceInfluence_2 extends WhitespaceInfluence { - public String input = "Test(1, 3)"; - public String output = null; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/LexerErrorsDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/LexerErrorsDescriptors.java deleted file mode 100644 index a7bcc3d7d7..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/LexerErrorsDescriptors.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseLexerTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -public class LexerErrorsDescriptors { - public static class DFAToATNThatFailsBackToDFA extends BaseLexerTestDescriptor { - public String input = "ababx"; - /** - [@0,0:1='ab',<1>,1:0] - [@1,2:3='ab',<1>,1:2] - [@2,5:4='',<-1>,1:5] - */ - @CommentHasStringValue - public String output; - - public String errors = "line 1:4 token recognition error at: 'x'\n"; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : 'ab' ; - B : 'abc' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class DFAToATNThatMatchesThenFailsInATN extends BaseLexerTestDescriptor { - public String input = "ababcx"; - /** - [@0,0:1='ab',<1>,1:0] - [@1,2:4='abc',<2>,1:2] - [@2,6:5='',<-1>,1:6] - */ - @CommentHasStringValue - public String output; - - public String errors = "line 1:5 token recognition error at: 'x'\n"; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : 'ab' ; - B : 'abc' ; - C : 'abcd' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static abstract class EnforcedGreedyNestedBraces extends BaseLexerTestDescriptor { - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - ACTION : '{' (ACTION | ~[{}])* '}'; - WS : [ \r\n\t]+ -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class EnforcedGreedyNestedBraces_1 extends EnforcedGreedyNestedBraces { - public String input = "{ { } }"; - /** - [@0,0:6='{ { } }',<1>,1:0] - [@1,7:6='',<-1>,1:7] - */ - @CommentHasStringValue - public String output; - } - - public static class EnforcedGreedyNestedBraces_2 extends EnforcedGreedyNestedBraces { - public String input = "{ { }"; - public String output = "[@0,5:4='',<-1>,1:5]\n"; - public String errors = "line 1:0 token recognition error at: '{ { }'\n"; - } - - public static class ErrorInMiddle extends BaseLexerTestDescriptor { - public String input = "abx"; - public String output = "[@0,3:2='',<-1>,1:3]\n"; - public String errors = "line 1:0 token recognition error at: 'abx'\n"; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : 'abc' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class InvalidCharAtStart extends BaseLexerTestDescriptor { - public String input = "x"; - public String output = "[@0,1:0='',<-1>,1:1]\n"; - public String errors = "line 1:0 token recognition error at: 'x'\n"; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : 'a' 'b' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class InvalidCharAtStartAfterDFACache extends BaseLexerTestDescriptor { - public String input = "abx"; - /** - [@0,0:1='ab',<1>,1:0] - [@1,3:2='',<-1>,1:3] - */ - @CommentHasStringValue - public String output; - - public String errors = "line 1:2 token recognition error at: 'x'\n"; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : 'a' 'b' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class InvalidCharInToken extends BaseLexerTestDescriptor { - public String input = "ax"; - public String output = "[@0,2:1='',<-1>,1:2]\n"; - public String errors = "line 1:0 token recognition error at: 'ax'\n"; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : 'a' 'b' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class InvalidCharInTokenAfterDFACache extends BaseLexerTestDescriptor { - public String input = "abax"; - /** - [@0,0:1='ab',<1>,1:0] - [@1,4:3='',<-1>,1:4] - */ - @CommentHasStringValue - public String output; - - public String errors = "line 1:2 token recognition error at: 'ax'\n"; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : 'a' 'b' ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This is a regression test for #45 "NullPointerException in LexerATNSimulator.execDFA". - * https://github.com/antlr/antlr4/issues/46 - */ - public static class LexerExecDFA extends BaseLexerTestDescriptor { - public String input = "x : x"; - /** - [@0,0:0='x',<3>,1:0] - [@1,2:2=':',<1>,1:2] - [@2,4:4='x',<3>,1:4] - [@3,5:4='',<-1>,1:5] - */ - @CommentHasStringValue - public String output; - - /** - line 1:1 token recognition error at: ' ' - line 1:3 token recognition error at: ' ' - */ - @CommentHasStringValue - public String errors; - - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - COLON : ':' ; - PTR : '->' ; - ID : [a-z]+; - */ - @CommentHasStringValue - public String grammar; - } - - public static abstract class StringsEmbeddedInActions extends BaseLexerTestDescriptor { - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - // ST interprets \\ as \ so we need \\\\ to get \\ - /** - lexer grammar L; - ACTION2 : '[' (STRING | ~'"')*? ']'; - STRING : '"' ('\\\\' '"' | .)*? '"'; - WS : [ \t\r\n]+ -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class StringsEmbeddedInActions_1 extends StringsEmbeddedInActions { - public String input = "[\"foo\"]"; - /** - [@0,0:6='["foo"]',<1>,1:0] - [@1,7:6='',<-1>,1:7] - */ - @CommentHasStringValue - public String output; - } - - public static class StringsEmbeddedInActions_2 extends StringsEmbeddedInActions { - public String input = "[\"foo]"; - public String output = "[@0,6:5='',<-1>,1:6]\n"; - public String errors = "line 1:0 token recognition error at: '[\"foo]'\n"; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/LexerExecDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/LexerExecDescriptors.java deleted file mode 100644 index 32f7d8cc87..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/LexerExecDescriptors.java +++ /dev/null @@ -1,1112 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.runtime.misc.Pair; -import org.antlr.v4.test.runtime.BaseLexerTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Paths; - -public class LexerExecDescriptors { - public static class ActionPlacement extends BaseLexerTestDescriptor { - public String input = "ab"; - /** - stuff0: - stuff1: a - stuff2: ab - ab - [@0,0:1='ab',<1>,1:0] - [@1,2:1='',<-1>,1:2] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - I : ({} 'a' - | {} - 'a' {} - 'b' {}) - {} ; - WS : (' '|'\n') -> skip ; - J : .; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class CharSet extends BaseLexerTestDescriptor { - public String input = "34\n 34"; - /** - I - I - [@0,0:1='34',<1>,1:0] - [@1,4:5='34',<1>,2:1] - [@2,6:5='',<-1>,2:3] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - I : '0'..'9'+ {} ; - WS : [ \n\\u000D] -> skip ; - */ // needs escape on u000D otherwise java converts even in comment - @CommentHasStringValue - public String grammar; - - } - - /* regression test for antlr/antlr4#1925 */ - public static class UnicodeCharSet extends BaseLexerTestDescriptor { - public String input = "均"; - /** - [@0,0:0='均',<1>,1:0] - [@1,1:0='',<-1>,1:1] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - ID : ([A-Z_]|'\u0100'..'\uFFFE') ([A-Z_0-9]|'\u0100'..'\uFFFE')*; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class CharSetInSet extends BaseLexerTestDescriptor { - public String input = "a x"; - /** - I - I - [@0,0:0='a',<1>,1:0] - [@1,2:2='x',<1>,1:2] - [@2,3:2='',<-1>,1:3] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - I : (~[ab \\n]|'a') {} ; - WS : [ \n\\u000D]+ -> skip ; - */ // needs escape on u000D otherwise java converts even in comment - @CommentHasStringValue - public String grammar; - - } - - public static class CharSetNot extends BaseLexerTestDescriptor { - public String input = "xaf"; - /** - I - [@0,0:2='xaf',<1>,1:0] - [@1,3:2='',<-1>,1:3] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - I : ~[ab \n] ~[ \ncd]* {} ; - WS : [ \n\\u000D]+ -> skip ; - */ // needs escape on u000D otherwise java converts even in comment - @CommentHasStringValue - public String grammar; - - } - - public static class CharSetPlus extends BaseLexerTestDescriptor { - public String input = "34\n 34"; - /** - I - I - [@0,0:1='34',<1>,1:0] - [@1,4:5='34',<1>,2:1] - [@2,6:5='',<-1>,2:3] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - I : '0'..'9'+ {} ; - WS : [ \n\\u000D]+ -> skip ; - */ // needs escape on u000D otherwise java converts even in comment - @CommentHasStringValue - public String grammar; - - } - - public static class CharSetRange extends BaseLexerTestDescriptor { - public String input = "34\n 34 a2 abc \n "; - /** - I - I - ID - ID - [@0,0:1='34',<1>,1:0] - [@1,4:5='34',<1>,2:1] - [@2,7:8='a2',<2>,2:4] - [@3,10:12='abc',<2>,2:7] - [@4,18:17='',<-1>,3:3] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - I : [0-9]+ {} ; - ID : [a-zA-Z] [a-zA-Z0-9]* {} ; - WS : [ \n\\u0009\r]+ -> skip ; - */ // needs escape on u0009 otherwise java converts even in comment - @CommentHasStringValue - public String grammar; - - } - - public static class CharSetWithEscapedChar extends BaseLexerTestDescriptor { - public String input = "- ] "; - /** - DASHBRACK - DASHBRACK - [@0,0:0='-',<1>,1:0] - [@1,2:2=']',<1>,1:2] - [@2,4:3='',<-1>,1:4] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - DASHBRACK : [\\-\]]+ {} ; - WS : [ \n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class CharSetWithMissingEscapeChar extends BaseLexerTestDescriptor { - public String input = "34 "; - /** - I - [@0,0:1='34',<1>,1:0] - [@1,3:2='',<-1>,1:3] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - I : [0-9]+ {} ; - WS : [ \n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class CharSetWithQuote1 extends BaseLexerTestDescriptor { - public String input = "b\"a"; - /** - A - [@0,0:2='b"a',<1>,1:0] - [@1,3:2='',<-1>,1:3] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : ["a-z]+ {} ; - WS : [ \n\t]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class CharSetWithQuote2 extends BaseLexerTestDescriptor { - public String input = "b\"\\a"; - /** - A - [@0,0:3='b"\a',<1>,1:0] - [@1,4:3='',<-1>,1:4] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : ["\\\\ab]+ {} ; - WS : [ \n\t]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class EOFByItself extends BaseLexerTestDescriptor { - public String input = ""; - /** - [@0,0:-1='',<1>,1:0] - [@1,0:-1='',<-1>,1:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - DONE : EOF ; - A : 'a'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static abstract class EOFSuffixInFirstRule extends BaseLexerTestDescriptor { - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : 'a' EOF ; - B : 'a'; - C : 'c'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class EOFSuffixInFirstRule_1 extends EOFSuffixInFirstRule { - public String input = ""; - public String output = "[@0,0:-1='',<-1>,1:0]\n"; - } - - public static class EOFSuffixInFirstRule_2 extends EOFSuffixInFirstRule { - public String input = "a"; - /** - [@0,0:0='a',<1>,1:0] - [@1,1:0='',<-1>,1:1] - */ - @CommentHasStringValue - public String output; - } - - public static class GreedyClosure extends BaseLexerTestDescriptor { - /** - //blah - //blah - */ - @CommentHasStringValue - public String input; - - /** - [@0,0:13='//blah\n//blah\n',<1>,1:0] - [@1,14:13='',<-1>,3:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - CMT : '//' .*? '\n' CMT*; - WS : (' '|'\t')+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class GreedyConfigs extends BaseLexerTestDescriptor { - public String input = "ab"; - /** - ab - [@0,0:1='ab',<1>,1:0] - [@1,2:1='',<-1>,1:2] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - I : ('a' | 'ab') {} ; - WS : (' '|'\n') -> skip ; - J : .; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class GreedyOptional extends BaseLexerTestDescriptor { - /** - //blah - //blah - */ - @CommentHasStringValue - public String input; - - /** - [@0,0:13='//blah\n//blah\n',<1>,1:0] - [@1,14:13='',<-1>,3:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - CMT : '//' .*? '\n' CMT?; - WS : (' '|'\t')+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class GreedyPositiveClosure extends BaseLexerTestDescriptor { - /** - //blah - //blah - */ - @CommentHasStringValue - public String input; - - /** - [@0,0:13='//blah\n//blah\n',<1>,1:0] - [@1,14:13='',<-1>,3:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - CMT : ('//' .*? '\n')+; - WS : (' '|'\t')+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class HexVsID extends BaseLexerTestDescriptor { - public String input = "x 0 1 a.b a.l"; - /** - [@0,0:0='x',<5>,1:0] - [@1,1:1=' ',<6>,1:1] - [@2,2:2='0',<2>,1:2] - [@3,3:3=' ',<6>,1:3] - [@4,4:4='1',<2>,1:4] - [@5,5:5=' ',<6>,1:5] - [@6,6:6='a',<5>,1:6] - [@7,7:7='.',<4>,1:7] - [@8,8:8='b',<5>,1:8] - [@9,9:9=' ',<6>,1:9] - [@10,10:10='a',<5>,1:10] - [@11,11:11='.',<4>,1:11] - [@12,12:12='l',<5>,1:12] - [@13,13:12='',<-1>,1:13] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - HexLiteral : '0' ('x'|'X') HexDigit+ ; - DecimalLiteral : ('0' | '1'..'9' '0'..'9'*) ; - FloatingPointLiteral : ('0x' | '0X') HexDigit* ('.' HexDigit*)? ; - DOT : '.' ; - ID : 'a'..'z'+ ; - fragment HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ; - WS : (' '|'\n')+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class KeywordID extends BaseLexerTestDescriptor { - public String input = "end eend ending a"; - /** - [@0,0:2='end',<1>,1:0] - [@1,3:3=' ',<3>,1:3] - [@2,4:7='eend',<2>,1:4] - [@3,8:8=' ',<3>,1:8] - [@4,9:14='ending',<2>,1:9] - [@5,15:15=' ',<3>,1:15] - [@6,16:16='a',<2>,1:16] - [@7,17:16='',<-1>,1:17] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - KEND : 'end' ; // has priority - ID : 'a'..'z'+ ; - WS : (' '|'\n')+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NonGreedyClosure extends BaseLexerTestDescriptor { - /** - //blah - //blah - */ - @CommentHasStringValue - public String input; - - /** - [@0,0:6='//blah\n',<1>,1:0] - [@1,7:13='//blah\n',<1>,2:0] - [@2,14:13='',<-1>,3:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - CMT : '//' .*? '\n' CMT*?; - WS : (' '|'\t')+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NonGreedyConfigs extends BaseLexerTestDescriptor { - public String input = "ab"; - /** - a - b - [@0,0:0='a',<1>,1:0] - [@1,1:1='b',<3>,1:1] - [@2,2:1='',<-1>,1:2] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - I : .*? ('a' | 'ab') {} ; - WS : (' '|'\n') -> skip ; - J : . {}; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NonGreedyOptional extends BaseLexerTestDescriptor { - /** - //blah - //blah - */ - @CommentHasStringValue - public String input; - - /** - [@0,0:6='//blah\n',<1>,1:0] - [@1,7:13='//blah\n',<1>,2:0] - [@2,14:13='',<-1>,3:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - CMT : '//' .*? '\n' CMT??; - WS : (' '|'\t')+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NonGreedyPositiveClosure extends BaseLexerTestDescriptor { - /** - //blah - //blah - */ - @CommentHasStringValue - public String input; - - /** - [@0,0:6='//blah\n',<1>,1:0] - [@1,7:13='//blah\n',<1>,2:0] - [@2,14:13='',<-1>,3:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - CMT : ('//' .*? '\n')+?; - WS : (' '|'\t')+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NonGreedyTermination1 extends BaseLexerTestDescriptor { - public String input = "\"hi\"\"mom\""; - /** - [@0,0:3='"hi"',<1>,1:0] - [@1,4:8='"mom"',<1>,1:4] - [@2,9:8='',<-1>,1:9] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - STRING : '"' ('""' | .)*? '"'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NonGreedyTermination2 extends BaseLexerTestDescriptor { - public String input = "\"\"\"mom\""; - /** - [@0,0:6='"""mom"',<1>,1:0] - [@1,7:6='',<-1>,1:7] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - STRING : '"' ('""' | .)+? '"'; - */ - @CommentHasStringValue - public String grammar; - - } - - /* - * This is a regression test for antlr/antlr4#224: "Parentheses without - * quantifier in lexer rules have unclear effect". - * https://github.com/antlr/antlr4/issues/224 - */ - public static class Parentheses extends BaseLexerTestDescriptor { - public String input = "-.-.-!"; - /** - [@0,0:4='-.-.-',<1>,1:0] - [@1,5:5='!',<3>,1:5] - [@2,6:5='',<-1>,1:6] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - START_BLOCK: '-.-.-'; - ID : (LETTER SEPARATOR) (LETTER SEPARATOR)+; - fragment LETTER: L_A|L_K; - fragment L_A: '.-'; - fragment L_K: '-.-'; - SEPARATOR: '!'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class PositionAdjustingLexer extends BaseLexerTestDescriptor { - /** - tokens - tokens { - notLabel - label1 = - label2 += - notLabel - */ - @CommentHasStringValue - public String input; - - /** - [@0,0:5='tokens',<6>,1:0] - [@1,7:12='tokens',<4>,2:0] - [@2,14:14='{',<3>,2:7] - [@3,16:23='notLabel',<6>,3:0] - [@4,25:30='label1',<5>,4:0] - [@5,32:32='=',<1>,4:7] - [@6,34:39='label2',<5>,5:0] - [@7,41:42='+=',<2>,5:7] - [@8,44:51='notLabel',<6>,6:0] - [@9,53:52='',<-1>,7:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "PositionAdjustingLexer"; - - /** - lexer grammar PositionAdjustingLexer; - - @definitions { - - } - - @members { - - } - - ASSIGN : '=' ; - PLUS_ASSIGN : '+=' ; - LCURLY: '{'; - - // 'tokens' followed by '{' - TOKENS : 'tokens' IGNORED '{'; - - // IDENTIFIER followed by '+=' or '=' - LABEL - : IDENTIFIER IGNORED '+'? '=' - ; - - IDENTIFIER - : [a-zA-Z_] [a-zA-Z0-9_]* - ; - - fragment - IGNORED - : [ \t\r\n]* - ; - - NEWLINE - : [\r\n]+ -> skip - ; - - WS - : [ \t]+ -> skip - ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class QuoteTranslation extends BaseLexerTestDescriptor { - public String input = "\""; - /** - [@0,0:0='"',<1>,1:0] - [@1,1:0='',<-1>,1:1] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - QUOTE : '"' ; // make sure this compiles - */ - @CommentHasStringValue - public String grammar; - - } - - public static abstract class RecursiveLexerRuleRefWithWildcardPlus extends BaseLexerTestDescriptor { - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - CMT : '/*' (CMT | .)+? '*' '/' ; - WS : (' '|'\n')+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class RecursiveLexerRuleRefWithWildcardPlus_1 extends RecursiveLexerRuleRefWithWildcardPlus { - public String input = - "/* ick */\n"+ - "/* /* */\n"+ - "/* /*nested*/ */\n"; // stuff on end of comment matches another rule - - public String output = - "[@0,0:8='/* ick */',<1>,1:0]\n"+ - "[@1,9:9='\\n',<2>,1:9]\n"+ - "[@2,10:34='/* /* */\\n/* /*nested*/ */',<1>,2:0]\n"+ - "[@3,35:35='\\n',<2>,3:16]\n"+ - "[@4,36:35='',<-1>,4:0]\n"; - } - - public static class RecursiveLexerRuleRefWithWildcardPlus_2 extends RecursiveLexerRuleRefWithWildcardPlus { - public String input = - "/* ick */x\n"+ - "/* /* */x\n"+ - "/* /*nested*/ */x\n"; - - public String output = - "[@0,0:8='/* ick */',<1>,1:0]\n"+ - "[@1,10:10='\\n',<2>,1:10]\n"+ - "[@2,11:36='/* /* */x\\n/* /*nested*/ */',<1>,2:0]\n"+ - "[@3,38:38='\\n',<2>,3:17]\n"+ - "[@4,39:38='',<-1>,4:0]\n"; - - /** - line 1:9 token recognition error at: 'x' - line 3:16 token recognition error at: 'x' - */ - @CommentHasStringValue - public String errors; - } - - public static abstract class RecursiveLexerRuleRefWithWildcardStar extends BaseLexerTestDescriptor { - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - CMT : '/*' (CMT | .)*? '*' '/' ; - WS : (' '|'\n')+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class RecursiveLexerRuleRefWithWildcardStar_1 extends RecursiveLexerRuleRefWithWildcardStar { - public String input = - "/* ick */\n"+ - "/* /* */\n"+ - "/* /*nested*/ */\n"; - - public String output = - "[@0,0:8='/* ick */',<1>,1:0]\n"+ - "[@1,9:9='\\n',<2>,1:9]\n"+ - "[@2,10:34='/* /* */\\n/* /*nested*/ */',<1>,2:0]\n"+ - "[@3,35:35='\\n',<2>,3:16]\n"+ - "[@4,36:35='',<-1>,4:0]\n"; - } - - public static class RecursiveLexerRuleRefWithWildcardStar_2 extends RecursiveLexerRuleRefWithWildcardStar { - public String input = - "/* ick */x\n"+ - "/* /* */x\n"+ - "/* /*nested*/ */x\n"; - - public String output = - "[@0,0:8='/* ick */',<1>,1:0]\n"+ - "[@1,10:10='\\n',<2>,1:10]\n"+ - "[@2,11:36='/* /* */x\\n/* /*nested*/ */',<1>,2:0]\n"+ - "[@3,38:38='\\n',<2>,3:17]\n"+ - "[@4,39:38='',<-1>,4:0]\n"; - - /** - line 1:9 token recognition error at: 'x' - line 3:16 token recognition error at: 'x' - */ - @CommentHasStringValue - public String errors; - } - - public static class RefToRuleDoesNotSetTokenNorEmitAnother extends BaseLexerTestDescriptor { - public String input = "34 -21 3"; - - // EOF has no length so range is 8:7 not 8:8 - /** - [@0,0:1='34',<2>,1:0] - [@1,3:5='-21',<1>,1:3] - [@2,7:7='3',<2>,1:7] - [@3,8:7='',<-1>,1:8] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - A : '-' I ; - I : '0'..'9'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Slashes extends BaseLexerTestDescriptor { - public String input = "\\ / \\/ /\\"; - /** - [@0,0:0='\',<1>,1:0] - [@1,2:2='/',<2>,1:2] - [@2,4:5='\/',<3>,1:4] - [@3,7:8='/\',<4>,1:7] - [@4,9:8='',<-1>,1:9] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - Backslash : '\\\\'; - Slash : '/'; - Vee : '\\\\/'; - Wedge : '/\\\\'; - WS : [ \t] -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - /* - * This is a regression test for antlr/antlr4#687 "Empty zero-length tokens - * cannot have lexer commands" and antlr/antlr4#688 "Lexer cannot match - * zero-length tokens" - * https://github.com/antlr/antlr4/issues/687 - * https://github.com/antlr/antlr4/issues/688 - */ - public static class ZeroLengthToken extends BaseLexerTestDescriptor { - public String input = "'xxx'"; - /** - [@0,0:4=''xxx'',<1>,1:0] - [@1,5:4='',<-1>,1:5] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - BeginString - : '\'' -> more, pushMode(StringMode) - ; - mode StringMode; - StringMode_X : 'x' -> more; - StringMode_Done : -> more, mode(EndStringMode); - mode EndStringMode; - EndString : '\'' -> popMode; - */ - @CommentHasStringValue - public String grammar; - } - - /** - * This is a regression test for antlr/antlr4#76 "Serialized ATN strings - * should be split when longer than 2^16 bytes (class file limitation)" - * https://github.com/antlr/antlr4/issues/76 - */ - public static class LargeLexer extends BaseLexerTestDescriptor { - public String input = "KW400"; - /** - [@0,0:4='KW400',<402>,1:0] - [@1,5:4='',<-1>,1:5] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** Look for grammar as resource */ - @Override - public Pair getGrammar() { - String grammar = null; - - final ClassLoader loader = Thread.currentThread().getContextClassLoader(); - final URL stuff = loader.getResource("org/antlr/v4/test/runtime/LargeLexer.g4"); - try { - grammar = new String(Files.readAllBytes(Paths.get(stuff.toURI()))); - } - catch (Exception e) { - System.err.println("Cannot find grammar org/antlr/v4/test/runtime/LargeLexer.g4"); - } - - return new Pair<>(grammarName, grammar); - } - } - - /** - * This is a regression test for antlr/antlr4#2709 "PHP target generates - * invalid output when $ is used as part of the literal in lexer rule" - * https://github.com/antlr/antlr4/issues/2709 - */ - public static class EscapeTargetStringLiteral extends BaseLexerTestDescriptor { - /** - [@0,0:-1='',<-1>,1:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - ACTION_WITH_DOLLAR: '$ACTION'; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean ignore(String targetName) { - return !targetName.equals("PHP"); - } - } - - /** https://github.com/antlr/antlr4/issues/1943 */ - public static class StackoverflowDueToNotEscapedHyphen extends BaseLexerTestDescriptor { - public String input = "word"; - - /** - [@0,0:3='word',<1>,1:0] - [@1,4:3='',<-1>,1:4] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - WORD : [a-z-+]+; - */ - @CommentHasStringValue - public String grammar; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ListenersDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ListenersDescriptors.java deleted file mode 100644 index e4bafa7fcf..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ListenersDescriptors.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseParserTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -public class ListenersDescriptors { - public static class Basic extends BaseParserTestDescriptor { - public String input = "1 2"; - /** - (a 1 2) - 1 - 2 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - - - - - s - @after { - - - } - : r=a ; - a : INT INT - | ID - ; - MULT: '*' ; - ADD : '+' ; - INT : [0-9]+ ; - ID : [a-z]+ ; - WS : [ \t\n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LR extends BaseParserTestDescriptor { - public String input = "1+2*3"; - /** - (e (e 1) + (e (e 2) * (e 3))) - 1 - 2 - 3 - 2 3 2 - 1 2 1 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - - - - - s - @after { - - - } - : r=e ; - e : e op='*' e - | e op='+' e - | INT - ; - MULT: '*' ; - ADD : '+' ; - INT : [0-9]+ ; - ID : [a-z]+ ; - WS : [ \t\n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LRWithLabels extends BaseParserTestDescriptor { - public String input = "1(2,3)"; - /** - (e (e 1) ( (eList (e 2) , (e 3)) )) - 1 - 2 - 3 - 1 [13 6] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - - - - - s - @after { - - - } - : r=e ; - e : e '(' eList ')' # Call - | INT # Int - ; - eList : e (',' e)* ; - MULT: '*' ; - ADD : '+' ; - INT : [0-9]+ ; - ID : [a-z]+ ; - WS : [ \t\n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static abstract class RuleGetters extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - - - - - s - @after { - - - } - : r=a ; - a : b b // forces list - | b // a list still - ; - b : ID | INT; - MULT: '*' ; - ADD : '+' ; - INT : [0-9]+ ; - ID : [a-z]+ ; - WS : [ \t\n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class RuleGetters_1 extends RuleGetters { - public String input = "1 2"; - /** - (a (b 1) (b 2)) - 1 2 1 - */ - @CommentHasStringValue - public String output; - } - - public static class RuleGetters_2 extends RuleGetters { - public String input = "abc"; - /** - (a (b abc)) - abc - */ - @CommentHasStringValue - public String output; - } - - public static abstract class TokenGetters extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - - - - - s - @after { - - - } - : r=a ; - a : INT INT - | ID - ; - MULT: '*' ; - ADD : '+' ; - INT : [0-9]+ ; - ID : [a-z]+ ; - WS : [ \t\n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class TokenGetters_1 extends TokenGetters { - public String input = "1 2"; - /** - (a 1 2) - 1 2 [1, 2] - */ - @CommentHasStringValue - public String output; - } - - public static class TokenGetters_2 extends TokenGetters { - public String input = "abc"; - /** - (a abc) - [@0,0:2='abc',<4>,1:0] - */ - @CommentHasStringValue - public String output; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParseTreesDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParseTreesDescriptors.java deleted file mode 100644 index 5bd26693c7..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParseTreesDescriptors.java +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseParserTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -public class ParseTreesDescriptors { - public static class AltNum extends BaseParserTestDescriptor { - public String input = "xyz"; - public String output = "(a:3 x (b:2 y) z)\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - - options { contextSuperClass=MyRuleNode; } - - - - - s - @init { - - } - @after { - - } - : r=a ; - - a : 'f' - | 'g' - | 'x' b 'z' - ; - b : 'e' {} | 'y' - ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ExtraToken extends BaseParserTestDescriptor { - public String input = "xzy"; - public String output = "(a x z y)\n"; - public String errors = "line 1:1 extraneous input 'z' expecting 'y'\n"; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s - @init { - - } - @after { - - } - : r=a ; - a : 'x' 'y' - ; - Z : 'z' - ; - - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ExtraTokensAndAltLabels extends BaseParserTestDescriptor { - public String input = "${ ? a ?}"; - public String output = "(s ${ (v ? a) ? })\n"; - public String errors = - "line 1:3 extraneous input '?' expecting {'a', 'b'}\n"+ - "line 1:7 extraneous input '?' expecting '}'\n"; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - - s - @init { - - } - @after { - - } - : '${' v '}' - ; - - v : A #altA - | B #altB - ; - - A : 'a' ; - B : 'b' ; - - WHITESPACE : [ \n\t\r]+ -> channel(HIDDEN) ; - - ERROR : . ; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean ignore(String targetName) { - return !targetName.matches("Java|Python2|Python3|Node|Swift|CSharp|Dart"); - } - } - - public static class NoViableAlt extends BaseParserTestDescriptor { - public String input = "z"; - public String output = "(a z)\n"; - public String errors = "line 1:0 mismatched input 'z' expecting {'x', 'y'}\n"; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s - @init { - - } - @after { - - } - : r=a ; - a : 'x' | 'y' - ; - Z : 'z' - ; - - */ - @CommentHasStringValue - public String grammar; - - } - - public static class RuleRef extends BaseParserTestDescriptor { - public String input = "yx"; - public String output = "(a (b y) x)\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s - @init { - - } - @after { - - } - : r=a ; - a : b 'x' - ; - b : 'y' - ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Sync extends BaseParserTestDescriptor { - public String input = "xzyy!"; - public String output = "(a x z y y !)\n"; - public String errors = "line 1:1 extraneous input 'z' expecting {'y', '!'}\n"; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s - @init { - - } - @after { - - } - : r=a ; - a : 'x' 'y'* '!' - ; - Z : 'z' - ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Token2 extends BaseParserTestDescriptor { - public String input = "xy"; - public String output = "(a x y)\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s - @init { - - } - @after { - - } - : r=a ; - a : 'x' 'y' - ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class TokenAndRuleContextString extends BaseParserTestDescriptor { - public String input = "x"; - /** - [a, s] - (a x) - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s - @init { - - } - @after { - - } - : r=a ; - a : 'x' { - - } ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class TwoAltLoop extends BaseParserTestDescriptor { - public String input = "xyyxyxz"; - public String output = "(a x y y x y x z)\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s - @init { - - } - @after { - - } - : r=a ; - a : ('x' | 'y')* 'z' - ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class TwoAlts extends BaseParserTestDescriptor { - public String input = "y"; - public String output = "(a y)\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s - @init { - - } - @after { - - } - : r=a ; - a : 'x' | 'y' - ; - */ - @CommentHasStringValue - public String grammar; - - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserErrorsDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserErrorsDescriptors.java deleted file mode 100644 index b6f1c46860..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserErrorsDescriptors.java +++ /dev/null @@ -1,645 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseParserTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -public class ParserErrorsDescriptors { - public static class ConjuringUpToken extends BaseParserTestDescriptor { - public String input = "ac"; - public String output = "conjured=[@-1,-1:-1='',<2>,1:1]\n"; - public String errors = "line 1:1 missing 'b' at 'c'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' x='b' {} 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ConjuringUpTokenFromSet extends BaseParserTestDescriptor { - public String input = "ad"; - public String output = "conjured=[@-1,-1:-1='',<2>,1:1]\n"; - public String errors = "line 1:1 missing {'b', 'c'} at 'd'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' x=('b'|'c') {} 'd' ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * Regression test for "Getter for context is not a list when it should be". - * https://github.com/antlr/antlr4/issues/19 - */ - public static class ContextListGetters extends BaseParserTestDescriptor { - public String input = "abab"; - public String output = "abab\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - @parser::members{ - - } - s : (a | b)+; - a : 'a' {}; - b : 'b' {}; - */ - @CommentHasStringValue - public String grammar; - - } - - public static abstract class DuplicatedLeftRecursiveCall extends BaseParserTestDescriptor { - public String output = null; - public String errors = null; - public String startRule = "start"; - public String grammarName = "T"; - - /** - grammar T; - start : expr EOF; - expr : 'x' - | expr expr - ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class DuplicatedLeftRecursiveCall_1 extends DuplicatedLeftRecursiveCall { - public String input = "x"; - } - - public static class DuplicatedLeftRecursiveCall_2 extends DuplicatedLeftRecursiveCall { - public String input = "xx"; - } - - public static class DuplicatedLeftRecursiveCall_3 extends DuplicatedLeftRecursiveCall { - public String input = "xxx"; - } - - public static class DuplicatedLeftRecursiveCall_4 extends DuplicatedLeftRecursiveCall { - public String input = "xxxx"; - } - - /** - * This is a regression test for #45 "NullPointerException in ATNConfig.hashCode". - * https://github.com/antlr/antlr4/issues/45 - *

- * The original cause of this issue was an error in the tool's ATN state optimization, - * which is now detected early in {@link ATNSerializer} by ensuring that all - * serialized transitions point to states which were not removed. - */ - public static class InvalidATNStateRemoval extends BaseParserTestDescriptor { - public String input = "x:x"; - public String output = null; - public String errors = null; - public String startRule = "start"; - public String grammarName = "T"; - - /** - grammar T; - start : ID ':' expr; - expr : primary expr? {} | expr '->' ID; - primary : ID; - ID : [a-z]+; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This is a regression test for #6 "NullPointerException in getMissingSymbol". - * https://github.com/antlr/antlr4/issues/6 - */ - public static class InvalidEmptyInput extends BaseParserTestDescriptor { - public String input = ""; - public String output = null; - public String errors = "line 1:0 mismatched input '' expecting ID\n"; - public String startRule = "start"; - public String grammarName = "T"; - - /** - grammar T; - start : ID+; - ID : [a-z]+; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LL1ErrorInfo extends BaseParserTestDescriptor { - public String input = "dog and software"; - public String output = "{'hardware', 'software'}\n"; - public String errors = null; - public String startRule = "start"; - public String grammarName = "T"; - - /** - grammar T; - start : animal (AND acClass)? service EOF; - animal : (DOG | CAT ); - service : (HARDWARE | SOFTWARE) ; - AND : 'and'; - DOG : 'dog'; - CAT : 'cat'; - HARDWARE: 'hardware'; - SOFTWARE: 'software'; - WS : ' ' -> skip ; - acClass - @init - {} - : ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LL2 extends BaseParserTestDescriptor { - public String input = "ae"; - public String output = null; - public String errors = "line 1:1 no viable alternative at input 'ae'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' 'b' - | 'a' 'c' - ; - q : 'e' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LL3 extends BaseParserTestDescriptor { - public String input = "abe"; - public String output = null; - public String errors = "line 1:2 no viable alternative at input 'abe'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' 'b'* 'c' - | 'a' 'b' 'd' - ; - q : 'e' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LLStar extends BaseParserTestDescriptor { - public String input = "aaae"; - public String output = null; - public String errors = "line 1:3 no viable alternative at input 'aaae'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a'+ 'b' - | 'a'+ 'c' - ; - q : 'e' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class MultiTokenDeletionBeforeLoop extends BaseParserTestDescriptor { - public String input = "aacabc"; - public String output = null; - public String errors = "line 1:1 extraneous input 'a' expecting {'b', 'c'}\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' 'b'* 'c'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class MultiTokenDeletionBeforeLoop2 extends BaseParserTestDescriptor { - public String input = "aacabc"; - public String output = null; - public String errors = "line 1:1 extraneous input 'a' expecting {'b', 'z', 'c'}\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' ('b'|'z'{})* 'c'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class MultiTokenDeletionDuringLoop extends BaseParserTestDescriptor { - public String input = "abaaababc"; - public String output = null; - /** - line 1:2 extraneous input 'a' expecting {'b', 'c'} - line 1:6 extraneous input 'a' expecting {'b', 'c'} - */ - @CommentHasStringValue - public String errors; - - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' 'b'* 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class MultiTokenDeletionDuringLoop2 extends BaseParserTestDescriptor { - public String input = "abaaababc"; - public String output = null; - /** - line 1:2 extraneous input 'a' expecting {'b', 'z', 'c'} - line 1:6 extraneous input 'a' expecting {'b', 'z', 'c'} - */ - @CommentHasStringValue - public String errors; - - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' ('b'|'z'{})* 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NoViableAltAvoidance extends BaseParserTestDescriptor { - public String input = "a."; - public String output = null; - public String errors = "line 1:1 mismatched input '.' expecting '!'\n"; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : e '!' ; - e : 'a' 'b' - | 'a' - ; - DOT : '.' ; - WS : [ \t\r\n]+ -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleSetInsertion extends BaseParserTestDescriptor { - public String input = "ad"; - public String output = null; - public String errors = "line 1:1 missing {'b', 'c'} at 'd'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' ('b'|'c') 'd' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleSetInsertionConsumption extends BaseParserTestDescriptor { - public String input = "ad"; - public String output = "[@0,0:0='a',<3>,1:0]\n"; - public String errors = "line 1:1 missing {'b', 'c'} at 'd'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - myset: ('b'|'c') ; - a: 'a' myset 'd' {} ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleTokenDeletion extends BaseParserTestDescriptor { - public String input = "aab"; - public String output = null; - public String errors = "line 1:1 extraneous input 'a' expecting 'b'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' 'b' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleTokenDeletionBeforeAlt extends BaseParserTestDescriptor { - public String input = "ac"; - public String output = null; - public String errors = "line 1:0 extraneous input 'a' expecting {'b', 'c'}\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ('b' | 'c') - ; - q : 'a' - ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleTokenDeletionBeforeLoop extends BaseParserTestDescriptor { - public String input = "aabc"; - public String output = null; - /** - line 1:1 extraneous input 'a' expecting {, 'b'} - line 1:3 token recognition error at: 'c' - */ - @CommentHasStringValue - public String errors; - - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' 'b'* EOF ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleTokenDeletionBeforeLoop2 extends BaseParserTestDescriptor { - public String input = "aabc"; - public String output = null; - /** - line 1:1 extraneous input 'a' expecting {, 'b', 'z'} - line 1:3 token recognition error at: 'c' - */ - @CommentHasStringValue - public String errors; - - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' ('b'|'z'{})* EOF ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleTokenDeletionBeforePredict extends BaseParserTestDescriptor { - public String input = "caaab"; - public String output = null; - public String errors = "line 1:0 extraneous input 'c' expecting 'a'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a'+ 'b' - | 'a'+ 'c' - ; - q : 'e' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleTokenDeletionConsumption extends BaseParserTestDescriptor { - public String input = "aabd"; - public String output = "[@2,2:2='b',<1>,1:2]\n"; - public String errors = "line 1:1 extraneous input 'a' expecting {'b', 'c'}\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - myset: ('b'|'c') ; - a: 'a' myset 'd' {} ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleTokenDeletionDuringLoop extends BaseParserTestDescriptor { - public String input = "ababbc"; - public String output = null; - public String errors = "line 1:2 extraneous input 'a' expecting {'b', 'c'}\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' 'b'* 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleTokenDeletionDuringLoop2 extends BaseParserTestDescriptor { - public String input = "ababbc"; - public String output = null; - public String errors = "line 1:2 extraneous input 'a' expecting {'b', 'z', 'c'}\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' ('b'|'z'{})* 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleTokenDeletionExpectingSet extends BaseParserTestDescriptor { - public String input = "aab"; - public String output = null; - public String errors = "line 1:1 extraneous input 'a' expecting {'b', 'c'}\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' ('b'|'c') ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SingleTokenInsertion extends BaseParserTestDescriptor { - public String input = "ac"; - public String output = null; - public String errors = "line 1:1 missing 'b' at 'c'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' 'b' 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class TokenMismatch extends BaseParserTestDescriptor { - public String input = "aa"; - public String output = null; - public String errors = "line 1:1 mismatched input 'a' expecting 'b'\n"; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : 'a' 'b' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class TokenMismatch2 extends BaseParserTestDescriptor { - public String input = "( ~FORCE_ERROR~ "; - public String output = null; - public String errors = "line 1:2 mismatched input '~FORCE_ERROR~' expecting {')', ID}\n"; - public String startRule = "stat"; - public String grammarName = "T"; - - /** - grammar T; - - stat: ( '(' expr? ')' )? EOF ; - expr: ID '=' STR ; - - ERR : '~FORCE_ERROR~' ; - ID : [a-zA-Z]+ ; - STR : '"' ~["]* '"' ; - WS : [ \t\r\n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class TokenMismatch3 extends BaseParserTestDescriptor { - public String input = ""; - public String output = null; - public String errors = "line 1:0 mismatched input '' expecting {'(', BOOLEAN_LITERAL, ID, '$'}\n"; - public String startRule = "expression"; - public String grammarName = "T"; - - /** - grammar T; - - expression - : value - | expression op=AND expression - | expression op=OR expression - ; - value - : BOOLEAN_LITERAL - | ID - | ID1 - | '(' expression ')' - ; - - AND : '&&'; - OR : '||'; - - BOOLEAN_LITERAL : 'true' | 'false'; - - ID : [a-z]+; - ID1 : '$'; - - WS : [ \t\r\n]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ExtraneousInput extends BaseParserTestDescriptor { - public String input = "baa"; - public String output = null; - public String errors = "line 1:0 mismatched input 'b' expecting {, 'a'}\n"; - public String startRule = "file"; - public String grammarName = "T"; - - /** - grammar T; - - member : 'a'; - body : member*; - file : body EOF; - B : 'b'; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean ignore(String targetName) { - return !"Java".equals(targetName) && !"Swift".equals(targetName) && !"Dart".equals(targetName); - } - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserExecDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserExecDescriptors.java deleted file mode 100644 index d2b0931f09..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/ParserExecDescriptors.java +++ /dev/null @@ -1,920 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseParserTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -public class ParserExecDescriptors { - public static class APlus extends BaseParserTestDescriptor { - public String input = "a b c"; - public String output = "abc\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ID+ { - - }; - ID : 'a'..'z'+; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class AStar_1 extends BaseParserTestDescriptor { - public String input = ""; - public String output = "\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ID* { - - }; - ID : 'a'..'z'+; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class AStar_2 extends BaseParserTestDescriptor { - public String input = "a b c"; - public String output = "abc\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ID* { - - }; - ID : 'a'..'z'+; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class AorAPlus extends BaseParserTestDescriptor { - public String input = "a b c"; - public String output = "abc\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (ID|ID)+ { - - }; - ID : 'a'..'z'+; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class AorAStar_1 extends BaseParserTestDescriptor { - public String input = ""; - public String output = "\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (ID|ID)* { - - }; - ID : 'a'..'z'+; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class AorAStar_2 extends BaseParserTestDescriptor { - public String input = "a b c"; - public String output = "abc\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (ID|ID)* { - - }; - ID : 'a'..'z'+; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class AorB extends BaseParserTestDescriptor { - public String input = "34"; - public String output = "alt 2\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ID { - - } | INT { - - }; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class AorBPlus extends BaseParserTestDescriptor { - public String input = "a 34 c"; - public String output = "a34c\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (ID|INT{ - })+ { - - }; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class AorBStar_1 extends BaseParserTestDescriptor { - public String input = ""; - public String output = "\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (ID|INT{ - })* { - - }; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class AorBStar_2 extends BaseParserTestDescriptor { - public String input = "a 34 c"; - public String output = "a34c\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (ID|INT{ - })* { - - }; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Basic extends BaseParserTestDescriptor { - public String input = "abc 34"; - public String output = "abc34\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ID INT { - - }; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - /** Match assignments, ignore other tokens with wildcard. */ - public static class Wildcard extends BaseParserTestDescriptor { - public String input = "x=10; abc;;;; y=99;"; - public String output = "x=10;\ny=99;\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (assign|.)+ EOF ; - assign : ID '=' INT ';' { - - } ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - } - - /** - * This test ensures that {@link org.antlr.v4.runtime.atn.ParserATNSimulator} does not produce a - * {@link StackOverflowError} when it encounters an {@code EOF} transition - * inside a closure. - */ - public static class EOFInClosure extends BaseParserTestDescriptor { - public String input = "x"; - public String output = null; - public String errors = null; - public String startRule = "prog"; - public String grammarName = "T"; - - /** - grammar T; - prog : stat EOF; - stat : 'x' ('y' | EOF)*?; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class IfIfElseGreedyBinding1 extends BaseParserTestDescriptor { - public String input = "if y if y x else x"; - /** - if y x else x - if y if y x else x - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "start"; - public String grammarName = "T"; - - /** - grammar T; - start : statement+ ; - statement : 'x' | ifStatement; - ifStatement : 'if' 'y' statement ('else' statement)? { - - }; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> channel(HIDDEN); - */ - @CommentHasStringValue - public String grammar; - - } - - public static class IfIfElseGreedyBinding2 extends BaseParserTestDescriptor { - public String input = "if y if y x else x"; - /** - if y x else x - if y if y x else x - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "start"; - public String grammarName = "T"; - - /** - grammar T; - start : statement+ ; - statement : 'x' | ifStatement; - ifStatement : 'if' 'y' statement ('else' statement|) { - - }; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> channel(HIDDEN); - */ - @CommentHasStringValue - public String grammar; - - } - - public static class IfIfElseNonGreedyBinding1 extends BaseParserTestDescriptor { - public String input = "if y if y x else x"; - /** - if y x - if y if y x else x - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "start"; - public String grammarName = "T"; - - /** - grammar T; - start : statement+ ; - statement : 'x' | ifStatement; - ifStatement : 'if' 'y' statement ('else' statement)?? { - - }; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> channel(HIDDEN); - */ - @CommentHasStringValue - public String grammar; - - } - - public static class IfIfElseNonGreedyBinding2 extends BaseParserTestDescriptor { - public String input = "if y if y x else x"; - /** - if y x - if y if y x else x - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "start"; - public String grammarName = "T"; - - /** - grammar T; - start : statement+ ; - statement : 'x' | ifStatement; - ifStatement : 'if' 'y' statement (|'else' statement) { - - }; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> channel(HIDDEN); - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LL1OptionalBlock_1 extends BaseParserTestDescriptor { - public String input = ""; - public String output = "\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (ID|{}INT)? { - - }; - ID : 'a'..'z'+; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LL1OptionalBlock_2 extends BaseParserTestDescriptor { - public String input = "a"; - public String output = "a\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (ID|{}INT)? { - - }; - ID : 'a'..'z'+; - INT : '0'..'9'+ ; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This is a regression test for antlr/antlr4#195 "label 'label' type - * mismatch with previous definition: TOKEN_LABEL!=RULE_LABEL" - * https://github.com/antlr/antlr4/issues/195 - */ - public static class LabelAliasingAcrossLabeledAlternatives extends BaseParserTestDescriptor { - public String input = "xy"; - /** - x - y - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "start"; - public String grammarName = "T"; - - /** - grammar T; - start : a* EOF; - a - : label=subrule {} #One - | label='y' {} #Two - ; - subrule : 'x'; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Labels extends BaseParserTestDescriptor { - public String input = "abc 34;"; - public String output = null; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : b1=b b2+=b* b3+=';' ; - b : id_=ID val+=INT*; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This is a regression test for antlr/antlr4#299 "Repeating subtree not - * accessible in visitor". - * https://github.com/antlr/antlr4/issues/299 - */ - public static class ListLabelForClosureContext extends BaseParserTestDescriptor { - public String input = "a"; - public String output = null; - public String errors = null; - public String startRule = "expression"; - public String grammarName = "T"; - - /** - grammar T; - ifStatement - @after { - })> - } - : 'if' expression - ( ( 'then' - executableStatement* - elseIfStatement* // \<--- problem is here; should yield a list not node - elseStatement? - 'end' 'if' - ) | executableStatement ) - ; - - elseIfStatement - : 'else' 'if' expression 'then' executableStatement* - ; - expression : 'a' ; - executableStatement : 'a' ; - elseStatement : 'a' ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This is a regression test for #270 "Fix operator += applied to a set of - * tokens". - * https://github.com/antlr/antlr4/issues/270 - */ - public static class ListLabelsOnSet extends BaseParserTestDescriptor { - public String input = "abc 34;"; - public String output = null; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : b b* ';' ; - b : ID val+=(INT | FLOAT)*; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - FLOAT : [0-9]+ '.' [0-9]+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This test ensures that {@link ParserATNSimulator} produces a correct - * result when the grammar contains multiple explicit references to - * {@code EOF} inside of parser rules. - */ - public static class MultipleEOFHandling extends BaseParserTestDescriptor { - public String input = "x"; - public String output = null; - public String errors = null; - public String startRule = "prog"; - public String grammarName = "T"; - - /** - grammar T; - prog : ('x' | 'x' 'y') EOF EOF; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This test is meant to detect regressions of bug antlr/antlr4#41. - * https://github.com/antlr/antlr4/issues/41 - */ - public static class Optional_1 extends BaseParserTestDescriptor { - public String input = "x"; - public String output = null; - public String errors = null; - public String startRule = "stat"; - public String grammarName = "T"; - - /** - grammar T; - stat : ifstat | 'x'; - ifstat : 'if' stat ('else' stat)?; - WS : [ \n\t]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Optional_2 extends BaseParserTestDescriptor { - public String input = "if x"; - public String output = null; - public String errors = null; - public String startRule = "stat"; - public String grammarName = "T"; - - /** - grammar T; - stat : ifstat | 'x'; - ifstat : 'if' stat ('else' stat)?; - WS : [ \n\t]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Optional_3 extends BaseParserTestDescriptor { - public String input = "if x else x"; - public String output = null; - public String errors = null; - public String startRule = "stat"; - public String grammarName = "T"; - - /** - grammar T; - stat : ifstat | 'x'; - ifstat : 'if' stat ('else' stat)?; - WS : [ \n\t]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Optional_4 extends BaseParserTestDescriptor { - public String input = "if if x else x"; - public String output = null; - public String errors = null; - public String startRule = "stat"; - public String grammarName = "T"; - - /** - grammar T; - stat : ifstat | 'x'; - ifstat : 'if' stat ('else' stat)?; - WS : [ \n\t]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - /* - * This is a regression test for antlr/antlr4#561 "Issue with parser - * generation in 4.2.2" - * https://github.com/antlr/antlr4/issues/561 - */ - public static class ParserProperty extends BaseParserTestDescriptor { - public String input = "abc"; - public String output = "valid\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - - a : {}? ID {} - ; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This test is meant to test the expected solution to antlr/antlr4#42. - * https://github.com/antlr/antlr4/issues/42 - */ - public static class PredicatedIfIfElse extends BaseParserTestDescriptor { - public String input = "if x if x a else b"; - public String output = null; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : stmt EOF ; - stmt : ifStmt | ID; - ifStmt : 'if' ID stmt ('else' stmt | { })> }?); - ELSE : 'else'; - ID : [a-zA-Z]+; - WS : [ \\n\\t]+ -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This is a regression test for antlr/antlr4#334 "BailErrorStrategy: bails - * out on proper input". - * https://github.com/antlr/antlr4/issues/334 - */ - public static class PredictionIssue334 extends BaseParserTestDescriptor { - public String input = "a"; - public String output = "(file_ (item a) )\n"; - public String errors = null; - public String startRule = "file_"; - public String grammarName = "T"; - - /** - grammar T; - file_ @init{ - - } - @after { - - } - : item (SEMICOLON item)* SEMICOLON? EOF ; - item : A B?; - SEMICOLON: ';'; - A : 'a'|'A'; - B : 'b'|'B'; - WS : [ \r\t\n]+ -> skip; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This is a regression test for antlr/antlr4#561 "Issue with parser - * generation in 4.2.2" - * https://github.com/antlr/antlr4/issues/561 - */ - public static class ReferenceToATN_1 extends BaseParserTestDescriptor { - public String input = ""; - public String output = "\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (ID|ATN)* ATN? {} ; - ID : 'a'..'z'+ ; - ATN : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ReferenceToATN_2 extends BaseParserTestDescriptor { - public String input = "a 34 c"; - public String output = "a34c\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (ID|ATN)* ATN? {} ; - ID : 'a'..'z'+ ; - ATN : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - } - - /** - * This is a regression test for antlr/antlr4#1545, case 1. - */ - public static class OpenDeviceStatement_Case1 extends BaseParserTestDescriptor { - public String input = "OPEN DEVICE DEVICE"; - public String output = "OPEN DEVICE DEVICE\n"; - public String errors = null; - public String startRule = "statement"; - public String grammarName = "OpenDeviceStatement"; - - /** - grammar OpenDeviceStatement; - program : statement+ '.' ; - - statement : 'OPEN' ( 'DEVICE' ( OPT1 | OPT2 | OPT3 )? )+ {} ; - - OPT1 : 'OPT-1'; - OPT2 : 'OPT-2'; - OPT3 : 'OPT-3'; - - WS : (' '|'\n')+ -> channel(HIDDEN); - */ - @CommentHasStringValue - public String grammar; - } - - /** - * This is a regression test for antlr/antlr4#1545, case 2. - */ - public static class OpenDeviceStatement_Case2 extends BaseParserTestDescriptor { - public String input = "OPEN DEVICE DEVICE"; - public String output = "OPEN DEVICE DEVICE\n"; - public String errors = null; - public String startRule = "statement"; - public String grammarName = "OpenDeviceStatement"; - - /** - grammar OpenDeviceStatement; - program : statement+ '.' ; - - statement : 'OPEN' ( 'DEVICE' ( (OPT1) | OPT2 | OPT3 )? )+ {} ; - - OPT1 : 'OPT-1'; - OPT2 : 'OPT-2'; - OPT3 : 'OPT-3'; - - WS : (' '|'\n')+ -> channel(HIDDEN); - */ - @CommentHasStringValue - public String grammar; - } - - /** - * This is a regression test for antlr/antlr4#1545, case 3. - */ - public static class OpenDeviceStatement_Case3 extends BaseParserTestDescriptor { - public String input = "OPEN DEVICE DEVICE."; - public String output = "OPEN DEVICE DEVICE\n"; - public String errors = null; - public String startRule = "statement"; - public String grammarName = "OpenDeviceStatement"; - - /** - grammar OpenDeviceStatement; - program : statement+ '.' ; - - statement : 'OPEN' ( 'DEVICE' ( (OPT1) | OPT2 | OPT3 )? )+ {} ; - - OPT1 : 'OPT-1'; - OPT2 : 'OPT-2'; - OPT3 : 'OPT-3'; - - WS : (' '|'\n')+ -> channel(HIDDEN); - */ - @CommentHasStringValue - public String grammar; - } - - /** - * This is a regression test for antlr/antlr4#2301. - */ - public static class OrderingPredicates extends BaseParserTestDescriptor { - public String input = "POINT AT X"; - public String output = null; - public String errors = null; - public String startRule = "expr"; - public String grammarName = "Issue2301"; - - /** - grammar Issue2301; - - SPACES: [ \t\r\n]+ -> skip; - - AT: 'AT'; - X : 'X'; - Y : 'Y'; - - ID: [A-Z]+; - - constant - : 'DUMMY' - ; - - expr - : ID constant? - | expr AT X - | expr AT Y - ; - */ - @CommentHasStringValue - public String grammar; - } - - /** - * This is a regression test for antlr/antlr4#2728 - * It should generate correct code for grammars with more than 65 tokens. - * https://github.com/antlr/antlr4/pull/2728#issuecomment-622940562 - */ - public static class TokenOffset extends BaseParserTestDescriptor { - public String input = "12 34 56 66"; - public String output = "12345666\n"; - - public String errors = null; - public String startRule = "a"; - public String grammarName = "L"; - - /** - grammar L; - a : ('1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'|'10'|'11'|'12'|'13'|'14'|'15'|'16' - |'17'|'18'|'19'|'20'|'21'|'22'|'23'|'24'|'25'|'26'|'27'|'28'|'29'|'30'|'31'|'32' - |'33'|'34'|'35'|'36'|'37'|'38'|'39'|'40'|'41'|'42'|'43'|'44'|'45'|'46'|'47'|'48' - |'49'|'50'|'51'|'52'|'53'|'54'|'55'|'56'|'57'|'58'|'59'|'60'|'61'|'62'|'63'|'64' - |'65'|'66')+ { - - }; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/PerformanceDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/PerformanceDescriptors.java deleted file mode 100644 index 69dbd9a07d..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/PerformanceDescriptors.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseParserTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -import java.util.Arrays; - -public class PerformanceDescriptors { - /* - * This is a regression test for antlr/antlr4#192 "Poor performance of - * expression parsing". - * https://github.com/antlr/antlr4/issues/192 - */ - public static abstract class ExpressionGrammar extends BaseParserTestDescriptor { - public String output = null; - public String errors = null; - public String startRule = "program"; - public String grammarName = "Expr"; - - /** - grammar Expr; - - program: expr EOF; - - expr - : ID - | 'not' expr - | expr 'and' expr - | expr 'or' expr - ; - - ID: [a-zA-Z_][a-zA-Z_0-9]*; - WS: [ \t\n\r\f]+ -> skip; - ERROR: .; - */ - @CommentHasStringValue - public String grammar; - } - - public static class ExpressionGrammar_1 extends ExpressionGrammar { - /** - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or - X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or - not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or - not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or - not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or - not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 - */ - @CommentHasStringValue - public String input; - } - - public static class ExpressionGrammar_2 extends ExpressionGrammar { - /** - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and X6 and not X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and X7 and not X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and X8 and not X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and X9 and not X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and X10 and not X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and X11 and not X12 or not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 and not X8 and not X9 and not X10 and not X11 and X12 - */ - @CommentHasStringValue - public String input; - } - - /** Test for https://github.com/antlr/antlr4/issues/1398. - * Seeing through a large expression takes 5 _minutes_ on - * my fast box to complete. After fix, it's instantaneous. - */ - public static abstract class DropLoopEntryBranchInLRRule extends BaseParserTestDescriptor { - public String grammarName = "Expr"; - public String startRule = "stat"; - - /** - grammar Expr; - - stat : expr ';' - | expr '.' - ; - - expr - : ID - | 'not' expr - | expr 'and' expr - | expr 'or' expr - | '(' ID ')' expr - | expr '?' expr ':' expr - | 'between' expr 'and' expr - ; - - ID: [a-zA-Z_][a-zA-Z_0-9]*; - WS: [ \t\n\r\f]+ -> skip; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean ignore(String targetName) { - return !Arrays.asList("Java", "CSharp", "Python2", "Python3", "Node", "Cpp", "Swift", "Dart").contains(targetName); - } - } - - public static class DropLoopEntryBranchInLRRule_1 extends DropLoopEntryBranchInLRRule { - /** - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 - ; - */ - @CommentHasStringValue - public String input; - } - - public static class DropLoopEntryBranchInLRRule_2 extends DropLoopEntryBranchInLRRule { - /** - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 or - X1 and X2 and X3 and X4 and X5 and X6 and X7 - . - */ // Different in final token - @CommentHasStringValue - public String input; - } - - public static class DropLoopEntryBranchInLRRule_3 extends DropLoopEntryBranchInLRRule { - /** - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 or - not X1 and not X2 and not X3 and not X4 and not X5 and not X6 and not X7 - ; - */ - @CommentHasStringValue - public String input; - } - - public static class DropLoopEntryBranchInLRRule_4 extends DropLoopEntryBranchInLRRule { - /** - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 and - between X1 and X2 or between X3 and X4 - ; - */ - @CommentHasStringValue - public String input; - - @Override - public boolean ignore(String targetName) { - // passes, but still too slow in Python and JavaScript - return !Arrays.asList("Java", "CSharp", "Cpp", "Swift", "Dart").contains(targetName); - } - } - - public static class DropLoopEntryBranchInLRRule_5 extends DropLoopEntryBranchInLRRule { - /** - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z or - X ? Y : Z - ; - */ - @CommentHasStringValue - public String input; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexerDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexerDescriptors.java deleted file mode 100644 index 3b91a50f23..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/SemPredEvalLexerDescriptors.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseLexerTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -public class SemPredEvalLexerDescriptors { - // Test for https://github.com/antlr/antlr4/issues/958 - public static class RuleSempredFunction extends BaseLexerTestDescriptor { - public String input = "aaa"; - /** - [@0,0:0='a',<1>,1:0] - [@1,1:1='a',<1>,1:1] - [@2,2:2='a',<1>,1:2] - [@3,3:2='',<-1>,1:3] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - T : 'a' {}? ; - */ - @CommentHasStringValue - public String grammar; - } - - public static class DisableRule extends BaseLexerTestDescriptor { - public String input = "enum abc"; - /** - [@0,0:3='enum',<2>,1:0] - [@1,5:7='abc',<3>,1:5] - [@2,8:7='',<-1>,1:8] - s0-' '->:s5=>4 - s0-'a'->:s6=>3 - s0-'e'->:s1=>3 - :s1=>3-'n'->:s2=>3 - :s2=>3-'u'->:s3=>3 - :s6=>3-'b'->:s6=>3 - :s6=>3-'c'->:s6=>3 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - E1 : 'enum' { }? ; - E2 : 'enum' { }? ; // winner not E1 or ID - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean showDFA() { return true; } - } - - public static class EnumNotID extends BaseLexerTestDescriptor { - public String input = "enum abc enum"; - /** - [@0,0:3='enum',<1>,1:0] - [@1,5:7='abc',<2>,1:5] - [@2,9:12='enum',<1>,1:9] - [@3,13:12='',<-1>,1:13] - s0-' '->:s3=>3 - */ - @CommentHasStringValue // - - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - ENUM : [a-z]+ { }? ; - ID : [a-z]+ ; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean showDFA() { return true; } - } - - public static class IDnotEnum extends BaseLexerTestDescriptor { - public String input = "enum abc enum"; - /** - [@0,0:3='enum',<2>,1:0] - [@1,5:7='abc',<2>,1:5] - [@2,9:12='enum',<2>,1:9] - [@3,13:12='',<-1>,1:13] - s0-' '->:s2=>3 - */ - @CommentHasStringValue // - - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - ENUM : [a-z]+ { }? ; - ID : [a-z]+ ; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean showDFA() { return true; } - } - - public static class IDvsEnum extends BaseLexerTestDescriptor { - public String input = "enum abc enum"; - - /** - [@0,0:3='enum',<2>,1:0] - [@1,5:7='abc',<2>,1:5] - [@2,9:12='enum',<2>,1:9] - [@3,13:12='',<-1>,1:13] - s0-' '->:s5=>3 - s0-'a'->:s4=>2 - s0-'e'->:s1=>2 - :s1=>2-'n'->:s2=>2 - :s2=>2-'u'->:s3=>2 - :s4=>2-'b'->:s4=>2 - :s4=>2-'c'->:s4=>2 - */ - @CommentHasStringValue // no 'm'-> transition...conflicts with pred - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - ENUM : 'enum' { }? ; - ID : 'a'..'z'+ ; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean showDFA() { return true; } - } - - public static class Indent extends BaseLexerTestDescriptor { - public String input = "abc\n def \n"; - /** - INDENT - [@0,0:2='abc',<1>,1:0] - [@1,3:3='\n',<3>,1:3] - [@2,4:5=' ',<2>,2:0] - [@3,6:8='def',<1>,2:2] - [@4,9:10=' ',<4>,2:5] - [@5,11:11='\n',<3>,2:7] - [@6,12:11='',<-1>,3:0] - s0-' - '->:s2=>3 - s0-'a'->:s1=>1 - s0-'d'->:s1=>1 - :s1=>1-'b'->:s1=>1 - :s1=>1-'c'->:s1=>1 - :s1=>1-'e'->:s1=>1 - :s1=>1-'f'->:s1=>1 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - ID : [a-z]+ ; - INDENT : [ \t]+ { }? - { } ; - NL : '\n'; - WS : [ \t]+ ; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean showDFA() { return true; } - } - - public static class LexerInputPositionSensitivePredicates extends BaseLexerTestDescriptor { - public String input = "a cde\nabcde\n"; - /** - a - cde - ab - cde - [@0,0:0='a',<1>,1:0] - [@1,2:4='cde',<2>,1:2] - [@2,6:7='ab',<1>,2:0] - [@3,8:10='cde',<2>,2:2] - [@4,12:11='',<-1>,3:0] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - WORD1 : ID1+ { } ; - WORD2 : ID2+ { } ; - fragment ID1 : { \< 2 }? [a-zA-Z]; - fragment ID2 : { >= 2 }? [a-zA-Z]; - WS : (' '|'\n') -> skip; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean showDFA() { return true; } - } - - public static class PredicatedKeywords extends BaseLexerTestDescriptor { - public String input = "enum enu a"; - /** - enum! - ID enu - ID a - [@0,0:3='enum',<1>,1:0] - [@1,5:7='enu',<2>,1:5] - [@2,9:9='a',<2>,1:9] - [@3,10:9='',<-1>,1:10] - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = ""; - public String grammarName = "L"; - - /** - lexer grammar L; - ENUM : [a-z]+ { }? { } ; - ID : [a-z]+ { } ; - WS : [ \n] -> skip ; - */ - @CommentHasStringValue - public String grammar; - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/SemPredEvalParserDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/SemPredEvalParserDescriptors.java deleted file mode 100644 index b09f074881..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/SemPredEvalParserDescriptors.java +++ /dev/null @@ -1,751 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseParserTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -public class SemPredEvalParserDescriptors { - public static class ActionHidesPreds extends BaseParserTestDescriptor { - public String input = "x x y"; - /** - alt 1 - alt 1 - alt 1 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - @parser::members {} - s : a+ ; - a : {} ID {}? {} - | {} ID {}? {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** Regular non-forced actions can create side effects used by semantic - * predicates and so we cannot evaluate any semantic predicate - * encountered after having seen a regular action. This includes - * during global follow operations. - */ - public static class ActionsHidePredsInGlobalFOLLOW extends BaseParserTestDescriptor { - public String input = "a!"; - /** - eval=true - parse - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - @parser::members { - - } - s : e {} {}? {} '!' ; - t : e {} {}? ID ; - e : ID | ; // non-LL(1) so we use ATN - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This is a regression test for antlr/antlr4#196 - * "element+ in expression grammar doesn't parse properly" - * https://github.com/antlr/antlr4/issues/196 - */ - public static class AtomWithClosureInTranslatedLRRule extends BaseParserTestDescriptor { - public String input = "a+b+a"; - public String output = null; - public String errors = null; - public String startRule = "start"; - public String grammarName = "T"; - - /** - grammar T; - start : e[0] EOF; - e[int _p] - : ( 'a' | 'b'+ ) ( {3 >= $_p}? '+' e[4] )* - ; - - */ - @CommentHasStringValue - public String grammar; - - } - - /** We cannot collect predicates that are dependent on local context if - * we are doing a global follow. They appear as if they were not there at all. - */ - public static class DepedentPredsInGlobalFOLLOW extends BaseParserTestDescriptor { - public String input = "a!"; - /** - eval=true - parse - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - @parser::members { - - } - s : a[99] ; - a[int i] : e {}? {} '!' ; - b[int i] : e {}? ID ; - e : ID | ; // non-LL(1) so we use ATN - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class DependentPredNotInOuterCtxShouldBeIgnored extends BaseParserTestDescriptor { - public String input = "a;"; - public String output = "alt 2\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : b[2] ';' | b[2] '.' ; // decision in s drills down to ctx-dependent pred in a; - b[] : a[] ; - a[] - : {}? ID {} - | {}? ID {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * This is a regression test for antlr/antlr4#218 "ANTLR4 EOF Related Bug". - * https://github.com/antlr/antlr4/issues/218 - */ - public static class DisabledAlternative extends BaseParserTestDescriptor { - public String input = "hello"; - public String output = null; - public String errors = null; - public String startRule = "cppCompilationUnit"; - public String grammarName = "T"; - - /** - grammar T; - cppCompilationUnit : content+ EOF; - content: anything | {}? .; - anything: ANY_CHAR; - ANY_CHAR: [_a-zA-Z0-9]; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class IndependentPredNotPassedOuterCtxToAvoidCastException extends BaseParserTestDescriptor { - public String input = "a;"; - public String output = "alt 2\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : b ';' | b '.' ; - b : a ; - a - : {}? ID {} - | {}? ID {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NoTruePredsThrowsNoViableAlt extends BaseParserTestDescriptor { - public String input = "y 3 x 4"; - public String output = null; - public String errors = "line 1:0 no viable alternative at input 'y'\n"; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : a a; - a : {}? ID INT {} - | {}? ID INT {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Order extends BaseParserTestDescriptor { - public String input = "x y"; - /** - alt 1 - alt 1 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : a {} a; // do 2x: once in ATN, next in DFA; - // action blocks lookahead from falling off of 'a' - // and looking into 2nd 'a' ref. !ctx dependent pred - a : ID {} - | {}? ID {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** Loopback doesn't eval predicate at start of alt */ - public static abstract class PredFromAltTestedInLoopBack extends BaseParserTestDescriptor { - public String startRule = "file_"; - public String grammarName = "T"; - - /** - grammar T; - file_ - @after {} - : para para EOF ; - para: paraContent NL NL ; - paraContent : ('s'|'x'|{})>}? NL)+ ; - NL : '\n' ; - s : 's' ; - X : 'x' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class PredFromAltTestedInLoopBack_1 extends PredFromAltTestedInLoopBack { - public String input = "s\n\n\nx\n"; - public String output = "(file_ (para (paraContent s) \\n \\n) (para (paraContent \\n x \\n)) )\n"; - /** - line 5:0 mismatched input '' expecting {'s', ' - ', 'x'} - */ - @CommentHasStringValue - public String errors; - - @Override - public boolean ignore(String targetName) { - return !"Java".equals(targetName) && !"Swift".equals(targetName); - } - } - - public static class PredFromAltTestedInLoopBack_2 extends PredFromAltTestedInLoopBack { - public String input = "s\n\n\nx\n\n"; - public String output = "(file_ (para (paraContent s) \\n \\n) (para (paraContent \\n x) \\n \\n) )\n"; - public String errors = null; - } - - public static abstract class PredTestedEvenWhenUnAmbig extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "primary"; - public String grammarName = "T"; - - /** - grammar T; - @parser::members {} - primary - : ID {} - | {}? 'enum' {} - ; - ID : [a-z]+ ; - WS : [ \t\n\r]+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class PredTestedEvenWhenUnAmbig_1 extends PredTestedEvenWhenUnAmbig { - public String input = "abc"; - public String output = "ID abc\n"; - } - - public static class PredTestedEvenWhenUnAmbig_2 extends PredTestedEvenWhenUnAmbig { - public String input = "enum"; - public String output = null; - public String errors = "line 1:0 no viable alternative at input 'enum'\n"; - } - - /** - * In this case, we're passing a parameter into a rule that uses that - * information to predict the alternatives. This is the special case - * where we know exactly which context we are in. The context stack - * is empty and we have not dipped into the outer context to make a decision. - */ - public static class PredicateDependentOnArg extends BaseParserTestDescriptor { - public String input = "a b"; - /** - alt 2 - alt 1 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - @parser::members {} - s : a[2] a[1]; - a[int i] - : {}? ID {} - | {}? ID {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** - * In this case, we have to ensure that the predicates are not tested - * during the closure after recognizing the 1st ID. The closure will - * fall off the end of 'a' 1st time and reach into the a[1] rule - * invocation. It should not execute predicates because it does not know - * what the parameter is. The context stack will not be empty and so - * they should be ignored. It will not affect recognition, however. We - * are really making sure the ATN simulation doesn't crash with context - * object issues when it encounters preds during FOLLOW. - */ - public static class PredicateDependentOnArg2 extends BaseParserTestDescriptor { - public String input = "a b"; - public String output = null; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - @parser::members {} - s : a[2] a[1]; - a[int i] - : {}? ID - | {}? ID - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** During a global follow operation, we still collect semantic - * predicates as long as they are not dependent on local context - */ - public static class PredsInGlobalFOLLOW extends BaseParserTestDescriptor { - public String input = "a!"; - /** - eval=true - parse - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - @parser::members { - - } - s : e {}? {} '!' ; - t : e {}? ID ; - e : ID | ; // non-LL(1) so we use ATN - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class RewindBeforePredEval extends BaseParserTestDescriptor { - public String input = "y 3 x 4"; - /** - alt 2 - alt 1 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : a a; - a : {}? ID INT {} - | {}? ID INT {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class Simple extends BaseParserTestDescriptor { - public String input = "x y 3"; - /** - alt 2 - alt 2 - alt 3 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : a a a; // do 3x: once in ATN, next in DFA then INT in ATN - a : {}? ID {} - | {}? ID {} - | INT {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SimpleValidate extends BaseParserTestDescriptor { - public String input = "x"; - public String output = null; - public String errors = "line 1:0 no viable alternative at input 'x'\n"; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : a ; - a : {}? ID {} - | {}? INT {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SimpleValidate2 extends BaseParserTestDescriptor { - public String input = "3 4 x"; - /** - alt 2 - alt 2 - */ - @CommentHasStringValue - public String output; - - public String errors = "line 1:4 no viable alternative at input 'x'\n"; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : a a a; - a : {}? ID {} - | {}? INT {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ToLeft extends BaseParserTestDescriptor { - public String input = "x x y"; - /** - alt 2 - alt 2 - alt 2 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : a+ ; - a : {}? ID {} - | {}? ID {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - /** In this case, we use predicates that depend on global information - * like we would do for a symbol table. We simply execute - * the predicates assuming that all necessary information is available. - * The i++ action is done outside of the prediction and so it is executed. - */ - public static class ToLeftWithVaryingPredicate extends BaseParserTestDescriptor { - public String input = "x x y"; - /** - i=1 - alt 2 - i=2 - alt 1 - i=3 - alt 2 - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - @parser::members {} - s : ({ - - } a)+ ; - a : {}? ID {} - | {}? ID {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class TwoUnpredicatedAlts extends BaseParserTestDescriptor { - public String input = "x; y"; - /** - alt 1 - alt 1 - */ - @CommentHasStringValue - public String output; - - /** - line 1:0 reportAttemptingFullContext d=0 (a), input='x' - line 1:0 reportAmbiguity d=0 (a): ambigAlts={1, 2}, input='x' - line 1:3 reportAttemptingFullContext d=0 (a), input='y' - line 1:3 reportAmbiguity d=0 (a): ambigAlts={1, 2}, input='y' - */ - @CommentHasStringValue - public String errors; - - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : {} a ';' a; // do 2x: once in ATN, next in DFA - a : ID {} - | ID {} - | {}? ID {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean showDiagnosticErrors() { return true; } - } - - public static class TwoUnpredicatedAltsAndOneOrthogonalAlt extends BaseParserTestDescriptor { - public String input = "34; x; y"; - /** - alt 1 - alt 2 - alt 2 - */ - @CommentHasStringValue - public String output; - - /** - line 1:4 reportAttemptingFullContext d=0 (a), input='x' - line 1:4 reportAmbiguity d=0 (a): ambigAlts={2, 3}, input='x' - line 1:7 reportAttemptingFullContext d=0 (a), input='y' - line 1:7 reportAmbiguity d=0 (a): ambigAlts={2, 3}, input='y' - */ - @CommentHasStringValue - public String errors; - - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : {} a ';' a ';' a; - a : INT {} - | ID {} // must pick this one for ID since pred is false - | ID {} - | {}? ID {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - @Override - public boolean showDiagnosticErrors() { return true; } - } - - public static class UnpredicatedPathsInAlt extends BaseParserTestDescriptor { - public String input = "x 4"; - public String output = "alt 1\n"; - public String errors = null; - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : a {} - | b {} - ; - a : {}? ID INT - | ID INT - ; - b : ID ID - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ValidateInDFA extends BaseParserTestDescriptor { - public String input = "x ; y"; - public String output = null; - /** - line 1:0 no viable alternative at input 'x' - line 1:4 no viable alternative at input 'y' - */ - @CommentHasStringValue - public String errors; - - public String startRule = "s"; - public String grammarName = "T"; - - /** - grammar T; - s : a ';' a; - // ';' helps us to resynchronize without consuming - // 2nd 'a' reference. We our testing that the DFA also - // throws an exception if the validating predicate fails - a : {}? ID {} - | {}? INT {} - ; - ID : 'a'..'z'+ ; - INT : '0'..'9'+; - WS : (' '|'\n') -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/SetsDescriptors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/SetsDescriptors.java deleted file mode 100644 index e877558992..0000000000 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/descriptors/SetsDescriptors.java +++ /dev/null @@ -1,683 +0,0 @@ -/* - * Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -package org.antlr.v4.test.runtime.descriptors; - -import org.antlr.v4.test.runtime.BaseParserTestDescriptor; -import org.antlr.v4.test.runtime.CommentHasStringValue; - -public class SetsDescriptors { - public static class CharSetLiteral extends BaseParserTestDescriptor { - public String input = "A a B b"; - /** - A - a - B - b - */ - @CommentHasStringValue - public String output; - - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : (A {})+ ; - A : [AaBb] ; - WS : (' '|'\n')+ -> skip ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ComplementSet extends BaseParserTestDescriptor { - public String input = "a"; - public String output = null; - /** - line 1:0 token recognition error at: 'a' - line 1:1 missing {} at '' - */ - @CommentHasStringValue - public String errors; - - public String startRule = "parse"; - public String grammarName = "T"; - - /** - grammar T; - parse : ~NEW_LINE; - NEW_LINE: '\\r'? '\\n'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LexerOptionalSet extends BaseParserTestDescriptor { - public String input = "ac"; - public String output = "ac\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A {} ; - A : ('a'|'b')? 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LexerPlusSet extends BaseParserTestDescriptor { - public String input = "abaac"; - public String output = "abaac\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A {} ; - A : ('a'|'b')+ 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class LexerStarSet extends BaseParserTestDescriptor { - public String input = "abaac"; - public String output = "abaac\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A {} ; - A : ('a'|'b')* 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NotChar extends BaseParserTestDescriptor { - public String input = "x"; - public String output = "x\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A {} ; - A : ~'b' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NotCharSet extends BaseParserTestDescriptor { - public String input = "x"; - public String output = "x\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A {} ; - A : ~('b'|'c') ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NotCharSetWithLabel extends BaseParserTestDescriptor { - public String input = "x"; - public String output = "x\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A {} ; - A : h=~('b'|'c') ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class NotCharSetWithRuleRef3 extends BaseParserTestDescriptor { - public String input = "x"; - public String output = "x\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A {} ; - A : ('a'|B) ; // this doesn't collapse to set but works - fragment - B : ~('a'|'c') ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class OptionalLexerSingleElement extends BaseParserTestDescriptor { - public String input = "bc"; - public String output = "bc\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A {} ; - A : 'b'? 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class OptionalSet extends BaseParserTestDescriptor { - public String input = "ac"; - public String output = "ac\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ('a'|'b')? 'c' {} ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class OptionalSingleElement extends BaseParserTestDescriptor { - public String input = "bc"; - public String output = "bc\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A? 'c' {} ; - A : 'b' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ParserNotSet extends BaseParserTestDescriptor { - public String input = "zz"; - public String output = "z\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : t=~('x'|'y') 'z' {} ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ParserNotToken extends BaseParserTestDescriptor { - public String input = "zz"; - public String output = "zz\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ~'x' 'z' {} ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ParserNotTokenWithLabel extends BaseParserTestDescriptor { - public String input = "zz"; - public String output = "z\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : t=~'x' 'z' {} ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class ParserSet extends BaseParserTestDescriptor { - public String input = "x"; - public String output = "x\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : t=('x'|'y') {} ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class PlusLexerSingleElement extends BaseParserTestDescriptor { - public String input = "bbbbc"; - public String output = "bbbbc\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A {} ; - A : 'b'+ 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class PlusSet extends BaseParserTestDescriptor { - public String input = "abaac"; - public String output = "abaac\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ('a'|'b')+ 'c' {} ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class RuleAsSet extends BaseParserTestDescriptor { - public String input = "b"; - public String output = "b\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a @after {} : 'a' | 'b' |'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class SeqDoesNotBecomeSet extends BaseParserTestDescriptor { - public String input = "34"; - public String output = "34\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : C {} ; - fragment A : '1' | '2'; - fragment B : '3' '4'; - C : A | B; - */ - @CommentHasStringValue - public String grammar; - - } - - public static abstract class StarLexerSingleElement extends BaseParserTestDescriptor { - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : A {} ; - A : 'b'* 'c' ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class StarLexerSingleElement_1 extends StarLexerSingleElement { - public String input = "bbbbc"; - public String output = "bbbbc\n"; - } - - public static class StarLexerSingleElement_2 extends StarLexerSingleElement { - public String input = "c"; - public String output = "c\n"; - } - - public static class StarSet extends BaseParserTestDescriptor { - public String input = "abaac"; - public String output = "abaac\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : ('a'|'b')* 'c' {} ; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class UnicodeUnescapedBMPSet extends BaseParserTestDescriptor { - public String input = "a\u00E4\u3042\u4E9Cc"; - public String output = "a\u00E4\u3042\u4E9Cc\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : LETTERS {} ; - // These are actually not escaped -- Java passes the - // raw unescaped Unicode values to the grammar compiler. - LETTERS : ('a'|'\u00E4'|'\u4E9C'|'\u3042')* 'c'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class UnicodeUnescapedBMPRangeSet extends BaseParserTestDescriptor { - public String input = "a\u00E1\u00E4\u00E1\u00E2\u00E5d"; - public String output = "a\u00E1\u00E4\u00E1\u00E2\u00E5d\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : LETTERS* 'd' {} ; - // These are actually not escaped -- Java passes the - // raw unescaped Unicode values to the grammar compiler. - LETTERS : ('a'|'\u00E0'..'\u00E5'); - */ - @CommentHasStringValue - public String grammar; - - } - - public static class UnicodeEscapedBMPSet extends BaseParserTestDescriptor { - public String input = "a\u00E4\u3042\u4E9Cc"; - public String output = "a\u00E4\u3042\u4E9Cc\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : LETTERS {} ; - // Note the double-backslash to avoid Java passing - // unescaped values as part of the grammar. - LETTERS : ('a'|'\\u00E4'|'\\u4E9C'|'\\u3042')* 'c'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class UnicodeEscapedBMPRangeSet extends BaseParserTestDescriptor { - public String input = "a\u00E1\u00E4\u00E1\u00E2\u00E5d"; - public String output = "a\u00E1\u00E4\u00E1\u00E2\u00E5d\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : LETTERS* 'd' {} ; - // Note the double-backslash to avoid Java passing - // unescaped values as part of the grammar. - LETTERS : ('a'|'\\u00E0'..'\\u00E5'); - */ - @CommentHasStringValue - public String grammar; - - } - - // TODO(bhamiltoncx): This needs to be an error, the V3 - // runtime used by the tool doesn't really understand unescaped code points > - // U+FFFF. - // public static class UnicodeUnescapedSMPSet extends BaseParserTestDescriptor { - // public String input = new StringBuilder() - // .append("a") - // .appendCodePoint(0x1D5C2) - // .appendCodePoint(0x1D5CE) - // .appendCodePoint(0x1D5BA) - // .append("c") - // .toString(); - // public String output = new StringBuilder() - // .append("a") - // .appendCodePoint(0x1D5C2) - // .appendCodePoint(0x1D5CE) - // .appendCodePoint(0x1D5BA) - // .append("c\n") - // .toString(); - // public String errors = null; - // public String startRule = "a"; - // public String grammarName = "T"; - - // /** - // grammar T; - // a : LETTERS {} ; - // // These are actually not escaped -- Java passes the - // // raw unescaped Unicode values to the grammar compiler. - // // - // // Each sequence is the UTF-16 encoding of a raw Unicode - // // SMP code point. - // LETTERS : ('a'|'\uD835\uDDBA'|'\uD835\uDDBE'|'\uD835\uDDC2'|'\uD835\uDDC8'|'\uD835\uDDCE')* 'c'; - // */ - // @CommentHasStringValue - // public String grammar; - - // } - - public static class UnicodeEscapedSMPSet extends BaseParserTestDescriptor { - public String input = new StringBuilder() - .append("a") - .appendCodePoint(0x1D5C2) - .appendCodePoint(0x1D5CE) - .appendCodePoint(0x1D5BA) - .append("c") - .toString(); - public String output = new StringBuilder() - .append("a") - .appendCodePoint(0x1D5C2) - .appendCodePoint(0x1D5CE) - .appendCodePoint(0x1D5BA) - .append("c\n") - .toString(); - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : LETTERS {} ; - // Note the double-backslash to avoid Java passing - // unescaped values as part of the grammar. - LETTERS : ('a'|'\\u{1D5BA}'|'\\u{1D5BE}'|'\\u{1D5C2}'|'\\u{1D5C8}'|'\\u{1D5CE}')* 'c'; - */ - @CommentHasStringValue - public String grammar; - - } - - // Turns out Tool.java uses ANTLR 3's runtime, which means it can't use - // CodePointCharStream to understand unescaped code points > U+FFFF. - // - // TODO(bhamiltoncx): This needs to be an error, since we don't currently plan - // to port Tool.java to use ANTLR 4's runtime. - - // public static class UnicodeUnescapedSMPRangeSet extends BaseParserTestDescriptor { - // public String input = new StringBuilder() - // .append("a") - // .appendCodePoint(0x1D5C2) - // .appendCodePoint(0x1D5CE) - // .appendCodePoint(0x1D5BA) - // .append("d") - // .toString(); - // public String output = new StringBuilder() - // .append("a") - // .appendCodePoint(0x1D5C2) - // .appendCodePoint(0x1D5CE) - // .appendCodePoint(0x1D5BA) - // .append("d\n") - // .toString(); - // public String errors = null; - // public String startRule = "a"; - // public String grammarName = "T"; - - // /** - // grammar T; - // a : LETTERS* 'd' {} ; - // // These are actually not escaped -- Java passes the - // // raw unescaped Unicode values to the grammar compiler. - // LETTERS : ('a'|'\uD83D\uDE00'..'\uD83E\uDD43'); - // */ - // @CommentHasStringValue - // public String grammar; - - // } - - public static class UnicodeEscapedSMPRangeSet extends BaseParserTestDescriptor { - public String input = new StringBuilder() - .append("a") - .appendCodePoint(0x1F609) - .appendCodePoint(0x1F942) - .appendCodePoint(0x1F700) - .append("d") - .toString(); - public String output = new StringBuilder() - .append("a") - .appendCodePoint(0x1F609) - .appendCodePoint(0x1F942) - .appendCodePoint(0x1F700) - .append("d\n") - .toString(); - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : LETTERS* 'd' {} ; - // Note the double-backslash to avoid Java passing - // unescaped values as part of the grammar. - LETTERS : ('a'|'\\u{1F600}'..'\\u{1F943}'); - */ - @CommentHasStringValue - public String grammar; - - } - - public static class UnicodeEscapedSMPRangeSetMismatch extends BaseParserTestDescriptor { - // Test the code points just before and just after the range. - public String input = new StringBuilder() - .append("a") - .appendCodePoint(0x1F5FF) - .appendCodePoint(0x1F944) - .append("d") - .toString(); - public String output = "ad\n"; - public String errors = new StringBuilder() - .append("line 1:1 token recognition error at: '") - .appendCodePoint(0x1F5FF) - .append("'\n") - .append("line 1:2 token recognition error at: '") - .appendCodePoint(0x1F944) - .append("'\n") - .toString(); - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : LETTERS* 'd' {} ; - // Note the double-backslash to avoid Java passing - // unescaped values as part of the grammar. - LETTERS : ('a'|'\\u{1F600}'..'\\u{1F943}'); - */ - @CommentHasStringValue - public String grammar; - - } - - public static class UnicodeNegatedBMPSetIncludesSMPCodePoints extends BaseParserTestDescriptor { - public String input = "a\uD83D\uDE33\uD83D\uDE21\uD83D\uDE1D\uD83E\uDD13c"; - public String output = "a\uD83D\uDE33\uD83D\uDE21\uD83D\uDE1D\uD83E\uDD13c\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : LETTERS {} ; - LETTERS : 'a' ~('b')+ 'c'; - */ - @CommentHasStringValue - public String grammar; - - } - - public static class UnicodeNegatedSMPSetIncludesBMPCodePoints extends BaseParserTestDescriptor { - public String input = "abc"; - public String output = "abc\n"; - public String errors = null; - public String startRule = "a"; - public String grammarName = "T"; - - /** - grammar T; - a : LETTERS {} ; - LETTERS : 'a' ~('\\u{1F600}'..'\\u{1F943}')+ 'c'; - */ - @CommentHasStringValue - public String grammar; - - } -} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/BaseGoTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/BaseGoTest.java index 2e0b391528..69f02de2a5 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/BaseGoTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/BaseGoTest.java @@ -7,24 +7,28 @@ import org.antlr.v4.test.runtime.*; +import org.junit.Assert; import org.stringtemplate.v4.ST; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.BufferedReader; -import java.io.BufferedWriter; +import java.io.*; import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; +import java.nio.charset.StandardCharsets; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.EnumSet; import static junit.framework.TestCase.*; import static org.antlr.v4.test.runtime.BaseRuntimeTest.antlrOnString; import static org.antlr.v4.test.runtime.BaseRuntimeTest.writeFile; +import static org.junit.Assert.fail; public class BaseGoTest extends BaseRuntimeTestSupport implements RuntimeTestSupport { - + private final static String antlrTestPackageName = "antlr"; + private static final String goModFileName = "go.mod"; private static final String GO_RUNTIME_IMPORT_PATH = "github.com/antlr/antlr4/runtime/Go/antlr"; // TODO: Change this before merging with upstream + private static boolean isRuntimeInitialized = false; + private static String newGoRootString; + private static String goModContent = null; private File parserTempDir; // "parser" with tempDir @@ -36,37 +40,6 @@ protected String getPropertyPrefix() { public static void groupSetUp() throws Exception { } public static void groupTearDown() throws Exception { } - private void setupAntlrRuntime() throws Exception { - File packageDir = new File(getTempParserDir(), "antlr"); - if (!packageDir.mkdirs()) { - throw new Exception("Cannot make directory for runtime"); - } - File[] runtimeFiles = locateRuntime().listFiles(new GoFileFilter()); - if (runtimeFiles == null) { - throw new Exception("Go runtime file list is empty."); - } - for (File runtimeFile : runtimeFiles) { - File dest = new File(packageDir, runtimeFile.getName()); - - RuntimeTestUtils.copyFile(runtimeFile, dest); - } - } - - private void setupGoMod() throws Exception { - String goExecutable = locateGo(); - ProcessBuilder pb = new ProcessBuilder(goExecutable, "mod", "init", "antlr.org/test"); - pb.directory(getTempTestDir()); - pb.redirectErrorStream(true); - Process process = pb.start(); - StreamVacuum sucker = new StreamVacuum(process.getInputStream()); - sucker.start(); - int exit = process.waitFor(); - sucker.join(); - if (exit != 0) { - throw new Exception("Non-zero exit while setting up go module: " + sucker.toString()); - } - } - public void testSetUp() throws Exception { eraseParserTempDir(); super.testSetUp(); @@ -96,8 +69,10 @@ public String execLexer(String grammarFileName, String grammarStr, boolean success = rawGenerateAndBuildRecognizer(grammarFileName, grammarStr, null, lexerName, "-no-listener"); assertTrue(success); + replaceImportPath(); writeFile(getTempDirPath(), "input", input); writeLexerTestFile(lexerName, showDFA); + writeGoModFile(); return execModule("Test.go"); } @@ -110,10 +85,57 @@ public String execParser(String grammarFileName, String grammarStr, boolean success = rawGenerateAndBuildRecognizer(grammarFileName, grammarStr, parserName, lexerName, "-visitor"); assertTrue(success); + replaceImportPath(); writeFile(getTempDirPath(), "input", input); + writeGoModFile(); rawBuildRecognizerTestFile(parserName, lexerName, listenerName, visitorName, startRuleName, showDiagnosticErrors); - return execRecognizer(); + return execModule("Test.go"); + } + + private void writeGoModFile() { + if (goModContent == null) { + try { + ProcessBuilder pb = new ProcessBuilder("go", "mod", "init", "test"); + pb.directory(getTempTestDir()); + pb.redirectErrorStream(true); + Process process = pb.start(); + StreamVacuum sucker = new StreamVacuum(process.getInputStream()); + sucker.start(); + int exit = process.waitFor(); + sucker.join(); + if (exit != 0) { + throw new Exception("Non-zero exit while setting up go module: " + sucker); + } + goModContent = new String(Files.readAllBytes(Paths.get(getTempDirPath(), goModFileName)), StandardCharsets.UTF_8); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Unable to execute go mod"); + } + } else { + try (PrintWriter out = new PrintWriter(Paths.get(getTempDirPath(), goModFileName).toString())) { + out.println(goModContent); + } catch (FileNotFoundException e) { + e.printStackTrace(); + Assert.fail("Unable to write " + goModFileName); + } + } + } + + private void replaceImportPath() { + File[] files = getTempParserDir().listFiles(new GoFileFilter()); + for (File file : files) { + String fileName = file.toString(); + try { + String content = new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8); + String newContent = content.replaceAll(GO_RUNTIME_IMPORT_PATH, antlrTestPackageName); + try (PrintWriter out = new PrintWriter(fileName)) { + out.println(newContent); + } + } catch (IOException e) { + fail("Error during processing " + fileName); + } + } } /** Return true if all is well */ @@ -130,10 +152,7 @@ protected boolean rawGenerateAndBuildRecognizer(String grammarFileName, boolean defaultListener, String... extraOptions) { ErrorQueue equeue = antlrOnString(getTempParserDirPath(), "Go", grammarFileName, grammarStr, defaultListener, extraOptions); - if (!equeue.errors.isEmpty()) { - return false; - } - return true; + return equeue.errors.isEmpty(); } protected void rawBuildRecognizerTestFile(String parserName, @@ -149,17 +168,15 @@ protected void rawBuildRecognizerTestFile(String parserName, } } - public String execRecognizer() { - return execModule("Test.go"); - } + private String execModule(String fileName) { + initializeRuntime(); - public String execModule(String fileName) { - String goExecutable = locateGo(); String modulePath = new File(getTempTestDir(), fileName).getAbsolutePath(); String inputPath = new File(getTempTestDir(), "input").getAbsolutePath(); try { - ProcessBuilder builder = new ProcessBuilder(goExecutable, "run", modulePath, inputPath); + ProcessBuilder builder = new ProcessBuilder("go", "run", modulePath, inputPath); builder.directory(getTempTestDir()); + builder.environment().put("GOROOT", newGoRootString); Process process = builder.start(); StreamVacuum stdoutVacuum = new StreamVacuum(process.getInputStream()); StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream()); @@ -169,62 +186,100 @@ public String execModule(String fileName) { stdoutVacuum.join(); stderrVacuum.join(); String output = stdoutVacuum.toString(); - if ( output.length()==0 ) { + if (output.length() == 0) { output = null; } if (stderrVacuum.toString().length() > 0) { setParseErrors(stderrVacuum.toString()); } return output; - } - catch (Exception e) { + } catch (Exception e) { System.err.println("can't exec recognizer"); e.printStackTrace(System.err); } return null; } - private static String locateTool(String tool) { - ArrayList paths = new ArrayList(); // default cap is about right + private static synchronized boolean initializeRuntime() { + if (isRuntimeInitialized) + return true; - // GOROOT should have priority if set - String goroot = System.getenv("GOROOT"); - if (goroot != null) { - paths.add(goroot + File.separatorChar + "bin"); + String goRoot = getGoRootValue(); + Path newGoRoot = Paths.get(cachingDirectory, "Go"); + newGoRootString = newGoRoot.toString(); + try { + File newGoRootDirectory = newGoRoot.toFile(); + if (newGoRootDirectory.exists()) + deleteDirectory(newGoRootDirectory); + copyDirectory(Paths.get(goRoot), newGoRoot); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail("Unable to copy go system files"); } - String pathEnv = System.getenv("PATH"); - if (pathEnv != null) { - paths.addAll(Arrays.asList(pathEnv.split(File.pathSeparator))); + String packageDir = Paths.get(newGoRootString, "src", antlrTestPackageName).toString(); + RuntimeTestUtils.mkdir(packageDir); + File[] runtimeFiles = locateRuntime().listFiles(new GoFileFilter()); + if (runtimeFiles == null) { + Assert.fail("Go runtime file list is empty."); } - // OS specific default locations of binary dist as last resort - paths.add("/usr/local/go/bin"); - paths.add("c:\\Go\\bin"); + for (File runtimeFile : runtimeFiles) { + File dest = new File(packageDir, runtimeFile.getName()); + try { + RuntimeTestUtils.copyFile(runtimeFile, dest); + } catch (IOException e) { + e.printStackTrace(); + Assert.fail("Unable to copy runtime file " + runtimeFile); + } + } - for (String path : paths) { - File candidate = new File(new File(path), tool); - if (candidate.exists()) { - return candidate.getPath(); + isRuntimeInitialized = true; + return isRuntimeInitialized; + } + + private static void copyDirectory(final Path source, final Path target, final CopyOption... options) + throws IOException { + Files.walkFileTree(source, EnumSet.of(FileVisitOption.FOLLOW_LINKS), 2147483647, new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) + throws IOException { + Files.createDirectories(target.resolve(source.relativize(dir))); + return FileVisitResult.CONTINUE; } - candidate = new File(new File(path), tool+".exe"); - if (candidate.exists()) { - return candidate.getPath(); + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + Files.copy(file, target.resolve(source.relativize(file)), options); + return FileVisitResult.CONTINUE; } - } - return null; + }); } - private static String locateGo() { - String propName = "antlr-go"; - String prop = System.getProperty(propName); - if (prop == null || prop.length() == 0) { - prop = locateTool("go"); + private static void deleteDirectory(File f) throws IOException { + if (f.isDirectory()) { + for (File c : f.listFiles()) + deleteDirectory(c); } - if (prop == null) { - throw new RuntimeException("Missing system property:" + propName); + if (!f.delete()) + throw new FileNotFoundException("Failed to delete file: " + f); + } + + private static String getGoRootValue() { + try { + ProcessBuilder pb = new ProcessBuilder("go", "env", "GOROOT"); + Process process = pb.start(); + StreamVacuum stdoutVacuum = new StreamVacuum(process.getInputStream()); + stdoutVacuum.start(); + process.waitFor(); + stdoutVacuum.join(); + return stdoutVacuum.toString().trim(); + } catch (Exception e) { + e.printStackTrace(); + Assert.fail("Unable to execute go env"); } - return prop; + return null; } private static File locateRuntime() { @@ -237,42 +292,17 @@ private static File locateRuntime() { if (!runtimeDir.exists()) { throw new RuntimeException("Cannot find Go ANTLR runtime"); } - return runtimeDir; + return new File(runtimeDir.getPath()); } - private void replaceImportPath() throws Exception { - File[] files = getTempParserDir().listFiles(new GoFileFilter()); - for (File file: files) { - File temp = File.createTempFile( - file.getName(), - ".bak", - file.getParentFile() - ); - BufferedReader br = new BufferedReader(new FileReader(file)); - BufferedWriter bw = new BufferedWriter(new FileWriter(temp)); - String s = ""; - - while ((s = br.readLine()) != null) { - bw.write(s.replace(GO_RUNTIME_IMPORT_PATH, "antlr.org/test/parser/antlr")); - bw.newLine(); - } - - br.close(); - bw.close(); - - file.delete(); - temp.renameTo(file); - } - } - protected void writeParserTestFile(String parserName, String lexerName, String listenerName, String visitorName, String parserStartRuleName, boolean debug) { ST outputFileST = new ST( "package main\n" + "import (\n" - + " \"antlr.org/test/parser\"\n" - + " \"antlr.org/test/parser/antlr\"\n" + + " \"test/parser\"\n" + + " \"" + antlrTestPackageName + "\"\n" + " \"fmt\"\n" + " \"os\"\n" + ")\n" @@ -322,24 +352,15 @@ protected void writeParserTestFile(String parserName, String lexerName, outputFileST.add("listenerName", listenerName); outputFileST.add("visitorName", visitorName); outputFileST.add("parserStartRuleName", parserStartRuleName.substring(0, 1).toUpperCase() + parserStartRuleName.substring(1) ); - try { - setupGoMod(); - setupAntlrRuntime(); - replaceImportPath(); - } catch (Exception e) { - // - } writeFile(getTempDirPath(), "Test.go", outputFileST.render()); } - - protected void writeLexerTestFile(String lexerName, boolean showDFA) { ST outputFileST = new ST( "package main\n" + "import (\n" - + " \"antlr.org/test/parser\"\n" - + " \"antlr.org/test/parser/antlr\"\n" + + " \"test/parser\"\n" + + " \"" + antlrTestPackageName + "\"\n" + " \"os\"\n" + " \"fmt\"\n" + ")\n" @@ -361,14 +382,6 @@ protected void writeLexerTestFile(String lexerName, boolean showDFA) { + "}\n" + "\n"); outputFileST.add("lexerName", lexerName); - try { - setupGoMod(); - setupAntlrRuntime(); - replaceImportPath(); - } catch (Exception e) { - // - } writeFile(getTempDirPath(), "Test.go", outputFileST.render()); } - } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestCompositeLexers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestCompositeLexers.java index cd1bcc2742..2021be5be5 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestCompositeLexers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestCompositeLexers.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeLexersDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeLexers extends BaseRuntimeTest { public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeLexersDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeLexers", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestCompositeParsers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestCompositeParsers.java index ce29ab1a00..52a69a274e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestCompositeParsers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestCompositeParsers.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeParsersDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeParsers extends BaseRuntimeTest { public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeParsersDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeParsers", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestFullContextParsing.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestFullContextParsing.java index e90645b39c..e4307dccf1 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestFullContextParsing.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestFullContextParsing.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.FullContextParsingDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestFullContextParsing extends BaseRuntimeTest { public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(FullContextParsingDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("FullContextParsing", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLeftRecursion.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLeftRecursion.java index ab492c4aef..f13abc7b5c 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLeftRecursion.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLeftRecursion.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LeftRecursionDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLeftRecursion extends BaseRuntimeTest { public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LeftRecursionDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LeftRecursion", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLexerErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLexerErrors.java index c4c967e80a..89cef89b3a 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLexerErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLexerErrors.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerErrorsDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerErrors extends BaseRuntimeTest { public TestLexerErrors(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestLexerErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerErrorsDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerErrors", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLexerExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLexerExec.java index da01840ddb..616b4c0913 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLexerExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestLexerExec.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerExec extends BaseRuntimeTest { public TestLexerExec(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestLexerExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerExecDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerExec", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestListeners.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestListeners.java index 012c0e2ac7..cf36811922 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestListeners.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestListeners.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestListeners extends BaseRuntimeTest { public TestListeners(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestListeners(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ListenersDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Listeners", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParseTrees.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParseTrees.java index 9b93978227..61fd8d1980 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParseTrees.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParseTrees.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParseTrees extends BaseRuntimeTest { public TestParseTrees(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestParseTrees(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParseTreesDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParseTrees", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserErrors.java index 4b339cccc5..f21dae78e0 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserErrors.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserErrorsDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserErrors extends BaseRuntimeTest { public TestParserErrors(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestParserErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserErrorsDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserErrors", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserExec.java index 5a453fcc2d..d7c360e3c4 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestParserExec.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserExecDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserExec extends BaseRuntimeTest { public TestParserExec(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestParserExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserExecDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserExec", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestPerformance.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestPerformance.java index d73b49cad3..74af6646ea 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestPerformance.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestPerformance.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestPerformance extends BaseRuntimeTest { public TestPerformance(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestPerformance(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(PerformanceDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Performance", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSemPredEvalLexer.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSemPredEvalLexer.java index 1b632cd334..1af66d8995 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSemPredEvalLexer.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSemPredEvalLexer.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalLexerDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalLexer extends BaseRuntimeTest { public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalLexerDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalLexer", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSemPredEvalParser.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSemPredEvalParser.java index 4e487e6589..ad0d218d7d 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSemPredEvalParser.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSemPredEvalParser.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalParserDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalParser extends BaseRuntimeTest { public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalParserDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalParser", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSets.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSets.java index 860cbf081d..e1520626c7 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSets.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/go/TestSets.java @@ -8,12 +8,10 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SetsDescriptors; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSets extends BaseRuntimeTest { public TestSets(RuntimeTestDescriptor descriptor) { @@ -28,6 +26,6 @@ public TestSets(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SetsDescriptors.class, "Go"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Sets", "Go"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java index cc03bdc116..de192d5a8e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/BaseJavaTest.java @@ -56,11 +56,9 @@ import java.util.Set; import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.assertFalse; import static junit.framework.TestCase.assertNotNull; import static junit.framework.TestCase.assertTrue; import static org.antlr.v4.test.runtime.BaseRuntimeTest.writeFile; -import static org.junit.Assert.assertArrayEquals; public class BaseJavaTest extends BaseRuntimeTestSupport implements RuntimeTestSupport { @@ -127,8 +125,6 @@ protected boolean compile(String... fileNames) { } JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); -// DiagnosticCollector diagnostics = -// new DiagnosticCollector(); StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null); @@ -137,7 +133,7 @@ protected boolean compile(String... fileNames) { fileManager.getJavaFileObjectsFromFiles(files); Iterable compileOptions = - Arrays.asList("-g", "-source", "1.6", "-target", "1.6", "-implicit:class", "-Xlint:-options", "-d", getTempDirPath(), "-cp", getTempDirPath() + PATH_SEP + CLASSPATH); + Arrays.asList("-g", "-source", "1.8", "-target", "1.8", "-implicit:class", "-Xlint:-options", "-d", getTempDirPath(), "-cp", getTempDirPath() + PATH_SEP + CLASSPATH); JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, null, compileOptions, null, @@ -189,7 +185,7 @@ public ParseTree execParser(String startRuleName, String input, public ParseTree execStartRule(String startRuleName, Parser parser) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { - Method startRule = null; + Method startRule; Object[] args = null; try { startRule = parser.getClass().getMethod(startRuleName); @@ -465,7 +461,7 @@ public void testActions(String templates, String actionName, String action, Stri AnalysisPipeline anal = new AnalysisPipeline(g); anal.process(); - CodeGenerator gen = new CodeGenerator(g); + CodeGenerator gen = CodeGenerator.create(g); ST outputFileST = gen.generateParser(false); String output = outputFileST.render(); //System.out.println(output); diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestCompositeLexers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestCompositeLexers.java index 58b316c0e9..b995f03754 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestCompositeLexers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestCompositeLexers.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeLexersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeLexers extends BaseRuntimeTest { public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeLexersDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeLexers", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestCompositeParsers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestCompositeParsers.java index 2b3a1b153a..51f79ef432 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestCompositeParsers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestCompositeParsers.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeParsersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeParsers extends BaseRuntimeTest { public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeParsersDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeParsers", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestFullContextParsing.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestFullContextParsing.java index ca6ec83d6d..c1fa1f3532 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestFullContextParsing.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestFullContextParsing.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.FullContextParsingDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestFullContextParsing extends BaseRuntimeTest { public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(FullContextParsingDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("FullContextParsing", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestIntegerList.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestIntegerList.java index 909a4f3b69..eee769f806 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestIntegerList.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestIntegerList.java @@ -37,7 +37,7 @@ public void surrogateRangeIntegerToCharArray() { // Java allows dangling surrogates, so (currently) we do // as well. We could change this if desired. l.add(0xDC00); - char expected[] = new char[] { 0xDC00 }; + char[] expected = new char[] { 0xDC00 }; assertArrayEquals(expected, l.toCharArray()); } @@ -55,7 +55,7 @@ public void unicodeBMPIntegerListToCharArray() { l.add(0x35); l.add(0x4E94); l.add(0xFF15); - char expected[] = new char[] { 0x35, 0x4E94, 0xFF15 }; + char[] expected = new char[] { 0x35, 0x4E94, 0xFF15 }; assertArrayEquals(expected, l.toCharArray()); } @@ -65,7 +65,7 @@ public void unicodeSMPIntegerListToCharArray() { l.add(0x104A5); l.add(0x116C5); l.add(0x1D7FB); - char expected[] = new char[] { 0xD801, 0xDCA5, 0xD805, 0xDEC5, 0xD835, 0xDFFB }; + char[] expected = new char[] { 0xD801, 0xDCA5, 0xD805, 0xDEC5, 0xD835, 0xDFFB }; assertArrayEquals(expected, l.toCharArray()); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestInterpreterDataReader.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestInterpreterDataReader.java new file mode 100644 index 0000000000..d11f6904a3 --- /dev/null +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestInterpreterDataReader.java @@ -0,0 +1,91 @@ +package org.antlr.v4.test.runtime.java; + +import org.antlr.v4.Tool; +import org.antlr.v4.runtime.Vocabulary; +import org.antlr.v4.runtime.VocabularyImpl; +import org.antlr.v4.runtime.atn.ATN; +import org.antlr.v4.runtime.atn.ATNDeserializer; +import org.antlr.v4.runtime.atn.ATNSerializer; +import org.antlr.v4.runtime.misc.IntegerList; +import org.antlr.v4.runtime.misc.InterpreterDataReader; +import org.antlr.v4.tool.Grammar; +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +/** This file represents a simple sanity checks on the parsing of the .interp file + * available to the Java runtime for interpreting rather than compiling and executing parsers. + */ +public class TestInterpreterDataReader extends BaseJavaTest { + @Test + public void testParseFile() throws IOException, NoSuchFieldException, IllegalAccessException, org.antlr.runtime.RecognitionException { + Grammar g = new Grammar( + "grammar Calc;\n" + + "s : expr EOF\n" + + " ;\n" + + "expr\n" + + " : INT # number\n" + + " | expr (MUL | DIV) expr # multiply\n" + + " | expr (ADD | SUB) expr # add\n" + + " ;\n" + + "\n" + + "INT : [0-9]+;\n" + + "MUL : '*';\n" + + "DIV : '/';\n" + + "ADD : '+';\n" + + "SUB : '-';\n" + + "WS : [ \\t]+ -> channel(HIDDEN);"); + String interpString = Tool.generateInterpreterData(g); + Path interpFile = Files.createTempFile(null, null); + Files.write(interpFile, interpString.getBytes(StandardCharsets.UTF_8)); + + InterpreterDataReader.InterpreterData interpreterData = InterpreterDataReader.parseFile(interpFile.toString()); + Field atnField = interpreterData.getClass().getDeclaredField("atn"); + Field vocabularyField = interpreterData.getClass().getDeclaredField("vocabulary"); + Field ruleNamesField = interpreterData.getClass().getDeclaredField("ruleNames"); + Field channelsField = interpreterData.getClass().getDeclaredField("channels"); + Field modesField = interpreterData.getClass().getDeclaredField("modes"); + + atnField.setAccessible(true); + vocabularyField.setAccessible(true); + ruleNamesField.setAccessible(true); + channelsField.setAccessible(true); + modesField.setAccessible(true); + + ATN atn = (ATN) atnField.get(interpreterData); + Vocabulary vocabulary = (Vocabulary) vocabularyField.get(interpreterData); + String[] literalNames = ((VocabularyImpl) vocabulary).getLiteralNames(); + String[] symbolicNames = ((VocabularyImpl) vocabulary).getSymbolicNames(); + List ruleNames = castList(ruleNamesField.get(interpreterData), String.class); + List channels = castList(channelsField.get(interpreterData), String.class); + List modes = castList(modesField.get(interpreterData), String.class); + + Assert.assertEquals(6, vocabulary.getMaxTokenType()); + Assert.assertArrayEquals(new String[]{"s","expr"}, ruleNames.toArray()); + Assert.assertArrayEquals(new String[]{"", "", "'*'", "'/'", "'+'", "'-'", ""}, literalNames); + Assert.assertArrayEquals(new String[]{"", "INT", "MUL", "DIV", "ADD", "SUB", "WS"}, symbolicNames); + Assert.assertNull(channels); + Assert.assertNull(modes); + + IntegerList serialized = ATNSerializer.getSerialized(atn); + Assert.assertEquals(ATNDeserializer.SERIALIZED_VERSION, serialized.get(0)); + } + + private List castList(Object obj, Class clazz) { + List result = new ArrayList(); + if (obj instanceof List) { + for (Object o : (List) obj) { + result.add(clazz.cast(o)); + } + return result; + } + return null; + } +} diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLeftRecursion.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLeftRecursion.java index 90b51ac72c..f408c588fb 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLeftRecursion.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLeftRecursion.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LeftRecursionDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLeftRecursion extends BaseRuntimeTest { public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LeftRecursionDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LeftRecursion", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLexerErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLexerErrors.java index 3ff3741f34..aaccc0905d 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLexerErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLexerErrors.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerErrorsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerErrors extends BaseRuntimeTest { public TestLexerErrors(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLexerErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerErrorsDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerErrors", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLexerExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLexerExec.java index adef511c09..0637ceed80 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLexerExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestLexerExec.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerExec extends BaseRuntimeTest { public TestLexerExec(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLexerExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerExecDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerExec", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestListeners.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestListeners.java index 643f562189..97244f0a75 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestListeners.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestListeners.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestListeners extends BaseRuntimeTest { public TestListeners(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestListeners(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ListenersDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Listeners", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParseTrees.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParseTrees.java index 4a293cc700..f4e8c656e7 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParseTrees.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParseTrees.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParseTrees extends BaseRuntimeTest { public TestParseTrees(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParseTrees(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParseTreesDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParseTrees", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserErrors.java index 3c6870f95d..ff590ccb07 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserErrors.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserErrorsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserErrors extends BaseRuntimeTest { public TestParserErrors(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParserErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserErrorsDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserErrors", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserExec.java index 1bf39a4219..839211f04f 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestParserExec.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserExecDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserExec extends BaseRuntimeTest { public TestParserExec(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParserExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserExecDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserExec", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestPerformance.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestPerformance.java index 097365816e..348ab58852 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestPerformance.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestPerformance.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestPerformance extends BaseRuntimeTest { public TestPerformance(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestPerformance(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(PerformanceDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Performance", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSemPredEvalLexer.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSemPredEvalLexer.java index 0cd917b1a9..81297f1a9c 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSemPredEvalLexer.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSemPredEvalLexer.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalLexerDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalLexer extends BaseRuntimeTest { public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalLexerDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalLexer", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSemPredEvalParser.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSemPredEvalParser.java index 2cbb91b676..d40066b449 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSemPredEvalParser.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSemPredEvalParser.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalParserDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalParser extends BaseRuntimeTest { public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalParserDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalParser", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSets.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSets.java index bc43a44c02..73be980b1b 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSets.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/TestSets.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SetsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSets extends BaseRuntimeTest { public TestSets(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSets(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SetsDescriptors.class, "Java"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Sets", "Java"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/TestVisitors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/TestVisitors.java index 5eafca122b..7a494d7873 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/TestVisitors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/TestVisitors.java @@ -107,7 +107,8 @@ protected String aggregateResult(String aggregate, String nextResult) { /** * This test verifies that {@link AbstractParseTreeVisitor#visitChildren} does not call - * {@link ParseTreeVisitor#visit} after {@link AbstractParseTreeVisitor#shouldVisitNextChild} returns + * {@link org.antlr.v4.runtime.tree.ParseTreeVisitor#visit} after + * {@link org.antlr.v4.runtime.tree.AbstractParseTreeVisitor#shouldVisitNextChild} returns * {@code false}. */ @Test diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java index 5d612d089a..e653f8b59f 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/perf/TimeLexerSpeed.java @@ -55,7 +55,7 @@ * * Sample output on OS X with 4 GHz Intel Core i7 (us == microseconds, 1/1000 of a millisecond): * - Java VM args: -Xms2G -Xmx2G + Java VM args: -Xms2G -Xmx8g Warming up Java compiler.... load_legacy_java_ascii_file average time 53us size 58384b over 3500 loads of 29038 symbols from Parser.java load_legacy_java_ascii_file average time 27us size 15568b over 3500 loads of 7625 symbols from RuleContext.java @@ -381,7 +381,7 @@ public void lex_legacy_java_utf8(int n, boolean clearLexerDFACache) throws Excep public void lex_new_java_utf8(int n, boolean clearLexerDFACache) throws Exception { ClassLoader loader = TimeLexerSpeed.class.getClassLoader(); - try (InputStream is = loader.getResourceAsStream(Parser_java_file);) { + try (InputStream is = loader.getResourceAsStream(Parser_java_file)) { long size = getResourceSize(loader, Parser_java_file); CharStream input = CharStreams.fromStream(is, StandardCharsets.UTF_8, size); JavaLexer lexer = new JavaLexer(input); @@ -490,7 +490,7 @@ public static String dirname(Path path) { return path.getName(0).toString(); } - public static final long getResourceSize(ClassLoader loader, String resourceName) throws IOException { + public static long getResourceSize(ClassLoader loader, String resourceName) throws IOException { URLConnection uc = null; try { // Sadly, URLConnection is not AutoCloseable, but it leaks resources if diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/BaseNodeTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/BaseNodeTest.java index b22e632d6c..97bf6388dd 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/BaseNodeTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/BaseNodeTest.java @@ -5,20 +5,36 @@ */ package org.antlr.v4.test.runtime.javascript; -import org.antlr.v4.runtime.misc.Utils; import org.antlr.v4.test.runtime.*; import org.stringtemplate.v4.ST; import java.io.File; import java.io.IOException; +import java.io.PrintWriter; import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.*; - import static org.antlr.v4.test.runtime.BaseRuntimeTest.antlrOnString; import static org.antlr.v4.test.runtime.BaseRuntimeTest.writeFile; import static org.junit.Assert.*; public class BaseNodeTest extends BaseRuntimeTestSupport implements RuntimeTestSupport { + private static String runtimeDir; + + static { + final ClassLoader loader = Thread.currentThread().getContextClassLoader(); + final URL runtimeSrc = loader.getResource("JavaScript"); + if ( runtimeSrc==null ) { + throw new RuntimeException("Cannot find JavaScript runtime"); + } + runtimeDir = runtimeSrc.getPath(); + if(isWindows()){ + runtimeDir = runtimeDir.replaceFirst("/", ""); + } + } @Override protected String getPropertyPrefix() { @@ -99,6 +115,21 @@ protected boolean rawGenerateAndBuildRecognizer(String grammarFileName, + "Visitor.js"); } } + + String newImportAntlrString = "import antlr4 from 'file://" + runtimeDir + "/src/antlr4/index.js'"; + for (String file : files) { + Path path = Paths.get(getTempDirPath(), file); + try { + String content = new String(Files.readAllBytes(path), StandardCharsets.UTF_8); + String newContent = content.replaceAll("import antlr4 from 'antlr4';", newImportAntlrString); + try (PrintWriter out = new PrintWriter(path.toString())) { + out.println(newContent); + } + } catch (IOException e) { + fail("File not found: " + path); + } + } + return true; // allIsWell: no compile } @@ -121,17 +152,9 @@ public String execRecognizer() { public String execModule(String fileName) { try { - String npmPath = locateNpm(); - if(!TestContext.isCI()) { - installRuntime(npmPath); - registerRuntime(npmPath); - } - String modulePath = new File(getTempTestDir(), fileName) - .getAbsolutePath(); - linkRuntime(npmPath); + String modulePath = new File(getTempTestDir(), fileName).getAbsolutePath(); String nodejsPath = locateNodeJS(); - String inputPath = new File(getTempTestDir(), "input") - .getAbsolutePath(); + String inputPath = new File(getTempTestDir(), "input").getAbsolutePath(); ProcessBuilder builder = new ProcessBuilder(nodejsPath, modulePath, inputPath); builder.environment().put("NODE_PATH", getTempDirPath()); @@ -165,60 +188,6 @@ public String execModule(String fileName) { } } - private void installRuntime(String npmPath) throws IOException, InterruptedException { - String runtimePath = locateRuntime(); - ProcessBuilder builder = new ProcessBuilder(npmPath, "install"); - builder.directory(new File(runtimePath)); - builder.redirectError(new File(getTempTestDir(), "error.txt")); - builder.redirectOutput(new File(getTempTestDir(), "output.txt")); - Process process = builder.start(); - // TODO switch to jdk 8 - process.waitFor(); - // if(!process.waitFor(30L, TimeUnit.SECONDS)) - // process.destroyForcibly(); - int error = process.exitValue(); - if(error!=0) - throw new IOException("'npm install' failed"); - } - - private void registerRuntime(String npmPath) throws IOException, InterruptedException { - String runtimePath = locateRuntime(); - ProcessBuilder builder = new ProcessBuilder(npmPath, "link"); - builder.directory(new File(runtimePath)); - builder.redirectError(new File(getTempTestDir(), "error.txt")); - builder.redirectOutput(new File(getTempTestDir(), "output.txt")); - Process process = builder.start(); - // TODO switch to jdk 8 - process.waitFor(); - // if(!process.waitFor(30L, TimeUnit.SECONDS)) - // process.destroyForcibly(); - int error = process.exitValue(); - if(error!=0) - throw new IOException("'npm link' failed"); - } - - private void linkRuntime(String npmPath) throws IOException, InterruptedException { - List args = new ArrayList<>(); - if(TestContext.isCircleCI()) - args.add("sudo"); - args.addAll(Arrays.asList(npmPath, "link", "antlr4")); - ProcessBuilder builder = new ProcessBuilder(args.toArray(new String[0])); - builder.directory(getTempTestDir()); - File errorFile = new File(getTempTestDir(), "error.txt"); - builder.redirectError(errorFile); - builder.redirectOutput(new File(getTempTestDir(), "output.txt")); - Process process = builder.start(); - // TODO switch to jdk 8 - process.waitFor(); - // if(!process.waitFor(30L, TimeUnit.SECONDS)) - // process.destroyForcibly(); - int error = process.exitValue(); - if(error!=0) { - char[] errors = Utils.readFile(errorFile.getAbsolutePath()); - throw new IOException("'npm link antlr4' failed: " + new String(errors)); - } - } - private boolean canExecute(String tool) { try { ProcessBuilder builder = new ProcessBuilder(tool, "--version"); @@ -237,17 +206,6 @@ private boolean canExecute(String tool) { } } - private String locateNpm() { - // typically /usr/local/bin/npm - String prop = System.getProperty("antlr-javascript-npm"); - if ( prop!=null && prop.length()!=0 ) { - if(prop.contains(" ")) - prop = "\"" + prop + "\""; - return prop; - } - return "npm"; // everywhere - } - private String locateNodeJS() { // typically /usr/local/bin/node String prop = System.getProperty("antlr-javascript-nodejs"); @@ -262,23 +220,11 @@ private String locateNodeJS() { return "node"; // everywhere else } - private String locateRuntime() { - final ClassLoader loader = Thread.currentThread().getContextClassLoader(); - final URL runtimeSrc = loader.getResource("JavaScript"); - if ( runtimeSrc==null ) { - throw new RuntimeException("Cannot find JavaScript runtime"); - } - if(isWindows()){ - return runtimeSrc.getPath().replaceFirst("/", ""); - } - return runtimeSrc.getPath(); - } - protected void writeParserTestFile(String parserName, String lexerName, String listenerName, String visitorName, String parserStartRuleName, boolean debug) { ST outputFileST = new ST( - "import antlr4 from 'antlr4';\n" + "import antlr4 from 'file:///src/antlr4/index.js'\n" + "import from './.js';\n" + "import from './.js';\n" + "import from './.js';\n" @@ -324,12 +270,13 @@ protected void writeParserTestFile(String parserName, String lexerName, outputFileST.add("listenerName", listenerName); outputFileST.add("visitorName", visitorName); outputFileST.add("parserStartRuleName", parserStartRuleName); + outputFileST.add("runtimeDir", runtimeDir); writeFile(getTempDirPath(), "Test.js", outputFileST.render()); } protected void writeLexerTestFile(String lexerName, boolean showDFA) { ST outputFileST = new ST( - "import antlr4 from 'antlr4';\n" + "import antlr4 from 'file:///src/antlr4/index.js'\n" + "import from './.js';\n" + "\n" + "function main(argv) {\n" @@ -344,6 +291,7 @@ protected void writeLexerTestFile(String lexerName, boolean showDFA) { : "") + "}\n" + "\n" + "main(process.argv);\n" + "\n"); outputFileST.add("lexerName", lexerName); + outputFileST.add("runtimeDir", runtimeDir); writeFile(getTempDirPath(), "Test.js", outputFileST.render()); } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestCompositeLexers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestCompositeLexers.java index f7b5fe3396..430292ba46 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestCompositeLexers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestCompositeLexers.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeLexersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeLexers extends BaseRuntimeTest { public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeLexersDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeLexers", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestCompositeParsers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestCompositeParsers.java index 9d9a35c0da..508abb49fa 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestCompositeParsers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestCompositeParsers.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeParsersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeParsers extends BaseRuntimeTest { public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeParsersDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeParsers", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestFullContextParsing.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestFullContextParsing.java index 1aed8bcb7a..1e537b99b0 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestFullContextParsing.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestFullContextParsing.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.FullContextParsingDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestFullContextParsing extends BaseRuntimeTest { public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(FullContextParsingDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("FullContextParsing", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLeftRecursion.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLeftRecursion.java index ab892d92fe..9042001757 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLeftRecursion.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLeftRecursion.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LeftRecursionDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLeftRecursion extends BaseRuntimeTest { public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LeftRecursionDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LeftRecursion", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLexerErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLexerErrors.java index d4bb1b8121..79c19fd6c5 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLexerErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLexerErrors.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerErrorsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerErrors extends BaseRuntimeTest { public TestLexerErrors(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLexerErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerErrorsDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerErrors", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLexerExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLexerExec.java index 8f6401dc26..84020d0679 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLexerExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestLexerExec.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerExec extends BaseRuntimeTest { public TestLexerExec(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLexerExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerExecDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerExec", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestListeners.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestListeners.java index 7e429a0632..3af1925fc1 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestListeners.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestListeners.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestListeners extends BaseRuntimeTest { public TestListeners(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestListeners(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ListenersDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Listeners", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParseTrees.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParseTrees.java index b69f90f412..9cc7462037 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParseTrees.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParseTrees.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParseTrees extends BaseRuntimeTest { public TestParseTrees(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParseTrees(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParseTreesDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParseTrees", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParserErrors.java index 8412327aeb..79cee3bec7 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParserErrors.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserErrorsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserErrors extends BaseRuntimeTest { public TestParserErrors(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParserErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserErrorsDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserErrors", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParserExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParserExec.java index 04838a1396..39d6495728 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParserExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestParserExec.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserExecDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserExec extends BaseRuntimeTest { public TestParserExec(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParserExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserExecDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserExec", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestPerformance.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestPerformance.java index 038d28a723..e02046f8c7 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestPerformance.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestPerformance.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestPerformance extends BaseRuntimeTest { public TestPerformance(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestPerformance(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(PerformanceDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Performance", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSemPredEvalLexer.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSemPredEvalLexer.java index ffc4b5434b..fb40627f13 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSemPredEvalLexer.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSemPredEvalLexer.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalLexerDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalLexer extends BaseRuntimeTest { public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalLexerDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalLexer", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSemPredEvalParser.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSemPredEvalParser.java index 01b5b95dac..4fe6946e28 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSemPredEvalParser.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSemPredEvalParser.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalParserDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalParser extends BaseRuntimeTest { public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalParserDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalParser", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSets.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSets.java index 8036d69564..b333734599 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSets.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/javascript/TestSets.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SetsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSets extends BaseRuntimeTest { public TestSets(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSets(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SetsDescriptors.class, "Node"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Sets", "Node"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/BasePHPTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/BasePHPTest.java index dd5af7cb90..ec6d4fda8e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/BasePHPTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/BasePHPTest.java @@ -20,7 +20,6 @@ import static org.antlr.v4.test.runtime.BaseRuntimeTest.antlrOnString; import static org.antlr.v4.test.runtime.BaseRuntimeTest.writeFile; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; public class BasePHPTest extends BaseRuntimeTestSupport implements RuntimeTestSupport { @@ -245,7 +244,7 @@ private String locateTool(String tool) { return phpPath; } - String[] roots = {"/usr/local/bin/", "/opt/local/bin", "/usr/bin/"}; + String[] roots = {"/usr/local/bin/", "/opt/local/bin", "/opt/homebrew/bin/", "/usr/bin/"}; for (String root: roots) { if (new File(root + tool).exists()) { diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestCompositeLexers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestCompositeLexers.java index d1d353875d..42f5541852 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestCompositeLexers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestCompositeLexers.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeLexersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeLexers extends BaseRuntimeTest { public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeLexersDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeLexers", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestCompositeParsers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestCompositeParsers.java index dd5b0015a7..5c6552c64d 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestCompositeParsers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestCompositeParsers.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeParsersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeParsers extends BaseRuntimeTest { public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeParsersDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeParsers", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestFullContextParsing.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestFullContextParsing.java index 60efc07184..9a0ce2dc6a 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestFullContextParsing.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestFullContextParsing.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.FullContextParsingDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestFullContextParsing extends BaseRuntimeTest { public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(FullContextParsingDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("FullContextParsing", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLeftRecursion.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLeftRecursion.java index cb200ef38a..70e08dd162 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLeftRecursion.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLeftRecursion.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LeftRecursionDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLeftRecursion extends BaseRuntimeTest { public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LeftRecursionDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LeftRecursion", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLexerErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLexerErrors.java index cd7a5c5968..a4f22db5a7 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLexerErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLexerErrors.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerErrorsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerErrors extends BaseRuntimeTest { public TestLexerErrors(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLexerErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerErrorsDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerErrors", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLexerExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLexerExec.java index 03595f564e..3742362070 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLexerExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestLexerExec.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerExec extends BaseRuntimeTest { public TestLexerExec(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLexerExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerExecDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerExec", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestListeners.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestListeners.java index 52260158d5..aff19e65b7 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestListeners.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestListeners.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestListeners extends BaseRuntimeTest { public TestListeners(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestListeners(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ListenersDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Listeners", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParseTrees.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParseTrees.java index 656e14d71e..6ce3573d4d 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParseTrees.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParseTrees.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParseTrees extends BaseRuntimeTest { public TestParseTrees(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParseTrees(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParseTreesDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParseTrees", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParserErrors.java index ac3ab88ef6..0c3b39c433 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParserErrors.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserErrorsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserErrors extends BaseRuntimeTest { public TestParserErrors(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParserErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserErrorsDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserErrors", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParserExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParserExec.java index 01e3f321ca..c282ffb71b 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParserExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestParserExec.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserExecDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserExec extends BaseRuntimeTest { public TestParserExec(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParserExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserExecDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserExec", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestPerformance.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestPerformance.java index 7459d77d82..22b6bc3204 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestPerformance.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestPerformance.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestPerformance extends BaseRuntimeTest { public TestPerformance(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestPerformance(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(PerformanceDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Performance", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSemPredEvalLexer.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSemPredEvalLexer.java index ec7f14efc8..f46b7167d8 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSemPredEvalLexer.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSemPredEvalLexer.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalLexerDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalLexer extends BaseRuntimeTest { public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalLexerDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalLexer", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSemPredEvalParser.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSemPredEvalParser.java index 1441444c53..7bee122154 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSemPredEvalParser.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSemPredEvalParser.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalParserDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalParser extends BaseRuntimeTest { public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalParserDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalParser", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSets.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSets.java index 9960453614..3ee62ae034 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSets.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/php/TestSets.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SetsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSets extends BaseRuntimeTest { public TestSets(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSets(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SetsDescriptors.class, "PHP"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Sets", "PHP"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/BasePython2Test.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/BasePython2Test.java index 7167a290ee..5eb8ec8b43 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/BasePython2Test.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/BasePython2Test.java @@ -9,7 +9,6 @@ import org.antlr.v4.test.runtime.python.BasePythonTest; import org.stringtemplate.v4.ST; -import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestCompositeLexers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestCompositeLexers.java index c68c0f579c..5838dc0daa 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestCompositeLexers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestCompositeLexers.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeLexersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeLexers extends BaseRuntimeTest { public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeLexersDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeLexers", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestCompositeParsers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestCompositeParsers.java index 489249c23c..66f4be9a42 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestCompositeParsers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestCompositeParsers.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeParsersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeParsers extends BaseRuntimeTest { public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeParsersDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeParsers", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestFullContextParsing.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestFullContextParsing.java index 05eb6038f2..b1917b38b6 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestFullContextParsing.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestFullContextParsing.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.FullContextParsingDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestFullContextParsing extends BaseRuntimeTest { public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(FullContextParsingDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("FullContextParsing", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLeftRecursion.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLeftRecursion.java index 7685599d2e..66f94e419e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLeftRecursion.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLeftRecursion.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LeftRecursionDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLeftRecursion extends BaseRuntimeTest { public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LeftRecursionDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LeftRecursion", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLexerErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLexerErrors.java index 3708c6ff8e..b1f576628a 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLexerErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLexerErrors.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerErrorsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerErrors extends BaseRuntimeTest { public TestLexerErrors(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLexerErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerErrorsDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerErrors", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLexerExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLexerExec.java index d99851ccea..10947ab034 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLexerExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestLexerExec.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerExec extends BaseRuntimeTest { public TestLexerExec(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLexerExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerExecDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerExec", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestListeners.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestListeners.java index 0cbcbcafaf..118a16fb65 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestListeners.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestListeners.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestListeners extends BaseRuntimeTest { public TestListeners(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestListeners(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ListenersDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Listeners", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParseTrees.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParseTrees.java index 311f85cd79..a72c93dfaf 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParseTrees.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParseTrees.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParseTrees extends BaseRuntimeTest { public TestParseTrees(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParseTrees(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParseTreesDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParseTrees", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserErrors.java index d405643dde..cd6f630421 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserErrors.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserErrorsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserErrors extends BaseRuntimeTest { public TestParserErrors(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParserErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserErrorsDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserErrors", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserExec.java index 95c41f4c93..58c754bf47 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestParserExec.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserExecDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserExec extends BaseRuntimeTest { public TestParserExec(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParserExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserExecDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserExec", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestPerformance.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestPerformance.java index 7248041e8e..458a6df1df 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestPerformance.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestPerformance.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestPerformance extends BaseRuntimeTest { public TestPerformance(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestPerformance(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(PerformanceDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Performance", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSemPredEvalLexer.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSemPredEvalLexer.java index 96fbe6c2b6..c0e98b964e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSemPredEvalLexer.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSemPredEvalLexer.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalLexerDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalLexer extends BaseRuntimeTest { public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalLexerDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalLexer", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSemPredEvalParser.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSemPredEvalParser.java index a0bc6d0348..51d8ba935e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSemPredEvalParser.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSemPredEvalParser.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalParserDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalParser extends BaseRuntimeTest { public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalParserDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalParser", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSets.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSets.java index 8f569648df..ca5caed02d 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSets.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python2/TestSets.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SetsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSets extends BaseRuntimeTest { public TestSets(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSets(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SetsDescriptors.class, "Python2"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Sets", "Python2"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestCompositeLexers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestCompositeLexers.java index e9511e7423..c10c139646 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestCompositeLexers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestCompositeLexers.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeLexersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeLexers extends BaseRuntimeTest { public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeLexersDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeLexers", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestCompositeParsers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestCompositeParsers.java index d7f51a5e18..73c9807b7e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestCompositeParsers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestCompositeParsers.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.CompositeParsersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestCompositeParsers extends BaseRuntimeTest { public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeParsersDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeParsers", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestFullContextParsing.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestFullContextParsing.java index 4fb28eea08..17ab6126d6 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestFullContextParsing.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestFullContextParsing.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.FullContextParsingDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestFullContextParsing extends BaseRuntimeTest { public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(FullContextParsingDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("FullContextParsing", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLeftRecursion.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLeftRecursion.java index 75c1c575f9..144e60d1b1 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLeftRecursion.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLeftRecursion.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LeftRecursionDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLeftRecursion extends BaseRuntimeTest { public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LeftRecursionDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LeftRecursion", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLexerErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLexerErrors.java index 285174171d..6c1dde4263 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLexerErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLexerErrors.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerErrorsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerErrors extends BaseRuntimeTest { public TestLexerErrors(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLexerErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerErrorsDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerErrors", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLexerExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLexerExec.java index c612164a20..6a1708e27b 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLexerExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestLexerExec.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestLexerExec extends BaseRuntimeTest { public TestLexerExec(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestLexerExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerExecDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerExec", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestListeners.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestListeners.java index 6264fa7dd7..9afff0917b 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestListeners.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestListeners.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestListeners extends BaseRuntimeTest { public TestListeners(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestListeners(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ListenersDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Listeners", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParseTrees.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParseTrees.java index 5e62ea93ba..4930f16b16 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParseTrees.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParseTrees.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParseTrees extends BaseRuntimeTest { public TestParseTrees(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParseTrees(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParseTreesDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParseTrees", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserErrors.java index 4920c9b8d6..a5d061afe3 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserErrors.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserErrorsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserErrors extends BaseRuntimeTest { public TestParserErrors(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParserErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserErrorsDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserErrors", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserExec.java index f041443e40..3addf15858 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestParserExec.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.ParserExecDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestParserExec extends BaseRuntimeTest { public TestParserExec(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestParserExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserExecDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserExec", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestPerformance.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestPerformance.java index 961d98b06d..b436ae8393 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestPerformance.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestPerformance.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestPerformance extends BaseRuntimeTest { public TestPerformance(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestPerformance(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(PerformanceDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Performance", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSemPredEvalLexer.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSemPredEvalLexer.java index 3f0c659535..74f771cb4f 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSemPredEvalLexer.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSemPredEvalLexer.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalLexerDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalLexer extends BaseRuntimeTest { public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalLexerDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalLexer", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSemPredEvalParser.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSemPredEvalParser.java index a931fd2b96..7a33b4ce14 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSemPredEvalParser.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSemPredEvalParser.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalParserDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSemPredEvalParser extends BaseRuntimeTest { public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalParserDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalParser", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSets.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSets.java index 1a3ac2641c..03abf0237c 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSets.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/python3/TestSets.java @@ -8,10 +8,8 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.descriptors.SetsDescriptors; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; - @RunWith(Parameterized.class) public class TestSets extends BaseRuntimeTest { public TestSets(RuntimeTestDescriptor descriptor) { @@ -20,6 +18,6 @@ public TestSets(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SetsDescriptors.class, "Python3"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Sets", "Python3"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/BaseSwiftTest.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/BaseSwiftTest.java index d142bb5d1e..6751b33c16 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/BaseSwiftTest.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/BaseSwiftTest.java @@ -42,6 +42,18 @@ public class BaseSwiftTest extends BaseRuntimeTestSupport implements RuntimeTest */ private static final String SWIFT_HOME_ENV_KEY = "SWIFT_HOME"; + private static String getParent(String resourcePath, int count) { + String result = resourcePath; + while (count > 0) { + int index = result.lastIndexOf('/'); + if (index > 0) { + result = result.substring(0, index); + } + count -= 1; + } + return result; + } + static { Map env = System.getenv(); String swiftHome = env.containsKey(SWIFT_HOME_ENV_KEY) ? env.get(SWIFT_HOME_ENV_KEY) : ""; @@ -49,13 +61,16 @@ public class BaseSwiftTest extends BaseRuntimeTestSupport implements RuntimeTest ClassLoader loader = Thread.currentThread().getContextClassLoader(); // build swift runtime + // path like: file:/Users/100mango/Desktop/antlr4/runtime-testsuite/target/classes/Swift URL swiftRuntime = loader.getResource("Swift"); if (swiftRuntime == null) { throw new RuntimeException("Swift runtime file not found"); } - ANTLR_RUNTIME_PATH = swiftRuntime.getPath(); + + //enter project root + ANTLR_RUNTIME_PATH = getParent(swiftRuntime.getPath(),4); try { - fastFailRunProcess(ANTLR_RUNTIME_PATH, SWIFT_CMD, "build"); + fastFailRunProcess(ANTLR_RUNTIME_PATH, SWIFT_CMD, "build", "-c", "release"); } catch (IOException | InterruptedException e) { e.printStackTrace(); @@ -124,7 +139,7 @@ public String execParser(String grammarFileName, String grammarStr, String parse private String execTest(String projectDir, String projectName) { try { - Pair output = runProcess(projectDir, "./.build/debug/" + projectName, "input"); + Pair output = runProcess(projectDir, "./.build/release/" + projectName, "input"); if (output.b.length() > 0) { setParseErrors(output.b); } @@ -150,9 +165,10 @@ private void buildProject(String projectDir, String projectName) throws IOExcept fastFailRunProcess(getTempDirPath(), "mv", "-f", absPath, projectDir + "/Sources/" + projectName); } fastFailRunProcess(getTempDirPath(), "mv", "-f", "input", projectDir); - String dylibPath = ANTLR_RUNTIME_PATH + "/.build/debug/"; + String dylibPath = ANTLR_RUNTIME_PATH + "/.build/release/"; // System.err.println(dylibPath); Pair buildResult = runProcess(projectDir, SWIFT_CMD, "build", + "-c", "release", "-Xswiftc", "-I"+dylibPath, "-Xlinker", "-L"+dylibPath, "-Xlinker", "-lAntlr4", @@ -194,7 +210,7 @@ private static Pair runProcess(String execPath, String... args) t argsWithArch.addAll(Arrays.asList("arch", "-arm64")); argsWithArch.addAll(Arrays.asList(args)); if(VERBOSE) - System.err.println("Executing " + argsWithArch.toString() + " " + execPath); + System.err.println("Executing " + argsWithArch + " " + execPath); final Process process = Runtime.getRuntime().exec(argsWithArch.toArray(new String[0]), null, new File(execPath)); StreamVacuum stdoutVacuum = new StreamVacuum(process.getInputStream()); StreamVacuum stderrVacuum = new StreamVacuum(process.getErrorStream()); @@ -216,10 +232,10 @@ public void run() { stdoutVacuum.join(); stderrVacuum.join(); if(VERBOSE) - System.err.println("Done executing " + argsWithArch.toString() + " " + execPath); + System.err.println("Done executing " + argsWithArch + " " + execPath); if (status != 0) { System.err.println("Process exited with status " + status); - throw new IOException("Process exited with status " + status + ":\n" + stdoutVacuum.toString() + "\n" + stderrVacuum.toString()); + throw new IOException("Process exited with status " + status + ":\n" + stdoutVacuum + "\n" + stderrVacuum); } return new Pair<>(stdoutVacuum.toString(), stderrVacuum.toString()); } @@ -230,7 +246,7 @@ private static void fastFailRunProcess(String workingDir, String... command) thr argsWithArch.addAll(Arrays.asList("arch", "-arm64")); argsWithArch.addAll(Arrays.asList(command)); if(VERBOSE) - System.err.println("Executing " + argsWithArch.toString() + " " + workingDir); + System.err.println("Executing " + argsWithArch + " " + workingDir); ProcessBuilder builder = new ProcessBuilder(argsWithArch.toArray(new String[0])); builder.directory(new File(workingDir)); final Process process = builder.start(); @@ -248,7 +264,7 @@ public void run() { int status = process.waitFor(); timer.cancel(); if(VERBOSE) - System.err.println("Done executing " + argsWithArch.toString() + " " + workingDir); + System.err.println("Done executing " + argsWithArch + " " + workingDir); if (status != 0) { System.err.println("Process exited with status " + status); throw new IOException("Process exited with status " + status); @@ -380,12 +396,10 @@ private void generateParser(String grammarFileName, List files = new ArrayList<>(); if (lexerName != null) { files.add(lexerName + ".swift"); - files.add(lexerName + "ATN.swift"); } if (parserName != null) { files.add(parserName + ".swift"); - files.add(parserName + "ATN.swift"); Set optionsSet = new HashSet<>(Arrays.asList(extraOptions)); String grammarName = grammarFileName.substring(0, grammarFileName.lastIndexOf('.')); if (!optionsSet.contains("-no-listener")) { diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestCompositeLexers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestCompositeLexers.java index 5dad5c8395..7526fbcb23 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestCompositeLexers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestCompositeLexers.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.CompositeLexersDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestCompositeLexers extends BaseRuntimeTest { public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestCompositeLexers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeLexersDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeLexers", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestCompositeParsers.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestCompositeParsers.java index faaa7792eb..d927d4667c 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestCompositeParsers.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestCompositeParsers.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.CompositeParsersDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestCompositeParsers extends BaseRuntimeTest { public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestCompositeParsers(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(CompositeParsersDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("CompositeParsers", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestFullContextParsing.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestFullContextParsing.java index ad3844211f..2adb97bfde 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestFullContextParsing.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestFullContextParsing.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.FullContextParsingDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestFullContextParsing extends BaseRuntimeTest { public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestFullContextParsing(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(FullContextParsingDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("FullContextParsing", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLeftRecursion.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLeftRecursion.java index cfea28411c..a1deab7cf5 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLeftRecursion.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLeftRecursion.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LeftRecursionTests; -import org.antlr.v4.test.runtime.descriptors.LeftRecursionDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LeftRecursionTests.class) @RunWith(Parameterized.class) public class TestLeftRecursion extends BaseRuntimeTest { public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestLeftRecursion(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LeftRecursionDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LeftRecursion", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLexerErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLexerErrors.java index 9e094dc486..3484e7ac70 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLexerErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLexerErrors.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.LexerErrorsDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestLexerErrors extends BaseRuntimeTest { public TestLexerErrors(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestLexerErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerErrorsDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerErrors", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLexerExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLexerExec.java index 9d5a64716c..4933c9ce0d 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLexerExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestLexerExec.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.LexerExecDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestLexerExec extends BaseRuntimeTest { public TestLexerExec(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestLexerExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(LexerExecDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("LexerExec", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestListeners.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestListeners.java index 330680de94..06e1d41d9c 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestListeners.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestListeners.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ListenersDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestListeners extends BaseRuntimeTest { public TestListeners(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestListeners(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ListenersDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Listeners", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParseTrees.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParseTrees.java index a03e8fa576..35e7cace68 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParseTrees.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParseTrees.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ParseTreesDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestParseTrees extends BaseRuntimeTest { public TestParseTrees(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestParseTrees(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParseTreesDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParseTrees", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParserErrors.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParserErrors.java index 98d310e992..737a5d21ae 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParserErrors.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParserErrors.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ParserErrorsDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestParserErrors extends BaseRuntimeTest { public TestParserErrors(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestParserErrors(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserErrorsDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserErrors", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParserExec.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParserExec.java index 23b9823dfd..f01b867c7f 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParserExec.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestParserExec.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.ParserExecDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestParserExec extends BaseRuntimeTest { public TestParserExec(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestParserExec(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(ParserExecDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("ParserExec", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestPerformance.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestPerformance.java index 469877d3d8..b0e03bd58a 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestPerformance.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestPerformance.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.PerformanceDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestPerformance extends BaseRuntimeTest { public TestPerformance(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestPerformance(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(PerformanceDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Performance", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSemPredEvalLexer.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSemPredEvalLexer.java index fe0e380a53..40b7134f14 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSemPredEvalLexer.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSemPredEvalLexer.java @@ -9,13 +9,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalLexerDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestSemPredEvalLexer extends BaseRuntimeTest { public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @@ -24,7 +20,7 @@ public TestSemPredEvalLexer(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalLexerDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalLexer", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSemPredEvalParser.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSemPredEvalParser.java index ba231c9674..1486f12c62 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSemPredEvalParser.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSemPredEvalParser.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.ParserTests; -import org.antlr.v4.test.runtime.descriptors.SemPredEvalParserDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(ParserTests.class) @RunWith(Parameterized.class) public class TestSemPredEvalParser extends BaseRuntimeTest { public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestSemPredEvalParser(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SemPredEvalParserDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("SemPredEvalParser", "Swift"); } } diff --git a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSets.java b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSets.java index e46e9514db..83f8cfb06e 100644 --- a/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSets.java +++ b/runtime-testsuite/test/org/antlr/v4/test/runtime/swift/TestSets.java @@ -8,13 +8,9 @@ import org.antlr.v4.test.runtime.BaseRuntimeTest; import org.antlr.v4.test.runtime.RuntimeTestDescriptor; -import org.antlr.v4.test.runtime.category.LexerTests; -import org.antlr.v4.test.runtime.descriptors.SetsDescriptors; -import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -@Category(LexerTests.class) @RunWith(Parameterized.class) public class TestSets extends BaseRuntimeTest { public TestSets(RuntimeTestDescriptor descriptor) { @@ -23,7 +19,7 @@ public TestSets(RuntimeTestDescriptor descriptor) { @Parameterized.Parameters(name="{0}") public static RuntimeTestDescriptor[] getAllTestDescriptors() { - return BaseRuntimeTest.getRuntimeTestDescriptors(SetsDescriptors.class, "Swift"); + return BaseRuntimeTest.getRuntimeTestDescriptors("Sets", "Swift"); } } diff --git a/runtime/CSharp/src/Antlr4.csproj b/runtime/CSharp/src/Antlr4.csproj index 1d62b6e531..aac3a5804f 100644 --- a/runtime/CSharp/src/Antlr4.csproj +++ b/runtime/CSharp/src/Antlr4.csproj @@ -1,10 +1,11 @@  The ANTLR Organization - 4.9.3 + 4.10 en-US - net45;netstandard2.0 - $(NoWarn);CS1591;CS1574;CS1580 + netstandard2.0 + net45;netstandard2.0 + $(NoWarn);CS1591;CS1574;CS1580;CS1570;NU5048 true Antlr4.Runtime.Standard Antlr4.snk diff --git a/runtime/CSharp/src/Atn/ATNDeserializer.cs b/runtime/CSharp/src/Atn/ATNDeserializer.cs index d38c014640..7f47677062 100644 --- a/runtime/CSharp/src/Atn/ATNDeserializer.cs +++ b/runtime/CSharp/src/Atn/ATNDeserializer.cs @@ -5,8 +5,6 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.IO; -using Antlr4.Runtime.Atn; using Antlr4.Runtime.Dfa; using Antlr4.Runtime.Misc; using Antlr4.Runtime.Sharpen; @@ -16,53 +14,11 @@ namespace Antlr4.Runtime.Atn /// Sam Harwell public class ATNDeserializer { - public static readonly int SerializedVersion = 3; - - ///

This is the earliest supported serialized UUID. - /// This is the earliest supported serialized UUID. - private static readonly Guid BaseSerializedUuid; - - /// - /// This UUID indicates the serialized ATN contains two sets of - /// IntervalSets, where the second set's values are encoded as - /// 32-bit integers to support the full Unicode SMP range up to U+10FFFF. - /// - /// - /// This UUID indicates the serialized ATN contains two sets of - /// IntervalSets, where the second set's values are encoded as - /// 32-bit integers to support the full Unicode SMP range up to U+10FFFF. - /// - private static readonly Guid AddedUnicodeSmp; - - /// - /// This list contains all of the currently supported UUIDs, ordered by when - /// the feature first appeared in this branch. - /// - /// - /// This list contains all of the currently supported UUIDs, ordered by when - /// the feature first appeared in this branch. - /// - private static readonly IList SupportedUuids; - - /// This is the current serialized UUID. - /// This is the current serialized UUID. - public static readonly Guid SerializedUuid; - - static ATNDeserializer() - { - BaseSerializedUuid = new Guid("AADB8D7E-AEEF-4415-AD2B-8204D6CF042E"); - AddedUnicodeSmp = new Guid("59627784-3BE5-417A-B9EB-8131A7286089"); - SupportedUuids = new List(); - SupportedUuids.Add(BaseSerializedUuid); - SupportedUuids.Add(AddedUnicodeSmp); - SerializedUuid = AddedUnicodeSmp; - } + public static readonly int SerializedVersion = 4; [NotNull] private readonly ATNDeserializationOptions deserializationOptions; - private Guid uuid; - public ATNDeserializer() : this(ATNDeserializationOptions.Default) { @@ -77,66 +33,20 @@ public ATNDeserializer(ATNDeserializationOptions deserializationOptions) this.deserializationOptions = deserializationOptions; } - /// - /// Determines if a particular serialized representation of an ATN supports - /// a particular feature, identified by the - /// - /// used for serializing - /// the ATN at the time the feature was first introduced. - /// - /// - /// The - /// - /// marking the first time the feature was - /// supported in the serialized ATN. - /// - /// - /// The - /// - /// of the actual serialized ATN which is - /// currently being deserialized. - /// - /// - /// - /// - /// if the - /// - /// value represents a - /// serialized ATN at or after the feature identified by - /// - /// was - /// introduced; otherwise, - /// - /// . - /// - protected internal virtual bool IsFeatureSupported(Guid feature, Guid actualUuid) - { - int featureIndex = SupportedUuids.IndexOf(feature); - if (featureIndex < 0) - { - return false; - } - return SupportedUuids.IndexOf(actualUuid) >= featureIndex; - } - - char[] data; + int[] data; int p; - public virtual ATN Deserialize(char[] data) + public virtual ATN Deserialize(int[] data) { - Reset (data); + this.data = data; CheckVersion (); - CheckUUID (); ATN atn = ReadATN (); ReadStates (atn); ReadRules (atn); ReadModes (atn); IList sets = new List(); - ReadSets (atn, sets, this.ReadInt); - if (IsFeatureSupported(AddedUnicodeSmp, uuid)) { - ReadSets (atn, sets, this.ReadInt32); - } - ReadEdges (atn, sets); + ReadSets (atn, sets); + ReadEdges (atn, sets); ReadDecisions (atn); ReadLexerActions (atn); MarkPrecedenceDecisions(atn); @@ -279,15 +189,7 @@ protected internal virtual void ReadLexerActions(ATN atn) { LexerActionType actionType = (LexerActionType)ReadInt(); int data1 = ReadInt(); - if (data1 == unchecked((int)(0xFFFF))) - { - data1 = -1; - } int data2 = ReadInt(); - if (data2 == unchecked((int)(0xFFFF))) - { - data2 = -1; - } ILexerAction lexerAction = LexerActionFactory(actionType, data1, data2); atn.lexerActions[i_10] = lexerAction; } @@ -398,7 +300,7 @@ protected internal virtual void ReadEdges(ATN atn, IList sets) } } - protected internal virtual void ReadSets(ATN atn, IList sets, System.Func readUnicode) + protected internal virtual void ReadSets(ATN atn, IList sets) { // // SETS @@ -416,7 +318,7 @@ protected internal virtual void ReadSets(ATN atn, IList sets, Syste } for (int j = 0; j < nintervals; j++) { - set.Add(readUnicode(), readUnicode()); + set.Add(ReadInt(), ReadInt()); } } } @@ -458,9 +360,6 @@ protected internal virtual void ReadRules(ATN atn) atn.ruleToStartState[i_5] = startState; if (atn.grammarType == ATNType.Lexer) { int tokenType = ReadInt (); - if (tokenType == unchecked((int)(0xFFFF))) { - tokenType = TokenConstants.EOF; - } atn.ruleToTokenType [i_5] = tokenType; } } @@ -546,16 +445,6 @@ protected internal virtual ATN ReadATN() return new ATN(grammarType, maxTokenType); } - protected internal virtual void CheckUUID() - { - uuid = ReadUUID(); - if (!SupportedUuids.Contains(uuid)) - { - string reason = string.Format(CultureInfo.CurrentCulture, "Could not deserialize ATN with UUID {0} (expected {1} or a legacy UUID).", uuid, SerializedUuid); - throw new NotSupportedException(reason); - } - } - protected internal virtual void CheckVersion() { int version = ReadInt(); @@ -566,18 +455,6 @@ protected internal virtual void CheckVersion() } } - protected internal virtual void Reset(char[] data) - { - this.data = new char[data.Length]; - // don't adjust the first value since that's the version number - this.data[0] = data[0]; - for (int i = 1; i < data.Length; i++) - { - this.data[i] = (char)(data[i] - 2); - } - this.p = 0; - } - /// /// Analyze the /// @@ -1078,30 +955,6 @@ protected internal int ReadInt() return data[p++]; } - protected internal int ReadInt32() - { - return (int)data[p++] | ((int)data[p++] << 16); - } - - protected internal long ReadLong() - { - long lowOrder = ReadInt32() & unchecked((long)(0x00000000FFFFFFFFL)); - return lowOrder | ((long)ReadInt32() << 32); - } - - protected internal Guid ReadUUID() - { - byte[] d = BitConverter.GetBytes (ReadLong ()); - if(BitConverter.IsLittleEndian) - { - Array.Reverse(d); - } - short c = (short)ReadInt(); - short b = (short)ReadInt(); - int a = ReadInt32(); - return new Guid(a, b, c, d); - } - [return: NotNull] protected internal virtual Transition EdgeFactory(ATN atn, TransitionType type, int src, int trg, int arg1, int arg2, int arg3, IList sets) { diff --git a/runtime/CSharp/src/Atn/LexerATNSimulator.cs b/runtime/CSharp/src/Atn/LexerATNSimulator.cs index 34fe30bbce..11effa8483 100644 --- a/runtime/CSharp/src/Atn/LexerATNSimulator.cs +++ b/runtime/CSharp/src/Atn/LexerATNSimulator.cs @@ -45,8 +45,6 @@ public class LexerATNSimulator : ATNSimulator readonly SimState prevAccept = new SimState(); - public static int match_calls = 0; - public LexerATNSimulator(ATN atn, DFA[] decisionToDFA, PredictionContextCache sharedContextCache) : this(null, atn, decisionToDFA, sharedContextCache) @@ -74,7 +72,6 @@ public void CopyState(LexerATNSimulator simulator) public int Match(ICharStream input, int mode) { - match_calls++; this.mode = mode; int mark = input.Mark(); try diff --git a/runtime/CSharp/src/Misc/RuleDependencyChecker.cs b/runtime/CSharp/src/Misc/RuleDependencyChecker.cs index ab98df3096..63a0a4a56d 100644 --- a/runtime/CSharp/src/Misc/RuleDependencyChecker.cs +++ b/runtime/CSharp/src/Misc/RuleDependencyChecker.cs @@ -330,12 +330,12 @@ private static void GetElementDependencies(ICustomAttributeProvider annotatedEle private static RuleDependencyChecker.RuleRelations ExtractRuleRelations(TypeInfo recognizer) { - string serializedATN = GetSerializedATN(recognizer); + int[] serializedATN = GetSerializedATN(recognizer); if (serializedATN == null) { return null; } - ATN atn = new ATNDeserializer().Deserialize(serializedATN.ToCharArray()); + ATN atn = new ATNDeserializer().Deserialize(serializedATN); RuleDependencyChecker.RuleRelations relations = new RuleDependencyChecker.RuleRelations(atn.ruleToStartState.Length); foreach (ATNState state in atn.states) { @@ -356,11 +356,11 @@ private static RuleDependencyChecker.RuleRelations ExtractRuleRelations(TypeInfo return relations; } - private static string GetSerializedATN(TypeInfo recognizerClass) + private static int[] GetSerializedATN(TypeInfo recognizerClass) { FieldInfo serializedAtnField = recognizerClass.DeclaredFields.First(i => i.Name == "_serializedATN"); if (serializedAtnField != null) - return (string)serializedAtnField.GetValue(null); + return (int[])serializedAtnField.GetValue(null); if (recognizerClass.BaseType != null) return GetSerializedATN(recognizerClass.BaseType.GetTypeInfo()); diff --git a/runtime/CSharp/src/Parser.cs b/runtime/CSharp/src/Parser.cs index 2382d45066..ff05349137 100644 --- a/runtime/CSharp/src/Parser.cs +++ b/runtime/CSharp/src/Parser.cs @@ -90,7 +90,8 @@ public virtual void ExitEveryRule(ParserRuleContext ctx) /// bypass alternatives. /// /// - private static readonly IDictionary bypassAltsAtnCache = new Dictionary(); +// private static readonly IDictionary bypassAltsAtnCache = new Dictionary(); + private ATN bypassAltsAtnCache; /// The error handling strategy for the parser. /// @@ -562,22 +563,20 @@ public virtual ITokenFactory TokenFactory [return: NotNull] public virtual ATN GetATNWithBypassAlts() { - string serializedAtn = SerializedAtn; + int[] serializedAtn = SerializedAtn; if (serializedAtn == null) { throw new NotSupportedException("The current parser does not support an ATN with bypass alternatives."); } - lock (bypassAltsAtnCache) + lock (this) { - ATN result = bypassAltsAtnCache.Get(serializedAtn); - if (result == null) - { - ATNDeserializationOptions deserializationOptions = new ATNDeserializationOptions(); - deserializationOptions.GenerateRuleBypassTransitions = true; - result = new ATNDeserializer(deserializationOptions).Deserialize(serializedAtn.ToCharArray()); - bypassAltsAtnCache.Put(serializedAtn, result); + if ( bypassAltsAtnCache!=null ) { + return bypassAltsAtnCache; } - return result; + ATNDeserializationOptions deserializationOptions = new ATNDeserializationOptions(); + deserializationOptions.GenerateRuleBypassTransitions = true; + bypassAltsAtnCache = new ATNDeserializer(deserializationOptions).Deserialize(serializedAtn); + return bypassAltsAtnCache; } } diff --git a/runtime/CSharp/src/Properties/AssemblyInfo.cs b/runtime/CSharp/src/Properties/AssemblyInfo.cs index 352e2ce17a..6666031698 100644 --- a/runtime/CSharp/src/Properties/AssemblyInfo.cs +++ b/runtime/CSharp/src/Properties/AssemblyInfo.cs @@ -6,4 +6,4 @@ using System.Reflection; [assembly: CLSCompliant(true)] -[assembly: AssemblyVersion("4.9.3")] +[assembly: AssemblyVersion("4.10")] diff --git a/runtime/CSharp/src/README.md b/runtime/CSharp/src/README.md index 47aff0cd97..771253596f 100644 --- a/runtime/CSharp/src/README.md +++ b/runtime/CSharp/src/README.md @@ -41,7 +41,7 @@ See the docs and the book to learn about writing lexer and parser grammars. ### Step 4: Generate the C# code This can be done either from the cmd line, or by adding a custom pre-build command in your project. -At minimal, the cmd line should look as follows: ``java -jar antlr4-4.9.3.jar -Dlanguage=CSharp grammar.g4`` +At minimal, the cmd line should look as follows: ``java -jar antlr4-4.10.jar -Dlanguage=CSharp grammar.g4`` This will generate the files, which you can then integrate in your project. This is just a quick start. The tool has many useful options to control generation, please refer to its documentation. diff --git a/runtime/CSharp/src/Recognizer.cs b/runtime/CSharp/src/Recognizer.cs index 5f24bb00e4..0ab2894551 100644 --- a/runtime/CSharp/src/Recognizer.cs +++ b/runtime/CSharp/src/Recognizer.cs @@ -131,7 +131,7 @@ public virtual int GetTokenType(string tokenName) ///

For interpreters, we don't know their serialized ATN despite having /// created the interpreter from it.

///
- public virtual string SerializedAtn + public virtual int[] SerializedAtn { [return: NotNull] get diff --git a/runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs b/runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs index 6deab10811..d2cb6e9665 100644 --- a/runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs +++ b/runtime/CSharp/src/Tree/Pattern/ParseTreePatternMatcher.cs @@ -301,7 +301,11 @@ public virtual ParseTreePattern Compile(string pattern, int patternRuleIndex) IList tokenList = Tokenize(pattern); ListTokenSource tokenSrc = new ListTokenSource(tokenList); CommonTokenStream tokens = new CommonTokenStream(tokenSrc); - ParserInterpreter parserInterp = new ParserInterpreter(parser.GrammarFileName, parser.Vocabulary, Arrays.AsList(parser.RuleNames), parser.GetATNWithBypassAlts(), tokens); + ParserInterpreter parserInterp = new ParserInterpreter(parser.GrammarFileName, + parser.Vocabulary, + Arrays.AsList(parser.RuleNames), + parser.GetATNWithBypassAlts(), + tokens); IParseTree tree = null; try { diff --git a/runtime/CSharp/src/Tree/Xpath/XPathLexer.cs b/runtime/CSharp/src/Tree/Xpath/XPathLexer.cs index eec5d4805c..43619f3164 100644 --- a/runtime/CSharp/src/Tree/Xpath/XPathLexer.cs +++ b/runtime/CSharp/src/Tree/Xpath/XPathLexer.cs @@ -1,13 +1,15 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// ANTLR Version: 4.7 +// ANTLR Version: 4.9.3 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ +// Generated from XPathLexer.g4 by ANTLR 4.9.3 + // Unreachable code detected #pragma warning disable 0162 // The variable '...' is assigned but its value is never used @@ -18,6 +20,7 @@ #pragma warning disable 419 using System; +using System.IO; using System.Text; using Antlr4.Runtime; using Antlr4.Runtime.Atn; @@ -26,123 +29,107 @@ [System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.9.3")] [System.CLSCompliant(false)] -public partial class XPathLexer : Lexer -{ - protected static DFA[] decisionToDFA; - protected static PredictionContextCache sharedContextCache = new PredictionContextCache(); - public const int - TokenRef = 1, RuleRef = 2, Anywhere = 3, Root = 4, Wildcard = 5, Bang = 6, ID = 7, String = 8; - public static string[] channelNames = { +public partial class XPathLexer : Lexer { + protected static DFA[] decisionToDFA; + protected static PredictionContextCache sharedContextCache = new PredictionContextCache(); + public const int + TokenRef=1, RuleRef=2, Anywhere=3, Root=4, Wildcard=5, Bang=6, ID=7, String=8; + public static string[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; - public static string[] modeNames = { + public static string[] modeNames = { "DEFAULT_MODE" }; - public static readonly string[] ruleNames = { + public static readonly string[] ruleNames = { "Anywhere", "Root", "Wildcard", "Bang", "ID", "NameChar", "NameStartChar", "String" }; - public XPathLexer(ICharStream input) - : base(input) - { - Interpreter = new LexerATNSimulator(this, _ATN, decisionToDFA, sharedContextCache); - } + public XPathLexer(ICharStream input) + : this(input, Console.Out, Console.Error) { } + + public XPathLexer(ICharStream input, TextWriter output, TextWriter errorOutput) + : base(input, output, errorOutput) + { + Interpreter = new LexerATNSimulator(this, _ATN, decisionToDFA, sharedContextCache); + } - private static readonly string[] _LiteralNames = { + private static readonly string[] _LiteralNames = { null, null, null, "'//'", "'/'", "'*'", "'!'" }; - private static readonly string[] _SymbolicNames = { + private static readonly string[] _SymbolicNames = { null, "TokenRef", "RuleRef", "Anywhere", "Root", "Wildcard", "Bang", "ID", "String" }; - public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); - - [NotNull] - public override IVocabulary Vocabulary - { - get - { - return DefaultVocabulary; - } - } - - public override string GrammarFileName { get { return "XPathLexer.g4"; } } - - public override string[] RuleNames { get { return ruleNames; } } - - public override string[] ChannelNames { get { return channelNames; } } - - public override string[] ModeNames { get { return modeNames; } } - - public override string SerializedAtn { get { return _serializedATN; } } - - static XPathLexer() - { - decisionToDFA = new DFA[_ATN.NumberOfDecisions]; - for (int i = 0; i < _ATN.NumberOfDecisions; i++) - { - decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i); - } - } - public override void Action(RuleContext _localctx, int ruleIndex, int actionIndex) - { - switch (ruleIndex) - { - case 4: ID_action(_localctx, actionIndex); break; - } - } - private void ID_action(RuleContext _localctx, int actionIndex) - { - switch (actionIndex) - { - case 0: - String text = Text; - if (Char.IsUpper(text[0])) - Type = TokenRef; - else - Type = RuleRef; - break; - } - } - - private static string _serializedATN = _serializeATN(); - private static string _serializeATN() - { - StringBuilder sb = new StringBuilder(); - sb.Append("\x3\x430\xD6D1\x8206\xAD2D\x4417\xAEF1\x8D80\xAADD\x2\n\x34"); - sb.Append("\b\x1\x4\x2\t\x2\x4\x3\t\x3\x4\x4\t\x4\x4\x5\t\x5\x4\x6\t\x6"); - sb.Append("\x4\a\t\a\x4\b\t\b\x4\t\t\t\x3\x2\x3\x2\x3\x2\x3\x3\x3\x3\x3"); - sb.Append("\x4\x3\x4\x3\x5\x3\x5\x3\x6\x3\x6\a\x6\x1F\n\x6\f\x6\xE\x6\""); - sb.Append("\v\x6\x3\x6\x3\x6\x3\a\x3\a\x5\a(\n\a\x3\b\x3\b\x3\t\x3\t\a"); - sb.Append("\t.\n\t\f\t\xE\t\x31\v\t\x3\t\x3\t\x3/\x2\n\x3\x5\x5\x6\a\a"); - sb.Append("\t\b\v\t\r\x2\xF\x2\x11\n\x3\x2\x4\a\x2\x32;\x61\x61\xB9\xB9"); - sb.Append("\x302\x371\x2041\x2042\xF\x2\x43\\\x63|\xC2\xD8\xDA\xF8\xFA"); - sb.Append("\x301\x372\x37F\x381\x2001\x200E\x200F\x2072\x2191\x2C02\x2FF1"); - sb.Append("\x3003\xD801\xF902\xFDD1\xFDF2\xFFFF\x34\x2\x3\x3\x2\x2\x2\x2"); - sb.Append("\x5\x3\x2\x2\x2\x2\a\x3\x2\x2\x2\x2\t\x3\x2\x2\x2\x2\v\x3\x2"); - sb.Append("\x2\x2\x2\x11\x3\x2\x2\x2\x3\x13\x3\x2\x2\x2\x5\x16\x3\x2\x2"); - sb.Append("\x2\a\x18\x3\x2\x2\x2\t\x1A\x3\x2\x2\x2\v\x1C\x3\x2\x2\x2\r"); - sb.Append("\'\x3\x2\x2\x2\xF)\x3\x2\x2\x2\x11+\x3\x2\x2\x2\x13\x14\a\x31"); - sb.Append("\x2\x2\x14\x15\a\x31\x2\x2\x15\x4\x3\x2\x2\x2\x16\x17\a\x31"); - sb.Append("\x2\x2\x17\x6\x3\x2\x2\x2\x18\x19\a,\x2\x2\x19\b\x3\x2\x2\x2"); - sb.Append("\x1A\x1B\a#\x2\x2\x1B\n\x3\x2\x2\x2\x1C \x5\xF\b\x2\x1D\x1F"); - sb.Append("\x5\r\a\x2\x1E\x1D\x3\x2\x2\x2\x1F\"\x3\x2\x2\x2 \x1E\x3\x2"); - sb.Append("\x2\x2 !\x3\x2\x2\x2!#\x3\x2\x2\x2\" \x3\x2\x2\x2#$\b\x6\x2"); - sb.Append("\x2$\f\x3\x2\x2\x2%(\x5\xF\b\x2&(\t\x2\x2\x2\'%\x3\x2\x2\x2"); - sb.Append("\'&\x3\x2\x2\x2(\xE\x3\x2\x2\x2)*\t\x3\x2\x2*\x10\x3\x2\x2\x2"); - sb.Append("+/\a)\x2\x2,.\v\x2\x2\x2-,\x3\x2\x2\x2.\x31\x3\x2\x2\x2/\x30"); - sb.Append("\x3\x2\x2\x2/-\x3\x2\x2\x2\x30\x32\x3\x2\x2\x2\x31/\x3\x2\x2"); - sb.Append("\x2\x32\x33\a)\x2\x2\x33\x12\x3\x2\x2\x2\x6\x2 \'/\x3\x3\x6"); - sb.Append("\x2"); - return sb.ToString(); - } - - public static readonly ATN _ATN = - new ATNDeserializer().Deserialize(_serializedATN.ToCharArray()); + public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); + + [NotNull] + public override IVocabulary Vocabulary + { + get + { + return DefaultVocabulary; + } + } + + public override string GrammarFileName { get { return "XPathLexer.g4"; } } + + public override string[] RuleNames { get { return ruleNames; } } + + public override string[] ChannelNames { get { return channelNames; } } + + public override string[] ModeNames { get { return modeNames; } } + + public override int[] SerializedAtn { get { return _serializedATN; } } + + static XPathLexer() { + decisionToDFA = new DFA[_ATN.NumberOfDecisions]; + for (int i = 0; i < _ATN.NumberOfDecisions; i++) { + decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i); + } + } + public override void Action(RuleContext _localctx, int ruleIndex, int actionIndex) { + switch (ruleIndex) { + case 4 : ID_action(_localctx, actionIndex); break; + } + } + private void ID_action(RuleContext _localctx, int actionIndex) { + switch (actionIndex) { + case 0: + String text = Text; + if ( Char.IsUpper(text[0]) ) + Type = TokenRef; + else + Type = RuleRef; + break; + } + } + + private static int[] _serializedATN = { + 4,0,8,50,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6, + 2,7,7,7,1,0,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,4,1,4,5,4,29,8,4,10,4,12, + 4,32,9,4,1,4,1,4,1,5,1,5,3,5,38,8,5,1,6,1,6,1,7,1,7,5,7,44,8,7,10,7,12, + 7,47,9,7,1,7,1,7,1,45,0,8,1,3,3,4,5,5,7,6,9,7,11,0,13,0,15,8,1,0,2,5,0, + 48,57,95,95,183,183,768,879,8255,8256,13,0,65,90,97,122,192,214,216,246, + 248,767,880,893,895,8191,8204,8205,8304,8591,11264,12271,12289,55295,63744, + 64975,65008,65533,50,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0, + 9,1,0,0,0,0,15,1,0,0,0,1,17,1,0,0,0,3,20,1,0,0,0,5,22,1,0,0,0,7,24,1,0, + 0,0,9,26,1,0,0,0,11,37,1,0,0,0,13,39,1,0,0,0,15,41,1,0,0,0,17,18,5,47, + 0,0,18,19,5,47,0,0,19,2,1,0,0,0,20,21,5,47,0,0,21,4,1,0,0,0,22,23,5,42, + 0,0,23,6,1,0,0,0,24,25,5,33,0,0,25,8,1,0,0,0,26,30,3,13,6,0,27,29,3,11, + 5,0,28,27,1,0,0,0,29,32,1,0,0,0,30,28,1,0,0,0,30,31,1,0,0,0,31,33,1,0, + 0,0,32,30,1,0,0,0,33,34,6,4,0,0,34,10,1,0,0,0,35,38,3,13,6,0,36,38,7,0, + 0,0,37,35,1,0,0,0,37,36,1,0,0,0,38,12,1,0,0,0,39,40,7,1,0,0,40,14,1,0, + 0,0,41,45,5,39,0,0,42,44,9,0,0,0,43,42,1,0,0,0,44,47,1,0,0,0,45,46,1,0, + 0,0,45,43,1,0,0,0,46,48,1,0,0,0,47,45,1,0,0,0,48,49,5,39,0,0,49,16,1,0, + 0,0,4,0,30,37,45,1,1,4,0 + }; + + public static readonly ATN _ATN = + new ATNDeserializer().Deserialize(_serializedATN); } diff --git a/runtime/CSharp/src/Tree/Xpath/XPathLexer.g4 b/runtime/CSharp/src/Tree/Xpath/XPathLexer.g4 index d5cf9991ff..0dff1f2b02 100644 --- a/runtime/CSharp/src/Tree/Xpath/XPathLexer.g4 +++ b/runtime/CSharp/src/Tree/Xpath/XPathLexer.g4 @@ -1,9 +1,5 @@ lexer grammar XPathLexer; -@header { -using System; -} - tokens { TokenRef, RuleRef } /* diff --git a/runtime/Cpp/CMakeLists.txt b/runtime/Cpp/CMakeLists.txt index e549f113f7..302cd4a783 100644 --- a/runtime/Cpp/CMakeLists.txt +++ b/runtime/Cpp/CMakeLists.txt @@ -1,6 +1,8 @@ # -*- mode:cmake -*- -cmake_minimum_required (VERSION 2.8) -# 2.8 needed because of ExternalProject +cmake_minimum_required (VERSION 3.14) +# 3.14 needed because of FetchContent + +enable_testing() # Detect build type, fallback to release and throw a warning if use didn't specify any if(NOT CMAKE_BUILD_TYPE) @@ -79,16 +81,16 @@ if("${CMAKE_VERSION}" VERSION_GREATER 3.1.0) if(NOT DEFINED CMAKE_CXX_STANDARD) # only set CMAKE_CXX_STANDARD if not already set # this allows the standard to be set by the caller, for example with -DCMAKE_CXX_STANDARD:STRING=17 - set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD 17) endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") - set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -std=c++11") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -std=c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++17") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -std=c++17") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++17") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -std=c++17") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_WARNING_FLAGS}") @@ -104,7 +106,7 @@ else() set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g ${MY_CXX_WARNING_FLAGS}") endif() -# Compiler-specific C++11 activation. +# Compiler-specific C++17 activation. if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel") execute_process( COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) @@ -112,12 +114,12 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHE if(NOT (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0)) message(FATAL_ERROR "${PROJECT_NAME} requires g++ 5.0 or greater.") endif () -elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND ANDROID) +elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND ANDROID) # Need -Os cflag and cxxflags here to work with exception handling on armeabi. # see https://github.com/android-ndk/ndk/issues/573 # and without -stdlib=libc++ cxxflags elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -stdlib=libc++") elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND ( CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") ) execute_process( COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION) @@ -129,11 +131,11 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND ( CMAKE_SYSTEM_NAME MATCH set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif() elseif(MSVC_VERSION GREATER 1800 OR MSVC_VERSION EQUAL 1800) - # Visual Studio 2012+ supports c++11 features + # Visual Studio 2012+ supports C++17 features elseif(CMAKE_SYSTEM_NAME MATCHES "Emscripten") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -stdlib=libc++") else() - message(FATAL_ERROR "Your C++ compiler does not support C++11.") + message(FATAL_ERROR "Your C++ compiler does not support C++17.") endif() @@ -161,7 +163,7 @@ if (ANTLR4_INSTALL) set(ANTLR4_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING "Installation directory for libraries, relative to ${CMAKE_INSTALL_PREFIX}.") - + set(ANTLR4_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/antlr4-runtime CACHE STRING "Installation directory for include files, relative to ${CMAKE_INSTALL_PREFIX}.") @@ -169,18 +171,18 @@ if (ANTLR4_INSTALL) cmake/antlr4-runtime.cmake.in ${project_runtime_config} INSTALL_DESTINATION ${ANTLR4_CMAKE_DIR}/antlr4-runtime - PATH_VARS + PATH_VARS ANTLR4_INCLUDE_DIR ANTLR4_LIB_DIR ) - + configure_package_config_file( cmake/antlr4-generator.cmake.in ${project_generator_config} INSTALL_DESTINATION ${ANTLR4_CMAKE_DIR}/antlr4-generator - PATH_VARS + PATH_VARS ANTLR4_INCLUDE_DIR ANTLR4_LIB_DIR ) - + write_basic_package_version_file( ${version_runtime_config} VERSION ${ANTLR_VERSION} @@ -207,12 +209,12 @@ endif(ANTLR4_INSTALL) if(EXISTS LICENSE.txt) install(FILES LICENSE.txt DESTINATION "share/doc/libantlr4") -elseif(EXISTS ../../LICENSE.txt) +elseif(EXISTS ../../LICENSE.txt) install(FILES ../../LICENSE.txt DESTINATION "share/doc/libantlr4") endif() -install(FILES README.md VERSION +install(FILES README.md VERSION DESTINATION "share/doc/libantlr4") set(CPACK_PACKAGE_CONTACT "antlr-discussion@googlegroups.com") diff --git a/runtime/Cpp/README.md b/runtime/Cpp/README.md index 4caf612a11..7ce591ca50 100644 --- a/runtime/Cpp/README.md +++ b/runtime/Cpp/README.md @@ -16,7 +16,7 @@ The C++ target has been the work of the following people: * Dan McLaughlin, dan.mclaughlin@gmail.com (initial port, got code to compile) * David Sisson, dsisson@google.com (initial port, made the runtime C++ tests runnable) -* [Mike Lischke](www.soft-gems.net), mike@lischke-online.de (brought the initial port to a working library, made most runtime tests passing) +* [Mike Lischke](http://www.soft-gems.net), mike@lischke-online.de (brought the initial port to a working library, made most runtime tests passing) ## Other contributors @@ -62,7 +62,7 @@ Try run cmake -DCMAKE_ANDROID_NDK=/folder/of/android_ndkr17_and_above -DCMAKE_SY - make - DESTDIR=\/runtime/Cpp/run make install -If you don't want to build the demo then simply run cmake without parameters. +If you don't want to build the demo then replace the "cmake .. -DANTLR_JAR_LOCATION<...>" command in the above recipe with "cmake .." without any further parameters. There is another cmake script available in the subfolder cmake/ for those who prefer the superbuild cmake pattern. #### CMake Package support diff --git a/runtime/Cpp/VERSION b/runtime/Cpp/VERSION index c01c413359..8d39259a80 100644 --- a/runtime/Cpp/VERSION +++ b/runtime/Cpp/VERSION @@ -1 +1 @@ -4.9.3 +4.10 diff --git a/runtime/Cpp/cmake/Antlr4Package.md b/runtime/Cpp/cmake/Antlr4Package.md index 10e7752856..9b4d8584c3 100644 --- a/runtime/Cpp/cmake/Antlr4Package.md +++ b/runtime/Cpp/cmake/Antlr4Package.md @@ -96,7 +96,7 @@ target_link_libraries( Parsertest PRIVATE find_package(antlr4-generator REQUIRED) # Set path to generator - set(ANTLR4_JAR_LOCATION ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.9.3-complete.jar) + set(ANTLR4_JAR_LOCATION ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.10-complete.jar) # generate lexer antlr4_generate( diff --git a/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake b/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake index 2acc610ef0..6d07ba16cb 100644 --- a/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake +++ b/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake @@ -38,7 +38,7 @@ else() set(ANTLR4_SHARED_LIBRARIES ${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dll.a) set(ANTLR4_RUNTIME_LIBRARIES - ${ANTLR4_OUTPUT_DIR}/cygantlr4-runtime-4.9.3.dll) + ${ANTLR4_OUTPUT_DIR}/cygantlr4-runtime-4.10.dll) elseif(APPLE) set(ANTLR4_RUNTIME_LIBRARIES ${ANTLR4_OUTPUT_DIR}/libantlr4-runtime.dylib) diff --git a/runtime/Cpp/cmake/FindANTLR.cmake b/runtime/Cpp/cmake/FindANTLR.cmake index 2d204d7e9d..4a34d730d1 100644 --- a/runtime/Cpp/cmake/FindANTLR.cmake +++ b/runtime/Cpp/cmake/FindANTLR.cmake @@ -2,7 +2,7 @@ find_package(Java QUIET COMPONENTS Runtime) if(NOT ANTLR_EXECUTABLE) find_program(ANTLR_EXECUTABLE - NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.9.3-complete.jar) + NAMES antlr.jar antlr4.jar antlr-4.jar antlr-4.10-complete.jar) endif() if(ANTLR_EXECUTABLE AND Java_JAVA_EXECUTABLE) diff --git a/runtime/Cpp/cmake/README.md b/runtime/Cpp/cmake/README.md index 0ebe1dd51e..61e7186b4c 100644 --- a/runtime/Cpp/cmake/README.md +++ b/runtime/Cpp/cmake/README.md @@ -6,7 +6,7 @@ Here is how you can use this external project to create the antlr4cpp demo to st 1. Make a subfolder cmake 2. Copy the files in this folder to srcfolder/cmake 3. Cut below and use it to create srcfolder/CMakeLists.txt - 4. Copy main.cpp, TLexer.g4 and TParser.g4 to ./srcfolder/ from [here](https://github.com/antlr/antlr4/tree/master/runtime/Cpp/demo) + 4. Copy main.cpp, TLexer.g4 and TParser.g4 to srcfolder/ from [here](https://github.com/antlr/antlr4/tree/master/runtime/Cpp/demo) 2. Make a build folder e.g. ~/buildfolder/ 3. From the buildfolder, run `cmake ~/srcfolder; make` @@ -16,14 +16,22 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.7 FATAL_ERROR) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -# compiler must be 11 or 14 -set(CMAKE_CXX_STANDARD 11) +# compiler must be 17 +set(CMAKE_CXX_STANDARD 17) # required if linking to static library add_definitions(-DANTLR4CPP_STATIC) # using /MD flag for antlr4_runtime (for Visual C++ compilers only) set(ANTLR4_WITH_STATIC_CRT OFF) + +# Specify the version of the antlr4 library needed for this project. +# By default the latest version of antlr4 will be used. You can specify a +# specific, stable version by setting a repository tag value or a link +# to a zip file containing the libary source. +# set(ANTLR4_TAG 4.10) +# set(ANTLR4_ZIP_REPOSITORY https://github.com/antlr/antlr4/archive/refs/tags/4.10.zip) + # add external build for antlrcpp include(ExternalAntlr4Cpp) # add antrl4cpp artifacts to project environment @@ -31,7 +39,7 @@ include_directories(${ANTLR4_INCLUDE_DIRS}) # set variable pointing to the antlr tool that supports C++ # this is not required if the jar file can be found under PATH environment -set(ANTLR_EXECUTABLE /home/user/antlr-4.9.3-complete.jar) +set(ANTLR_EXECUTABLE /home/user/antlr-4.10-complete.jar) # add macros to generate ANTLR Cpp code from grammar find_package(ANTLR REQUIRED) @@ -123,9 +131,9 @@ ANTLR4_RUNTIME_LIBRARIES - path to antlr4 shared runtime library (such as DLL, D ANTLR4_TAG - branch/tag used for building antlr4 library ``` -`ANTLR4_TAG` is set to master branch by default to keep antlr4 updated. However, it will be required to rebuild after every `clean` is called. Set `ANTLR4_TAG` to a desired commit hash value to avoid rebuilding after every `clean` and keep the build stable, at the cost of not automatically update to latest commit. +`ANTLR4_TAG` is set to master branch by default to keep the antlr4 library up to date. However, this will require a rebuild after every `clean` is called. Set `ANTLR4_TAG` to a desired commit hash value to avoid rebuilding after every `clean` and keep the build stable, at the cost of not automatically updating to latest commit. -The ANTLR C++ runtime source is downloaded from GitHub by default. However, users may specify `ANTLR4_ZIP_REPOSITORY` to list the zip file from [ANTLR downloads](http://www.antlr.org/download.html) (under *C++ Target*). This variable can list a zip file included in the project directory; this is useful for maintaining a canonical source for each new build. +By defualt the ANTLR C++ runtime source is cloned from GitHub. However, users may specify `ANTLR4_ZIP_REPOSITORY` in order to download source as a zip file from [ANTLR downloads](http://www.antlr.org/download.html) (under *C++ Target*) or other locations. For example, this variable could list a zip file included in your the project directory. This is useful for maintaining a canonical source tree for each new build. Visual C++ compiler users may want to additionally define `ANTLR4_WITH_STATIC_CRT` before including the file. Set `ANTLR4_WITH_STATIC_CRT` to true if ANTLR4 C++ runtime library should be compiled with `/MT` flag, otherwise will be compiled with `/MD` flag. This variable has a default value of `OFF`. Changing `ANTLR4_WITH_STATIC_CRT` after building the library may require reinitialization of CMake or `clean` for the library to get rebuilt. diff --git a/runtime/Cpp/demo/Mac/antlrcpp-demo.xcodeproj/project.pbxproj b/runtime/Cpp/demo/Mac/antlrcpp-demo.xcodeproj/project.pbxproj index 5f136b03e7..fd5ff927da 100644 --- a/runtime/Cpp/demo/Mac/antlrcpp-demo.xcodeproj/project.pbxproj +++ b/runtime/Cpp/demo/Mac/antlrcpp-demo.xcodeproj/project.pbxproj @@ -7,8 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 270925AC1CDB427200522D32 /* libantlr4-runtime.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 270925A71CDB409400522D32 /* libantlr4-runtime.dylib */; }; - 270925AF1CDB428A00522D32 /* libantlr4-runtime.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 270925A91CDB409400522D32 /* libantlr4-runtime.a */; }; + 2707D9C22764C11300D99A45 /* libantlr4-runtime.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2707D9BC2764C04C00D99A45 /* libantlr4-runtime.dylib */; }; 270925B11CDB455B00522D32 /* TLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27A23EA11CC2A8D60036D8A3 /* TLexer.cpp */; }; 2747A7131CA6C46C0030247B /* InputHandlingTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2747A7121CA6C46C0030247B /* InputHandlingTests.mm */; }; 274FC6D91CA96B6C008D4374 /* MiscClassTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 274FC6D81CA96B6C008D4374 /* MiscClassTests.mm */; }; @@ -22,40 +21,26 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 270925A61CDB409400522D32 /* PBXContainerItemProxy */ = { + 2707D9BB2764C04C00D99A45 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 270925A11CDB409400522D32 /* antlrcpp.xcodeproj */; + containerPortal = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */; proxyType = 2; remoteGlobalIDString = 37D727AA1867AF1E007B6D10; - remoteInfo = antlrcpp; + remoteInfo = antlr4; }; - 270925A81CDB409400522D32 /* PBXContainerItemProxy */ = { + 2707D9BD2764C04C00D99A45 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 270925A11CDB409400522D32 /* antlrcpp.xcodeproj */; + containerPortal = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */; proxyType = 2; remoteGlobalIDString = 37C147171B4D5A04008EDDDB; - remoteInfo = antlrcpp_static; + remoteInfo = antlr4_static; }; - 270925AA1CDB426900522D32 /* PBXContainerItemProxy */ = { + 2707D9BF2764C04C00D99A45 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 270925A11CDB409400522D32 /* antlrcpp.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 37D727A91867AF1E007B6D10; - remoteInfo = antlrcpp; - }; - 270925AD1CDB428400522D32 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 270925A11CDB409400522D32 /* antlrcpp.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 37C147161B4D5A04008EDDDB; - remoteInfo = antlrcpp_static; - }; - 273DC2BC1CDB619900DB7B2B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 270925A11CDB409400522D32 /* antlrcpp.xcodeproj */; + containerPortal = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */; proxyType = 2; remoteGlobalIDString = 270C67F01CDB4F1E00116E17; - remoteInfo = antlrcpp_ios; + remoteInfo = antlr4_ios; }; /* End PBXContainerItemProxy section */ @@ -72,7 +57,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 270925A11CDB409400522D32 /* antlrcpp.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = antlrcpp.xcodeproj; path = ../../runtime/antlrcpp.xcodeproj; sourceTree = ""; }; + 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = antlrcpp.xcodeproj; path = ../../runtime/antlrcpp.xcodeproj; sourceTree = ""; }; 2747A7121CA6C46C0030247B /* InputHandlingTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InputHandlingTests.mm; sourceTree = ""; wrapsLines = 0; }; 274FC6D81CA96B6C008D4374 /* MiscClassTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MiscClassTests.mm; sourceTree = ""; wrapsLines = 0; }; 27874F1D1CCB7A0700AF1C53 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; @@ -102,7 +87,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 270925AC1CDB427200522D32 /* libantlr4-runtime.dylib in Frameworks */, + 2707D9C22764C11300D99A45 /* libantlr4-runtime.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -110,23 +95,29 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 270925AF1CDB428A00522D32 /* libantlr4-runtime.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 270925A21CDB409400522D32 /* Products */ = { + 2707D9B62764C04C00D99A45 /* Products */ = { isa = PBXGroup; children = ( - 270925A71CDB409400522D32 /* libantlr4-runtime.dylib */, - 270925A91CDB409400522D32 /* libantlr4-runtime.a */, - 273DC2BD1CDB619900DB7B2B /* antlr4_ios.framework */, + 2707D9BC2764C04C00D99A45 /* libantlr4-runtime.dylib */, + 2707D9BE2764C04C00D99A45 /* libantlr4-runtime.a */, + 2707D9C02764C04C00D99A45 /* antlr4_ios.framework */, ); name = Products; sourceTree = ""; }; + 2707D9C12764C11300D99A45 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; 27874F221CCBB34200AF1C53 /* Linked Frameworks */ = { isa = PBXGroup; children = ( @@ -167,12 +158,13 @@ 37D727A11867AF1E007B6D10 = { isa = PBXGroup; children = ( - 270925A11CDB409400522D32 /* antlrcpp.xcodeproj */, + 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */, 27C66A681C9591280021E494 /* antlr4-cpp-demo */, 37F135691B4AC02800E0CACF /* antlrcpp Tests */, 27C66A5C1C958EB50021E494 /* generated */, 27874F221CCBB34200AF1C53 /* Linked Frameworks */, 37D727AB1867AF1E007B6D10 /* Products */, + 2707D9C12764C11300D99A45 /* Frameworks */, ); sourceTree = ""; }; @@ -219,7 +211,6 @@ buildRules = ( ); dependencies = ( - 270925AB1CDB426900522D32 /* PBXTargetDependency */, ); name = "antlr4-cpp-demo"; productName = "antlr4-cpp-demo"; @@ -237,7 +228,6 @@ buildRules = ( ); dependencies = ( - 270925AE1CDB428400522D32 /* PBXTargetDependency */, ); name = "antlrcpp Tests"; productName = "antlrcpp Tests"; @@ -266,6 +256,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = 37D727A11867AF1E007B6D10; @@ -273,8 +264,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = 270925A21CDB409400522D32 /* Products */; - ProjectRef = 270925A11CDB409400522D32 /* antlrcpp.xcodeproj */; + ProductGroup = 2707D9B62764C04C00D99A45 /* Products */; + ProjectRef = 2707D9B52764C04C00D99A45 /* antlrcpp.xcodeproj */; }, ); projectRoot = ""; @@ -286,25 +277,25 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 270925A71CDB409400522D32 /* libantlr4-runtime.dylib */ = { + 2707D9BC2764C04C00D99A45 /* libantlr4-runtime.dylib */ = { isa = PBXReferenceProxy; fileType = "compiled.mach-o.dylib"; path = "libantlr4-runtime.dylib"; - remoteRef = 270925A61CDB409400522D32 /* PBXContainerItemProxy */; + remoteRef = 2707D9BB2764C04C00D99A45 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 270925A91CDB409400522D32 /* libantlr4-runtime.a */ = { + 2707D9BE2764C04C00D99A45 /* libantlr4-runtime.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libantlr4-runtime.a"; - remoteRef = 270925A81CDB409400522D32 /* PBXContainerItemProxy */; + remoteRef = 2707D9BD2764C04C00D99A45 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 273DC2BD1CDB619900DB7B2B /* antlr4_ios.framework */ = { + 2707D9C02764C04C00D99A45 /* antlr4_ios.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = antlr4_ios.framework; - remoteRef = 273DC2BC1CDB619900DB7B2B /* PBXContainerItemProxy */; + remoteRef = 2707D9BF2764C04C00D99A45 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -364,19 +355,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 270925AB1CDB426900522D32 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = antlrcpp; - targetProxy = 270925AA1CDB426900522D32 /* PBXContainerItemProxy */; - }; - 270925AE1CDB428400522D32 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = antlrcpp_static; - targetProxy = 270925AD1CDB428400522D32 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ 27C66A6C1C9591280021E494 /* Debug */ = { isa = XCBuildConfiguration; @@ -412,8 +390,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -464,7 +441,7 @@ ../../runtime/src/atn, ../../runtime/src, ); - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 11.1; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; @@ -474,8 +451,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; @@ -520,7 +496,7 @@ ../../runtime/src/atn, ../../runtime/src, ); - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 11.1; SDKROOT = macosx; }; name = Release; diff --git a/runtime/Cpp/demo/generate.cmd b/runtime/Cpp/demo/generate.cmd index 5d74466a90..53619c742f 100644 --- a/runtime/Cpp/demo/generate.cmd +++ b/runtime/Cpp/demo/generate.cmd @@ -6,7 +6,7 @@ :: Download the ANLTR jar and place it in the same folder as this script (or adjust the LOCATION var accordingly). -set LOCATION=antlr-4.9.3-complete.jar +set LOCATION=antlr-4.10-complete.jar java -jar %LOCATION% -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4 ::java -jar %LOCATION% -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest -XdbgST TLexer.g4 TParser.g4 ::java -jar %LOCATION% -Dlanguage=Java -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4 diff --git a/runtime/Cpp/deploy-macos.sh b/runtime/Cpp/deploy-macos.sh index cf977652d9..770d06fa1b 100755 --- a/runtime/Cpp/deploy-macos.sh +++ b/runtime/Cpp/deploy-macos.sh @@ -4,18 +4,6 @@ rm -f -R antlr4-runtime build lib 2> /dev/null rm antlr4-cpp-runtime-macos.zip 2> /dev/null -# Get utf8 dependency. -mkdir -p runtime/thirdparty 2> /dev/null -pushd runtime/thirdparty -if [ ! -d utfcpp ] -then - git clone https://github.com/nemtrif/utfcpp.git utfcpp - pushd utfcpp - git checkout tags/v3.1.1 - popd -fi -popd - # Binaries xcodebuild -project runtime/antlrcpp.xcodeproj \ -target antlr4 \ @@ -35,9 +23,6 @@ rm -f -R antlr4-runtime pushd runtime/src find . -name '*.h' | cpio -pdm ../../antlr4-runtime popd -pushd runtime/thirdparty/utfcpp/source -find . -name '*.h' | cpio -pdm ../../../../antlr4-runtime -popd # Zip up and clean up zip -r antlr4-cpp-runtime-macos.zip antlr4-runtime lib diff --git a/runtime/Cpp/runtime/CMakeLists.txt b/runtime/Cpp/runtime/CMakeLists.txt index c8b16c6cf9..baf46cac9b 100644 --- a/runtime/Cpp/runtime/CMakeLists.txt +++ b/runtime/Cpp/runtime/CMakeLists.txt @@ -1,3 +1,5 @@ +option(ANTLR_BUILD_CPP_TESTS "Build C++ tests." ON) + include_directories( ${PROJECT_SOURCE_DIR}/runtime/src ${PROJECT_SOURCE_DIR}/runtime/src/atn @@ -35,44 +37,36 @@ add_custom_target(make_lib_output_dir ALL add_dependencies(antlr4_shared make_lib_output_dir) add_dependencies(antlr4_static make_lib_output_dir) -find_package(utf8cpp QUIET) +if (ANTLR_BUILD_CPP_TESTS) + include(FetchContent) -set(INSTALL_utf8cpp FALSE) + FetchContent_Declare( + googletest + URL https://github.com/google/googletest/archive/e2239ee6043f73722e7aa812a459f54a28552929.zip + ) -if (utf8cpp_FOUND) - target_link_libraries(antlr4_shared utf8cpp) - target_link_libraries(antlr4_static utf8cpp) -else() + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - # older utf8cpp doesn't define the package above - find_path(utf8cpp_HEADER utf8.h - PATH_SUFFIXES utf8cpp - ) + FetchContent_MakeAvailable(googletest) - if (utf8cpp_HEADER) - include_directories(${utf8cpp_HEADER}) - else() - include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) - set(THIRDPARTY_DIR ${CMAKE_BINARY_DIR}/runtime/thirdparty) - set(UTFCPP_DIR ${THIRDPARTY_DIR}/utfcpp) - ExternalProject_Add( - utf8cpp - GIT_REPOSITORY "https://github.com/nemtrif/utfcpp" - GIT_TAG "v3.1.1" - SOURCE_DIR ${UTFCPP_DIR} - UPDATE_DISCONNECTED 1 - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${UTFCPP_DIR}/install -DUTF8_TESTS=off -DUTF8_SAMPLES=off - STEP_TARGETS build) - - include_directories( - ${UTFCPP_DIR}/install/include/utf8cpp - ${UTFCPP_DIR}/install/include/utf8cpp/utf8 - ) - - add_dependencies(antlr4_shared utf8cpp) - add_dependencies(antlr4_static utf8cpp) - set(INSTALL_utf8cpp TRUE) - endif() + file(GLOB libantlrcpp_TESTS + "${PROJECT_SOURCE_DIR}/runtime/tests/*.cpp" + ) + + add_executable( + antlr4_tests + ${libantlrcpp_TESTS} + ) + + target_link_libraries( + antlr4_tests + antlr4_static + gtest_main + ) + + include(GoogleTest) + + gtest_discover_tests(antlr4_tests) endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") @@ -141,27 +135,19 @@ set_target_properties(antlr4_static COMPILE_FLAGS "${disabled_compile_warnings} ${extra_static_compile_flags}") install(TARGETS antlr4_shared - DESTINATION lib - EXPORT antlr4-targets) + EXPORT antlr4-targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(TARGETS antlr4_static - DESTINATION lib - EXPORT antlr4-targets) + EXPORT antlr4-targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(DIRECTORY "${PROJECT_SOURCE_DIR}/runtime/src/" DESTINATION "include/antlr4-runtime" COMPONENT dev FILES_MATCHING PATTERN "*.h" ) - -if (INSTALL_utf8cpp) - install(FILES "${UTFCPP_DIR}/source/utf8.h" - DESTINATION "include/antlr4-runtime") - install(DIRECTORY "${UTFCPP_DIR}/source/utf8" - DESTINATION "include/antlr4-runtime" - COMPONENT dev - FILES_MATCHING PATTERN "*.h" - ) -endif() - - - diff --git a/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj b/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj index 47377c18af..83f76113ef 100644 --- a/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj +++ b/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj @@ -179,6 +179,7 @@ 4251 + stdcpp17 Windows @@ -196,6 +197,7 @@ 4251 + stdcpp17 Windows @@ -213,6 +215,7 @@ 4251 + stdcpp17 Windows @@ -230,6 +233,7 @@ 4251 + stdcpp17 Windows @@ -249,6 +253,7 @@ 4251 + stdcpp17 Windows @@ -270,6 +275,7 @@ 4251 + stdcpp17 Windows @@ -291,6 +297,7 @@ 4251 + stdcpp17 Windows @@ -312,6 +319,7 @@ 4251 + stdcpp17 Windows @@ -430,7 +438,7 @@ - + @@ -485,8 +493,6 @@ - - @@ -586,7 +592,7 @@ - + @@ -634,4 +640,4 @@ - \ No newline at end of file + diff --git a/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj.filters b/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj.filters index 499a82ed4d..0105b80e74 100644 --- a/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj.filters +++ b/runtime/Cpp/runtime/antlr4cpp-vs2013.vcxproj.filters @@ -285,9 +285,6 @@ Header Files\atn - - Header Files\atn - Header Files\atn diff --git a/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj b/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj index 9085761e8d..8fb5cf9806 100644 --- a/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj +++ b/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj @@ -182,6 +182,7 @@ 4251 true false + stdcpp17 Windows @@ -201,6 +202,7 @@ 4251 true false + stdcpp17 Windows @@ -220,6 +222,7 @@ 4251 true false + stdcpp17 Windows @@ -239,6 +242,7 @@ 4251 true false + stdcpp17 Windows @@ -259,6 +263,7 @@ 4251 true + stdcpp17 Windows @@ -281,6 +286,7 @@ 4251 true + stdcpp17 Windows @@ -303,6 +309,7 @@ 4251 true + stdcpp17 Windows @@ -325,6 +332,7 @@ 4251 true + stdcpp17 Windows @@ -444,7 +452,7 @@ - + @@ -499,7 +507,6 @@ - @@ -602,7 +609,7 @@ - + @@ -649,4 +656,4 @@ - \ No newline at end of file + diff --git a/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj.filters b/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj.filters index cc1986923d..8573ee8373 100644 --- a/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj.filters +++ b/runtime/Cpp/runtime/antlr4cpp-vs2015.vcxproj.filters @@ -285,9 +285,6 @@ Header Files\atn - - Header Files\atn - Header Files\atn diff --git a/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj b/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj index 2c3611c861..8ad1d01b6f 100644 --- a/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj +++ b/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj @@ -182,6 +182,7 @@ 4251 true false + stdcpp17 Windows @@ -201,6 +202,7 @@ 4251 true false + stdcpp17 Windows @@ -220,6 +222,7 @@ 4251 true false + stdcpp17 Windows @@ -239,6 +242,7 @@ 4251 true false + stdcpp17 Windows @@ -259,6 +263,7 @@ 4251 true + stdcpp17 Windows @@ -281,6 +286,7 @@ 4251 true + stdcpp17 Windows @@ -303,6 +309,7 @@ 4251 true + stdcpp17 Windows @@ -325,6 +332,7 @@ 4251 true + stdcpp17 Windows @@ -444,7 +452,7 @@ - + @@ -499,7 +507,6 @@ - @@ -602,7 +609,7 @@ - + @@ -649,4 +656,4 @@ - \ No newline at end of file + diff --git a/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj.filters b/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj.filters index cc1986923d..8573ee8373 100644 --- a/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj.filters +++ b/runtime/Cpp/runtime/antlr4cpp-vs2017.vcxproj.filters @@ -285,9 +285,6 @@ Header Files\atn - - Header Files\atn - Header Files\atn diff --git a/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj b/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj index 54f0aeb14b..d5df910b8a 100644 --- a/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj +++ b/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj @@ -183,6 +183,7 @@ true false /Zc:__cplusplus %(AdditionalOptions) + stdcpp17 Windows @@ -203,6 +204,7 @@ true false /Zc:__cplusplus %(AdditionalOptions) + stdcpp17 Windows @@ -223,6 +225,7 @@ true false /Zc:__cplusplus %(AdditionalOptions) + stdcpp17 Windows @@ -243,6 +246,7 @@ true false /Zc:__cplusplus %(AdditionalOptions) + stdcpp17 Windows @@ -264,6 +268,7 @@ 4251 true /Zc:__cplusplus %(AdditionalOptions) + stdcpp17 Windows @@ -287,6 +292,7 @@ 4251 true /Zc:__cplusplus %(AdditionalOptions) + stdcpp17 Windows @@ -310,6 +316,7 @@ 4251 true /Zc:__cplusplus %(AdditionalOptions) + stdcpp17 Windows @@ -333,6 +340,7 @@ 4251 true /Zc:__cplusplus %(AdditionalOptions) + stdcpp17 Windows @@ -452,7 +460,7 @@ - + @@ -507,7 +515,6 @@ - @@ -610,7 +617,7 @@ - + @@ -657,4 +664,4 @@ - \ No newline at end of file + diff --git a/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj.filters b/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj.filters index cc1986923d..8573ee8373 100644 --- a/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj.filters +++ b/runtime/Cpp/runtime/antlr4cpp-vs2019.vcxproj.filters @@ -285,9 +285,6 @@ Header Files\atn - - Header Files\atn - Header Files\atn diff --git a/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj b/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj index 17ab198483..c258a30156 100644 --- a/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj +++ b/runtime/Cpp/runtime/antlrcpp.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 270C67F31CDB4F1E00116E17 /* antlrcpp_ios.h in Headers */ = {isa = PBXBuildFile; fileRef = 270C67F21CDB4F1E00116E17 /* antlrcpp_ios.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 270C69E01CDB536A00116E17 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 270C69DF1CDB536A00116E17 /* CoreFoundation.framework */; }; 276566E01DA93BFB000869BE /* ParseTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276566DF1DA93BFB000869BE /* ParseTree.cpp */; }; 276566E11DA93BFB000869BE /* ParseTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276566DF1DA93BFB000869BE /* ParseTree.cpp */; }; 276566E21DA93BFB000869BE /* ParseTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276566DF1DA93BFB000869BE /* ParseTree.cpp */; }; @@ -645,12 +644,12 @@ 276E5FBC1CDB57AA003FF4B4 /* Declarations.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEA1CDB57AA003FF4B4 /* Declarations.h */; }; 276E5FBD1CDB57AA003FF4B4 /* Declarations.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEA1CDB57AA003FF4B4 /* Declarations.h */; }; 276E5FBE1CDB57AA003FF4B4 /* Declarations.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEA1CDB57AA003FF4B4 /* Declarations.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 276E5FBF1CDB57AA003FF4B4 /* guid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CEB1CDB57AA003FF4B4 /* guid.cpp */; }; - 276E5FC01CDB57AA003FF4B4 /* guid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CEB1CDB57AA003FF4B4 /* guid.cpp */; }; - 276E5FC11CDB57AA003FF4B4 /* guid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CEB1CDB57AA003FF4B4 /* guid.cpp */; }; - 276E5FC21CDB57AA003FF4B4 /* guid.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEC1CDB57AA003FF4B4 /* guid.h */; }; - 276E5FC31CDB57AA003FF4B4 /* guid.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEC1CDB57AA003FF4B4 /* guid.h */; }; - 276E5FC41CDB57AA003FF4B4 /* guid.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEC1CDB57AA003FF4B4 /* guid.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 276E5FBF1CDB57AA003FF4B4 /* Guid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CEB1CDB57AA003FF4B4 /* Guid.cpp */; }; + 276E5FC01CDB57AA003FF4B4 /* Guid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CEB1CDB57AA003FF4B4 /* Guid.cpp */; }; + 276E5FC11CDB57AA003FF4B4 /* Guid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CEB1CDB57AA003FF4B4 /* Guid.cpp */; }; + 276E5FC21CDB57AA003FF4B4 /* Guid.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEC1CDB57AA003FF4B4 /* Guid.h */; }; + 276E5FC31CDB57AA003FF4B4 /* Guid.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEC1CDB57AA003FF4B4 /* Guid.h */; }; + 276E5FC41CDB57AA003FF4B4 /* Guid.h in Headers */ = {isa = PBXBuildFile; fileRef = 276E5CEC1CDB57AA003FF4B4 /* Guid.h */; settings = {ATTRIBUTES = (Public, ); }; }; 276E5FC51CDB57AA003FF4B4 /* StringUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */; }; 276E5FC61CDB57AA003FF4B4 /* StringUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */; }; 276E5FC71CDB57AA003FF4B4 /* StringUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */; }; @@ -927,7 +926,6 @@ 270C67F01CDB4F1E00116E17 /* antlr4_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = antlr4_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 270C67F21CDB4F1E00116E17 /* antlrcpp_ios.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = antlrcpp_ios.h; sourceTree = ""; wrapsLines = 0; }; 270C67F41CDB4F1E00116E17 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 270C69DF1CDB536A00116E17 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; }; 276566DF1DA93BFB000869BE /* ParseTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParseTree.cpp; sourceTree = ""; }; 276E5C0C1CDB57AA003FF4B4 /* ANTLRErrorListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANTLRErrorListener.h; sourceTree = ""; wrapsLines = 0; }; 276E5C0D1CDB57AA003FF4B4 /* ANTLRErrorStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANTLRErrorStrategy.h; sourceTree = ""; }; @@ -1140,8 +1138,8 @@ 276E5CE81CDB57AA003FF4B4 /* CPPUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CPPUtils.cpp; sourceTree = ""; wrapsLines = 0; }; 276E5CE91CDB57AA003FF4B4 /* CPPUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPPUtils.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 276E5CEA1CDB57AA003FF4B4 /* Declarations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Declarations.h; sourceTree = ""; }; - 276E5CEB1CDB57AA003FF4B4 /* guid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = guid.cpp; sourceTree = ""; }; - 276E5CEC1CDB57AA003FF4B4 /* guid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = guid.h; sourceTree = ""; }; + 276E5CEB1CDB57AA003FF4B4 /* Guid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Guid.cpp; sourceTree = ""; }; + 276E5CEC1CDB57AA003FF4B4 /* Guid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Guid.h; sourceTree = ""; }; 276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringUtils.cpp; sourceTree = ""; }; 276E5CEE1CDB57AA003FF4B4 /* StringUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringUtils.h; sourceTree = ""; }; 276E5CF01CDB57AA003FF4B4 /* Token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Token.h; sourceTree = ""; }; @@ -1242,7 +1240,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 270C69E01CDB536A00116E17 /* CoreFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1553,8 +1550,8 @@ 276E5CE81CDB57AA003FF4B4 /* CPPUtils.cpp */, 276E5CE91CDB57AA003FF4B4 /* CPPUtils.h */, 276E5CEA1CDB57AA003FF4B4 /* Declarations.h */, - 276E5CEB1CDB57AA003FF4B4 /* guid.cpp */, - 276E5CEC1CDB57AA003FF4B4 /* guid.h */, + 276E5CEB1CDB57AA003FF4B4 /* Guid.cpp */, + 276E5CEC1CDB57AA003FF4B4 /* Guid.h */, 276E5CED1CDB57AA003FF4B4 /* StringUtils.cpp */, 276E5CEE1CDB57AA003FF4B4 /* StringUtils.h */, ); @@ -1618,7 +1615,6 @@ 27874F221CCBB34200AF1C53 /* Linked Frameworks */ = { isa = PBXGroup; children = ( - 270C69DF1CDB536A00116E17 /* CoreFoundation.framework */, 27874F1D1CCB7A0700AF1C53 /* CoreFoundation.framework */, ); name = "Linked Frameworks"; @@ -1767,7 +1763,7 @@ 276E5F581CDB57AA003FF4B4 /* LexerNoViableAltException.h in Headers */, 276E5D811CDB57AA003FF4B4 /* ATNSimulator.h in Headers */, 27DB44B61D0463CC007E790B /* XPathLexer.h in Headers */, - 276E5FC41CDB57AA003FF4B4 /* guid.h in Headers */, + 276E5FC41CDB57AA003FF4B4 /* Guid.h in Headers */, 276E602D1CDB57AA003FF4B4 /* TagChunk.h in Headers */, 276E5E951CDB57AA003FF4B4 /* RuleStopState.h in Headers */, 276E5F761CDB57AA003FF4B4 /* Predicate.h in Headers */, @@ -1934,7 +1930,7 @@ 276E60141CDB57AA003FF4B4 /* ParseTreeMatch.h in Headers */, 276E5F571CDB57AA003FF4B4 /* LexerNoViableAltException.h in Headers */, 276E5D801CDB57AA003FF4B4 /* ATNSimulator.h in Headers */, - 276E5FC31CDB57AA003FF4B4 /* guid.h in Headers */, + 276E5FC31CDB57AA003FF4B4 /* Guid.h in Headers */, 276E602C1CDB57AA003FF4B4 /* TagChunk.h in Headers */, 276E5E941CDB57AA003FF4B4 /* RuleStopState.h in Headers */, 276E5F751CDB57AA003FF4B4 /* Predicate.h in Headers */, @@ -2092,7 +2088,7 @@ 276E60131CDB57AA003FF4B4 /* ParseTreeMatch.h in Headers */, 276E5F561CDB57AA003FF4B4 /* LexerNoViableAltException.h in Headers */, 276E5D7F1CDB57AA003FF4B4 /* ATNSimulator.h in Headers */, - 276E5FC21CDB57AA003FF4B4 /* guid.h in Headers */, + 276E5FC21CDB57AA003FF4B4 /* Guid.h in Headers */, 276E602B1CDB57AA003FF4B4 /* TagChunk.h in Headers */, 276E5E931CDB57AA003FF4B4 /* RuleStopState.h in Headers */, 276E5F741CDB57AA003FF4B4 /* Predicate.h in Headers */, @@ -2368,7 +2364,7 @@ 276E5E861CDB57AA003FF4B4 /* RangeTransition.cpp in Sources */, 276E5D7E1CDB57AA003FF4B4 /* ATNSimulator.cpp in Sources */, 276E5D9C1CDB57AA003FF4B4 /* BasicState.cpp in Sources */, - 276E5FC11CDB57AA003FF4B4 /* guid.cpp in Sources */, + 276E5FC11CDB57AA003FF4B4 /* Guid.cpp in Sources */, 276E5E801CDB57AA003FF4B4 /* ProfilingATNSimulator.cpp in Sources */, 2793DCA91F08095F00A84290 /* ANTLRErrorStrategy.cpp in Sources */, 276E5F401CDB57AA003FF4B4 /* IntStream.cpp in Sources */, @@ -2522,7 +2518,7 @@ 276E5E851CDB57AA003FF4B4 /* RangeTransition.cpp in Sources */, 276E5D7D1CDB57AA003FF4B4 /* ATNSimulator.cpp in Sources */, 276E5D9B1CDB57AA003FF4B4 /* BasicState.cpp in Sources */, - 276E5FC01CDB57AA003FF4B4 /* guid.cpp in Sources */, + 276E5FC01CDB57AA003FF4B4 /* Guid.cpp in Sources */, 276E5E7F1CDB57AA003FF4B4 /* ProfilingATNSimulator.cpp in Sources */, 2793DCA81F08095F00A84290 /* ANTLRErrorStrategy.cpp in Sources */, 276E5F3F1CDB57AA003FF4B4 /* IntStream.cpp in Sources */, @@ -2676,7 +2672,7 @@ 276E5E841CDB57AA003FF4B4 /* RangeTransition.cpp in Sources */, 276E5D7C1CDB57AA003FF4B4 /* ATNSimulator.cpp in Sources */, 276E5D9A1CDB57AA003FF4B4 /* BasicState.cpp in Sources */, - 276E5FBF1CDB57AA003FF4B4 /* guid.cpp in Sources */, + 276E5FBF1CDB57AA003FF4B4 /* Guid.cpp in Sources */, 276E5E7E1CDB57AA003FF4B4 /* ProfilingATNSimulator.cpp in Sources */, 2793DCA71F08095F00A84290 /* ANTLRErrorStrategy.cpp in Sources */, 276E5F3E1CDB57AA003FF4B4 /* IntStream.cpp in Sources */, @@ -2737,6 +2733,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_ENABLE_MODULES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -2772,6 +2769,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_ENABLE_MODULES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -2807,6 +2805,7 @@ 37C1471F1B4D5A04008EDDDB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_ENABLE_MODULES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; COMBINE_HIDPI_IMAGES = YES; @@ -2829,6 +2828,7 @@ 37C147201B4D5A04008EDDDB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_CXX_LANGUAGE_STANDARD = "c++17"; CLANG_ENABLE_MODULES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; COMBINE_HIDPI_IMAGES = YES; diff --git a/runtime/Cpp/runtime/src/ANTLRFileStream.cpp b/runtime/Cpp/runtime/src/ANTLRFileStream.cpp index 62061bb83a..9785092e2a 100755 --- a/runtime/Cpp/runtime/src/ANTLRFileStream.cpp +++ b/runtime/Cpp/runtime/src/ANTLRFileStream.cpp @@ -3,8 +3,6 @@ * can be found in the LICENSE.txt file in the project root. */ -#include "support/StringUtils.h" - #include "ANTLRFileStream.h" using namespace antlr4; diff --git a/runtime/Cpp/runtime/src/ANTLRInputStream.cpp b/runtime/Cpp/runtime/src/ANTLRInputStream.cpp index 2dded40910..b6470af9b7 100755 --- a/runtime/Cpp/runtime/src/ANTLRInputStream.cpp +++ b/runtime/Cpp/runtime/src/ANTLRInputStream.cpp @@ -9,7 +9,7 @@ #include "misc/Interval.h" #include "IntStream.h" -#include "support/StringUtils.h" +#include "support/Utf8.h" #include "support/CPPUtils.h" #include "ANTLRInputStream.h" @@ -23,15 +23,9 @@ ANTLRInputStream::ANTLRInputStream() { InitializeInstanceFields(); } -#if __cplusplus >= 201703L -ANTLRInputStream::ANTLRInputStream(const std::string_view &input): ANTLRInputStream() { +ANTLRInputStream::ANTLRInputStream(std::string_view input): ANTLRInputStream() { load(input.data(), input.length()); } -#endif - -ANTLRInputStream::ANTLRInputStream(const std::string &input): ANTLRInputStream() { - load(input.data(), input.size()); -} ANTLRInputStream::ANTLRInputStream(const char *data, size_t length) { load(data, length); @@ -41,28 +35,37 @@ ANTLRInputStream::ANTLRInputStream(std::istream &stream): ANTLRInputStream() { load(stream); } -void ANTLRInputStream::load(const std::string &input) { - load(input.data(), input.size()); +void ANTLRInputStream::load(const std::string &input, bool lenient) { + load(input.data(), input.size(), lenient); } -void ANTLRInputStream::load(const char *data, size_t length) { +void ANTLRInputStream::load(const char *data, size_t length, bool lenient) { // Remove the UTF-8 BOM if present. const char *bom = "\xef\xbb\xbf"; - if (length >= 3 && strncmp(data, bom, 3) == 0) - _data = antlrcpp::utf8_to_utf32(data + 3, data + length); - else - _data = antlrcpp::utf8_to_utf32(data, data + length); + if (length >= 3 && strncmp(data, bom, 3) == 0) { + data += 3; + length -= 3; + } + if (lenient) { + _data = Utf8::lenientDecode(std::string_view(data, length)); + } else { + auto maybe_utf32 = Utf8::strictDecode(std::string_view(data, length)); + if (!maybe_utf32.has_value()) { + throw IllegalArgumentException("UTF-8 string contains an illegal byte sequence"); + } + _data = std::move(maybe_utf32).value(); + } p = 0; } -void ANTLRInputStream::load(std::istream &stream) { +void ANTLRInputStream::load(std::istream &stream, bool lenient) { if (!stream.good() || stream.eof()) // No fail, bad or EOF. return; _data.clear(); std::string s((std::istreambuf_iterator(stream)), std::istreambuf_iterator()); - load(s.data(), s.length()); + load(s.data(), s.length(), lenient); } void ANTLRInputStream::reset() { @@ -150,7 +153,11 @@ std::string ANTLRInputStream::getText(const Interval &interval) { return ""; } - return antlrcpp::utf32_to_utf8(_data.substr(start, count)); + auto maybeUtf8 = Utf8::strictEncode(std::u32string_view(_data).substr(start, count)); + if (!maybeUtf8.has_value()) { + throw IllegalArgumentException("Input stream contains invalid Unicode code points"); + } + return std::move(maybeUtf8).value(); } std::string ANTLRInputStream::getSourceName() const { @@ -161,7 +168,11 @@ std::string ANTLRInputStream::getSourceName() const { } std::string ANTLRInputStream::toString() const { - return antlrcpp::utf32_to_utf8(_data); + auto maybeUtf8 = Utf8::strictEncode(_data); + if (!maybeUtf8.has_value()) { + throw IllegalArgumentException("Input stream contains invalid Unicode code points"); + } + return std::move(maybeUtf8).value(); } void ANTLRInputStream::InitializeInstanceFields() { diff --git a/runtime/Cpp/runtime/src/ANTLRInputStream.h b/runtime/Cpp/runtime/src/ANTLRInputStream.h index fdf857e3e3..413eadefa4 100755 --- a/runtime/Cpp/runtime/src/ANTLRInputStream.h +++ b/runtime/Cpp/runtime/src/ANTLRInputStream.h @@ -5,6 +5,8 @@ #pragma once +#include + #include "CharStream.h" namespace antlr4 { @@ -16,7 +18,7 @@ namespace antlr4 { protected: /// The data being scanned. // UTF-32 - UTF32String _data; + std::u32string _data; /// 0..n-1 index into string of next char size_t p; @@ -26,18 +28,19 @@ namespace antlr4 { std::string name; ANTLRInputStream(); - -#if __cplusplus >= 201703L - ANTLRInputStream(const std::string_view &input); -#endif - - ANTLRInputStream(const std::string &input); + + ANTLRInputStream(std::string_view input); + ANTLRInputStream(const char *data, size_t length); ANTLRInputStream(std::istream &stream); - virtual void load(const std::string &input); - virtual void load(const char *data, size_t length); - virtual void load(std::istream &stream); + virtual void load(const std::string &input, bool lenient); + virtual void load(const char *data, size_t length, bool lenient); + virtual void load(std::istream &stream, bool lenient); + + virtual void load(const std::string &input) { load(input, false); } + virtual void load(const char *data, size_t length) { load(data, length, false); } + virtual void load(std::istream &stream) { load(stream, false); } /// Reset the stream so that it's in the same state it was /// when the object was created *except* the data array is not diff --git a/runtime/Cpp/runtime/src/CommonToken.cpp b/runtime/Cpp/runtime/src/CommonToken.cpp index 200a6af94f..1497846d37 100755 --- a/runtime/Cpp/runtime/src/CommonToken.cpp +++ b/runtime/Cpp/runtime/src/CommonToken.cpp @@ -10,8 +10,8 @@ #include "misc/Interval.h" -#include "support/StringUtils.h" #include "support/CPPUtils.h" +#include "support/StringUtils.h" #include "CommonToken.h" @@ -165,9 +165,7 @@ std::string CommonToken::toString(Recognizer *r) const { } std::string txt = getText(); if (!txt.empty()) { - antlrcpp::replaceAll(txt, "\n", "\\n"); - antlrcpp::replaceAll(txt, "\r", "\\r"); - antlrcpp::replaceAll(txt, "\t", "\\t"); + txt = antlrcpp::escapeWhitespace(txt); } else { txt = ""; } diff --git a/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp b/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp index e0c9426391..54d35ee3b1 100755 --- a/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp +++ b/runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp @@ -12,10 +12,11 @@ #include "atn/RuleTransition.h" #include "atn/ATN.h" #include "atn/ATNState.h" +#include "support/StringUtils.h" +#include "support/Casts.h" #include "Parser.h" #include "CommonToken.h" #include "Vocabulary.h" -#include "support/StringUtils.h" #include "DefaultErrorStrategy.h" @@ -106,10 +107,10 @@ void DefaultErrorStrategy::sync(Parser *recognizer) { } switch (s->getStateType()) { - case atn::ATNState::BLOCK_START: - case atn::ATNState::STAR_BLOCK_START: - case atn::ATNState::PLUS_BLOCK_START: - case atn::ATNState::STAR_LOOP_ENTRY: + case atn::ATNStateType::BLOCK_START: + case atn::ATNStateType::STAR_BLOCK_START: + case atn::ATNStateType::PLUS_BLOCK_START: + case atn::ATNStateType::STAR_LOOP_ENTRY: // report error and recover if possible if (singleTokenDeletion(recognizer) != nullptr) { return; @@ -117,8 +118,8 @@ void DefaultErrorStrategy::sync(Parser *recognizer) { throw InputMismatchException(recognizer); - case atn::ATNState::PLUS_LOOP_BACK: - case atn::ATNState::STAR_LOOP_BACK: { + case atn::ATNStateType::PLUS_LOOP_BACK: + case atn::ATNStateType::STAR_LOOP_BACK: { reportUnwantedToken(recognizer); misc::IntervalSet expecting = recognizer->getExpectedTokens(); misc::IntervalSet whatFollowsLoopIterationOrRule = expecting.Or(getErrorRecoverySet(recognizer)); @@ -292,11 +293,13 @@ size_t DefaultErrorStrategy::getSymbolType(Token *symbol) { } std::string DefaultErrorStrategy::escapeWSAndQuote(const std::string &s) const { - std::string result = s; - antlrcpp::replaceAll(result, "\n", "\\n"); - antlrcpp::replaceAll(result, "\r","\\r"); - antlrcpp::replaceAll(result, "\t","\\t"); - return "'" + result + "'"; + std::string result; + result.reserve(s.size() + 2); + result.push_back('\''); + antlrcpp::escapeWhitespace(result, s); + result.push_back('\''); + result.shrink_to_fit(); + return result; } misc::IntervalSet DefaultErrorStrategy::getErrorRecoverySet(Parser *recognizer) { @@ -306,7 +309,7 @@ misc::IntervalSet DefaultErrorStrategy::getErrorRecoverySet(Parser *recognizer) while (ctx->invokingState != ATNState::INVALID_STATE_NUMBER) { // compute what follows who invoked us atn::ATNState *invokingState = atn.states[ctx->invokingState]; - atn::RuleTransition *rt = dynamic_cast(invokingState->transitions[0]); + const atn::RuleTransition *rt = downCast(invokingState->transitions[0].get()); misc::IntervalSet follow = atn.nextTokens(rt->followState); recoverSet.addAll(follow); diff --git a/runtime/Cpp/runtime/src/Exceptions.cpp b/runtime/Cpp/runtime/src/Exceptions.cpp index b6a7b06c65..24aea29b0c 100644 --- a/runtime/Cpp/runtime/src/Exceptions.cpp +++ b/runtime/Cpp/runtime/src/Exceptions.cpp @@ -10,7 +10,7 @@ using namespace antlr4; RuntimeException::RuntimeException(const std::string &msg) : std::exception(), _message(msg) { } -const char* RuntimeException::what() const NOEXCEPT { +const char* RuntimeException::what() const noexcept { return _message.c_str(); } @@ -19,7 +19,7 @@ const char* RuntimeException::what() const NOEXCEPT { IOException::IOException(const std::string &msg) : std::exception(), _message(msg) { } -const char* IOException::what() const NOEXCEPT { +const char* IOException::what() const noexcept { return _message.c_str(); } diff --git a/runtime/Cpp/runtime/src/Exceptions.h b/runtime/Cpp/runtime/src/Exceptions.h index d57b26a83d..35d72b52ee 100644 --- a/runtime/Cpp/runtime/src/Exceptions.h +++ b/runtime/Cpp/runtime/src/Exceptions.h @@ -16,7 +16,7 @@ namespace antlr4 { public: RuntimeException(const std::string &msg = ""); - virtual const char* what() const NOEXCEPT override; + virtual const char* what() const noexcept override; }; class ANTLR4CPP_PUBLIC IllegalStateException : public RuntimeException { @@ -77,7 +77,7 @@ namespace antlr4 { public: IOException(const std::string &msg = ""); - virtual const char* what() const NOEXCEPT override; + virtual const char* what() const noexcept override; }; class ANTLR4CPP_PUBLIC CancellationException : public IllegalStateException { diff --git a/runtime/Cpp/runtime/src/FailedPredicateException.cpp b/runtime/Cpp/runtime/src/FailedPredicateException.cpp index 3ec7b27f84..b44725cce8 100755 --- a/runtime/Cpp/runtime/src/FailedPredicateException.cpp +++ b/runtime/Cpp/runtime/src/FailedPredicateException.cpp @@ -8,6 +8,7 @@ #include "atn/PredicateTransition.h" #include "atn/ATN.h" #include "atn/ATNState.h" +#include "support/Casts.h" #include "support/CPPUtils.h" #include "FailedPredicateException.h" @@ -26,10 +27,10 @@ FailedPredicateException::FailedPredicateException(Parser *recognizer, const std recognizer->getInputStream(), recognizer->getContext(), recognizer->getCurrentToken()) { atn::ATNState *s = recognizer->getInterpreter()->atn.states[recognizer->getState()]; - atn::Transition *transition = s->transitions[0]; - if (is(transition)) { - _ruleIndex = static_cast(transition)->ruleIndex; - _predicateIndex = static_cast(transition)->predIndex; + const atn::Transition *transition = s->transitions[0].get(); + if (transition->getTransitionType() == atn::TransitionType::PREDICATE) { + _ruleIndex = downCast(*transition).getRuleIndex(); + _predicateIndex = downCast(*transition).getPredIndex(); } else { _ruleIndex = 0; _predicateIndex = 0; diff --git a/runtime/Cpp/runtime/src/FailedPredicateException.h b/runtime/Cpp/runtime/src/FailedPredicateException.h index 16e37f7ddb..745537f74a 100755 --- a/runtime/Cpp/runtime/src/FailedPredicateException.h +++ b/runtime/Cpp/runtime/src/FailedPredicateException.h @@ -15,7 +15,7 @@ namespace antlr4 { /// prediction. class ANTLR4CPP_PUBLIC FailedPredicateException : public RecognitionException { public: - FailedPredicateException(Parser *recognizer); + explicit FailedPredicateException(Parser *recognizer); FailedPredicateException(Parser *recognizer, const std::string &predicate); FailedPredicateException(Parser *recognizer, const std::string &predicate, const std::string &message); diff --git a/runtime/Cpp/runtime/src/IntStream.h b/runtime/Cpp/runtime/src/IntStream.h index 928f2c5aac..97a301cc28 100755 --- a/runtime/Cpp/runtime/src/IntStream.h +++ b/runtime/Cpp/runtime/src/IntStream.h @@ -27,13 +27,7 @@ namespace antlr4 { /// class ANTLR4CPP_PUBLIC IntStream { public: -#if __cplusplus >= 201703L static constexpr size_t EOF = std::numeric_limits::max(); -#else - enum : size_t { - EOF = static_cast(-1), // std::numeric_limits::max(); doesn't work in VS 2013 - }; -#endif /// The value returned by when the end of the stream is /// reached. diff --git a/runtime/Cpp/runtime/src/Lexer.cpp b/runtime/Cpp/runtime/src/Lexer.cpp index 6cb8cd004d..b0385c56ba 100755 --- a/runtime/Cpp/runtime/src/Lexer.cpp +++ b/runtime/Cpp/runtime/src/Lexer.cpp @@ -11,7 +11,6 @@ #include "ANTLRErrorListener.h" #include "support/CPPUtils.h" #include "CommonToken.h" -#include "support/StringUtils.h" #include "Lexer.h" diff --git a/runtime/Cpp/runtime/src/Lexer.h b/runtime/Cpp/runtime/src/Lexer.h index 7561955859..2f9b8b6442 100755 --- a/runtime/Cpp/runtime/src/Lexer.h +++ b/runtime/Cpp/runtime/src/Lexer.h @@ -18,7 +18,6 @@ namespace antlr4 { /// of speed. class ANTLR4CPP_PUBLIC Lexer : public Recognizer, public TokenSource { public: -#if __cplusplus >= 201703L static constexpr size_t DEFAULT_MODE = 0; static constexpr size_t MORE = std::numeric_limits::max() - 1; static constexpr size_t SKIP = std::numeric_limits::max() - 2; @@ -27,18 +26,6 @@ namespace antlr4 { static constexpr size_t HIDDEN = Token::HIDDEN_CHANNEL; static constexpr size_t MIN_CHAR_VALUE = 0; static constexpr size_t MAX_CHAR_VALUE = 0x10FFFF; -#else - enum : size_t { - DEFAULT_MODE = 0, - MORE = static_cast(-2), // std::numeric_limits::max() - 1; doesn't work in VS 2013 - SKIP = static_cast(-3), // std::numeric_limits::max() - 2; doesn't work in VS 2013 - - DEFAULT_TOKEN_CHANNEL = Token::DEFAULT_CHANNEL, - HIDDEN = Token::HIDDEN_CHANNEL, - MIN_CHAR_VALUE = 0, - MAX_CHAR_VALUE = 0x10FFFF, - }; -#endif CharStream *_input; // Pure reference, usually from statically allocated instance. diff --git a/runtime/Cpp/runtime/src/LexerInterpreter.cpp b/runtime/Cpp/runtime/src/LexerInterpreter.cpp index c05bbb0390..b23610c313 100755 --- a/runtime/Cpp/runtime/src/LexerInterpreter.cpp +++ b/runtime/Cpp/runtime/src/LexerInterpreter.cpp @@ -6,7 +6,6 @@ #include "atn/ATNType.h" #include "atn/LexerATNSimulator.h" #include "dfa/DFA.h" -#include "atn/EmptyPredictionContext.h" #include "Exceptions.h" #include "Vocabulary.h" @@ -14,12 +13,6 @@ using namespace antlr4; -LexerInterpreter::LexerInterpreter(const std::string &grammarFileName, const std::vector &tokenNames, - const std::vector &ruleNames, const std::vector &channelNames, const std::vector &modeNames, - const atn::ATN &atn, CharStream *input) - : LexerInterpreter(grammarFileName, dfa::Vocabulary::fromTokenNames(tokenNames), ruleNames, channelNames, modeNames, atn, input) { -} - LexerInterpreter::LexerInterpreter(const std::string &grammarFileName, const dfa::Vocabulary &vocabulary, const std::vector &ruleNames, const std::vector &channelNames, const std::vector &modeNames, const atn::ATN &atn, CharStream *input) @@ -31,10 +24,6 @@ LexerInterpreter::LexerInterpreter(const std::string &grammarFileName, const dfa throw IllegalArgumentException("The ATN must be a lexer ATN."); } - for (size_t i = 0; i < atn.maxTokenType; i++) { - _tokenNames.push_back(vocabulary.getDisplayName(i)); - } - for (size_t i = 0; i < atn.getNumberOfDecisions(); ++i) { _decisionToDFA.push_back(dfa::DFA(_atn.getDecisionState(i), i)); } @@ -54,10 +43,6 @@ std::string LexerInterpreter::getGrammarFileName() const { return _grammarFileName; } -const std::vector& LexerInterpreter::getTokenNames() const { - return _tokenNames; -} - const std::vector& LexerInterpreter::getRuleNames() const { return _ruleNames; } diff --git a/runtime/Cpp/runtime/src/LexerInterpreter.h b/runtime/Cpp/runtime/src/LexerInterpreter.h index e8707e9472..e39a7ccf2c 100755 --- a/runtime/Cpp/runtime/src/LexerInterpreter.h +++ b/runtime/Cpp/runtime/src/LexerInterpreter.h @@ -7,16 +7,13 @@ #include "Lexer.h" #include "atn/PredictionContext.h" +#include "atn/PredictionContextCache.h" #include "Vocabulary.h" namespace antlr4 { class ANTLR4CPP_PUBLIC LexerInterpreter : public Lexer { public: - // @deprecated - LexerInterpreter(const std::string &grammarFileName, const std::vector &tokenNames, - const std::vector &ruleNames, const std::vector &channelNames, - const std::vector &modeNames, const atn::ATN &atn, CharStream *input); LexerInterpreter(const std::string &grammarFileName, const dfa::Vocabulary &vocabulary, const std::vector &ruleNames, const std::vector &channelNames, const std::vector &modeNames, const atn::ATN &atn, CharStream *input); @@ -25,7 +22,6 @@ namespace antlr4 { virtual const atn::ATN& getATN() const override; virtual std::string getGrammarFileName() const override; - virtual const std::vector& getTokenNames() const override; virtual const std::vector& getRuleNames() const override; virtual const std::vector& getChannelNames() const override; virtual const std::vector& getModeNames() const override; @@ -36,8 +32,6 @@ namespace antlr4 { const std::string _grammarFileName; const atn::ATN &_atn; - // @deprecated - std::vector _tokenNames; const std::vector &_ruleNames; const std::vector &_channelNames; const std::vector &_modeNames; diff --git a/runtime/Cpp/runtime/src/Parser.cpp b/runtime/Cpp/runtime/src/Parser.cpp index 8b2a1eac20..e01569cb2f 100755 --- a/runtime/Cpp/runtime/src/Parser.cpp +++ b/runtime/Cpp/runtime/src/Parser.cpp @@ -28,10 +28,25 @@ using namespace antlr4; using namespace antlr4::atn; - using namespace antlrcpp; -std::map, atn::ATN> Parser::bypassAltsAtnCache; +namespace { + +struct BypassAltsAtnCache final { + std::shared_mutex mutex; + /// This field maps from the serialized ATN string to the deserialized with + /// bypass alternatives. + /// + /// + std::map, std::unique_ptr, std::less<>> map; +}; + +BypassAltsAtnCache* getBypassAltsAtnCache() { + static BypassAltsAtnCache* const instance = new BypassAltsAtnCache(); + return instance; +} + +} Parser::TraceListener::TraceListener(Parser *outerInstance_) : outerInstance(outerInstance_) { } @@ -212,27 +227,32 @@ TokenFactory* Parser::getTokenFactory() { return _input->getTokenSource()->getTokenFactory(); } - const atn::ATN& Parser::getATNWithBypassAlts() { - std::vector serializedAtn = getSerializedATN(); + auto serializedAtn = getSerializedATN(); if (serializedAtn.empty()) { throw UnsupportedOperationException("The current parser does not support an ATN with bypass alternatives."); } - - std::lock_guard lck(_mutex); - // XXX: using the entire serialized ATN as key into the map is a big resource waste. // How large can that thing become? - if (bypassAltsAtnCache.find(serializedAtn) == bypassAltsAtnCache.end()) + auto *cache = getBypassAltsAtnCache(); { - atn::ATNDeserializationOptions deserializationOptions; - deserializationOptions.setGenerateRuleBypassTransitions(true); - - atn::ATNDeserializer deserializer(deserializationOptions); - bypassAltsAtnCache[serializedAtn] = deserializer.deserialize(serializedAtn); + std::shared_lock lock(cache->mutex); + auto existing = cache->map.find(serializedAtn); + if (existing != cache->map.end()) { + return *existing->second; + } } - return bypassAltsAtnCache[serializedAtn]; + std::unique_lock lock(cache->mutex); + auto existing = cache->map.find(serializedAtn); + if (existing != cache->map.end()) { + return *existing->second; + } + atn::ATNDeserializationOptions deserializationOptions; + deserializationOptions.setGenerateRuleBypassTransitions(true); + atn::ATNDeserializer deserializer(deserializationOptions); + auto atn = deserializer.deserialize(serializedAtn); + return *cache->map.insert(std::make_pair(std::vector(serializedAtn.begin(), serializedAtn.end()), std::move(atn))).first->second; } tree::pattern::ParseTreePattern Parser::compileParseTreePattern(const std::string &pattern, int patternRuleIndex) { @@ -328,8 +348,7 @@ void Parser::addContextToParseTree() { if (_ctx->parent == nullptr) return; - ParserRuleContext *parent = dynamic_cast(_ctx->parent); - parent->addChild(_ctx); + downCast(_ctx->parent)->addChild(_ctx); } void Parser::enterRule(ParserRuleContext *localctx, size_t state, size_t /*ruleIndex*/) { @@ -357,7 +376,7 @@ void Parser::exitRule() { triggerExitRuleEvent(); } setState(_ctx->invokingState); - _ctx = dynamic_cast(_ctx->parent); + _ctx = downCast(_ctx->parent); } void Parser::enterOuterAlt(ParserRuleContext *localctx, size_t altNum) { @@ -367,7 +386,7 @@ void Parser::enterOuterAlt(ParserRuleContext *localctx, size_t altNum) { // that is previous child of parse tree if (_buildParseTrees && _ctx != localctx) { if (_ctx->parent != nullptr) { - ParserRuleContext *parent = dynamic_cast(_ctx->parent); + ParserRuleContext *parent = downCast(_ctx->parent); parent->removeLastChild(); parent->addChild(localctx); } @@ -423,7 +442,7 @@ void Parser::unrollRecursionContexts(ParserRuleContext *parentctx) { if (_parseListeners.size() > 0) { while (_ctx != parentctx) { triggerExitRuleEvent(); - _ctx = dynamic_cast(_ctx->parent); + _ctx = downCast(_ctx->parent); } } else { _ctx = parentctx; @@ -446,7 +465,7 @@ ParserRuleContext* Parser::getInvokingContext(size_t ruleIndex) { } if (p->parent == nullptr) break; - p = dynamic_cast(p->parent); + p = downCast(p->parent); } return nullptr; } @@ -484,13 +503,13 @@ bool Parser::isExpectedToken(size_t symbol) { while (ctx && ctx->invokingState != ATNState::INVALID_STATE_NUMBER && following.contains(Token::EPSILON)) { atn::ATNState *invokingState = atn.states[ctx->invokingState]; - atn::RuleTransition *rt = static_cast(invokingState->transitions[0]); + const atn::RuleTransition *rt = static_cast(invokingState->transitions[0].get()); following = atn.nextTokens(rt->followState); if (following.contains(symbol)) { return true; } - ctx = dynamic_cast(ctx->parent); + ctx = downCast(ctx->parent); } if (following.contains(Token::EPSILON) && symbol == EOF) { @@ -543,9 +562,10 @@ std::vector Parser::getRuleInvocationStack(RuleContext *p) { } else { stack.push_back(ruleNames[ruleIndex]); } - if (p->parent == nullptr) + if (!RuleContext::is(run->parent)) { break; - run = dynamic_cast(run->parent); + } + run = downCast(run->parent); } return stack; } @@ -589,12 +609,12 @@ std::string Parser::getSourceName() { } atn::ParseInfo Parser::getParseInfo() const { - atn::ProfilingATNSimulator *interp = getInterpreter(); - return atn::ParseInfo(interp); + atn::ParserATNSimulator *simulator = getInterpreter(); + return atn::ParseInfo(dynamic_cast(simulator)); } void Parser::setProfile(bool profile) { - atn::ParserATNSimulator *interp = getInterpreter(); + atn::ParserATNSimulator *interp = getInterpreter(); atn::PredictionMode saveMode = interp != nullptr ? interp->getPredictionMode() : atn::PredictionMode::LL; if (profile) { if (!is(interp)) { diff --git a/runtime/Cpp/runtime/src/Parser.h b/runtime/Cpp/runtime/src/Parser.h index 2cdd66689b..4d735da68d 100755 --- a/runtime/Cpp/runtime/src/Parser.h +++ b/runtime/Cpp/runtime/src/Parser.h @@ -448,12 +448,6 @@ namespace antlr4 { tree::ParseTreeTracker _tracker; private: - /// This field maps from the serialized ATN string to the deserialized with - /// bypass alternatives. - /// - /// - static std::map, atn::ATN> bypassAltsAtnCache; - /// When setTrace(true) is called, a reference to the /// TraceListener is stored here so it can be easily removed in a /// later call to setTrace(false). The listener itself is diff --git a/runtime/Cpp/runtime/src/ParserInterpreter.cpp b/runtime/Cpp/runtime/src/ParserInterpreter.cpp index 5d5d2ced77..e3be2d2c61 100755 --- a/runtime/Cpp/runtime/src/ParserInterpreter.cpp +++ b/runtime/Cpp/runtime/src/ParserInterpreter.cpp @@ -26,6 +26,7 @@ #include "tree/ErrorNode.h" #include "support/CPPUtils.h" +#include "support/Casts.h" #include "ParserInterpreter.h" @@ -35,19 +36,10 @@ using namespace antlr4::misc; using namespace antlrcpp; -ParserInterpreter::ParserInterpreter(const std::string &grammarFileName, const std::vector& tokenNames, - const std::vector& ruleNames, const atn::ATN &atn, TokenStream *input) - : ParserInterpreter(grammarFileName, dfa::Vocabulary::fromTokenNames(tokenNames), ruleNames, atn, input) { -} - ParserInterpreter::ParserInterpreter(const std::string &grammarFileName, const dfa::Vocabulary &vocabulary, const std::vector &ruleNames, const atn::ATN &atn, TokenStream *input) : Parser(input), _grammarFileName(grammarFileName), _atn(atn), _ruleNames(ruleNames), _vocabulary(vocabulary) { - for (size_t i = 0; i < atn.maxTokenType; ++i) { - _tokenNames.push_back(vocabulary.getDisplayName(i)); - } - // init decision DFA for (size_t i = 0; i < atn.getNumberOfDecisions(); ++i) { atn::DecisionState *decisionState = atn.getDecisionState(i); @@ -72,10 +64,6 @@ const atn::ATN& ParserInterpreter::getATN() const { return _atn; } -const std::vector& ParserInterpreter::getTokenNames() const { - return _tokenNames; -} - const dfa::Vocabulary& ParserInterpreter::getVocabulary() const { return _vocabulary; } @@ -102,7 +90,7 @@ ParserRuleContext* ParserInterpreter::parse(size_t startRuleIndex) { while (true) { atn::ATNState *p = getATNState(); switch (p->getStateType()) { - case atn::ATNState::RULE_STOP : + case atn::ATNStateType::RULE_STOP : // pop; return from rule if (_ctx->isEmpty()) { if (startRuleStartState->isLeftRecursiveRule) { @@ -161,16 +149,16 @@ atn::ATNState* ParserInterpreter::getATNState() { void ParserInterpreter::visitState(atn::ATNState *p) { size_t predictedAlt = 1; - if (is(p)) { - predictedAlt = visitDecisionState(dynamic_cast(p)); + if (DecisionState::is(p)) { + predictedAlt = visitDecisionState(downCast(p)); } - atn::Transition *transition = p->transitions[predictedAlt - 1]; - switch (transition->getSerializationType()) { - case atn::Transition::EPSILON: - if (p->getStateType() == ATNState::STAR_LOOP_ENTRY && - (dynamic_cast(p))->isPrecedenceDecision && - !is(transition->target)) { + const atn::Transition *transition = p->transitions[predictedAlt - 1].get(); + switch (transition->getTransitionType()) { + case atn::TransitionType::EPSILON: + if (p->getStateType() == ATNStateType::STAR_LOOP_ENTRY && + (downCast(p))->isPrecedenceDecision && + !LoopEndState::is(transition->target)) { // We are at the start of a left recursive rule's (...)* loop // and we're not taking the exit branch of loop. InterpreterRuleContext *localctx = createInterpreterRuleContext(_parentContextStack.top().first, @@ -179,56 +167,56 @@ void ParserInterpreter::visitState(atn::ATNState *p) { } break; - case atn::Transition::ATOM: - match(static_cast(static_cast(transition)->_label)); + case atn::TransitionType::ATOM: + match(static_cast(static_cast(transition)->_label)); break; - case atn::Transition::RANGE: - case atn::Transition::SET: - case atn::Transition::NOT_SET: + case atn::TransitionType::RANGE: + case atn::TransitionType::SET: + case atn::TransitionType::NOT_SET: if (!transition->matches(static_cast(_input->LA(1)), Token::MIN_USER_TOKEN_TYPE, Lexer::MAX_CHAR_VALUE)) { recoverInline(); } matchWildcard(); break; - case atn::Transition::WILDCARD: + case atn::TransitionType::WILDCARD: matchWildcard(); break; - case atn::Transition::RULE: + case atn::TransitionType::RULE: { atn::RuleStartState *ruleStartState = static_cast(transition->target); size_t ruleIndex = ruleStartState->ruleIndex; InterpreterRuleContext *newctx = createInterpreterRuleContext(_ctx, p->stateNumber, ruleIndex); if (ruleStartState->isLeftRecursiveRule) { - enterRecursionRule(newctx, ruleStartState->stateNumber, ruleIndex, static_cast(transition)->precedence); + enterRecursionRule(newctx, ruleStartState->stateNumber, ruleIndex, static_cast(transition)->precedence); } else { enterRule(newctx, transition->target->stateNumber, ruleIndex); } } break; - case atn::Transition::PREDICATE: + case atn::TransitionType::PREDICATE: { - atn::PredicateTransition *predicateTransition = static_cast(transition); - if (!sempred(_ctx, predicateTransition->ruleIndex, predicateTransition->predIndex)) { + const atn::PredicateTransition *predicateTransition = static_cast(transition); + if (!sempred(_ctx, predicateTransition->getRuleIndex(), predicateTransition->getPredIndex())) { throw FailedPredicateException(this); } } break; - case atn::Transition::ACTION: + case atn::TransitionType::ACTION: { - atn::ActionTransition *actionTransition = static_cast(transition); + const atn::ActionTransition *actionTransition = static_cast(transition); action(_ctx, actionTransition->ruleIndex, actionTransition->actionIndex); } break; - case atn::Transition::PRECEDENCE: + case atn::TransitionType::PRECEDENCE: { - if (!precpred(_ctx, static_cast(transition)->precedence)) { - throw FailedPredicateException(this, "precpred(_ctx, " + std::to_string(static_cast(transition)->precedence) + ")"); + if (!precpred(_ctx, static_cast(transition)->getPrecedence())) { + throw FailedPredicateException(this, "precpred(_ctx, " + std::to_string(static_cast(transition)->getPrecedence()) + ")"); } } break; @@ -272,7 +260,7 @@ void ParserInterpreter::visitRuleStopState(atn::ATNState *p) { exitRule(); } - atn::RuleTransition *ruleTransition = static_cast(_atn.states[getState()]->transitions[0]); + const atn::RuleTransition *ruleTransition = static_cast(_atn.states[getState()]->transitions[0].get()); setState(ruleTransition->followState->stateNumber); } diff --git a/runtime/Cpp/runtime/src/ParserInterpreter.h b/runtime/Cpp/runtime/src/ParserInterpreter.h index f25fc53741..a040d7caf4 100755 --- a/runtime/Cpp/runtime/src/ParserInterpreter.h +++ b/runtime/Cpp/runtime/src/ParserInterpreter.h @@ -9,6 +9,7 @@ #include "atn/ATN.h" #include "support/BitSet.h" #include "atn/PredictionContext.h" +#include "atn/PredictionContextCache.h" #include "Vocabulary.h" namespace antlr4 { @@ -29,9 +30,6 @@ namespace antlr4 { /// class ANTLR4CPP_PUBLIC ParserInterpreter : public Parser { public: - // @deprecated - ParserInterpreter(const std::string &grammarFileName, const std::vector& tokenNames, - const std::vector& ruleNames, const atn::ATN &atn, TokenStream *input); ParserInterpreter(const std::string &grammarFileName, const dfa::Vocabulary &vocabulary, const std::vector &ruleNames, const atn::ATN &atn, TokenStream *input); ~ParserInterpreter(); @@ -40,9 +38,6 @@ namespace antlr4 { virtual const atn::ATN& getATN() const override; - // @deprecated - virtual const std::vector& getTokenNames() const override; - virtual const dfa::Vocabulary& getVocabulary() const override; virtual const std::vector& getRuleNames() const override; @@ -110,7 +105,6 @@ namespace antlr4 { protected: const std::string _grammarFileName; - std::vector _tokenNames; const atn::ATN &_atn; std::vector _ruleNames; diff --git a/runtime/Cpp/runtime/src/ParserRuleContext.cpp b/runtime/Cpp/runtime/src/ParserRuleContext.cpp index b67b9a93d1..2cf143c324 100755 --- a/runtime/Cpp/runtime/src/ParserRuleContext.cpp +++ b/runtime/Cpp/runtime/src/ParserRuleContext.cpp @@ -9,6 +9,7 @@ #include "Parser.h" #include "Token.h" +#include "support/Casts.h" #include "support/CPPUtils.h" #include "ParserRuleContext.h" @@ -39,10 +40,9 @@ void ParserRuleContext::copyFrom(ParserRuleContext *ctx) { // copy any error nodes to alt label node if (!ctx->children.empty()) { for (auto *child : ctx->children) { - auto *errorNode = dynamic_cast(child); - if (errorNode != nullptr) { - errorNode->setParent(this); - children.push_back(errorNode); + if (ErrorNode::is(child)) { + downCast(child)->setParent(this); + children.push_back(child); } } @@ -76,39 +76,36 @@ void ParserRuleContext::removeLastChild() { } } -tree::TerminalNode* ParserRuleContext::getToken(size_t ttype, size_t i) { +tree::TerminalNode* ParserRuleContext::getToken(size_t ttype, size_t i) const { if (i >= children.size()) { return nullptr; } - size_t j = 0; // what token with ttype have we found? - for (auto *o : children) { - if (is(o)) { - tree::TerminalNode *tnode = dynamic_cast(o); - Token *symbol = tnode->getSymbol(); + for (auto *child : children) { + if (TerminalNode::is(child)) { + tree::TerminalNode *typedChild = downCast(child); + Token *symbol = typedChild->getSymbol(); if (symbol->getType() == ttype) { if (j++ == i) { - return tnode; + return typedChild; } } } } - return nullptr; } -std::vector ParserRuleContext::getTokens(size_t ttype) { - std::vector tokens; - for (auto &o : children) { - if (is(o)) { - tree::TerminalNode *tnode = dynamic_cast(o); - Token *symbol = tnode->getSymbol(); +std::vector ParserRuleContext::getTokens(size_t ttype) const { + std::vector tokens; + for (auto *child : children) { + if (TerminalNode::is(child)) { + tree::TerminalNode *typedChild = downCast(child); + Token *symbol = typedChild->getSymbol(); if (symbol->getType() == ttype) { - tokens.push_back(tnode); + tokens.push_back(typedChild); } } } - return tokens; } @@ -123,11 +120,11 @@ misc::Interval ParserRuleContext::getSourceInterval() { return misc::Interval(start->getTokenIndex(), stop->getTokenIndex()); } -Token* ParserRuleContext::getStart() { +Token* ParserRuleContext::getStart() const { return start; } -Token* ParserRuleContext::getStop() { +Token* ParserRuleContext::getStop() const { return stop; } diff --git a/runtime/Cpp/runtime/src/ParserRuleContext.h b/runtime/Cpp/runtime/src/ParserRuleContext.h index c9ffe17790..43528a2e91 100755 --- a/runtime/Cpp/runtime/src/ParserRuleContext.h +++ b/runtime/Cpp/runtime/src/ParserRuleContext.h @@ -67,7 +67,6 @@ namespace antlr4 { ParserRuleContext(); ParserRuleContext(ParserRuleContext *parent, size_t invokingStateNumber); - virtual ~ParserRuleContext() {} /** COPY a ctx (I'm deliberately not using copy constructor) to avoid * confusion with creating node with parent. Does not copy children @@ -88,23 +87,22 @@ namespace antlr4 { /// Used by enterOuterAlt to toss out a RuleContext previously added as /// we entered a rule. If we have # label, we will need to remove /// generic ruleContext object. - virtual void removeLastChild(); + void removeLastChild(); - virtual tree::TerminalNode* getToken(size_t ttype, std::size_t i); + tree::TerminalNode* getToken(size_t ttype, std::size_t i) const; - virtual std::vector getTokens(size_t ttype); + std::vector getTokens(size_t ttype) const; template - T* getRuleContext(size_t i) { - if (children.empty()) { - return nullptr; - } - + T* getRuleContext(size_t i) const { + static_assert(std::is_base_of_v, "T must be derived from RuleContext"); size_t j = 0; // what element have we found with ctxType? - for (auto &child : children) { - if (antlrcpp::is(child)) { - if (j++ == i) { - return dynamic_cast(child); + for (auto *child : children) { + if (RuleContext::is(child)) { + if (auto *typedChild = dynamic_cast(child); typedChild != nullptr) { + if (j++ == i) { + return typedChild; + } } } } @@ -112,14 +110,16 @@ namespace antlr4 { } template - std::vector getRuleContexts() { - std::vector contexts; + std::vector getRuleContexts() const { + static_assert(std::is_base_of_v, "T must be derived from RuleContext"); + std::vector contexts; for (auto *child : children) { - if (antlrcpp::is(child)) { - contexts.push_back(dynamic_cast(child)); + if (RuleContext::is(child)) { + if (auto *typedChild = dynamic_cast(child); typedChild != nullptr) { + contexts.push_back(typedChild); + } } } - return contexts; } @@ -130,14 +130,14 @@ namespace antlr4 { * Note that the range from start to stop is inclusive, so for rules that do not consume anything * (for example, zero length or error productions) this token may exceed stop. */ - virtual Token *getStart(); + Token* getStart() const; /** * Get the final token in this context. * Note that the range from start to stop is inclusive, so for rules that do not consume anything * (for example, zero length or error productions) this token may precede start. */ - virtual Token *getStop(); + Token* getStop() const; /// /// Used for rule context info debugging during parse-time, not so much for ATN debugging diff --git a/runtime/Cpp/runtime/src/RecognitionException.cpp b/runtime/Cpp/runtime/src/RecognitionException.cpp index 29c950819e..59ea48ad53 100755 --- a/runtime/Cpp/runtime/src/RecognitionException.cpp +++ b/runtime/Cpp/runtime/src/RecognitionException.cpp @@ -5,7 +5,6 @@ #include "atn/ATN.h" #include "Recognizer.h" -#include "support/StringUtils.h" #include "ParserRuleContext.h" #include "misc/IntervalSet.h" diff --git a/runtime/Cpp/runtime/src/Recognizer.cpp b/runtime/Cpp/runtime/src/Recognizer.cpp index 257619ba17..8a944619d5 100755 --- a/runtime/Cpp/runtime/src/Recognizer.cpp +++ b/runtime/Cpp/runtime/src/Recognizer.cpp @@ -6,11 +6,11 @@ #include "ConsoleErrorListener.h" #include "RecognitionException.h" #include "support/CPPUtils.h" -#include "support/StringUtils.h" #include "Token.h" #include "atn/ATN.h" #include "atn/ATNSimulator.h" #include "support/CPPUtils.h" +#include "support/StringUtils.h" #include "Vocabulary.h" @@ -19,7 +19,7 @@ using namespace antlr4; using namespace antlr4::atn; -std::map> Recognizer::_tokenTypeMapCache; +std::map> Recognizer::_tokenTypeMapCache; std::map, std::map> Recognizer::_ruleIndexMapCache; Recognizer::Recognizer() { @@ -30,31 +30,26 @@ Recognizer::Recognizer() { Recognizer::~Recognizer() { } -dfa::Vocabulary const& Recognizer::getVocabulary() const { - static dfa::Vocabulary vocabulary = dfa::Vocabulary::fromTokenNames(getTokenNames()); - return vocabulary; -} - -std::map Recognizer::getTokenTypeMap() { +std::map Recognizer::getTokenTypeMap() { const dfa::Vocabulary& vocabulary = getVocabulary(); std::lock_guard lck(_mutex); - std::map result; + std::map result; auto iterator = _tokenTypeMapCache.find(&vocabulary); if (iterator != _tokenTypeMapCache.end()) { result = iterator->second; } else { for (size_t i = 0; i <= getATN().maxTokenType; ++i) { - std::string literalName = vocabulary.getLiteralName(i); + std::string_view literalName = vocabulary.getLiteralName(i); if (!literalName.empty()) { result[literalName] = i; } - std::string symbolicName = vocabulary.getSymbolicName(i); + std::string_view symbolicName = vocabulary.getSymbolicName(i); if (!symbolicName.empty()) { result[symbolicName] = i; } - } + } result["EOF"] = EOF; _tokenTypeMapCache[&vocabulary] = result; } @@ -80,8 +75,8 @@ std::map Recognizer::getRuleIndexMap() { return result; } -size_t Recognizer::getTokenType(const std::string &tokenName) { - const std::map &map = getTokenTypeMap(); +size_t Recognizer::getTokenType(std::string_view tokenName) { + const std::map &map = getTokenTypeMap(); auto iterator = map.find(tokenName); if (iterator == map.end()) return Token::INVALID_TYPE; @@ -118,11 +113,13 @@ std::string Recognizer::getTokenErrorDisplay(Token *t) { } } - antlrcpp::replaceAll(s, "\n", "\\n"); - antlrcpp::replaceAll(s, "\r","\\r"); - antlrcpp::replaceAll(s, "\t", "\\t"); - - return "'" + s + "'"; + std::string result; + result.reserve(s.size() + 2); + result.push_back('\''); + antlrcpp::escapeWhitespace(result, s); + result.push_back('\''); + result.shrink_to_fit(); + return result; } void Recognizer::addErrorListener(ANTLRErrorListener *listener) { @@ -152,14 +149,6 @@ bool Recognizer::precpred(RuleContext * /*localctx*/, int /*precedence*/) { void Recognizer::action(RuleContext * /*localctx*/, size_t /*ruleIndex*/, size_t /*actionIndex*/) { } -size_t Recognizer::getState() const { - return _stateNumber; -} - -void Recognizer::setState(size_t atnState) { - _stateNumber = atnState; -} - void Recognizer::InitializeInstanceFields() { _stateNumber = ATNState::INVALID_STATE_NUMBER; _interpreter = nullptr; diff --git a/runtime/Cpp/runtime/src/Recognizer.h b/runtime/Cpp/runtime/src/Recognizer.h index 9c12891c2e..849075b360 100755 --- a/runtime/Cpp/runtime/src/Recognizer.h +++ b/runtime/Cpp/runtime/src/Recognizer.h @@ -7,18 +7,13 @@ #include "ProxyErrorListener.h" #include "support/Casts.h" +#include "atn/SerializedATNView.h" namespace antlr4 { class ANTLR4CPP_PUBLIC Recognizer { public: -#if __cplusplus >= 201703L static constexpr size_t EOF = std::numeric_limits::max(); -#else - enum : size_t { - EOF = static_cast(-1), // std::numeric_limits::max(); doesn't work in VS 2013. - }; -#endif Recognizer(); Recognizer(Recognizer const&) = delete; @@ -26,13 +21,6 @@ namespace antlr4 { Recognizer& operator=(Recognizer const&) = delete; - /** Used to print out token names like ID during debugging and - * error reporting. The generated parsers implement a method - * that overrides this to point to their String[] tokenNames. - * - * @deprecated Use {@link #getVocabulary()} instead. - */ - virtual std::vector const& getTokenNames() const = 0; virtual std::vector const& getRuleNames() const = 0; /** @@ -41,14 +29,14 @@ namespace antlr4 { * @return A {@link Vocabulary} instance providing information about the * vocabulary used by the grammar. */ - virtual dfa::Vocabulary const& getVocabulary() const; + virtual dfa::Vocabulary const& getVocabulary() const = 0; /// /// Get a map from token names to token types. ///

/// Used for XPath and tree pattern compilation. ///

- virtual std::map getTokenTypeMap(); + virtual std::map getTokenTypeMap(); /// /// Get a map from rule names to rule indexes. @@ -57,7 +45,7 @@ namespace antlr4 { /// virtual std::map getRuleIndexMap(); - virtual size_t getTokenType(const std::string &tokenName); + virtual size_t getTokenType(std::string_view tokenName); /// /// If this recognizer was generated, it will have a serialized ATN @@ -66,7 +54,7 @@ namespace antlr4 { /// For interpreters, we don't know their serialized ATN despite having /// created the interpreter from it. /// - virtual const std::vector getSerializedATN() const { + virtual atn::SerializedATNView getSerializedATN() const { throw "there is no serialized ATN"; } @@ -126,7 +114,7 @@ namespace antlr4 { virtual void action(RuleContext *localctx, size_t ruleIndex, size_t actionIndex); - virtual size_t getState() const ; + size_t getState() const { return _stateNumber; } // Get the ATN used by the recognizer for prediction. virtual const atn::ATN& getATN() const = 0; @@ -139,7 +127,7 @@ namespace antlr4 { /// invoking rules. Combine this and we have complete ATN /// configuration information. /// - void setState(size_t atnState); + void setState(size_t atnState) { _stateNumber = atnState; } virtual IntStream* getInputStream() = 0; @@ -157,7 +145,7 @@ namespace antlr4 { std::mutex _mutex; private: - static std::map> _tokenTypeMapCache; + static std::map> _tokenTypeMapCache; static std::map, std::map> _ruleIndexMapCache; ProxyErrorListener _proxListener; // Manages a collection of listeners. diff --git a/runtime/Cpp/runtime/src/RuleContext.cpp b/runtime/Cpp/runtime/src/RuleContext.cpp index 467e5ec427..3ed945fc1b 100755 --- a/runtime/Cpp/runtime/src/RuleContext.cpp +++ b/runtime/Cpp/runtime/src/RuleContext.cpp @@ -14,12 +14,13 @@ using namespace antlr4; using namespace antlr4::atn; +using namespace antlr4::tree; -RuleContext::RuleContext() { +RuleContext::RuleContext() : ParseTree(ParseTreeType::RULE) { InitializeInstanceFields(); } -RuleContext::RuleContext(RuleContext *parent_, size_t invokingState_) { +RuleContext::RuleContext(RuleContext *parent_, size_t invokingState_) : ParseTree(ParseTreeType::RULE) { InitializeInstanceFields(); this->parent = parent_; this->invokingState = invokingState_; @@ -71,7 +72,7 @@ size_t RuleContext::getAltNumber() const { void RuleContext::setAltNumber(size_t /*altNumber*/) { } -antlrcpp::Any RuleContext::accept(tree::ParseTreeVisitor *visitor) { +std::any RuleContext::accept(tree::ParseTreeVisitor *visitor) { return visitor->visitChildren(this); } diff --git a/runtime/Cpp/runtime/src/RuleContext.h b/runtime/Cpp/runtime/src/RuleContext.h index 9ee0d2defd..117f90b2d6 100755 --- a/runtime/Cpp/runtime/src/RuleContext.h +++ b/runtime/Cpp/runtime/src/RuleContext.h @@ -61,6 +61,10 @@ namespace antlr4 { */ class ANTLR4CPP_PUBLIC RuleContext : public tree::ParseTree { public: + static bool is(const tree::ParseTree &parseTree) { return parseTree.getTreeType() == tree::ParseTreeType::RULE; } + + static bool is(const tree::ParseTree *parseTree) { return parseTree != nullptr && is(*parseTree); } + /// What state invoked the rule associated with this context? /// The "return address" is the followState of invokingState /// If parent is null, this should be -1 and this context object represents the start rule. @@ -103,7 +107,7 @@ namespace antlr4 { */ virtual void setAltNumber(size_t altNumber); - virtual antlrcpp::Any accept(tree::ParseTreeVisitor *visitor) override; + virtual std::any accept(tree::ParseTreeVisitor *visitor) override; /// /// Print out a whole tree, not just a node, in LISP format diff --git a/runtime/Cpp/runtime/src/RuntimeMetaData.cpp b/runtime/Cpp/runtime/src/RuntimeMetaData.cpp index 3c7f612dd6..cf30d68587 100755 --- a/runtime/Cpp/runtime/src/RuntimeMetaData.cpp +++ b/runtime/Cpp/runtime/src/RuntimeMetaData.cpp @@ -4,10 +4,11 @@ */ #include "RuntimeMetaData.h" +#include "Version.h" using namespace antlr4; -const std::string RuntimeMetaData::VERSION = "4.9.3"; +const std::string RuntimeMetaData::VERSION = ANTLRCPP_VERSION_STRING; std::string RuntimeMetaData::getRuntimeVersion() { return VERSION; diff --git a/runtime/Cpp/runtime/src/Token.h b/runtime/Cpp/runtime/src/Token.h index 1878b28a1a..6f3fa76c12 100755 --- a/runtime/Cpp/runtime/src/Token.h +++ b/runtime/Cpp/runtime/src/Token.h @@ -14,50 +14,24 @@ namespace antlr4 { /// we obtained this token. class ANTLR4CPP_PUBLIC Token { public: -#if __cplusplus >= 201703L static constexpr size_t INVALID_TYPE = 0; -#else - enum : size_t { - INVALID_TYPE = 0, - }; -#endif /// During lookahead operations, this "token" signifies we hit rule end ATN state /// and did not follow it despite needing to. -#if __cplusplus >= 201703L static constexpr size_t EPSILON = std::numeric_limits::max() - 1; static constexpr size_t MIN_USER_TOKEN_TYPE = 1; static constexpr size_t EOF = IntStream::EOF; -#else - enum : size_t { - EPSILON = static_cast(-2), // std::numeric_limits::max() - 1; doesn't work in VS 2013 - MIN_USER_TOKEN_TYPE = 1, - EOF = IntStream::EOF, - }; -#endif virtual ~Token(); /// All tokens go to the parser (unless skip() is called in that rule) /// on a particular "channel". The parser tunes to a particular channel /// so that whitespace etc... can go to the parser on a "hidden" channel. -#if __cplusplus >= 201703L static constexpr size_t DEFAULT_CHANNEL = 0; -#else - enum : size_t { - DEFAULT_CHANNEL = 0, - }; -#endif /// Anything on different channel than DEFAULT_CHANNEL is not parsed /// by parser. -#if __cplusplus >= 201703L static constexpr size_t HIDDEN_CHANNEL = 1; -#else - enum : size_t { - HIDDEN_CHANNEL = 1, - }; -#endif /** * This is the minimum constant value which can be assigned to a @@ -70,13 +44,7 @@ namespace antlr4 { * * @see Token#getChannel() */ -#if __cplusplus >= 201703L static constexpr size_t MIN_USER_CHANNEL_VALUE = 2; -#else - enum : size_t { - MIN_USER_CHANNEL_VALUE = 2, - }; -#endif /// Get the text of the token. virtual std::string getText() const = 0; diff --git a/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp b/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp index 3ccbed757f..1740b1178e 100755 --- a/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp +++ b/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp @@ -93,7 +93,7 @@ TokenStreamRewriter::TokenStreamRewriter(TokenStream *tokens_) : tokens(tokens_) } TokenStreamRewriter::~TokenStreamRewriter() { - for (auto program : _programs) { + for (const auto &program : _programs) { for (auto *operation : program.second) { delete operation; } diff --git a/runtime/Cpp/runtime/src/TokenStreamRewriter.h b/runtime/Cpp/runtime/src/TokenStreamRewriter.h index 561607a36d..db6a863a9f 100755 --- a/runtime/Cpp/runtime/src/TokenStreamRewriter.h +++ b/runtime/Cpp/runtime/src/TokenStreamRewriter.h @@ -5,6 +5,8 @@ #pragma once +#include "antlr4-common.h" + namespace antlr4 { /** @@ -86,15 +88,8 @@ namespace antlr4 { class ANTLR4CPP_PUBLIC TokenStreamRewriter { public: static const std::string DEFAULT_PROGRAM_NAME; -#if __cplusplus >= 201703L static constexpr size_t PROGRAM_INIT_SIZE = 100; static constexpr size_t MIN_TOKEN_INDEX = 0; -#else - enum : size_t { - PROGRAM_INIT_SIZE = 100, - MIN_TOKEN_INDEX = 0, - }; -#endif TokenStreamRewriter(TokenStream *tokens); virtual ~TokenStreamRewriter(); diff --git a/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp b/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp index 1f18d38431..fd234de099 100755 --- a/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp +++ b/runtime/Cpp/runtime/src/UnbufferedCharStream.cpp @@ -5,7 +5,7 @@ #include "misc/Interval.h" #include "Exceptions.h" -#include "support/StringUtils.h" +#include "support/Utf8.h" #include "UnbufferedCharStream.h" @@ -13,9 +13,8 @@ using namespace antlrcpp; using namespace antlr4; using namespace antlr4::misc; -UnbufferedCharStream::UnbufferedCharStream(std::wistream &input) : _input(input) { - InitializeInstanceFields(); - +UnbufferedCharStream::UnbufferedCharStream(std::wistream &input) + : _p(0), _numMarkers(0), _lastChar(0), _lastCharBufferStart(0), _currentCharIndex(0), _input(input) { // The vector's size is what used to be n in Java code. fill(1); // prime } @@ -74,9 +73,7 @@ size_t UnbufferedCharStream::fill(size_t n) { } char32_t UnbufferedCharStream::nextChar() { - wchar_t result = 0; - _input >> result; - return result; + return _input.get(); } void UnbufferedCharStream::add(char32_t c) { @@ -101,7 +98,7 @@ size_t UnbufferedCharStream::LA(ssize_t i) { return EOF; } - if (_data[static_cast(index)] == 0xFFFF) { + if (_data[static_cast(index)] == std::char_traits::eof()) { return EOF; } @@ -178,7 +175,7 @@ std::string UnbufferedCharStream::getSourceName() const { } std::string UnbufferedCharStream::getText(const misc::Interval &interval) { - if (interval.a < 0 || interval.b >= interval.a - 1) { + if (interval.a < 0 || interval.b < interval.a - 1) { throw IllegalArgumentException("invalid interval"); } @@ -195,17 +192,17 @@ std::string UnbufferedCharStream::getText(const misc::Interval &interval) { } // convert from absolute to local index size_t i = interval.a - bufferStartIndex; - return utf32_to_utf8(_data.substr(i, interval.length())); + auto maybeUtf8 = Utf8::strictEncode(std::u32string_view(_data).substr(i, interval.length())); + if (!maybeUtf8.has_value()) { + throw IllegalArgumentException("Unbuffered stream contains invalid Unicode code points"); + } + return std::move(maybeUtf8).value(); } -size_t UnbufferedCharStream::getBufferStartIndex() const { - return _currentCharIndex - _p; +std::string UnbufferedCharStream::toString() const { + throw UnsupportedOperationException("Unbuffered stream cannot be materialized to a string"); } -void UnbufferedCharStream::InitializeInstanceFields() { - _p = 0; - _numMarkers = 0; - _lastChar = 0; - _lastCharBufferStart = 0; - _currentCharIndex = 0; +size_t UnbufferedCharStream::getBufferStartIndex() const { + return _currentCharIndex - _p; } diff --git a/runtime/Cpp/runtime/src/UnbufferedCharStream.h b/runtime/Cpp/runtime/src/UnbufferedCharStream.h index 98cdcc6142..a65c6ca054 100755 --- a/runtime/Cpp/runtime/src/UnbufferedCharStream.h +++ b/runtime/Cpp/runtime/src/UnbufferedCharStream.h @@ -18,10 +18,10 @@ namespace antlr4 { /// The name or source of this char stream. std::string name; - UnbufferedCharStream(std::wistream &input); + explicit UnbufferedCharStream(std::wistream &input); - virtual void consume() override; - virtual size_t LA(ssize_t i) override; + void consume() override; + size_t LA(ssize_t i) override; /// /// Return a marker that we can release later. @@ -30,35 +30,32 @@ namespace antlr4 { /// protection against misuse where {@code seek()} is called on a mark or /// {@code release()} is called in the wrong order. /// - virtual ssize_t mark() override; + ssize_t mark() override; /// /// Decrement number of markers, resetting buffer if we hit 0. /// - virtual void release(ssize_t marker) override; - virtual size_t index() override; + void release(ssize_t marker) override; + size_t index() override; /// /// Seek to absolute character index, which might not be in the current /// sliding window. Move {@code p} to {@code index-bufferStartIndex}. /// - virtual void seek(size_t index) override; - virtual size_t size() override; - virtual std::string getSourceName() const override; - virtual std::string getText(const misc::Interval &interval) override; + void seek(size_t index) override; + size_t size() override; + std::string getSourceName() const override; + std::string getText(const misc::Interval &interval) override; + + std::string toString() const override; protected: /// A moving window buffer of the data being scanned. While there's a marker, /// we keep adding to buffer. Otherwise, resets so /// we start filling at index 0 again. // UTF-32 encoded. -#if defined(_MSC_VER) && _MSC_VER == 1900 - i32string _data; // Custom type for VS 2015. - typedef __int32 storage_type; -#else std::u32string _data; typedef char32_t storage_type; -#endif /// /// 0..n-1 index into of next character. @@ -115,9 +112,6 @@ namespace antlr4 { virtual char32_t nextChar(); virtual void add(char32_t c); size_t getBufferStartIndex() const; - - private: - void InitializeInstanceFields(); }; } // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/Version.h b/runtime/Cpp/runtime/src/Version.h new file mode 100644 index 0000000000..e14a0f6641 --- /dev/null +++ b/runtime/Cpp/runtime/src/Version.h @@ -0,0 +1,42 @@ +// Copyright 2012-2022 The ANTLR Project +// +// 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 name of the copyright holder 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 HOLDER 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. + +#pragma once + +#include "antlr4-common.h" + +#define ANTLRCPP_VERSION_MAJOR 4 +#define ANTLRCPP_VERSION_MINOR 9 +#define ANTLRCPP_VERSION_PATCH 3 + +#define ANTLRCPP_MAKE_VERSION(major, minor, patch) ((major) * 100000 + (minor) * 1000 + (patch)) + +#define ANTLRCPP_VERSION \ + ANTLRCPP_MAKE_VERSION(ANTLR4CPP_VERSION_MAJOR, ANTLR4CPP_VERSION_MINOR, ANTLR4CPP_VERSION_PATCH) + +#define ANTLRCPP_VERSION_STRING \ + ANTLR4CPP_STRINGIFY(ANTLR4CPP_VERSION_MAJOR) "." \ + ANTLR4CPP_STRINGIFY(ANTLR4CPP_VERSION_MINOR) "." \ + ANTLR4CPP_STRINGIFY(ANTLR4CPP_VERSION_PATCH) diff --git a/runtime/Cpp/runtime/src/Vocabulary.cpp b/runtime/Cpp/runtime/src/Vocabulary.cpp index 9bbf0b23a2..0f783d5d79 100755 --- a/runtime/Cpp/runtime/src/Vocabulary.cpp +++ b/runtime/Cpp/runtime/src/Vocabulary.cpp @@ -11,50 +11,18 @@ using namespace antlr4::dfa; const Vocabulary Vocabulary::EMPTY_VOCABULARY; -Vocabulary::Vocabulary(const std::vector &literalNames, const std::vector &symbolicNames) -: Vocabulary(literalNames, symbolicNames, {}) { +Vocabulary::Vocabulary(std::vector literalNames, std::vector symbolicNames) +: Vocabulary(std::move(literalNames), std::move(symbolicNames), {}) { } -Vocabulary::Vocabulary(const std::vector &literalNames, - const std::vector &symbolicNames, const std::vector &displayNames) - : _literalNames(literalNames), _symbolicNames(symbolicNames), _displayNames(displayNames), +Vocabulary::Vocabulary(std::vector literalNames, + std::vector symbolicNames, std::vector displayNames) + : _literalNames(std::move(literalNames)), _symbolicNames(std::move(symbolicNames)), _displayNames(std::move(displayNames)), _maxTokenType(std::max(_displayNames.size(), std::max(_literalNames.size(), _symbolicNames.size())) - 1) { // See note here on -1 part: https://github.com/antlr/antlr4/pull/1146 } -Vocabulary::~Vocabulary() = default; - -Vocabulary Vocabulary::fromTokenNames(const std::vector &tokenNames) { - if (tokenNames.empty()) { - return EMPTY_VOCABULARY; - } - - std::vector literalNames = tokenNames; - std::vector symbolicNames = tokenNames; - std::locale locale; - for (size_t i = 0; i < tokenNames.size(); i++) { - const std::string& tokenName = tokenNames[i]; - if (tokenName.empty()) { - continue; - } else if (tokenName.front() == '\'') { - symbolicNames[i].clear(); - } else if (std::isupper(tokenName.front(), locale)) { - literalNames[i].clear(); - } else { - // wasn't a literal or symbolic name - literalNames[i].clear(); - symbolicNames[i].clear(); - } - } - - return Vocabulary(literalNames, symbolicNames, tokenNames); -} - -size_t Vocabulary::getMaxTokenType() const { - return _maxTokenType; -} - -std::string Vocabulary::getLiteralName(size_t tokenType) const { +std::string_view Vocabulary::getLiteralName(size_t tokenType) const { if (tokenType < _literalNames.size()) { return _literalNames[tokenType]; } @@ -62,7 +30,7 @@ std::string Vocabulary::getLiteralName(size_t tokenType) const { return ""; } -std::string Vocabulary::getSymbolicName(size_t tokenType) const { +std::string_view Vocabulary::getSymbolicName(size_t tokenType) const { if (tokenType == Token::EOF) { return "EOF"; } @@ -76,20 +44,20 @@ std::string Vocabulary::getSymbolicName(size_t tokenType) const { std::string Vocabulary::getDisplayName(size_t tokenType) const { if (tokenType < _displayNames.size()) { - std::string displayName = _displayNames[tokenType]; + std::string_view displayName = _displayNames[tokenType]; if (!displayName.empty()) { - return displayName; + return std::string(displayName); } } - std::string literalName = getLiteralName(tokenType); + std::string_view literalName = getLiteralName(tokenType); if (!literalName.empty()) { - return literalName; + return std::string(literalName); } - std::string symbolicName = getSymbolicName(tokenType); + std::string_view symbolicName = getSymbolicName(tokenType); if (!symbolicName.empty()) { - return symbolicName; + return std::string(symbolicName); } return std::to_string(tokenType); diff --git a/runtime/Cpp/runtime/src/Vocabulary.h b/runtime/Cpp/runtime/src/Vocabulary.h index e8924bf171..af5b243880 100755 --- a/runtime/Cpp/runtime/src/Vocabulary.h +++ b/runtime/Cpp/runtime/src/Vocabulary.h @@ -12,7 +12,7 @@ namespace dfa { /// This class provides a default implementation of the /// interface. - class ANTLR4CPP_PUBLIC Vocabulary { + class ANTLR4CPP_PUBLIC Vocabulary final { public: /// Gets an empty instance. /// @@ -20,11 +20,11 @@ namespace dfa { /// No literal or symbol names are assigned to token types, so /// returns the numeric value for all tokens /// except . - static const Vocabulary EMPTY_VOCABULARY; + [[deprecated("Use the default constructor of Vocabulary instead.")]] static const Vocabulary EMPTY_VOCABULARY; Vocabulary() {} - Vocabulary(Vocabulary const&) = default; - virtual ~Vocabulary(); + + Vocabulary(const Vocabulary&) = default; /// /// Constructs a new instance of from the specified @@ -37,7 +37,7 @@ namespace dfa { /// /// /// - Vocabulary(const std::vector &literalNames, const std::vector &symbolicNames); + Vocabulary(std::vector literalNames, std::vector symbolicNames); /// /// Constructs a new instance of from the specified @@ -55,29 +55,14 @@ namespace dfa { /// /// /// - Vocabulary(const std::vector &literalNames, const std::vector &symbolicNames, - const std::vector &displayNames); - - /// - /// Returns a instance from the specified set of token - /// names. This method acts as a compatibility layer for the single - /// {@code tokenNames} array generated by previous releases of ANTLR. - /// - /// The resulting vocabulary instance returns {@code null} for - /// and , and the - /// value from {@code tokenNames} for the display names. - /// - /// The token names, or {@code null} if no token names are - /// available. - /// A instance which uses {@code tokenNames} for - /// the display names of tokens. - static Vocabulary fromTokenNames(const std::vector &tokenNames); + Vocabulary(std::vector literalNames, std::vector symbolicNames, + std::vector displayNames); /// /// Returns the highest token type value. It can be used to iterate from /// zero to that number, inclusively, thus querying all stored entries. /// the highest token type value - virtual size_t getMaxTokenType() const; + constexpr size_t getMaxTokenType() const { return _maxTokenType; } /// /// Gets the string literal associated with a token type. The string returned @@ -114,7 +99,7 @@ namespace dfa { /// /// The string literal associated with the specified token type, or /// {@code null} if no string literal is associated with the type. - virtual std::string getLiteralName(size_t tokenType) const; + std::string_view getLiteralName(size_t tokenType) const; /// /// Gets the symbolic name associated with a token type. The string returned @@ -158,7 +143,7 @@ namespace dfa { /// /// The symbolic name associated with the specified token type, or /// {@code null} if no symbolic name is associated with the type. - virtual std::string getSymbolicName(size_t tokenType) const; + std::string_view getSymbolicName(size_t tokenType) const; /// /// Gets the display name of a token type. @@ -179,7 +164,7 @@ namespace dfa { /// /// The display name of the token type, for use in error reporting or /// other user-visible messages which reference specific token types. - virtual std::string getDisplayName(size_t tokenType) const; + std::string getDisplayName(size_t tokenType) const; private: std::vector const _literalNames; diff --git a/runtime/Cpp/runtime/src/antlr4-common.h b/runtime/Cpp/runtime/src/antlr4-common.h index b2d6ab4a2b..4af009ed13 100644 --- a/runtime/Cpp/runtime/src/antlr4-common.h +++ b/runtime/Cpp/runtime/src/antlr4-common.h @@ -6,38 +6,34 @@ #pragma once #include -#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include -#include #include #include +#include #include -#include -#include -#include +#include #include #include #include +#include #include #include #include #include #include #include -#include -#include -#include -#include - -#ifndef USE_UTF8_INSTEAD_OF_CODECVT - #include -#endif // Defines for the Guid class and other platform dependent stuff. #ifdef _WIN32 @@ -51,25 +47,12 @@ #endif #endif - #define GUID_WINDOWS - #ifdef _WIN64 typedef __int64 ssize_t; #else typedef __int32 ssize_t; #endif - #if _MSC_VER >= 1900 && _MSC_VER < 2000 - // VS 2015 has a known bug when using std::codecvt_utf8 - // so we have to temporarily use __int32 instead. - // https://connect.microsoft.com/VisualStudio/feedback/details/1403302/unresolved-external-when-using-codecvt-utf8 - typedef std::basic_string<__int32> i32string; - - typedef i32string UTF32String; - #else - typedef std::u32string UTF32String; - #endif - #ifdef ANTLR4CPP_EXPORTS #define ANTLR4CPP_PUBLIC __declspec(dllexport) #else @@ -80,26 +63,13 @@ #endif #endif - #if defined(_MSC_VER) && !defined(__clang__) - // clang-cl should escape this to prevent [ignored-attributes]. - namespace std { - class ANTLR4CPP_PUBLIC exception; // Prevents warning C4275 from MSVC. - } // namespace std - #endif - #elif defined(__APPLE__) - typedef std::u32string UTF32String; - - #define GUID_CFUUID #if __GNUC__ >= 4 #define ANTLR4CPP_PUBLIC __attribute__ ((visibility ("default"))) #else #define ANTLR4CPP_PUBLIC #endif #else - typedef std::u32string UTF32String; - - #define GUID_LIBUUID #if __GNUC__ >= 6 #define ANTLR4CPP_PUBLIC __attribute__ ((visibility ("default"))) #else @@ -107,27 +77,16 @@ #endif #endif -#include "support/Guid.h" -#include "support/Declarations.h" +#ifdef __has_builtin +#define ANTLR4CPP_HAVE_BUILTIN(x) __has_builtin(x) +#else +#define ANTLR4CPP_HAVE_BUILTIN(x) 0 +#endif -#if !defined(HAS_NOEXCEPT) - #if defined(__clang__) - #if __has_feature(cxx_noexcept) - #define HAS_NOEXCEPT - #endif - #else - #if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 || \ - defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 - #define HAS_NOEXCEPT - #endif - #endif +#define ANTLR4CPP_INTERNAL_STRINGIFY(x) #x +#define ANTLR4CPP_STRINGIFY(x) ANTLR4CPP_INTERNAL_STRINGIFY(x) - #ifdef HAS_NOEXCEPT - #define NOEXCEPT noexcept - #else - #define NOEXCEPT - #endif -#endif +#include "support/Declarations.h" // We have to undefine this symbol as ANTLR will use this name for own members and even // generated functions. Because EOF is a global macro we cannot use e.g. a namespace scope to disambiguate. diff --git a/runtime/Cpp/runtime/src/antlr4-runtime.h b/runtime/Cpp/runtime/src/antlr4-runtime.h index 03e110bfc5..516bfc0970 100644 --- a/runtime/Cpp/runtime/src/antlr4-runtime.h +++ b/runtime/Cpp/runtime/src/antlr4-runtime.h @@ -49,6 +49,7 @@ #include "TokenStreamRewriter.h" #include "UnbufferedCharStream.h" #include "UnbufferedTokenStream.h" +#include "Version.h" #include "Vocabulary.h" #include "Vocabulary.h" #include "WritableToken.h" @@ -57,11 +58,9 @@ #include "atn/ATNConfigSet.h" #include "atn/ATNDeserializationOptions.h" #include "atn/ATNDeserializer.h" -#include "atn/ATNSerializer.h" #include "atn/ATNSimulator.h" #include "atn/ATNState.h" #include "atn/ATNType.h" -#include "atn/AbstractPredicateTransition.h" #include "atn/ActionTransition.h" #include "atn/AmbiguityInfo.h" #include "atn/ArrayPredictionContext.h" @@ -74,7 +73,6 @@ #include "atn/DecisionEventInfo.h" #include "atn/DecisionInfo.h" #include "atn/DecisionState.h" -#include "atn/EmptyPredictionContext.h" #include "atn/EpsilonTransition.h" #include "atn/ErrorInfo.h" #include "atn/LL1Analyzer.h" @@ -98,12 +96,16 @@ #include "atn/OrderedATNConfigSet.h" #include "atn/ParseInfo.h" #include "atn/ParserATNSimulator.h" +#include "atn/ParserATNSimulatorOptions.h" #include "atn/PlusBlockStartState.h" #include "atn/PlusLoopbackState.h" #include "atn/PrecedencePredicateTransition.h" #include "atn/PredicateEvalInfo.h" #include "atn/PredicateTransition.h" #include "atn/PredictionContext.h" +#include "atn/PredictionContextCache.h" +#include "atn/PredictionContextMergeCache.h" +#include "atn/PredictionContextMergeCacheOptions.h" #include "atn/PredictionMode.h" #include "atn/ProfilingATNSimulator.h" #include "atn/RangeTransition.h" @@ -111,6 +113,7 @@ #include "atn/RuleStopState.h" #include "atn/RuleTransition.h" #include "atn/SemanticContext.h" +#include "atn/SerializedATNView.h" #include "atn/SetTransition.h" #include "atn/SingletonPredictionContext.h" #include "atn/StarBlockStartState.h" @@ -133,8 +136,6 @@ #include "support/BitSet.h" #include "support/Casts.h" #include "support/CPPUtils.h" -#include "support/StringUtils.h" -#include "support/Guid.h" #include "tree/AbstractParseTreeVisitor.h" #include "tree/ErrorNode.h" #include "tree/ErrorNodeImpl.h" diff --git a/runtime/Cpp/runtime/src/atn/ATN.cpp b/runtime/Cpp/runtime/src/atn/ATN.cpp index 2334e6bca7..20a320d8e2 100755 --- a/runtime/Cpp/runtime/src/atn/ATN.cpp +++ b/runtime/Cpp/runtime/src/atn/ATN.cpp @@ -20,24 +20,9 @@ using namespace antlr4; using namespace antlr4::atn; using namespace antlrcpp; -ATN::ATN() : ATN(ATNType::LEXER, 0) { -} +ATN::ATN() : ATN(ATNType::LEXER, 0) {} -ATN::ATN(ATN &&other) { - // All source vectors are implicitly cleared by the moves. - states = std::move(other.states); - decisionToState = std::move(other.decisionToState); - ruleToStartState = std::move(other.ruleToStartState); - ruleToStopState = std::move(other.ruleToStopState); - grammarType = std::move(other.grammarType); - maxTokenType = std::move(other.maxTokenType); - ruleToTokenType = std::move(other.ruleToTokenType); - lexerActions = std::move(other.lexerActions); - modeToStartState = std::move(other.modeToStartState); -} - -ATN::ATN(ATNType grammarType_, size_t maxTokenType_) : grammarType(grammarType_), maxTokenType(maxTokenType_) { -} +ATN::ATN(ATNType grammarType_, size_t maxTokenType_) : grammarType(grammarType_), maxTokenType(maxTokenType_) {} ATN::~ATN() { for (ATNState *state : states) { @@ -45,42 +30,6 @@ ATN::~ATN() { } } -/** - * Required to be defined (even though not used) as we have an explicit move assignment operator. - */ -ATN& ATN::operator = (ATN &other) NOEXCEPT { - states = other.states; - decisionToState = other.decisionToState; - ruleToStartState = other.ruleToStartState; - ruleToStopState = other.ruleToStopState; - grammarType = other.grammarType; - maxTokenType = other.maxTokenType; - ruleToTokenType = other.ruleToTokenType; - lexerActions = other.lexerActions; - modeToStartState = other.modeToStartState; - - return *this; -} - -/** - * Explicit move assignment operator to make this the preferred assignment. With implicit copy/move assignment - * operators it seems the copy operator is preferred causing trouble when releasing the allocated ATNState instances. - */ -ATN& ATN::operator = (ATN &&other) NOEXCEPT { - // All source vectors are implicitly cleared by the moves. - states = std::move(other.states); - decisionToState = std::move(other.decisionToState); - ruleToStartState = std::move(other.ruleToStartState); - ruleToStopState = std::move(other.ruleToStopState); - grammarType = std::move(other.grammarType); - maxTokenType = std::move(other.maxTokenType); - ruleToTokenType = std::move(other.ruleToTokenType); - lexerActions = std::move(other.lexerActions); - modeToStartState = std::move(other.modeToStartState); - - return *this; -} - misc::IntervalSet ATN::nextTokens(ATNState *s, RuleContext *ctx) const { LL1Analyzer analyzer(*this); return analyzer.LOOK(s, ctx); @@ -89,7 +38,7 @@ misc::IntervalSet ATN::nextTokens(ATNState *s, RuleContext *ctx) const { misc::IntervalSet const& ATN::nextTokens(ATNState *s) const { if (!s->_nextTokenUpdated) { - std::unique_lock lock { _mutex }; + std::unique_lock lock(_mutex); if (!s->_nextTokenUpdated) { s->_nextTokenWithinRule = nextTokens(s, nullptr); s->_nextTokenUpdated = true; @@ -146,7 +95,7 @@ misc::IntervalSet ATN::getExpectedTokens(size_t stateNumber, RuleContext *contex expected.remove(Token::EPSILON); while (ctx && ctx->invokingState != ATNState::INVALID_STATE_NUMBER && following.contains(Token::EPSILON)) { ATNState *invokingState = states.at(ctx->invokingState); - RuleTransition *rt = static_cast(invokingState->transitions[0]); + const RuleTransition *rt = static_cast(invokingState->transitions[0].get()); following = nextTokens(rt->followState); expected.addAll(following); expected.remove(Token::EPSILON); diff --git a/runtime/Cpp/runtime/src/atn/ATN.h b/runtime/Cpp/runtime/src/atn/ATN.h index 616834bf6d..b8a93e0e47 100755 --- a/runtime/Cpp/runtime/src/atn/ATN.h +++ b/runtime/Cpp/runtime/src/atn/ATN.h @@ -16,21 +16,27 @@ namespace antlr4 { namespace atn { + class LexerATNSimulator; + class ParserATNSimulator; + class ANTLR4CPP_PUBLIC ATN { public: -#if __cplusplus >= 201703L static constexpr size_t INVALID_ALT_NUMBER = 0; -#else - enum : size_t { - INVALID_ALT_NUMBER = 0, - }; -#endif /// Used for runtime deserialization of ATNs from strings. ATN(); - ATN(ATN &&other); + ATN(ATNType grammarType, size_t maxTokenType); - virtual ~ATN(); + + ATN(const ATN&) = delete; + + ATN(ATN&&) = delete; + + ~ATN(); + + ATN& operator=(const ATN&) = delete; + + ATN& operator=(ATN&&) = delete; std::vector states; @@ -62,37 +68,34 @@ namespace atn { /// For lexer ATNs, this is an array of {@link LexerAction} objects which may /// be referenced by action transitions in the ATN. - std::vector> lexerActions; + std::vector> lexerActions; std::vector modeToStartState; - ATN& operator = (ATN &other) NOEXCEPT; - ATN& operator = (ATN &&other) NOEXCEPT; - /// /// Compute the set of valid tokens that can occur starting in state {@code s}. /// If {@code ctx} is null, the set of tokens will not include what can follow /// the rule surrounding {@code s}. In other words, the set will be /// restricted to tokens reachable staying within {@code s}'s rule. /// - virtual misc::IntervalSet nextTokens(ATNState *s, RuleContext *ctx) const; + misc::IntervalSet nextTokens(ATNState *s, RuleContext *ctx) const; /// /// Compute the set of valid tokens that can occur starting in {@code s} and /// staying in same rule. is in set if we reach end of /// rule. /// - virtual misc::IntervalSet const& nextTokens(ATNState *s) const; + misc::IntervalSet const& nextTokens(ATNState *s) const; - virtual void addState(ATNState *state); + void addState(ATNState *state); - virtual void removeState(ATNState *state); + void removeState(ATNState *state); - virtual int defineDecisionState(DecisionState *s); + int defineDecisionState(DecisionState *s); - virtual DecisionState *getDecisionState(size_t decision) const; + DecisionState *getDecisionState(size_t decision) const; - virtual size_t getNumberOfDecisions() const; + size_t getNumberOfDecisions() const; /// /// Computes the set of input symbols which could follow ATN state number @@ -112,12 +115,17 @@ namespace atn { /// specified state in the specified context. /// if the ATN does not contain a state with /// number {@code stateNumber} - virtual misc::IntervalSet getExpectedTokens(size_t stateNumber, RuleContext *context) const; + misc::IntervalSet getExpectedTokens(size_t stateNumber, RuleContext *context) const; std::string toString() const; private: + friend class LexerATNSimulator; + friend class ParserATNSimulator; + mutable std::mutex _mutex; + mutable std::shared_mutex _stateMutex; + mutable std::shared_mutex _edgeMutex; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/ATNConfig.cpp b/runtime/Cpp/runtime/src/atn/ATNConfig.cpp index c490f041db..a9f83a61cd 100755 --- a/runtime/Cpp/runtime/src/atn/ATNConfig.cpp +++ b/runtime/Cpp/runtime/src/atn/ATNConfig.cpp @@ -11,41 +11,40 @@ using namespace antlr4::atn; -ATNConfig::ATNConfig(ATNState *state_, size_t alt_, Ref const& context_) - : ATNConfig(state_, alt_, context_, SemanticContext::NONE) { -} +namespace { -ATNConfig::ATNConfig(ATNState *state_, size_t alt_, Ref const& context_, Ref const& semanticContext_) - : state(state_), alt(alt_), context(context_), semanticContext(semanticContext_) { - reachesIntoOuterContext = 0; -} +/** + * This field stores the bit mask for implementing the + * {@link #isPrecedenceFilterSuppressed} property as a bit within the + * existing {@link #reachesIntoOuterContext} field. + */ +inline constexpr size_t SUPPRESS_PRECEDENCE_FILTER = 0x40000000; -ATNConfig::ATNConfig(Ref const& c) : ATNConfig(c, c->state, c->context, c->semanticContext) { } -ATNConfig::ATNConfig(Ref const& c, ATNState *state_) : ATNConfig(c, state_, c->context, c->semanticContext) { -} +ATNConfig::ATNConfig(ATNState *state, size_t alt, Ref context) + : ATNConfig(state, alt, std::move(context), 0, SemanticContext::NONE) {} -ATNConfig::ATNConfig(Ref const& c, ATNState *state, Ref const& semanticContext) - : ATNConfig(c, state, c->context, semanticContext) { -} +ATNConfig::ATNConfig(ATNState *state, size_t alt, Ref context, Ref semanticContext) + : ATNConfig(state, alt, std::move(context), 0, std::move(semanticContext)) {} -ATNConfig::ATNConfig(Ref const& c, Ref const& semanticContext) - : ATNConfig(c, c->state, c->context, semanticContext) { -} +ATNConfig::ATNConfig(ATNConfig const& other, Ref semanticContext) + : ATNConfig(other.state, other.alt, other.context, other.reachesIntoOuterContext, std::move(semanticContext)) {} -ATNConfig::ATNConfig(Ref const& c, ATNState *state, Ref const& context) - : ATNConfig(c, state, context, c->semanticContext) { -} +ATNConfig::ATNConfig(ATNConfig const& other, ATNState *state) + : ATNConfig(state, other.alt, other.context, other.reachesIntoOuterContext, other.semanticContext) {} -ATNConfig::ATNConfig(Ref const& c, ATNState *state, Ref const& context, - Ref const& semanticContext) - : state(state), alt(c->alt), context(context), reachesIntoOuterContext(c->reachesIntoOuterContext), - semanticContext(semanticContext) { -} +ATNConfig::ATNConfig(ATNConfig const& other, ATNState *state, Ref semanticContext) + : ATNConfig(state, other.alt, other.context, other.reachesIntoOuterContext, std::move(semanticContext)) {} -ATNConfig::~ATNConfig() { -} +ATNConfig::ATNConfig(ATNConfig const& other, ATNState *state, Ref context) + : ATNConfig(state, other.alt, std::move(context), other.reachesIntoOuterContext, other.semanticContext) {} + +ATNConfig::ATNConfig(ATNConfig const& other, ATNState *state, Ref context, Ref semanticContext) + : ATNConfig(state, other.alt, std::move(context), other.reachesIntoOuterContext, std::move(semanticContext)) {} + +ATNConfig::ATNConfig(ATNState *state, size_t alt, Ref context, size_t reachesIntoOuterContext, Ref semanticContext) + : state(state), alt(alt), context(std::move(context)), reachesIntoOuterContext(reachesIntoOuterContext), semanticContext(std::move(semanticContext)) {} size_t ATNConfig::hashCode() const { size_t hashCode = misc::MurmurHash::initialize(7); @@ -73,22 +72,18 @@ void ATNConfig::setPrecedenceFilterSuppressed(bool value) { } } -bool ATNConfig::operator == (const ATNConfig &other) const { +bool ATNConfig::operator==(const ATNConfig &other) const { return state->stateNumber == other.state->stateNumber && alt == other.alt && ((context == other.context) || (*context == *other.context)) && *semanticContext == *other.semanticContext && isPrecedenceFilterSuppressed() == other.isPrecedenceFilterSuppressed(); } -bool ATNConfig::operator != (const ATNConfig &other) const { - return !operator==(other); -} - -std::string ATNConfig::toString() { +std::string ATNConfig::toString() const { return toString(true); } -std::string ATNConfig::toString(bool showAlt) { +std::string ATNConfig::toString(bool showAlt) const { std::stringstream ss; ss << "("; @@ -100,12 +95,12 @@ std::string ATNConfig::toString(bool showAlt) { ss << ",[" << context->toString() << "]"; } if (semanticContext != nullptr && semanticContext != SemanticContext::NONE) { - ss << "," << semanticContext.get(); + ss << ",[" << semanticContext->toString() << "]"; } if (getOuterContextDepth() > 0) { ss << ",up=" << getOuterContextDepth(); } - ss << ')'; + ss << ")"; return ss.str(); } diff --git a/runtime/Cpp/runtime/src/atn/ATNConfig.h b/runtime/Cpp/runtime/src/atn/ATNConfig.h index 767655b33b..1d2e7ae163 100755 --- a/runtime/Cpp/runtime/src/atn/ATNConfig.h +++ b/runtime/Cpp/runtime/src/atn/ATNConfig.h @@ -5,6 +5,11 @@ #pragma once +#include + +#include "antlr4-common.h" +#include "atn/SemanticContext.h" + namespace antlr4 { namespace atn { @@ -20,32 +25,39 @@ namespace atn { public: struct Hasher { + size_t operator()(Ref const& k) const { + return k->hashCode(); + } + size_t operator()(ATNConfig const& k) const { return k.hashCode(); } }; struct Comparer { + bool operator()(Ref const& lhs, Ref const& rhs) const { + return (lhs == rhs) || (*lhs == *rhs); + } + bool operator()(ATNConfig const& lhs, ATNConfig const& rhs) const { return (&lhs == &rhs) || (lhs == rhs); } }; - using Set = std::unordered_set, Hasher, Comparer>; /// The ATN state associated with this configuration. - ATNState * state; + ATNState *state = nullptr; /// What alt (or lexer rule) is predicted by this configuration. - const size_t alt; + const size_t alt = 0; /// The stack of invoking states leading to the rule/states associated /// with this config. We track only those contexts pushed during /// execution of the ATN simulator. /// /// Can be shared between multiple ANTConfig instances. - Ref context; + Ref context; /** * We cannot execute predicates dependent upon local context unless @@ -70,23 +82,25 @@ namespace atn { * {@link ATNConfigSet#add(ATNConfig, DoubleKeyMap)} method are * completely unaffected by the change.

*/ - size_t reachesIntoOuterContext; + size_t reachesIntoOuterContext = 0; /// Can be shared between multiple ATNConfig instances. - Ref semanticContext; + Ref semanticContext; - ATNConfig(ATNState *state, size_t alt, Ref const& context); - ATNConfig(ATNState *state, size_t alt, Ref const& context, Ref const& semanticContext); + ATNConfig(ATNState *state, size_t alt, Ref context); + ATNConfig(ATNState *state, size_t alt, Ref context, Ref semanticContext); - ATNConfig(Ref const& c); // dup - ATNConfig(Ref const& c, ATNState *state); - ATNConfig(Ref const& c, ATNState *state, Ref const& semanticContext); - ATNConfig(Ref const& c, Ref const& semanticContext); - ATNConfig(Ref const& c, ATNState *state, Ref const& context); - ATNConfig(Ref const& c, ATNState *state, Ref const& context, Ref const& semanticContext); + ATNConfig(ATNConfig const& other, Ref semanticContext); + ATNConfig(ATNConfig const& other, ATNState *state); + ATNConfig(ATNConfig const& other, ATNState *state, Ref semanticContext); + ATNConfig(ATNConfig const& other, ATNState *state, Ref context); + ATNConfig(ATNConfig const& other, ATNState *state, Ref context, Ref semanticContext); ATNConfig(ATNConfig const&) = default; - virtual ~ATNConfig(); + + ATNConfig(ATNConfig&&) = default; + + virtual ~ATNConfig() = default; virtual size_t hashCode() const; @@ -95,32 +109,21 @@ namespace atn { * as it existed prior to the introduction of the * {@link #isPrecedenceFilterSuppressed} method. */ - size_t getOuterContextDepth() const ; + size_t getOuterContextDepth() const; bool isPrecedenceFilterSuppressed() const; void setPrecedenceFilterSuppressed(bool value); /// An ATN configuration is equal to another if both have /// the same state, they predict the same alternative, and /// syntactic/semantic contexts are the same. - bool operator == (const ATNConfig &other) const; - bool operator != (const ATNConfig &other) const; + bool operator==(const ATNConfig &other) const; + bool operator!=(const ATNConfig &other) const; - virtual std::string toString(); - std::string toString(bool showAlt); + virtual std::string toString() const; + std::string toString(bool showAlt) const; private: - /** - * This field stores the bit mask for implementing the - * {@link #isPrecedenceFilterSuppressed} property as a bit within the - * existing {@link #reachesIntoOuterContext} field. - */ -#if __cplusplus >= 201703L - static constexpr size_t SUPPRESS_PRECEDENCE_FILTER = 0x40000000; -#else - enum : size_t { - SUPPRESS_PRECEDENCE_FILTER = 0x40000000, - }; -#endif + ATNConfig(ATNState *state, size_t alt, Ref context, size_t reachesIntoOuterContext, Ref semanticContext); }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp b/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp index 7a480a480d..d44e46d5ee 100755 --- a/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp +++ b/runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp @@ -15,26 +15,31 @@ using namespace antlr4::atn; using namespace antlrcpp; -ATNConfigSet::ATNConfigSet(bool fullCtx) : fullCtx(fullCtx) { - InitializeInstanceFields(); -} +namespace { -ATNConfigSet::ATNConfigSet(const Ref &old) : ATNConfigSet(old->fullCtx) { - addAll(old); - uniqueAlt = old->uniqueAlt; - conflictingAlts = old->conflictingAlts; - hasSemanticContext = old->hasSemanticContext; - dipsIntoOuterContext = old->dipsIntoOuterContext; } -ATNConfigSet::~ATNConfigSet() { +ATNConfigSet::ATNConfigSet() : ATNConfigSet(true) {} + +ATNConfigSet::ATNConfigSet(const ATNConfigSet &other) + : fullCtx(other.fullCtx), _configLookup(other._configLookup.bucket_count(), ATNConfigHasher{this}, ATNConfigComparer{this}) { + addAll(other); + uniqueAlt = other.uniqueAlt; + conflictingAlts = other.conflictingAlts; + hasSemanticContext = other.hasSemanticContext; + dipsIntoOuterContext = other.dipsIntoOuterContext; } +ATNConfigSet::ATNConfigSet(bool fullCtx) + : fullCtx(fullCtx), _configLookup(0, ATNConfigHasher{this}, ATNConfigComparer{this}) {} + bool ATNConfigSet::add(const Ref &config) { return add(config, nullptr); } bool ATNConfigSet::add(const Ref &config, PredictionContextMergeCache *mergeCache) { + assert(config); + if (_readonly) { throw IllegalStateException("This set is readonly"); } @@ -45,10 +50,9 @@ bool ATNConfigSet::add(const Ref &config, PredictionContextMergeCache dipsIntoOuterContext = true; } - size_t hash = getHash(config.get()); - ATNConfig *existing = _configLookup[hash]; - if (existing == nullptr) { - _configLookup[hash] = config.get(); + auto existing = _configLookup.find(config.get()); + if (existing == _configLookup.end()) { + _configLookup.insert(config.get()); _cachedHashCode = 0; configs.push_back(config); // track order here @@ -57,32 +61,33 @@ bool ATNConfigSet::add(const Ref &config, PredictionContextMergeCache // a previous (s,i,pi,_), merge with it and save result bool rootIsWildcard = !fullCtx; - Ref merged = PredictionContext::merge(existing->context, config->context, rootIsWildcard, mergeCache); + Ref merged = PredictionContext::merge((*existing)->context, config->context, rootIsWildcard, mergeCache); // no need to check for existing.context, config.context in cache // since only way to create new graphs is "call rule" and here. We // cache at both places. - existing->reachesIntoOuterContext = std::max(existing->reachesIntoOuterContext, config->reachesIntoOuterContext); + (*existing)->reachesIntoOuterContext = std::max((*existing)->reachesIntoOuterContext, config->reachesIntoOuterContext); // make sure to preserve the precedence filter suppression during the merge if (config->isPrecedenceFilterSuppressed()) { - existing->setPrecedenceFilterSuppressed(true); + (*existing)->setPrecedenceFilterSuppressed(true); } - existing->context = merged; // replace context; no need to alt mapping + (*existing)->context = std::move(merged); // replace context; no need to alt mapping return true; } -bool ATNConfigSet::addAll(const Ref &other) { - for (auto &c : other->configs) { +bool ATNConfigSet::addAll(const ATNConfigSet &other) { + for (const auto &c : other.configs) { add(c); } return false; } -std::vector ATNConfigSet::getStates() { +std::vector ATNConfigSet::getStates() const { std::vector states; - for (auto c : configs) { + states.reserve(configs.size()); + for (const auto &c : configs) { states.push_back(c->state); } return states; @@ -97,17 +102,18 @@ std::vector ATNConfigSet::getStates() { * @since 4.3 */ -BitSet ATNConfigSet::getAlts() { +BitSet ATNConfigSet::getAlts() const { BitSet alts; - for (ATNConfig config : configs) { - alts.set(config.alt); + for (const auto &config : configs) { + alts.set(config->alt); } return alts; } -std::vector> ATNConfigSet::getPredicates() { - std::vector> preds; - for (auto c : configs) { +std::vector> ATNConfigSet::getPredicates() const { + std::vector> preds; + preds.reserve(configs.size()); + for (const auto &c : configs) { if (c->semanticContext != SemanticContext::NONE) { preds.push_back(c->semanticContext); } @@ -115,23 +121,25 @@ std::vector> ATNConfigSet::getPredicates() { return preds; } -Ref ATNConfigSet::get(size_t i) const { +const Ref& ATNConfigSet::get(size_t i) const { return configs[i]; } void ATNConfigSet::optimizeConfigs(ATNSimulator *interpreter) { + assert(interpreter); + if (_readonly) { throw IllegalStateException("This set is readonly"); } if (_configLookup.empty()) return; - for (auto &config : configs) { + for (const auto &config : configs) { config->context = interpreter->getCachedContext(config->context); } } -bool ATNConfigSet::operator == (const ATNConfigSet &other) { +bool ATNConfigSet::equals(const ATNConfigSet &other) const { if (&other == this) { return true; } @@ -147,22 +155,23 @@ bool ATNConfigSet::operator == (const ATNConfigSet &other) { return Arrays::equals(configs, other.configs); } -size_t ATNConfigSet::hashCode() { - if (!isReadonly() || _cachedHashCode == 0) { - _cachedHashCode = 1; - for (auto &i : configs) { - _cachedHashCode = 31 * _cachedHashCode + i->hashCode(); // Same as Java's list hashCode impl. +size_t ATNConfigSet::hashCode() const { + size_t cachedHashCode = _cachedHashCode.load(std::memory_order_relaxed); + if (!isReadonly() || cachedHashCode == 0) { + cachedHashCode = 1; + for (const auto &i : configs) { + cachedHashCode = 31 * cachedHashCode + i->hashCode(); // Same as Java's list hashCode impl. } + _cachedHashCode.store(cachedHashCode, std::memory_order_relaxed); } - - return _cachedHashCode; + return cachedHashCode; } -size_t ATNConfigSet::size() { +size_t ATNConfigSet::size() const { return configs.size(); } -bool ATNConfigSet::isEmpty() { +bool ATNConfigSet::isEmpty() const { return configs.empty(); } @@ -175,16 +184,16 @@ void ATNConfigSet::clear() { _configLookup.clear(); } -bool ATNConfigSet::isReadonly() { +bool ATNConfigSet::isReadonly() const { return _readonly; } void ATNConfigSet::setReadonly(bool readonly) { _readonly = readonly; - _configLookup.clear(); + LookupContainer(0, ATNConfigHasher{this}, ATNConfigComparer{this}).swap(_configLookup); } -std::string ATNConfigSet::toString() { +std::string ATNConfigSet::toString() const { std::stringstream ss; ss << "["; for (size_t i = 0; i < configs.size(); i++) { @@ -210,19 +219,14 @@ std::string ATNConfigSet::toString() { return ss.str(); } -size_t ATNConfigSet::getHash(ATNConfig *c) { +size_t ATNConfigSet::hashCode(const ATNConfig &other) const { size_t hashCode = 7; - hashCode = 31 * hashCode + c->state->stateNumber; - hashCode = 31 * hashCode + c->alt; - hashCode = 31 * hashCode + c->semanticContext->hashCode(); + hashCode = 31 * hashCode + other.state->stateNumber; + hashCode = 31 * hashCode + other.alt; + hashCode = 31 * hashCode + other.semanticContext->hashCode(); return hashCode; } -void ATNConfigSet::InitializeInstanceFields() { - uniqueAlt = 0; - hasSemanticContext = false; - dipsIntoOuterContext = false; - - _readonly = false; - _cachedHashCode = 0; +bool ATNConfigSet::equals(const ATNConfig &lhs, const ATNConfig &rhs) const { + return lhs.state->stateNumber == rhs.state->stateNumber && lhs.alt == rhs.alt && *lhs.semanticContext == *rhs.semanticContext; } diff --git a/runtime/Cpp/runtime/src/atn/ATNConfigSet.h b/runtime/Cpp/runtime/src/atn/ATNConfigSet.h index 850a07c129..301a84a83e 100755 --- a/runtime/Cpp/runtime/src/atn/ATNConfigSet.h +++ b/runtime/Cpp/runtime/src/atn/ATNConfigSet.h @@ -5,8 +5,11 @@ #pragma once +#include + #include "support/BitSet.h" #include "atn/PredictionContext.h" +#include "atn/ATNConfig.h" namespace antlr4 { namespace atn { @@ -20,7 +23,7 @@ namespace atn { // TODO: these fields make me pretty uncomfortable but nice to pack up info together, saves recomputation // TODO: can we track conflicts as they are added to save scanning configs later? - size_t uniqueAlt; + size_t uniqueAlt = 0; /** Currently this is only used when we detect SLL conflict; this does * not necessarily represent the ambiguous alternatives. In fact, @@ -31,20 +34,25 @@ namespace atn { // Used in parser and lexer. In lexer, it indicates we hit a pred // while computing a closure operation. Don't make a DFA state from this. - bool hasSemanticContext; - bool dipsIntoOuterContext; + bool hasSemanticContext = false; + bool dipsIntoOuterContext = false; /// Indicates that this configuration set is part of a full context /// LL prediction. It will be used to determine how to merge $. With SLL /// it's a wildcard whereas it is not for LL context merge. - const bool fullCtx; + const bool fullCtx = true; + + ATNConfigSet(); + + ATNConfigSet(const ATNConfigSet &other); - ATNConfigSet(bool fullCtx = true); - ATNConfigSet(const Ref &old); + ATNConfigSet(ATNConfigSet&&) = delete; - virtual ~ATNConfigSet(); + explicit ATNConfigSet(bool fullCtx); - virtual bool add(const Ref &config); + virtual ~ATNConfigSet() = default; + + bool add(const Ref &config); /// /// Adding a new config means merging contexts with existing configs for @@ -56,9 +64,11 @@ namespace atn { /// This method updates and /// when necessary. /// - virtual bool add(const Ref &config, PredictionContextMergeCache *mergeCache); + bool add(const Ref &config, PredictionContextMergeCache *mergeCache); + + bool addAll(const ATNConfigSet &other); - virtual std::vector getStates(); + std::vector getStates() const; /** * Gets the complete set of represented alternatives for the configuration @@ -68,43 +78,79 @@ namespace atn { * * @since 4.3 */ - antlrcpp::BitSet getAlts(); - virtual std::vector> getPredicates(); + antlrcpp::BitSet getAlts() const; + std::vector> getPredicates() const; + + const Ref& get(size_t i) const; - virtual Ref get(size_t i) const; + void optimizeConfigs(ATNSimulator *interpreter); - virtual void optimizeConfigs(ATNSimulator *interpreter); + size_t size() const; + bool isEmpty() const; + void clear(); + bool isReadonly() const; + void setReadonly(bool readonly); + + virtual size_t hashCode() const; + + virtual bool equals(const ATNConfigSet &other) const; + + virtual std::string toString() const; + + private: + struct ATNConfigHasher final { + const ATNConfigSet* atnConfigSet; - bool addAll(const Ref &other); + size_t operator()(const ATNConfig *other) const { + assert(other != nullptr); + return atnConfigSet->hashCode(*other); + } + }; - bool operator == (const ATNConfigSet &other); - virtual size_t hashCode(); - virtual size_t size(); - virtual bool isEmpty(); - virtual void clear(); - virtual bool isReadonly(); - virtual void setReadonly(bool readonly); - virtual std::string toString(); + struct ATNConfigComparer final { + const ATNConfigSet* atnConfigSet; + + bool operator()(const ATNConfig *lhs, const ATNConfig *rhs) const { + assert(lhs != nullptr); + assert(rhs != nullptr); + return atnConfigSet->equals(*lhs, *rhs); + } + }; + + mutable std::atomic _cachedHashCode = 0; - protected: /// Indicates that the set of configurations is read-only. Do not /// allow any code to manipulate the set; DFA states will point at /// the sets and they must not change. This does not protect the other /// fields; in particular, conflictingAlts is set after /// we've made this readonly. - bool _readonly; + bool _readonly = false; - virtual size_t getHash(ATNConfig *c); // Hash differs depending on set type. + virtual size_t hashCode(const ATNConfig &atnConfig) const; - private: - size_t _cachedHashCode; + virtual bool equals(const ATNConfig &lhs, const ATNConfig &rhs) const; + + using LookupContainer = std::unordered_set; /// All configs but hashed by (s, i, _, pi) not including context. Wiped out /// when we go readonly as this set becomes a DFA state. - std::unordered_map _configLookup; - - void InitializeInstanceFields(); + LookupContainer _configLookup; }; + inline bool operator==(const ATNConfigSet &lhs, const ATNConfigSet &rhs) { return lhs.equals(rhs); } + + inline bool operator!=(const ATNConfigSet &lhs, const ATNConfigSet &rhs) { return !operator==(lhs, rhs); } + } // namespace atn } // namespace antlr4 + +namespace std { + +template <> +struct hash<::antlr4::atn::ATNConfigSet> { + size_t operator()(const ::antlr4::atn::ATNConfigSet &atnConfigSet) const { + return atnConfigSet.hashCode(); + } +}; + +} // namespace std diff --git a/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp b/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp index d070cd9d61..7743d89d89 100755 --- a/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp +++ b/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp @@ -4,61 +4,51 @@ */ #include "atn/ATNDeserializationOptions.h" +#include "Exceptions.h" +#include +#include + +using namespace antlr4; using namespace antlr4::atn; -const ATNDeserializationOptions ATNDeserializationOptions::defaultOptions; +namespace { -ATNDeserializationOptions::ATNDeserializationOptions() { - InitializeInstanceFields(); -} +std::once_flag defaultATNDeserializationOptionsOnceFlag; +std::unique_ptr defaultATNDeserializationOptions; -ATNDeserializationOptions::ATNDeserializationOptions(ATNDeserializationOptions *options) : ATNDeserializationOptions() { - this->verifyATN = options->verifyATN; - this->generateRuleBypassTransitions = options->generateRuleBypassTransitions; +void initializeDefaultATNDeserializationOptions() { + defaultATNDeserializationOptions.reset(new ATNDeserializationOptions()); } -ATNDeserializationOptions::~ATNDeserializationOptions() { } -const ATNDeserializationOptions& ATNDeserializationOptions::getDefaultOptions() { - return defaultOptions; -} +ATNDeserializationOptions::ATNDeserializationOptions(ATNDeserializationOptions *options) + : _readOnly(false), _verifyATN(options->_verifyATN), + _generateRuleBypassTransitions(options->_generateRuleBypassTransitions) {} -bool ATNDeserializationOptions::isReadOnly() { - return readOnly; +const ATNDeserializationOptions& ATNDeserializationOptions::getDefaultOptions() { + std::call_once(defaultATNDeserializationOptionsOnceFlag, + initializeDefaultATNDeserializationOptions); + return *defaultATNDeserializationOptions; } void ATNDeserializationOptions::makeReadOnly() { - readOnly = true; -} - -bool ATNDeserializationOptions::isVerifyATN() { - return verifyATN; + _readOnly = true; } void ATNDeserializationOptions::setVerifyATN(bool verify) { throwIfReadOnly(); - verifyATN = verify; -} - -bool ATNDeserializationOptions::isGenerateRuleBypassTransitions() { - return generateRuleBypassTransitions; + _verifyATN = verify; } void ATNDeserializationOptions::setGenerateRuleBypassTransitions(bool generate) { throwIfReadOnly(); - generateRuleBypassTransitions = generate; + _generateRuleBypassTransitions = generate; } -void ATNDeserializationOptions::throwIfReadOnly() { +void ATNDeserializationOptions::throwIfReadOnly() const { if (isReadOnly()) { - throw "The object is read only."; + throw IllegalStateException("ATNDeserializationOptions is read only."); } } - -void ATNDeserializationOptions::InitializeInstanceFields() { - readOnly = false; - verifyATN = true; - generateRuleBypassTransitions = false; -} diff --git a/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h b/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h index f03bdb39ad..8b1f9850b7 100755 --- a/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h +++ b/runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.h @@ -10,41 +10,39 @@ namespace antlr4 { namespace atn { - class ANTLR4CPP_PUBLIC ATNDeserializationOptions { - private: - static const ATNDeserializationOptions defaultOptions; +class ANTLR4CPP_PUBLIC ATNDeserializationOptions final { +public: + ATNDeserializationOptions() + : _readOnly(false), _verifyATN(true), _generateRuleBypassTransitions(false) {} - bool readOnly; - bool verifyATN; - bool generateRuleBypassTransitions; + // TODO: Is this useful? If so we should mark it as explicit, otherwise remove it. + ATNDeserializationOptions(ATNDeserializationOptions *options); - public: - ATNDeserializationOptions(); - ATNDeserializationOptions(ATNDeserializationOptions *options); - ATNDeserializationOptions(ATNDeserializationOptions const&) = default; - virtual ~ATNDeserializationOptions(); - ATNDeserializationOptions& operator=(ATNDeserializationOptions const&) = default; + ATNDeserializationOptions(const ATNDeserializationOptions&) = default; - static const ATNDeserializationOptions& getDefaultOptions(); + ATNDeserializationOptions& operator=(const ATNDeserializationOptions&) = default; - bool isReadOnly(); + static const ATNDeserializationOptions& getDefaultOptions(); - void makeReadOnly(); + bool isReadOnly() const { return _readOnly; } - bool isVerifyATN(); + void makeReadOnly(); - void setVerifyATN(bool verify); + bool isVerifyATN() const { return _verifyATN; } - bool isGenerateRuleBypassTransitions(); + void setVerifyATN(bool verify); - void setGenerateRuleBypassTransitions(bool generate); + bool isGenerateRuleBypassTransitions() const { return _generateRuleBypassTransitions; } - protected: - virtual void throwIfReadOnly(); + void setGenerateRuleBypassTransitions(bool generate); - private: - void InitializeInstanceFields(); - }; +private: + void throwIfReadOnly() const; + + bool _readOnly; + bool _verifyATN; + bool _generateRuleBypassTransitions; +}; } // namespace atn } // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp b/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp index 00d745d0b4..fb35dfec0e 100755 --- a/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp +++ b/runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp @@ -33,12 +33,13 @@ #include "atn/SetTransition.h" #include "atn/NotSetTransition.h" #include "atn/WildcardTransition.h" +#include "atn/TransitionType.h" #include "Token.h" #include "misc/IntervalSet.h" #include "Exceptions.h" #include "support/CPPUtils.h" -#include "support/StringUtils.h" +#include "support/Casts.h" #include "atn/LexerCustomAction.h" #include "atn/LexerChannelAction.h" @@ -51,7 +52,10 @@ #include "atn/ATNDeserializer.h" +#include +#include #include +#include using namespace antlr4; using namespace antlr4::atn; @@ -59,108 +63,199 @@ using namespace antlrcpp; namespace { -uint32_t deserializeInt32(const std::vector& data, size_t offset) { - return (uint32_t)data[offset] | ((uint32_t)data[offset + 1] << 16); -} - -ssize_t readUnicodeInt(const std::vector& data, int& p) { - return static_cast(data[p++]); -} + void checkCondition(bool condition, std::string_view message) { + if (!condition) { + throw IllegalStateException(std::string(message)); + } + } -ssize_t readUnicodeInt32(const std::vector& data, int& p) { - auto result = deserializeInt32(data, p); - p += 2; - return static_cast(result); -} + void checkCondition(bool condition) { + checkCondition(condition, ""); + } -// We templatize this on the function type so the optimizer can inline -// the 16- or 32-bit readUnicodeInt/readUnicodeInt32 as needed. -template -void deserializeSets( - const std::vector& data, - int& p, - std::vector& sets, - F readUnicode) { - int nsets = data[p++]; - for (int i = 0; i < nsets; i++) { - int nintervals = data[p++]; - misc::IntervalSet set; - - bool containsEof = data[p++] != 0; - if (containsEof) { - set.add(-1); - } + /** + * Analyze the {@link StarLoopEntryState} states in the specified ATN to set + * the {@link StarLoopEntryState#isPrecedenceDecision} field to the + * correct value. + * + * @param atn The ATN. + */ + void markPrecedenceDecisions(const ATN &atn) { + for (ATNState *state : atn.states) { + if (!StarLoopEntryState::is(state)) { + continue; + } - for (int j = 0; j < nintervals; j++) { - auto a = readUnicode(data, p); - auto b = readUnicode(data, p); - set.add(a, b); + /* We analyze the ATN to determine if this ATN decision state is the + * decision for the closure block that determines whether a + * precedence rule should continue or complete. + */ + if (atn.ruleToStartState[state->ruleIndex]->isLeftRecursiveRule) { + ATNState *maybeLoopEndState = state->transitions[state->transitions.size() - 1]->target; + if (LoopEndState::is(maybeLoopEndState)) { + if (maybeLoopEndState->epsilonOnlyTransitions && RuleStopState::is(maybeLoopEndState->transitions[0]->target)) { + downCast(state)->isPrecedenceDecision = true; + } + } + } } - sets.push_back(set); } -} -} + Ref lexerActionFactory(LexerActionType type, int data1, int data2) { + switch (type) { + case LexerActionType::CHANNEL: + return std::make_shared(data1); -ATNDeserializer::ATNDeserializer(): ATNDeserializer(ATNDeserializationOptions::getDefaultOptions()) { -} + case LexerActionType::CUSTOM: + return std::make_shared(data1, data2); -ATNDeserializer::ATNDeserializer(const ATNDeserializationOptions& dso): deserializationOptions(dso) { -} + case LexerActionType::MODE: + return std::make_shared< LexerModeAction>(data1); -ATNDeserializer::~ATNDeserializer() { -} + case LexerActionType::MORE: + return LexerMoreAction::getInstance(); -/** - * This value should never change. Updates following this version are - * reflected as change in the unique ID SERIALIZED_UUID. - */ -antlrcpp::Guid ATNDeserializer::ADDED_PRECEDENCE_TRANSITIONS() { - return antlrcpp::Guid("1DA0C57D-6C06-438A-9B27-10BCB3CE0F61"); -} + case LexerActionType::POP_MODE: + return LexerPopModeAction::getInstance(); -antlrcpp::Guid ATNDeserializer::ADDED_LEXER_ACTIONS() { - return antlrcpp::Guid("AADB8D7E-AEEF-4415-AD2B-8204D6CF042E"); -} + case LexerActionType::PUSH_MODE: + return std::make_shared(data1); -antlrcpp::Guid ATNDeserializer::ADDED_UNICODE_SMP() { - return antlrcpp::Guid("59627784-3BE5-417A-B9EB-8131A7286089"); -} + case LexerActionType::SKIP: + return LexerSkipAction::getInstance(); -antlrcpp::Guid ATNDeserializer::SERIALIZED_UUID() { - return ADDED_UNICODE_SMP(); -} + case LexerActionType::TYPE: + return std::make_shared(data1); -antlrcpp::Guid ATNDeserializer::BASE_SERIALIZED_UUID() { - return antlrcpp::Guid("33761B2D-78BB-4A43-8B0B-4F5BEE8AACF3"); -} + default: + throw IllegalArgumentException("The specified lexer action type " + std::to_string(static_cast(type)) + + " is not valid."); + } + } -std::vector& ATNDeserializer::SUPPORTED_UUIDS() { - static std::vector singleton = { BASE_SERIALIZED_UUID(), ADDED_PRECEDENCE_TRANSITIONS(), ADDED_LEXER_ACTIONS(), ADDED_UNICODE_SMP() }; - return singleton; -} + ConstTransitionPtr edgeFactory(const ATN &atn, TransitionType type, size_t trg, size_t arg1, size_t arg2, + size_t arg3, const std::vector &sets) { + ATNState *target = atn.states[trg]; + switch (type) { + case TransitionType::EPSILON: + return std::make_unique(target); + case TransitionType::RANGE: + if (arg3 != 0) { + return std::make_unique(target, Token::EOF, arg2); + } else { + return std::make_unique(target, arg1, arg2); + } + case TransitionType::RULE: + return std::make_unique(downCast(atn.states[arg1]), arg2, (int)arg3, target); + case TransitionType::PREDICATE: + return std::make_unique(target, arg1, arg2, arg3 != 0); + case TransitionType::PRECEDENCE: + return std::make_unique(target, (int)arg1); + case TransitionType::ATOM: + if (arg3 != 0) { + return std::make_unique(target, Token::EOF); + } else { + return std::make_unique(target, arg1); + } + case TransitionType::ACTION: + return std::make_unique(target, arg1, arg2, arg3 != 0); + case TransitionType::SET: + return std::make_unique(target, sets[arg1]); + case TransitionType::NOT_SET: + return std::make_unique(target, sets[arg1]); + case TransitionType::WILDCARD: + return std::make_unique(target); + } -bool ATNDeserializer::isFeatureSupported(const antlrcpp::Guid &feature, const antlrcpp::Guid &actualUuid) { - auto featureIterator = std::find(SUPPORTED_UUIDS().begin(), SUPPORTED_UUIDS().end(), feature); - if (featureIterator == SUPPORTED_UUIDS().end()) { - return false; + throw IllegalArgumentException("The specified transition type is not valid."); } - auto actualIterator = std::find(SUPPORTED_UUIDS().begin(), SUPPORTED_UUIDS().end(), actualUuid); - if (actualIterator == SUPPORTED_UUIDS().end()) { - return false; + + /* mem check: all created instances are freed in the d-tor of the ATN. */ + ATNState* stateFactory(ATNStateType type, size_t ruleIndex) { + ATNState *s; + switch (type) { + case ATNStateType::INVALID: + return nullptr; + case ATNStateType::BASIC : + s = new BasicState(); + break; + case ATNStateType::RULE_START : + s = new RuleStartState(); + break; + case ATNStateType::BLOCK_START : + s = new BasicBlockStartState(); + break; + case ATNStateType::PLUS_BLOCK_START : + s = new PlusBlockStartState(); + break; + case ATNStateType::STAR_BLOCK_START : + s = new StarBlockStartState(); + break; + case ATNStateType::TOKEN_START : + s = new TokensStartState(); + break; + case ATNStateType::RULE_STOP : + s = new RuleStopState(); + break; + case ATNStateType::BLOCK_END : + s = new BlockEndState(); + break; + case ATNStateType::STAR_LOOP_BACK : + s = new StarLoopbackState(); + break; + case ATNStateType::STAR_LOOP_ENTRY : + s = new StarLoopEntryState(); + break; + case ATNStateType::PLUS_LOOP_BACK : + s = new PlusLoopbackState(); + break; + case ATNStateType::LOOP_END : + s = new LoopEndState(); + break; + default : + std::string message = "The specified state type " + std::to_string(static_cast(type)) + " is not valid."; + throw IllegalArgumentException(message); + } + assert(s->getStateType() == type); + s->ruleIndex = ruleIndex; + return s; } - return std::distance(featureIterator, actualIterator) >= 0; -} + ssize_t readUnicodeInt32(SerializedATNView data, int& p) { + return static_cast(data[p++]); + } + + void deserializeSets( + SerializedATNView data, + int& p, + std::vector& sets) { + size_t nsets = data[p++]; + sets.reserve(sets.size() + nsets); + for (size_t i = 0; i < nsets; i++) { + size_t nintervals = data[p++]; + misc::IntervalSet set; + + bool containsEof = data[p++] != 0; + if (containsEof) { + set.add(-1); + } -ATN ATNDeserializer::deserialize(const std::vector& input) { - // Don't adjust the first value since that's the version number. - std::vector data(input.size()); - data[0] = input[0]; - for (size_t i = 1; i < input.size(); ++i) { - data[i] = input[i] - 2; + for (size_t j = 0; j < nintervals; j++) { + auto a = readUnicodeInt32(data, p); + auto b = readUnicodeInt32(data, p); + set.add(a, b); + } + sets.push_back(set); + } } +} + +ATNDeserializer::ATNDeserializer() : ATNDeserializer(ATNDeserializationOptions::getDefaultOptions()) {} + +ATNDeserializer::ATNDeserializer(ATNDeserializationOptions deserializationOptions) : _deserializationOptions(std::move(deserializationOptions)) {} + +std::unique_ptr ATNDeserializer::deserialize(SerializedATNView data) const { int p = 0; int version = data[p++]; if (version != SERIALIZED_VERSION) { @@ -169,60 +264,48 @@ ATN ATNDeserializer::deserialize(const std::vector& input) { throw UnsupportedOperationException(reason); } - antlrcpp::Guid uuid = toUUID(data.data(), p); - p += 8; - auto uuidIterator = std::find(SUPPORTED_UUIDS().begin(), SUPPORTED_UUIDS().end(), uuid); - if (uuidIterator == SUPPORTED_UUIDS().end()) { - std::string reason = "Could not deserialize ATN with UUID " + uuid.toString() + " (expected " + - SERIALIZED_UUID().toString() + " or a legacy UUID)."; - - throw UnsupportedOperationException(reason); - } - - bool supportsPrecedencePredicates = isFeatureSupported(ADDED_PRECEDENCE_TRANSITIONS(), uuid); - bool supportsLexerActions = isFeatureSupported(ADDED_LEXER_ACTIONS(), uuid); - ATNType grammarType = (ATNType)data[p++]; size_t maxTokenType = data[p++]; - ATN atn(grammarType, maxTokenType); + auto atn = std::make_unique(grammarType, maxTokenType); // // STATES // - std::vector> loopBackStateNumbers; - std::vector> endStateNumbers; - size_t nstates = data[p++]; - for (size_t i = 0; i < nstates; i++) { - size_t stype = data[p++]; - // ignore bad type of states - if (stype == ATNState::ATN_INVALID_TYPE) { - atn.addState(nullptr); - continue; - } + { + std::vector> loopBackStateNumbers; + std::vector> endStateNumbers; + size_t nstates = data[p++]; + atn->states.reserve(nstates); + loopBackStateNumbers.reserve(nstates); // Reserve worst case size, its short lived. + endStateNumbers.reserve(nstates); // Reserve worst case size, its short lived. + for (size_t i = 0; i < nstates; i++) { + ATNStateType stype = static_cast(data[p++]); + // ignore bad type of states + if (stype == ATNStateType::INVALID) { + atn->addState(nullptr); + continue; + } - size_t ruleIndex = data[p++]; - if (ruleIndex == 0xFFFF) { - ruleIndex = INVALID_INDEX; + size_t ruleIndex = data[p++]; + ATNState *s = stateFactory(stype, ruleIndex); + if (stype == ATNStateType::LOOP_END) { // special case + int loopBackStateNumber = data[p++]; + loopBackStateNumbers.push_back({ downCast(s), loopBackStateNumber }); + } else if (BlockStartState::is(s)) { + int endStateNumber = data[p++]; + endStateNumbers.push_back({ downCast(s), endStateNumber }); + } + atn->addState(s); } - ATNState *s = stateFactory(stype, ruleIndex); - if (stype == ATNState::LOOP_END) { // special case - int loopBackStateNumber = data[p++]; - loopBackStateNumbers.push_back({ (LoopEndState*)s, loopBackStateNumber }); - } else if (is(s)) { - int endStateNumber = data[p++]; - endStateNumbers.push_back({ (BlockStartState*)s, endStateNumber }); + // delay the assignment of loop back and end states until we know all the state instances have been initialized + for (auto &pair : loopBackStateNumbers) { + pair.first->loopBackState = atn->states[pair.second]; } - atn.addState(s); - } - - // delay the assignment of loop back and end states until we know all the state instances have been initialized - for (auto &pair : loopBackStateNumbers) { - pair.first->loopBackState = atn.states[pair.second]; - } - for (auto &pair : endStateNumbers) { - pair.first->endState = (BlockEndState*)atn.states[pair.second]; + for (auto &pair : endStateNumbers) { + pair.first->endState = downCast(atn->states[pair.second]); + } } size_t numNonGreedyStates = data[p++]; @@ -230,118 +313,102 @@ ATN ATNDeserializer::deserialize(const std::vector& input) { size_t stateNumber = data[p++]; // The serialized ATN must be specifying the right states, so that the // cast below is correct. - ((DecisionState *)atn.states[stateNumber])->nonGreedy = true; + downCast(atn->states[stateNumber])->nonGreedy = true; } - if (supportsPrecedencePredicates) { - size_t numPrecedenceStates = data[p++]; - for (size_t i = 0; i < numPrecedenceStates; i++) { - size_t stateNumber = data[p++]; - ((RuleStartState *)atn.states[stateNumber])->isLeftRecursiveRule = true; - } + size_t numPrecedenceStates = data[p++]; + for (size_t i = 0; i < numPrecedenceStates; i++) { + size_t stateNumber = data[p++]; + downCast(atn->states[stateNumber])->isLeftRecursiveRule = true; } // // RULES // size_t nrules = data[p++]; + atn->ruleToStartState.reserve(nrules); for (size_t i = 0; i < nrules; i++) { size_t s = data[p++]; // Also here, the serialized atn must ensure to point to the correct class type. - RuleStartState *startState = (RuleStartState*)atn.states[s]; - atn.ruleToStartState.push_back(startState); - if (atn.grammarType == ATNType::LEXER) { + RuleStartState *startState = downCast(atn->states[s]); + atn->ruleToStartState.push_back(startState); + if (atn->grammarType == ATNType::LEXER) { size_t tokenType = data[p++]; - if (tokenType == 0xFFFF) { - tokenType = Token::EOF; - } - - atn.ruleToTokenType.push_back(tokenType); - - if (!isFeatureSupported(ADDED_LEXER_ACTIONS(), uuid)) { - // this piece of unused metadata was serialized prior to the - // addition of LexerAction - //int actionIndexIgnored = data[p++]; - p++; - } + atn->ruleToTokenType.push_back(tokenType); } } - atn.ruleToStopState.resize(nrules); - for (ATNState *state : atn.states) { - if (!is(state)) { + atn->ruleToStopState.resize(nrules); + for (ATNState *state : atn->states) { + if (!RuleStopState::is(state)) { continue; } - RuleStopState *stopState = static_cast(state); - atn.ruleToStopState[state->ruleIndex] = stopState; - atn.ruleToStartState[state->ruleIndex]->stopState = stopState; + RuleStopState *stopState = downCast(state); + atn->ruleToStopState[state->ruleIndex] = stopState; + atn->ruleToStartState[state->ruleIndex]->stopState = stopState; } // // MODES // size_t nmodes = data[p++]; + atn->modeToStartState.reserve(nmodes); for (size_t i = 0; i < nmodes; i++) { size_t s = data[p++]; - atn.modeToStartState.push_back(static_cast(atn.states[s])); + atn->modeToStartState.push_back(downCast(atn->states[s])); } // // SETS // - std::vector sets; - - // First, deserialize sets with 16-bit arguments <= U+FFFF. - deserializeSets(data, p, sets, readUnicodeInt); - - // Next, if the ATN was serialized with the Unicode SMP feature, - // deserialize sets with 32-bit arguments <= U+10FFFF. - if (isFeatureSupported(ADDED_UNICODE_SMP(), uuid)) { - deserializeSets(data, p, sets, readUnicodeInt32); - } - - // - // EDGES - // - int nedges = data[p++]; - for (int i = 0; i < nedges; i++) { - size_t src = data[p]; - size_t trg = data[p + 1]; - size_t ttype = data[p + 2]; - size_t arg1 = data[p + 3]; - size_t arg2 = data[p + 4]; - size_t arg3 = data[p + 5]; - Transition *trans = edgeFactory(atn, ttype, src, trg, arg1, arg2, arg3, sets); - ATNState *srcState = atn.states[src]; - srcState->addTransition(trans); - p += 6; + { + std::vector sets; + + deserializeSets(data, p, sets); + sets.shrink_to_fit(); + + // + // EDGES + // + int nedges = data[p++]; + for (int i = 0; i < nedges; i++) { + size_t src = data[p]; + size_t trg = data[p + 1]; + TransitionType ttype = static_cast(data[p + 2]); + size_t arg1 = data[p + 3]; + size_t arg2 = data[p + 4]; + size_t arg3 = data[p + 5]; + ConstTransitionPtr trans = edgeFactory(*atn, ttype, trg, arg1, arg2, arg3, sets); + ATNState *srcState = atn->states[src]; + srcState->addTransition(std::move(trans)); + p += 6; + } } - // edges for rule stop states can be derived, so they aren't serialized - for (ATNState *state : atn.states) { + for (ATNState *state : atn->states) { for (size_t i = 0; i < state->transitions.size(); i++) { - Transition *t = state->transitions[i]; - if (!is(t)) { + const Transition *t = state->transitions[i].get(); + if (!RuleTransition::is(t)) { continue; } - RuleTransition *ruleTransition = static_cast(t); + const RuleTransition *ruleTransition = downCast(t); size_t outermostPrecedenceReturn = INVALID_INDEX; - if (atn.ruleToStartState[ruleTransition->target->ruleIndex]->isLeftRecursiveRule) { + if (atn->ruleToStartState[ruleTransition->target->ruleIndex]->isLeftRecursiveRule) { if (ruleTransition->precedence == 0) { outermostPrecedenceReturn = ruleTransition->target->ruleIndex; } } - EpsilonTransition *returnTransition = new EpsilonTransition(ruleTransition->followState, outermostPrecedenceReturn); /* mem check: freed in ANTState d-tor */ - atn.ruleToStopState[ruleTransition->target->ruleIndex]->addTransition(returnTransition); + ConstTransitionPtr returnTransition = std::make_unique(ruleTransition->followState, outermostPrecedenceReturn); + atn->ruleToStopState[ruleTransition->target->ruleIndex]->addTransition(std::move(returnTransition)); } } - for (ATNState *state : atn.states) { - if (is(state)) { - BlockStartState *startState = static_cast(state); + for (ATNState *state : atn->states) { + if (BlockStartState::is(state)) { + BlockStartState *startState = downCast(state); // we need to know the end state to set its start state if (startState->endState == nullptr) { @@ -353,23 +420,23 @@ ATN ATNDeserializer::deserialize(const std::vector& input) { throw IllegalStateException(); } - startState->endState->startState = static_cast(state); + startState->endState->startState = downCast(state); } - if (is(state)) { - PlusLoopbackState *loopbackState = static_cast(state); + if (PlusLoopbackState::is(state)) { + PlusLoopbackState *loopbackState = downCast(state); for (size_t i = 0; i < loopbackState->transitions.size(); i++) { ATNState *target = loopbackState->transitions[i]->target; - if (is(target)) { - (static_cast(target))->loopBackState = loopbackState; + if (PlusBlockStartState::is(target)) { + (downCast(target))->loopBackState = loopbackState; } } - } else if (is(state)) { - StarLoopbackState *loopbackState = static_cast(state); + } else if (StarLoopbackState::is(state)) { + StarLoopbackState *loopbackState = downCast(state); for (size_t i = 0; i < loopbackState->transitions.size(); i++) { ATNState *target = loopbackState->transitions[i]->target; - if (is(target)) { - (static_cast(target))->loopBackState = loopbackState; + if (StarLoopEntryState::is(target)) { + downCast(target)->loopBackState = loopbackState; } } } @@ -379,104 +446,76 @@ ATN ATNDeserializer::deserialize(const std::vector& input) { // DECISIONS // size_t ndecisions = data[p++]; - for (size_t i = 1; i <= ndecisions; i++) { + atn->decisionToState.reserve(ndecisions); + for (size_t i = 0; i < ndecisions; i++) { size_t s = data[p++]; - DecisionState *decState = dynamic_cast(atn.states[s]); + DecisionState *decState = downCast(atn->states[s]); if (decState == nullptr) throw IllegalStateException(); - atn.decisionToState.push_back(decState); - decState->decision = (int)i - 1; + atn->decisionToState.push_back(decState); + decState->decision = static_cast(i); } // // LEXER ACTIONS // - if (atn.grammarType == ATNType::LEXER) { - if (supportsLexerActions) { - atn.lexerActions.resize(data[p++]); - for (size_t i = 0; i < atn.lexerActions.size(); i++) { - LexerActionType actionType = (LexerActionType)data[p++]; - int data1 = data[p++]; - if (data1 == 0xFFFF) { - data1 = -1; - } - - int data2 = data[p++]; - if (data2 == 0xFFFF) { - data2 = -1; - } - - atn.lexerActions[i] = lexerActionFactory(actionType, data1, data2); - } - } else { - // for compatibility with older serialized ATNs, convert the old - // serialized action index for action transitions to the new - // form, which is the index of a LexerCustomAction - for (ATNState *state : atn.states) { - for (size_t i = 0; i < state->transitions.size(); i++) { - Transition *transition = state->transitions[i]; - if (!is(transition)) { - continue; - } - - size_t ruleIndex = static_cast(transition)->ruleIndex; - size_t actionIndex = static_cast(transition)->actionIndex; - Ref lexerAction = std::make_shared(ruleIndex, actionIndex); - state->transitions[i] = new ActionTransition(transition->target, ruleIndex, atn.lexerActions.size(), false); /* mem-check freed in ATNState d-tor */ - delete transition; // ml: no longer needed since we just replaced it. - atn.lexerActions.push_back(lexerAction); - } - } + if (atn->grammarType == ATNType::LEXER) { + atn->lexerActions.resize(data[p++]); + for (size_t i = 0; i < atn->lexerActions.size(); i++) { + LexerActionType actionType = static_cast(data[p++]); + int data1 = data[p++]; + int data2 = data[p++]; + atn->lexerActions[i] = lexerActionFactory(actionType, data1, data2); } } - markPrecedenceDecisions(atn); + markPrecedenceDecisions(*atn); - if (deserializationOptions.isVerifyATN()) { - verifyATN(atn); + if (_deserializationOptions.isVerifyATN()) { + verifyATN(*atn); } - if (deserializationOptions.isGenerateRuleBypassTransitions() && atn.grammarType == ATNType::PARSER) { - atn.ruleToTokenType.resize(atn.ruleToStartState.size()); - for (size_t i = 0; i < atn.ruleToStartState.size(); i++) { - atn.ruleToTokenType[i] = int(atn.maxTokenType + i + 1); + if (_deserializationOptions.isGenerateRuleBypassTransitions() && atn->grammarType == ATNType::PARSER) { + atn->ruleToTokenType.resize(atn->ruleToStartState.size()); + for (size_t i = 0; i < atn->ruleToStartState.size(); i++) { + atn->ruleToTokenType[i] = static_cast(atn->maxTokenType + i + 1); } - for (std::vector::size_type i = 0; i < atn.ruleToStartState.size(); i++) { + for (std::vector::size_type i = 0; i < atn->ruleToStartState.size(); i++) { BasicBlockStartState *bypassStart = new BasicBlockStartState(); /* mem check: freed in ATN d-tor */ - bypassStart->ruleIndex = (int)i; - atn.addState(bypassStart); + bypassStart->ruleIndex = static_cast(i); + atn->addState(bypassStart); BlockEndState *bypassStop = new BlockEndState(); /* mem check: freed in ATN d-tor */ - bypassStop->ruleIndex = (int)i; - atn.addState(bypassStop); + bypassStop->ruleIndex = static_cast(i); + atn->addState(bypassStop); bypassStart->endState = bypassStop; - atn.defineDecisionState(bypassStart); + atn->defineDecisionState(bypassStart); bypassStop->startState = bypassStart; ATNState *endState; - Transition *excludeTransition = nullptr; - if (atn.ruleToStartState[i]->isLeftRecursiveRule) { + const Transition *excludeTransition = nullptr; + if (atn->ruleToStartState[i]->isLeftRecursiveRule) { // wrap from the beginning of the rule to the StarLoopEntryState endState = nullptr; - for (ATNState *state : atn.states) { + for (ATNState *state : atn->states) { if (state->ruleIndex != i) { continue; } - if (!is(state)) { + if (!StarLoopEntryState::is(state)) { continue; } ATNState *maybeLoopEndState = state->transitions[state->transitions.size() - 1]->target; - if (!is(maybeLoopEndState)) { + if (!LoopEndState::is(maybeLoopEndState)) { continue; } - if (maybeLoopEndState->epsilonOnlyTransitions && is(maybeLoopEndState->transitions[0]->target)) { + if (maybeLoopEndState->epsilonOnlyTransitions && RuleStopState::is(maybeLoopEndState->transitions[0]->target)) { endState = state; break; } @@ -487,78 +526,50 @@ ATN ATNDeserializer::deserialize(const std::vector& input) { } - excludeTransition = (static_cast(endState))->loopBackState->transitions[0]; + excludeTransition = (static_cast(endState))->loopBackState->transitions[0].get(); } else { - endState = atn.ruleToStopState[i]; + endState = atn->ruleToStopState[i]; } // all non-excluded transitions that currently target end state need to target blockEnd instead - for (ATNState *state : atn.states) { - for (Transition *transition : state->transitions) { - if (transition == excludeTransition) { + for (ATNState *state : atn->states) { + for (auto &transition : state->transitions) { + if (transition.get() == excludeTransition) { continue; } if (transition->target == endState) { - transition->target = bypassStop; + const_cast(transition.get())->target = bypassStop; } } } // all transitions leaving the rule start state need to leave blockStart instead - while (atn.ruleToStartState[i]->transitions.size() > 0) { - Transition *transition = atn.ruleToStartState[i]->removeTransition(atn.ruleToStartState[i]->transitions.size() - 1); - bypassStart->addTransition(transition); + while (atn->ruleToStartState[i]->transitions.size() > 0) { + ConstTransitionPtr transition = atn->ruleToStartState[i]->removeTransition(atn->ruleToStartState[i]->transitions.size() - 1); + bypassStart->addTransition(std::move(transition)); } // link the new states - atn.ruleToStartState[i]->addTransition(new EpsilonTransition(bypassStart)); /* mem check: freed in ATNState d-tor */ - bypassStop->addTransition(new EpsilonTransition(endState)); /* mem check: freed in ATNState d-tor */ + atn->ruleToStartState[i]->addTransition(std::make_unique(bypassStart)); + bypassStop->addTransition(std::make_unique(endState)); ATNState *matchState = new BasicState(); /* mem check: freed in ATN d-tor */ - atn.addState(matchState); - matchState->addTransition(new AtomTransition(bypassStop, atn.ruleToTokenType[i])); /* mem check: freed in ATNState d-tor */ - bypassStart->addTransition(new EpsilonTransition(matchState)); /* mem check: freed in ATNState d-tor */ + atn->addState(matchState); + matchState->addTransition(std::make_unique(bypassStop, atn->ruleToTokenType[i])); + bypassStart->addTransition(std::make_unique(matchState)); } - if (deserializationOptions.isVerifyATN()) { + if (_deserializationOptions.isVerifyATN()) { // reverify after modification - verifyATN(atn); + verifyATN(*atn); } } return atn; } -/** - * Analyze the {@link StarLoopEntryState} states in the specified ATN to set - * the {@link StarLoopEntryState#isPrecedenceDecision} field to the - * correct value. - * - * @param atn The ATN. - */ -void ATNDeserializer::markPrecedenceDecisions(const ATN &atn) { - for (ATNState *state : atn.states) { - if (!is(state)) { - continue; - } - - /* We analyze the ATN to determine if this ATN decision state is the - * decision for the closure block that determines whether a - * precedence rule should continue or complete. - */ - if (atn.ruleToStartState[state->ruleIndex]->isLeftRecursiveRule) { - ATNState *maybeLoopEndState = state->transitions[state->transitions.size() - 1]->target; - if (is(maybeLoopEndState)) { - if (maybeLoopEndState->epsilonOnlyTransitions && is(maybeLoopEndState->transitions[0]->target)) { - static_cast(state)->isPrecedenceDecision = true; - } - } - } - } -} - -void ATNDeserializer::verifyATN(const ATN &atn) { +void ATNDeserializer::verifyATN(const ATN &atn) const { // verify assumptions for (ATNState *state : atn.states) { if (state == nullptr) { @@ -567,190 +578,52 @@ void ATNDeserializer::verifyATN(const ATN &atn) { checkCondition(state->epsilonOnlyTransitions || state->transitions.size() <= 1); - if (is(state)) { - checkCondition((static_cast(state))->loopBackState != nullptr); + if (PlusBlockStartState::is(state)) { + checkCondition((downCast(state))->loopBackState != nullptr); } - if (is(state)) { - StarLoopEntryState *starLoopEntryState = static_cast(state); + if (StarLoopEntryState::is(state)) { + StarLoopEntryState *starLoopEntryState = downCast(state); checkCondition(starLoopEntryState->loopBackState != nullptr); checkCondition(starLoopEntryState->transitions.size() == 2); - if (is(starLoopEntryState->transitions[0]->target)) { - checkCondition(static_cast(starLoopEntryState->transitions[1]->target) != nullptr); + if (StarBlockStartState::is(starLoopEntryState->transitions[0]->target)) { + checkCondition(downCast(starLoopEntryState->transitions[1]->target) != nullptr); checkCondition(!starLoopEntryState->nonGreedy); - } else if (is(starLoopEntryState->transitions[0]->target)) { - checkCondition(is(starLoopEntryState->transitions[1]->target)); + } else if (LoopEndState::is(starLoopEntryState->transitions[0]->target)) { + checkCondition(StarBlockStartState::is(starLoopEntryState->transitions[1]->target)); checkCondition(starLoopEntryState->nonGreedy); } else { throw IllegalStateException(); - } } - if (is(state)) { + if (StarLoopbackState::is(state)) { checkCondition(state->transitions.size() == 1); - checkCondition(is(state->transitions[0]->target)); + checkCondition(StarLoopEntryState::is(state->transitions[0]->target)); } - if (is(state)) { - checkCondition((static_cast(state))->loopBackState != nullptr); + if (LoopEndState::is(state)) { + checkCondition((downCast(state))->loopBackState != nullptr); } - if (is(state)) { - checkCondition((static_cast(state))->stopState != nullptr); + if (RuleStartState::is(state)) { + checkCondition((downCast(state))->stopState != nullptr); } - if (is(state)) { - checkCondition((static_cast(state))->endState != nullptr); + if (BlockStartState::is(state)) { + checkCondition((downCast(state))->endState != nullptr); } - if (is(state)) { - checkCondition((static_cast(state))->startState != nullptr); + if (BlockEndState::is(state)) { + checkCondition((downCast(state))->startState != nullptr); } - if (is(state)) { - DecisionState *decisionState = static_cast(state); + if (DecisionState::is(state)) { + DecisionState *decisionState = downCast(state); checkCondition(decisionState->transitions.size() <= 1 || decisionState->decision >= 0); } else { - checkCondition(state->transitions.size() <= 1 || is(state)); + checkCondition(state->transitions.size() <= 1 || RuleStopState::is(state)); } } } - -void ATNDeserializer::checkCondition(bool condition) { - checkCondition(condition, ""); -} - -void ATNDeserializer::checkCondition(bool condition, const std::string &message) { - if (!condition) { - throw IllegalStateException(message); - } -} - -antlrcpp::Guid ATNDeserializer::toUUID(const unsigned short *data, size_t offset) { - return antlrcpp::Guid((uint16_t *)data + offset, true); -} - -/* mem check: all created instances are freed in the d-tor of the ATNState they are added to. */ -Transition *ATNDeserializer::edgeFactory(const ATN &atn, size_t type, size_t /*src*/, size_t trg, size_t arg1, - size_t arg2, size_t arg3, - const std::vector &sets) { - - ATNState *target = atn.states[trg]; - switch (type) { - case Transition::EPSILON: - return new EpsilonTransition(target); - case Transition::RANGE: - if (arg3 != 0) { - return new RangeTransition(target, Token::EOF, arg2); - } else { - return new RangeTransition(target, arg1, arg2); - } - case Transition::RULE: - return new RuleTransition(static_cast(atn.states[arg1]), arg2, (int)arg3, target); - case Transition::PREDICATE: - return new PredicateTransition(target, arg1, arg2, arg3 != 0); - case Transition::PRECEDENCE: - return new PrecedencePredicateTransition(target, (int)arg1); - case Transition::ATOM: - if (arg3 != 0) { - return new AtomTransition(target, Token::EOF); - } else { - return new AtomTransition(target, arg1); - } - case Transition::ACTION: - return new ActionTransition(target, arg1, arg2, arg3 != 0); - case Transition::SET: - return new SetTransition(target, sets[arg1]); - case Transition::NOT_SET: - return new NotSetTransition(target, sets[arg1]); - case Transition::WILDCARD: - return new WildcardTransition(target); - } - - throw IllegalArgumentException("The specified transition type is not valid."); -} - -/* mem check: all created instances are freed in the d-tor of the ATN. */ -ATNState* ATNDeserializer::stateFactory(size_t type, size_t ruleIndex) { - ATNState *s; - switch (type) { - case ATNState::ATN_INVALID_TYPE: - return nullptr; - case ATNState::BASIC : - s = new BasicState(); - break; - case ATNState::RULE_START : - s = new RuleStartState(); - break; - case ATNState::BLOCK_START : - s = new BasicBlockStartState(); - break; - case ATNState::PLUS_BLOCK_START : - s = new PlusBlockStartState(); - break; - case ATNState::STAR_BLOCK_START : - s = new StarBlockStartState(); - break; - case ATNState::TOKEN_START : - s = new TokensStartState(); - break; - case ATNState::RULE_STOP : - s = new RuleStopState(); - break; - case ATNState::BLOCK_END : - s = new BlockEndState(); - break; - case ATNState::STAR_LOOP_BACK : - s = new StarLoopbackState(); - break; - case ATNState::STAR_LOOP_ENTRY : - s = new StarLoopEntryState(); - break; - case ATNState::PLUS_LOOP_BACK : - s = new PlusLoopbackState(); - break; - case ATNState::LOOP_END : - s = new LoopEndState(); - break; - default : - std::string message = "The specified state type " + std::to_string(type) + " is not valid."; - throw IllegalArgumentException(message); - } - - s->ruleIndex = ruleIndex; - return s; -} - -Ref ATNDeserializer::lexerActionFactory(LexerActionType type, int data1, int data2) { - switch (type) { - case LexerActionType::CHANNEL: - return std::make_shared(data1); - - case LexerActionType::CUSTOM: - return std::make_shared(data1, data2); - - case LexerActionType::MODE: - return std::make_shared< LexerModeAction>(data1); - - case LexerActionType::MORE: - return LexerMoreAction::getInstance(); - - case LexerActionType::POP_MODE: - return LexerPopModeAction::getInstance(); - - case LexerActionType::PUSH_MODE: - return std::make_shared(data1); - - case LexerActionType::SKIP: - return LexerSkipAction::getInstance(); - - case LexerActionType::TYPE: - return std::make_shared(data1); - - default: - throw IllegalArgumentException("The specified lexer action type " + std::to_string(static_cast(type)) + - " is not valid."); - } -} diff --git a/runtime/Cpp/runtime/src/atn/ATNDeserializer.h b/runtime/Cpp/runtime/src/atn/ATNDeserializer.h index 57b6c7b285..9be49159fd 100755 --- a/runtime/Cpp/runtime/src/atn/ATNDeserializer.h +++ b/runtime/Cpp/runtime/src/atn/ATNDeserializer.h @@ -5,86 +5,27 @@ #pragma once -#include "atn/LexerAction.h" #include "atn/ATNDeserializationOptions.h" +#include "atn/SerializedATNView.h" +#include "atn/LexerAction.h" +#include "atn/Transition.h" namespace antlr4 { namespace atn { - class ANTLR4CPP_PUBLIC ATNDeserializer { + class ANTLR4CPP_PUBLIC ATNDeserializer final { public: -#if __cplusplus >= 201703L - static constexpr size_t SERIALIZED_VERSION = 3; -#else - enum : size_t { - SERIALIZED_VERSION = 3, - }; -#endif - - /// This is the current serialized UUID. - // ml: defined as function to avoid the “static initialization order fiasco”. - static antlrcpp::Guid SERIALIZED_UUID(); + static constexpr size_t SERIALIZED_VERSION = 4; ATNDeserializer(); - ATNDeserializer(const ATNDeserializationOptions& dso); - virtual ~ATNDeserializer(); - - static antlrcpp::Guid toUUID(const unsigned short *data, size_t offset); - - virtual ATN deserialize(const std::vector &input); - virtual void verifyATN(const ATN &atn); - - static void checkCondition(bool condition); - static void checkCondition(bool condition, const std::string &message); - static Transition *edgeFactory(const ATN &atn, size_t type, size_t src, size_t trg, size_t arg1, size_t arg2, - size_t arg3, const std::vector &sets); + explicit ATNDeserializer(ATNDeserializationOptions deserializationOptions); - static ATNState *stateFactory(size_t type, size_t ruleIndex); - - protected: - /// Determines if a particular serialized representation of an ATN supports - /// a particular feature, identified by the used for serializing - /// the ATN at the time the feature was first introduced. - /// - /// The marking the first time the feature was - /// supported in the serialized ATN. - /// The of the actual serialized ATN which is - /// currently being deserialized. - /// {@code true} if the {@code actualUuid} value represents a - /// serialized ATN at or after the feature identified by {@code feature} was - /// introduced; otherwise, {@code false}. - virtual bool isFeatureSupported(const antlrcpp::Guid &feature, const antlrcpp::Guid &actualUuid); - void markPrecedenceDecisions(const ATN &atn); - Ref lexerActionFactory(LexerActionType type, int data1, int data2); + std::unique_ptr deserialize(SerializedATNView input) const; + void verifyATN(const ATN &atn) const; private: - /// This is the earliest supported serialized UUID. - static antlrcpp::Guid BASE_SERIALIZED_UUID(); - - /// This UUID indicates an extension of for the - /// addition of precedence predicates. - static antlrcpp::Guid ADDED_PRECEDENCE_TRANSITIONS(); - - /** - * This UUID indicates an extension of ADDED_PRECEDENCE_TRANSITIONS - * for the addition of lexer actions encoded as a sequence of - * LexerAction instances. - */ - static antlrcpp::Guid ADDED_LEXER_ACTIONS(); - - /** - * This UUID indicates the serialized ATN contains two sets of - * IntervalSets, where the second set's values are encoded as - * 32-bit integers to support the full Unicode SMP range up to U+10FFFF. - */ - static antlrcpp::Guid ADDED_UNICODE_SMP(); - - /// This list contains all of the currently supported UUIDs, ordered by when - /// the feature first appeared in this branch. - static std::vector& SUPPORTED_UUIDS(); - - ATNDeserializationOptions deserializationOptions; + const ATNDeserializationOptions _deserializationOptions; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/ATNSerializer.cpp b/runtime/Cpp/runtime/src/atn/ATNSerializer.cpp deleted file mode 100755 index c680d7be87..0000000000 --- a/runtime/Cpp/runtime/src/atn/ATNSerializer.cpp +++ /dev/null @@ -1,621 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "misc/IntervalSet.h" -#include "atn/ATNType.h" -#include "atn/ATNState.h" -#include "atn/BlockEndState.h" - -#include "atn/DecisionState.h" -#include "atn/RuleStartState.h" -#include "atn/LoopEndState.h" -#include "atn/BlockStartState.h" -#include "atn/Transition.h" -#include "atn/SetTransition.h" -#include "Token.h" -#include "misc/Interval.h" -#include "atn/ATN.h" - -#include "atn/RuleTransition.h" -#include "atn/PrecedencePredicateTransition.h" -#include "atn/PredicateTransition.h" -#include "atn/RangeTransition.h" -#include "atn/AtomTransition.h" -#include "atn/ActionTransition.h" -#include "atn/ATNDeserializer.h" - -#include "atn/TokensStartState.h" -#include "Exceptions.h" -#include "support/CPPUtils.h" - -#include "atn/LexerChannelAction.h" -#include "atn/LexerCustomAction.h" -#include "atn/LexerModeAction.h" -#include "atn/LexerPushModeAction.h" -#include "atn/LexerTypeAction.h" - -#include "Exceptions.h" - -#include "atn/ATNSerializer.h" - -using namespace antlrcpp; -using namespace antlr4::atn; - -ATNSerializer::ATNSerializer(ATN *atn) { this->atn = atn; } - -ATNSerializer::ATNSerializer(ATN *atn, const std::vector &tokenNames) { - this->atn = atn; - _tokenNames = tokenNames; -} - -ATNSerializer::~ATNSerializer() { } - -std::vector ATNSerializer::serialize() { - std::vector data; - data.push_back(ATNDeserializer::SERIALIZED_VERSION); - serializeUUID(data, ATNDeserializer::SERIALIZED_UUID()); - - // convert grammar type to ATN const to avoid dependence on ANTLRParser - data.push_back(static_cast(atn->grammarType)); - data.push_back(atn->maxTokenType); - size_t nedges = 0; - - std::unordered_map setIndices; - std::vector sets; - - // dump states, count edges and collect sets while doing so - std::vector nonGreedyStates; - std::vector precedenceStates; - data.push_back(atn->states.size()); - for (ATNState *s : atn->states) { - if (s == nullptr) { // might be optimized away - data.push_back(ATNState::ATN_INVALID_TYPE); - continue; - } - - size_t stateType = s->getStateType(); - if (is(s) && (static_cast(s))->nonGreedy) { - nonGreedyStates.push_back(s->stateNumber); - } - - if (is(s) && (static_cast(s))->isLeftRecursiveRule) { - precedenceStates.push_back(s->stateNumber); - } - - data.push_back(stateType); - - if (s->ruleIndex == INVALID_INDEX) { - data.push_back(0xFFFF); - } - else { - data.push_back(s->ruleIndex); - } - - if (s->getStateType() == ATNState::LOOP_END) { - data.push_back((static_cast(s))->loopBackState->stateNumber); - } - else if (is(s)) { - data.push_back((static_cast(s))->endState->stateNumber); - } - - if (s->getStateType() != ATNState::RULE_STOP) { - // the deserializer can trivially derive these edges, so there's no need - // to serialize them - nedges += s->transitions.size(); - } - - for (size_t i = 0; i < s->transitions.size(); i++) { - Transition *t = s->transitions[i]; - Transition::SerializationType edgeType = t->getSerializationType(); - if (edgeType == Transition::SET || edgeType == Transition::NOT_SET) { - SetTransition *st = static_cast(t); - if (setIndices.find(st->set) == setIndices.end()) { - sets.push_back(st->set); - setIndices.insert({ st->set, (int)sets.size() - 1 }); - } - } - } - } - - // non-greedy states - data.push_back(nonGreedyStates.size()); - for (size_t i = 0; i < nonGreedyStates.size(); i++) { - data.push_back(nonGreedyStates.at(i)); - } - - // precedence states - data.push_back(precedenceStates.size()); - for (size_t i = 0; i < precedenceStates.size(); i++) { - data.push_back(precedenceStates.at(i)); - } - - size_t nrules = atn->ruleToStartState.size(); - data.push_back(nrules); - for (size_t r = 0; r < nrules; r++) { - ATNState *ruleStartState = atn->ruleToStartState[r]; - data.push_back(ruleStartState->stateNumber); - if (atn->grammarType == ATNType::LEXER) { - if (atn->ruleToTokenType[r] == Token::EOF) { - data.push_back(0xFFFF); - } - else { - data.push_back(atn->ruleToTokenType[r]); - } - } - } - - size_t nmodes = atn->modeToStartState.size(); - data.push_back(nmodes); - if (nmodes > 0) { - for (const auto &modeStartState : atn->modeToStartState) { - data.push_back(modeStartState->stateNumber); - } - } - - size_t nsets = sets.size(); - data.push_back(nsets); - for (auto set : sets) { - bool containsEof = set.contains(Token::EOF); - if (containsEof && set.getIntervals().at(0).b == -1) { - data.push_back(set.getIntervals().size() - 1); - } - else { - data.push_back(set.getIntervals().size()); - } - - data.push_back(containsEof ? 1 : 0); - for (const auto &interval : set.getIntervals()) { - if (interval.a == -1) { - if (interval.b == -1) { - continue; - } else { - data.push_back(0); - } - } - else { - data.push_back(interval.a); - } - - data.push_back(interval.b); - } - } - - data.push_back(nedges); - for (ATNState *s : atn->states) { - if (s == nullptr) { - // might be optimized away - continue; - } - - if (s->getStateType() == ATNState::RULE_STOP) { - continue; - } - - for (size_t i = 0; i < s->transitions.size(); i++) { - Transition *t = s->transitions[i]; - - if (atn->states[t->target->stateNumber] == nullptr) { - throw IllegalStateException("Cannot serialize a transition to a removed state."); - } - - size_t src = s->stateNumber; - size_t trg = t->target->stateNumber; - Transition::SerializationType edgeType = t->getSerializationType(); - size_t arg1 = 0; - size_t arg2 = 0; - size_t arg3 = 0; - switch (edgeType) { - case Transition::RULE: - trg = (static_cast(t))->followState->stateNumber; - arg1 = (static_cast(t))->target->stateNumber; - arg2 = (static_cast(t))->ruleIndex; - arg3 = (static_cast(t))->precedence; - break; - case Transition::PRECEDENCE: - { - PrecedencePredicateTransition *ppt = - static_cast(t); - arg1 = ppt->precedence; - } - break; - case Transition::PREDICATE: - { - PredicateTransition *pt = static_cast(t); - arg1 = pt->ruleIndex; - arg2 = pt->predIndex; - arg3 = pt->isCtxDependent ? 1 : 0; - } - break; - case Transition::RANGE: - arg1 = (static_cast(t))->from; - arg2 = (static_cast(t))->to; - if (arg1 == Token::EOF) { - arg1 = 0; - arg3 = 1; - } - - break; - case Transition::ATOM: - arg1 = (static_cast(t))->_label; - if (arg1 == Token::EOF) { - arg1 = 0; - arg3 = 1; - } - - break; - case Transition::ACTION: - { - ActionTransition *at = static_cast(t); - arg1 = at->ruleIndex; - arg2 = at->actionIndex; - if (arg2 == INVALID_INDEX) { - arg2 = 0xFFFF; - } - - arg3 = at->isCtxDependent ? 1 : 0; - } - break; - case Transition::SET: - arg1 = setIndices[(static_cast(t))->set]; - break; - - case Transition::NOT_SET: - arg1 = setIndices[(static_cast(t))->set]; - break; - - default: - break; - } - - data.push_back(src); - data.push_back(trg); - data.push_back(edgeType); - data.push_back(arg1); - data.push_back(arg2); - data.push_back(arg3); - } - } - - size_t ndecisions = atn->decisionToState.size(); - data.push_back(ndecisions); - for (DecisionState *decStartState : atn->decisionToState) { - data.push_back(decStartState->stateNumber); - } - - // LEXER ACTIONS - if (atn->grammarType == ATNType::LEXER) { - data.push_back(atn->lexerActions.size()); - for (Ref &action : atn->lexerActions) { - data.push_back(static_cast(action->getActionType())); - switch (action->getActionType()) { - case LexerActionType::CHANNEL: - { - int channel = std::dynamic_pointer_cast(action)->getChannel(); - data.push_back(channel != -1 ? channel : 0xFFFF); - data.push_back(0); - break; - } - - case LexerActionType::CUSTOM: - { - size_t ruleIndex = std::dynamic_pointer_cast(action)->getRuleIndex(); - size_t actionIndex = std::dynamic_pointer_cast(action)->getActionIndex(); - data.push_back(ruleIndex != INVALID_INDEX ? ruleIndex : 0xFFFF); - data.push_back(actionIndex != INVALID_INDEX ? actionIndex : 0xFFFF); - break; - } - - case LexerActionType::MODE: - { - int mode = std::dynamic_pointer_cast(action)->getMode(); - data.push_back(mode != -1 ? mode : 0xFFFF); - data.push_back(0); - break; - } - - case LexerActionType::MORE: - data.push_back(0); - data.push_back(0); - break; - - case LexerActionType::POP_MODE: - data.push_back(0); - data.push_back(0); - break; - - case LexerActionType::PUSH_MODE: - { - int mode = std::dynamic_pointer_cast(action)->getMode(); - data.push_back(mode != -1 ? mode : 0xFFFF); - data.push_back(0); - break; - } - - case LexerActionType::SKIP: - data.push_back(0); - data.push_back(0); - break; - - case LexerActionType::TYPE: - { - int type = std::dynamic_pointer_cast(action)->getType(); - data.push_back(type != -1 ? type : 0xFFFF); - data.push_back(0); - break; - } - - default: - throw IllegalArgumentException("The specified lexer action type " + - std::to_string(static_cast(action->getActionType())) + - " is not valid."); - } - } - } - - // don't adjust the first value since that's the version number - for (size_t i = 1; i < data.size(); i++) { - if (data.at(i) > 0xFFFF) { - throw UnsupportedOperationException("Serialized ATN data element out of range."); - } - - size_t value = (data.at(i) + 2) & 0xFFFF; - data.at(i) = value; - } - - return data; -} - -//------------------------------------------------------------------------------------------------------------ - -std::string ATNSerializer::decode(const std::wstring &inpdata) { - if (inpdata.size() < 10) - throw IllegalArgumentException("Not enough data to decode"); - - std::vector data(inpdata.size()); - data[0] = (uint16_t)inpdata[0]; - - // Don't adjust the first value since that's the version number. - for (size_t i = 1; i < inpdata.size(); ++i) { - data[i] = (uint16_t)inpdata[i] - 2; - } - - std::string buf; - size_t p = 0; - size_t version = data[p++]; - if (version != ATNDeserializer::SERIALIZED_VERSION) { - std::string reason = "Could not deserialize ATN with version " + std::to_string(version) + "(expected " + - std::to_string(ATNDeserializer::SERIALIZED_VERSION) + ")."; - throw UnsupportedOperationException("ATN Serializer" + reason); - } - - antlrcpp::Guid uuid = ATNDeserializer::toUUID(data.data(), p); - p += 8; - if (uuid != ATNDeserializer::SERIALIZED_UUID()) { - std::string reason = "Could not deserialize ATN with UUID " + uuid.toString() + " (expected " + - ATNDeserializer::SERIALIZED_UUID().toString() + ")."; - throw UnsupportedOperationException("ATN Serializer" + reason); - } - - p++; // skip grammarType - size_t maxType = data[p++]; - buf.append("max type ").append(std::to_string(maxType)).append("\n"); - size_t nstates = data[p++]; - for (size_t i = 0; i < nstates; i++) { - size_t stype = data[p++]; - if (stype == ATNState::ATN_INVALID_TYPE) { // ignore bad type of states - continue; - } - size_t ruleIndex = data[p++]; - if (ruleIndex == 0xFFFF) { - ruleIndex = INVALID_INDEX; - } - - std::string arg = ""; - if (stype == ATNState::LOOP_END) { - int loopBackStateNumber = data[p++]; - arg = std::string(" ") + std::to_string(loopBackStateNumber); - } - else if (stype == ATNState::PLUS_BLOCK_START || - stype == ATNState::STAR_BLOCK_START || - stype == ATNState::BLOCK_START) { - int endStateNumber = data[p++]; - arg = std::string(" ") + std::to_string(endStateNumber); - } - buf.append(std::to_string(i)) - .append(":") - .append(ATNState::serializationNames[stype]) - .append(" ") - .append(std::to_string(ruleIndex)) - .append(arg) - .append("\n"); - } - size_t numNonGreedyStates = data[p++]; - p += numNonGreedyStates; // Instead of that useless loop below. - /* - for (int i = 0; i < numNonGreedyStates; i++) { - int stateNumber = data[p++]; - } - */ - - size_t numPrecedenceStates = data[p++]; - p += numPrecedenceStates; - /* - for (int i = 0; i < numPrecedenceStates; i++) { - int stateNumber = data[p++]; - } - */ - - size_t nrules = data[p++]; - for (size_t i = 0; i < nrules; i++) { - size_t s = data[p++]; - if (atn->grammarType == ATNType::LEXER) { - size_t arg1 = data[p++]; - buf.append("rule ") - .append(std::to_string(i)) - .append(":") - .append(std::to_string(s)) - .append(" ") - .append(std::to_string(arg1)) - .append("\n"); - } - else { - buf.append("rule ") - .append(std::to_string(i)) - .append(":") - .append(std::to_string(s)) - .append("\n"); - } - } - size_t nmodes = data[p++]; - for (size_t i = 0; i < nmodes; i++) { - size_t s = data[p++]; - buf.append("mode ") - .append(std::to_string(i)) - .append(":") - .append(std::to_string(s)) - .append("\n"); - } - size_t nsets = data[p++]; - for (size_t i = 0; i < nsets; i++) { - size_t nintervals = data[p++]; - buf.append(std::to_string(i)).append(":"); - bool containsEof = data[p++] != 0; - if (containsEof) { - buf.append(getTokenName(Token::EOF)); - } - - for (size_t j = 0; j < nintervals; j++) { - if (containsEof || j > 0) { - buf.append(", "); - } - - buf.append(getTokenName(data[p])) - .append("..") - .append(getTokenName(data[p + 1])); - p += 2; - } - buf.append("\n"); - } - size_t nedges = data[p++]; - for (size_t i = 0; i < nedges; i++) { - size_t src = data[p]; - size_t trg = data[p + 1]; - size_t ttype = data[p + 2]; - size_t arg1 = data[p + 3]; - size_t arg2 = data[p + 4]; - size_t arg3 = data[p + 5]; - buf.append(std::to_string(src)) - .append("->") - .append(std::to_string(trg)) - .append(" ") - .append(Transition::serializationNames[ttype]) - .append(" ") - .append(std::to_string(arg1)) - .append(",") - .append(std::to_string(arg2)) - .append(",") - .append(std::to_string(arg3)) - .append("\n"); - p += 6; - } - size_t ndecisions = data[p++]; - for (size_t i = 0; i < ndecisions; i++) { - size_t s = data[p++]; - buf += std::to_string(i) + ":" + std::to_string(s) + "\n"; - } - - if (atn->grammarType == ATNType::LEXER) { - //int lexerActionCount = data[p++]; - - //p += lexerActionCount * 3; // Instead of useless loop below. - /* - for (int i = 0; i < lexerActionCount; i++) { - LexerActionType actionType = (LexerActionType)data[p++]; - int data1 = data[p++]; - int data2 = data[p++]; - } - */ - } - - return buf; -} - -std::string ATNSerializer::getTokenName(size_t t) { - if (t == Token::EOF) { - return "EOF"; - } - - if (atn->grammarType == ATNType::LEXER && t <= 0x10FFFF) { - switch (t) { - case '\n': - return "'\\n'"; - case '\r': - return "'\\r'"; - case '\t': - return "'\\t'"; - case '\b': - return "'\\b'"; - case '\f': - return "'\\f'"; - case '\\': - return "'\\\\'"; - case '\'': - return "'\\''"; - default: - std::string s_hex = antlrcpp::toHexString((int)t); - if (s_hex >= "0" && s_hex <= "7F" && !iscntrl((int)t)) { - return "'" + std::to_string(t) + "'"; - } - - // turn on the bit above max "\u10FFFF" value so that we pad with zeros - // then only take last 6 digits - std::string hex = antlrcpp::toHexString((int)t | 0x1000000).substr(1, 6); - std::string unicodeStr = std::string("'\\u") + hex + std::string("'"); - return unicodeStr; - } - } - - if (_tokenNames.size() > 0 && t < _tokenNames.size()) { - return _tokenNames[t]; - } - - return std::to_string(t); -} - -std::wstring ATNSerializer::getSerializedAsString(ATN *atn) { - std::vector data = getSerialized(atn); - std::wstring result; - for (size_t entry : data) - result.push_back((wchar_t)entry); - - return result; -} - -std::vector ATNSerializer::getSerialized(ATN *atn) { - return ATNSerializer(atn).serialize(); -} - -std::string ATNSerializer::getDecoded(ATN *atn, std::vector &tokenNames) { - std::wstring serialized = getSerializedAsString(atn); - return ATNSerializer(atn, tokenNames).decode(serialized); -} - -void ATNSerializer::serializeUUID(std::vector &data, antlrcpp::Guid uuid) { - unsigned int twoBytes = 0; - bool firstByte = true; - for(antlrcpp::Guid::const_reverse_iterator rit = uuid.rbegin(); rit != uuid.rend(); ++rit ) - { - if (firstByte) { - twoBytes = *rit; - firstByte = false; - } else { - twoBytes |= (*rit << 8); - data.push_back(twoBytes); - firstByte = true; - } - } - if (!firstByte) - throw IllegalArgumentException( "The UUID provided is not valid (odd number of bytes)." ); -} diff --git a/runtime/Cpp/runtime/src/atn/ATNSerializer.h b/runtime/Cpp/runtime/src/atn/ATNSerializer.h deleted file mode 100755 index d222ebb593..0000000000 --- a/runtime/Cpp/runtime/src/atn/ATNSerializer.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#pragma once - -namespace antlr4 { -namespace atn { - - class ANTLR4CPP_PUBLIC ATNSerializer { - public: - ATN *atn; - - ATNSerializer(ATN *atn); - ATNSerializer(ATN *atn, const std::vector &tokenNames); - virtual ~ATNSerializer(); - - /// - /// Serialize state descriptors, edge descriptors, and decision->state map - /// into list of ints: - /// - /// grammar-type, (ANTLRParser.LEXER, ...) - /// max token type, - /// num states, - /// state-0-type ruleIndex, state-1-type ruleIndex, ... state-i-type - /// ruleIndex optional-arg ... - /// num rules, - /// rule-1-start-state rule-1-args, rule-2-start-state rule-2-args, ... - /// (args are token type,actionIndex in lexer else 0,0) - /// num modes, - /// mode-0-start-state, mode-1-start-state, ... (parser has 0 modes) - /// num sets - /// set-0-interval-count intervals, set-1-interval-count intervals, ... - /// num total edges, - /// src, trg, edge-type, edge arg1, optional edge arg2 (present always), - /// ... - /// num decisions, - /// decision-0-start-state, decision-1-start-state, ... - /// - /// Convenient to pack into unsigned shorts to make as Java string. - /// - virtual std::vector serialize(); - - virtual std::string decode(const std::wstring& data); - virtual std::string getTokenName(size_t t); - - /// Used by Java target to encode short/int array as chars in string. - static std::wstring getSerializedAsString(ATN *atn); - static std::vector getSerialized(ATN *atn); - - static std::string getDecoded(ATN *atn, std::vector &tokenNames); - - private: - std::vector _tokenNames; - - void serializeUUID(std::vector &data, antlrcpp::Guid uuid); - }; - -} // namespace atn -} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp b/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp index 29570b90db..3abe6882ff 100755 --- a/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp +++ b/runtime/Cpp/runtime/src/atn/ATNSimulator.cpp @@ -3,61 +3,31 @@ * can be found in the LICENSE.txt file in the project root. */ -#include "atn/ATNType.h" +#include "atn/ATNSimulator.h" + #include "atn/ATNConfigSet.h" -#include "dfa/DFAState.h" #include "atn/ATNDeserializer.h" -#include "atn/EmptyPredictionContext.h" - -#include "atn/ATNSimulator.h" +#include "atn/ATNType.h" +#include "dfa/DFAState.h" using namespace antlr4; using namespace antlr4::dfa; using namespace antlr4::atn; -const Ref ATNSimulator::ERROR = std::make_shared(INT32_MAX); -antlrcpp::SingleWriteMultipleReadLock ATNSimulator::_stateLock; -antlrcpp::SingleWriteMultipleReadLock ATNSimulator::_edgeLock; +const Ref ATNSimulator::ERROR = std::make_shared(std::numeric_limits::max()); ATNSimulator::ATNSimulator(const ATN &atn, PredictionContextCache &sharedContextCache) -: atn(atn), _sharedContextCache(sharedContextCache) { -} - -ATNSimulator::~ATNSimulator() { -} + : atn(atn), _sharedContextCache(sharedContextCache) {} void ATNSimulator::clearDFA() { throw UnsupportedOperationException("This ATN simulator does not support clearing the DFA."); } -PredictionContextCache& ATNSimulator::getSharedContextCache() { +PredictionContextCache& ATNSimulator::getSharedContextCache() const { return _sharedContextCache; } -Ref ATNSimulator::getCachedContext(Ref const& context) { +Ref ATNSimulator::getCachedContext(const Ref &context) { // This function must only be called with an active state lock, as we are going to change a shared structure. - std::map, Ref> visited; - return PredictionContext::getCachedContext(context, _sharedContextCache, visited); -} - -ATN ATNSimulator::deserialize(const std::vector &data) { - ATNDeserializer deserializer; - return deserializer.deserialize(data); -} - -void ATNSimulator::checkCondition(bool condition) { - ATNDeserializer::checkCondition(condition); -} - -void ATNSimulator::checkCondition(bool condition, const std::string &message) { - ATNDeserializer::checkCondition(condition, message); -} - -Transition *ATNSimulator::edgeFactory(const ATN &atn, int type, int src, int trg, int arg1, int arg2, int arg3, - const std::vector &sets) { - return ATNDeserializer::edgeFactory(atn, type, src, trg, arg1, arg2, arg3, sets); -} - -ATNState *ATNSimulator::stateFactory(int type, int ruleIndex) { - return ATNDeserializer::stateFactory(type, ruleIndex); + return PredictionContext::getCachedContext(context, getSharedContextCache()); } diff --git a/runtime/Cpp/runtime/src/atn/ATNSimulator.h b/runtime/Cpp/runtime/src/atn/ATNSimulator.h index f702c97f90..1b0ebf6db3 100755 --- a/runtime/Cpp/runtime/src/atn/ATNSimulator.h +++ b/runtime/Cpp/runtime/src/atn/ATNSimulator.h @@ -6,9 +6,10 @@ #pragma once #include "atn/ATN.h" +#include "atn/PredictionContext.h" +#include "atn/PredictionContextCache.h" #include "misc/IntervalSet.h" #include "support/CPPUtils.h" -#include "atn/PredictionContext.h" namespace antlr4 { namespace atn { @@ -20,7 +21,8 @@ namespace atn { const ATN &atn; ATNSimulator(const ATN &atn, PredictionContextCache &sharedContextCache); - virtual ~ATNSimulator(); + + virtual ~ATNSimulator() = default; virtual void reset() = 0; @@ -36,29 +38,11 @@ namespace atn { * @since 4.3 */ virtual void clearDFA(); - virtual PredictionContextCache& getSharedContextCache(); - virtual Ref getCachedContext(Ref const& context); - - /// @deprecated Use instead. - static ATN deserialize(const std::vector &data); - /// @deprecated Use instead. - static void checkCondition(bool condition); - - /// @deprecated Use instead. - static void checkCondition(bool condition, const std::string &message); - - /// @deprecated Use instead. - static Transition *edgeFactory(const ATN &atn, int type, int src, int trg, int arg1, int arg2, int arg3, - const std::vector &sets); - - /// @deprecated Use instead. - static ATNState *stateFactory(int type, int ruleIndex); + PredictionContextCache& getSharedContextCache() const; + Ref getCachedContext(const Ref &context); protected: - static antlrcpp::SingleWriteMultipleReadLock _stateLock; // Lock for DFA states. - static antlrcpp::SingleWriteMultipleReadLock _edgeLock; // Lock for the sparse edge map in DFA states. - /// /// The context cache maps all PredictionContext objects that are equals() /// to a single cached copy. This cache is shared across all contexts diff --git a/runtime/Cpp/runtime/src/atn/ATNState.cpp b/runtime/Cpp/runtime/src/atn/ATNState.cpp index 5dcb85d844..43deb258a8 100755 --- a/runtime/Cpp/runtime/src/atn/ATNState.cpp +++ b/runtime/Cpp/runtime/src/atn/ATNState.cpp @@ -13,30 +13,15 @@ using namespace antlr4::atn; using namespace antlrcpp; -ATNState::ATNState() { -} - -ATNState::~ATNState() { - for (auto *transition : transitions) { - delete transition; - } -} - -const std::vector ATNState::serializationNames = { - "INVALID", "BASIC", "RULE_START", "BLOCK_START", - "PLUS_BLOCK_START", "STAR_BLOCK_START", "TOKEN_START", "RULE_STOP", - "BLOCK_END", "STAR_LOOP_BACK", "STAR_LOOP_ENTRY", "PLUS_LOOP_BACK", "LOOP_END" -}; - -size_t ATNState::hashCode() { +size_t ATNState::hashCode() const { return stateNumber; } -bool ATNState::operator == (const ATNState &other) { +bool ATNState::equals(const ATNState &other) const { return stateNumber == other.stateNumber; } -bool ATNState::isNonGreedyExitState() { +bool ATNState::isNonGreedyExitState() const { return false; } @@ -44,14 +29,13 @@ std::string ATNState::toString() const { return std::to_string(stateNumber); } -void ATNState::addTransition(Transition *e) { - addTransition(transitions.size(), e); +void ATNState::addTransition(ConstTransitionPtr e) { + addTransition(transitions.size(), std::move(e)); } -void ATNState::addTransition(size_t index, Transition *e) { - for (Transition *transition : transitions) +void ATNState::addTransition(size_t index, ConstTransitionPtr e) { + for (const auto &transition : transitions) if (transition->target->stateNumber == e->target->stateNumber) { - delete e; return; } @@ -62,11 +46,11 @@ void ATNState::addTransition(size_t index, Transition *e) { epsilonOnlyTransitions = false; } - transitions.insert(transitions.begin() + index, e); + transitions.insert(transitions.begin() + index, std::move(e)); } -Transition *ATNState::removeTransition(size_t index) { - Transition *result = transitions[index]; +ConstTransitionPtr ATNState::removeTransition(size_t index) { + ConstTransitionPtr result = std::move(transitions[index]); transitions.erase(transitions.begin() + index); return result; } diff --git a/runtime/Cpp/runtime/src/atn/ATNState.h b/runtime/Cpp/runtime/src/atn/ATNState.h index 9d1422a9ea..8b3f118e28 100755 --- a/runtime/Cpp/runtime/src/atn/ATNState.h +++ b/runtime/Cpp/runtime/src/atn/ATNState.h @@ -6,6 +6,8 @@ #pragma once #include "misc/IntervalSet.h" +#include "atn/Transition.h" +#include "atn/ATNStateType.h" namespace antlr4 { namespace atn { @@ -81,58 +83,42 @@ namespace atn { class ANTLR4CPP_PUBLIC ATNState { public: - ATNState(); - ATNState(ATNState const&) = delete; - - virtual ~ATNState(); - - ATNState& operator=(ATNState const&) = delete; - -#if __cplusplus >= 201703L static constexpr size_t INITIAL_NUM_TRANSITIONS = 4; static constexpr size_t INVALID_STATE_NUMBER = std::numeric_limits::max(); -#else - enum : size_t { - INITIAL_NUM_TRANSITIONS = 4, - INVALID_STATE_NUMBER = static_cast(-1), // std::numeric_limits::max(); doesn't work in VS 2013 - }; -#endif - - enum { - ATN_INVALID_TYPE = 0, - BASIC = 1, - RULE_START = 2, - BLOCK_START = 3, - PLUS_BLOCK_START = 4, - STAR_BLOCK_START = 5, - TOKEN_START = 6, - RULE_STOP = 7, - BLOCK_END = 8, - STAR_LOOP_BACK = 9, - STAR_LOOP_ENTRY = 10, - PLUS_LOOP_BACK = 11, - LOOP_END = 12 - }; - - static const std::vector serializationNames; size_t stateNumber = INVALID_STATE_NUMBER; size_t ruleIndex = 0; // at runtime, we don't have Rule objects bool epsilonOnlyTransitions = false; - public: - virtual size_t hashCode(); - bool operator == (const ATNState &other); - /// Track the transitions emanating from this ATN state. - std::vector transitions; + std::vector transitions; + + ATNState() = delete; + + ATNState(ATNState const&) = delete; - virtual bool isNonGreedyExitState(); + ATNState(ATNState&&) = delete; + + virtual ~ATNState() = default; + + ATNState& operator=(ATNState const&) = delete; + + ATNState& operator=(ATNState&&) = delete; + + void addTransition(ConstTransitionPtr e); + void addTransition(size_t index, ConstTransitionPtr e); + ConstTransitionPtr removeTransition(size_t index); + + virtual size_t hashCode() const; + virtual bool equals(const ATNState &other) const; + + virtual bool isNonGreedyExitState() const; virtual std::string toString() const; - virtual void addTransition(Transition *e); - virtual void addTransition(size_t index, Transition *e); - virtual Transition* removeTransition(size_t index); - virtual size_t getStateType() = 0; + + ATNStateType getStateType() const { return _stateType; } + + protected: + explicit ATNState(ATNStateType stateType) : _stateType(stateType) {} private: /// Used to cache lookahead during parsing, not used during construction. @@ -140,8 +126,14 @@ namespace atn { misc::IntervalSet _nextTokenWithinRule; std::atomic _nextTokenUpdated { false }; + const ATNStateType _stateType; + friend class ATN; }; + inline bool operator==(const ATNState &lhs, const ATNState &rhs) { return lhs.equals(rhs); } + + inline bool operator!=(const ATNState &lhs, const ATNState &rhs) { return !operator==(lhs, rhs); } + } // namespace atn } // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/ATNStateType.cpp b/runtime/Cpp/runtime/src/atn/ATNStateType.cpp new file mode 100644 index 0000000000..577e2af87c --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/ATNStateType.cpp @@ -0,0 +1,33 @@ +#include "atn/ATNStateType.h" + +std::string antlr4::atn::atnStateTypeName(ATNStateType atnStateType) { + switch (atnStateType) { + case ATNStateType::INVALID: + return "INVALID"; + case ATNStateType::BASIC: + return "BASIC"; + case ATNStateType::RULE_START: + return "RULE_START"; + case ATNStateType::BLOCK_START: + return "BLOCK_START"; + case ATNStateType::PLUS_BLOCK_START: + return "PLUS_BLOCK_START"; + case ATNStateType::STAR_BLOCK_START: + return "STAR_BLOCK_START"; + case ATNStateType::TOKEN_START: + return "TOKEN_START"; + case ATNStateType::RULE_STOP: + return "RULE_STOP"; + case ATNStateType::BLOCK_END: + return "BLOCK_END"; + case ATNStateType::STAR_LOOP_BACK: + return "STAR_LOOP_BACK"; + case ATNStateType::STAR_LOOP_ENTRY: + return "STAR_LOOP_ENTRY"; + case ATNStateType::PLUS_LOOP_BACK: + return "PLUS_LOOP_BACK"; + case ATNStateType::LOOP_END: + return "LOOP_END"; + } + return "UNKNOWN"; +} diff --git a/runtime/Cpp/runtime/src/atn/ATNStateType.h b/runtime/Cpp/runtime/src/atn/ATNStateType.h new file mode 100644 index 0000000000..e19b2cce92 --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/ATNStateType.h @@ -0,0 +1,36 @@ +/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +#pragma once + +#include +#include + +#include "antlr4-common.h" + +namespace antlr4 { +namespace atn { + + // Constants for ATNState serialization. + enum class ATNStateType : size_t { + INVALID = 0, + BASIC = 1, + RULE_START = 2, + BLOCK_START = 3, + PLUS_BLOCK_START = 4, + STAR_BLOCK_START = 5, + TOKEN_START = 6, + RULE_STOP = 7, + BLOCK_END = 8, + STAR_LOOP_BACK = 9, + STAR_LOOP_ENTRY = 10, + PLUS_LOOP_BACK = 11, + LOOP_END = 12, + }; + + ANTLR4CPP_PUBLIC std::string atnStateTypeName(ATNStateType atnStateType); + +} // namespace atn +} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.cpp b/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.cpp deleted file mode 100755 index ef8afc25ed..0000000000 --- a/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/AbstractPredicateTransition.h" - -using namespace antlr4::atn; - -AbstractPredicateTransition::AbstractPredicateTransition(ATNState *target) : Transition(target) { -} - -AbstractPredicateTransition::~AbstractPredicateTransition() { -} diff --git a/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.h b/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.h deleted file mode 100755 index 4865cb1bd1..0000000000 --- a/runtime/Cpp/runtime/src/atn/AbstractPredicateTransition.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#pragma once - -#include "atn/Transition.h" - -namespace antlr4 { -namespace atn { - - class ANTState; - - class ANTLR4CPP_PUBLIC AbstractPredicateTransition : public Transition { - - public: - AbstractPredicateTransition(ATNState *target); - ~AbstractPredicateTransition(); - - }; - -} // namespace atn -} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/ActionTransition.cpp b/runtime/Cpp/runtime/src/atn/ActionTransition.cpp index fa11c4485e..45930c42c8 100755 --- a/runtime/Cpp/runtime/src/atn/ActionTransition.cpp +++ b/runtime/Cpp/runtime/src/atn/ActionTransition.cpp @@ -8,15 +8,11 @@ using namespace antlr4::atn; ActionTransition::ActionTransition(ATNState *target, size_t ruleIndex) - : Transition(target), ruleIndex(ruleIndex), actionIndex(INVALID_INDEX), isCtxDependent(false) { + : Transition(TransitionType::ACTION, target), ruleIndex(ruleIndex), actionIndex(INVALID_INDEX), isCtxDependent(false) { } ActionTransition::ActionTransition(ATNState *target, size_t ruleIndex, size_t actionIndex, bool isCtxDependent) - : Transition(target), ruleIndex(ruleIndex), actionIndex(actionIndex), isCtxDependent(isCtxDependent) { -} - -Transition::SerializationType ActionTransition::getSerializationType() const { - return ACTION; + : Transition(TransitionType::ACTION, target), ruleIndex(ruleIndex), actionIndex(actionIndex), isCtxDependent(isCtxDependent) { } bool ActionTransition::isEpsilon() const { diff --git a/runtime/Cpp/runtime/src/atn/ActionTransition.h b/runtime/Cpp/runtime/src/atn/ActionTransition.h index 652e75f3bf..0c6b9afce7 100755 --- a/runtime/Cpp/runtime/src/atn/ActionTransition.h +++ b/runtime/Cpp/runtime/src/atn/ActionTransition.h @@ -12,6 +12,10 @@ namespace atn { class ANTLR4CPP_PUBLIC ActionTransition final : public Transition { public: + static bool is(const Transition &transition) { return transition.getTransitionType() == TransitionType::ACTION; } + + static bool is(const Transition *transition) { return transition != nullptr && is(*transition); } + const size_t ruleIndex; const size_t actionIndex; const bool isCtxDependent; // e.g., $i ref in action @@ -20,8 +24,6 @@ namespace atn { ActionTransition(ATNState *target, size_t ruleIndex, size_t actionIndex, bool isCtxDependent); - virtual SerializationType getSerializationType() const override; - virtual bool isEpsilon() const override; virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; diff --git a/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp b/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp index b69d30d18d..7dcc011d1d 100755 --- a/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp +++ b/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp @@ -3,25 +3,39 @@ * can be found in the LICENSE.txt file in the project root. */ -#include "support/Arrays.h" -#include "atn/SingletonPredictionContext.h" - #include "atn/ArrayPredictionContext.h" +#include + +#include "atn/SingletonPredictionContext.h" +#include "misc/MurmurHash.h" +#include "support/Casts.h" + using namespace antlr4::atn; +using namespace antlr4::misc; +using namespace antlrcpp; -ArrayPredictionContext::ArrayPredictionContext(Ref const& a) - : ArrayPredictionContext({ a->parent }, { a->returnState }) { -} +namespace { + + bool cachedHashCodeEqual(size_t lhs, size_t rhs) { + return lhs == rhs || lhs == 0 || rhs == 0; + } + + bool predictionContextEqual(const Ref &lhs, const Ref &rhs) { + return *lhs == *rhs; + } -ArrayPredictionContext::ArrayPredictionContext(std::vector> const& parents_, - std::vector const& returnStates) - : PredictionContext(calculateHashCode(parents_, returnStates)), parents(parents_), returnStates(returnStates) { - assert(parents.size() > 0); - assert(returnStates.size() > 0); } -ArrayPredictionContext::~ArrayPredictionContext() { +ArrayPredictionContext::ArrayPredictionContext(const SingletonPredictionContext &predictionContext) + : ArrayPredictionContext({ predictionContext.parent }, { predictionContext.returnState }) {} + +ArrayPredictionContext::ArrayPredictionContext(std::vector> parents, + std::vector returnStates) + : PredictionContext(PredictionContextType::ARRAY), parents(std::move(parents)), returnStates(std::move(returnStates)) { + assert(this->parents.size() > 0); + assert(this->returnStates.size() > 0); + assert(this->parents.size() == this->returnStates.size()); } bool ArrayPredictionContext::isEmpty() const { @@ -33,7 +47,7 @@ size_t ArrayPredictionContext::size() const { return returnStates.size(); } -Ref ArrayPredictionContext::getParent(size_t index) const { +const Ref& ArrayPredictionContext::getParent(size_t index) const { return parents[index]; } @@ -41,18 +55,31 @@ size_t ArrayPredictionContext::getReturnState(size_t index) const { return returnStates[index]; } -bool ArrayPredictionContext::operator == (PredictionContext const& o) const { - if (this == &o) { - return true; +size_t ArrayPredictionContext::hashCodeImpl() const { + size_t hash = MurmurHash::initialize(); + hash = MurmurHash::update(hash, static_cast(getContextType())); + for (const auto &parent : parents) { + hash = MurmurHash::update(hash, parent); } - - const ArrayPredictionContext *other = dynamic_cast(&o); - if (other == nullptr || hashCode() != other->hashCode()) { - return false; // can't be same if hash is different + for (const auto &returnState : returnStates) { + hash = MurmurHash::update(hash, returnState); } + return MurmurHash::finish(hash, 1 + parents.size() + returnStates.size()); +} - return antlrcpp::Arrays::equals(returnStates, other->returnStates) && - antlrcpp::Arrays::equals(parents, other->parents); +bool ArrayPredictionContext::equals(const PredictionContext &other) const { + if (this == std::addressof(other)) { + return true; + } + if (getContextType() != other.getContextType()) { + return false; + } + const auto &array = downCast(other); + return returnStates.size() == array.returnStates.size() && + parents.size() == array.parents.size() && + cachedHashCodeEqual(cachedHashCode(), array.cachedHashCode()) && + std::memcmp(returnStates.data(), array.returnStates.data(), returnStates.size() * sizeof(decltype(returnStates)::value_type)) == 0 && + std::equal(parents.begin(), parents.end(), array.parents.begin(), predictionContextEqual); } std::string ArrayPredictionContext::toString() const { diff --git a/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h b/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h index 53a5b17a03..adc2ca4ce4 100755 --- a/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h +++ b/runtime/Cpp/runtime/src/atn/ArrayPredictionContext.h @@ -13,29 +13,37 @@ namespace atn { class SingletonPredictionContext; - class ANTLR4CPP_PUBLIC ArrayPredictionContext : public PredictionContext { + class ANTLR4CPP_PUBLIC ArrayPredictionContext final : public PredictionContext { public: + static bool is(const PredictionContext &predictionContext) { return predictionContext.getContextType() == PredictionContextType::ARRAY; } + + static bool is(const PredictionContext *predictionContext) { return predictionContext != nullptr && is(*predictionContext); } + /// Parent can be empty only if full ctx mode and we make an array /// from EMPTY and non-empty. We merge EMPTY by using null parent and /// returnState == EMPTY_RETURN_STATE. // Also here: we use a strong reference to our parents to avoid having them freed prematurely. // See also SinglePredictionContext. - const std::vector> parents; + std::vector> parents; /// Sorted for merge, no duplicates; if present, EMPTY_RETURN_STATE is always last. - const std::vector returnStates; + std::vector returnStates; + + explicit ArrayPredictionContext(const SingletonPredictionContext &predictionContext); + + ArrayPredictionContext(std::vector> parents, std::vector returnStates); - ArrayPredictionContext(Ref const& a); - ArrayPredictionContext(std::vector> const& parents_, std::vector const& returnStates); - virtual ~ArrayPredictionContext(); + ArrayPredictionContext(ArrayPredictionContext&&) = default; - virtual bool isEmpty() const override; - virtual size_t size() const override; - virtual Ref getParent(size_t index) const override; - virtual size_t getReturnState(size_t index) const override; - bool operator == (const PredictionContext &o) const override; + bool isEmpty() const override; + size_t size() const override; + const Ref& getParent(size_t index) const override; + size_t getReturnState(size_t index) const override; + bool equals(const PredictionContext &other) const override; + std::string toString() const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/AtomTransition.cpp b/runtime/Cpp/runtime/src/atn/AtomTransition.cpp index af956c2435..4424980cde 100755 --- a/runtime/Cpp/runtime/src/atn/AtomTransition.cpp +++ b/runtime/Cpp/runtime/src/atn/AtomTransition.cpp @@ -11,11 +11,7 @@ using namespace antlr4::misc; using namespace antlr4::atn; -AtomTransition::AtomTransition(ATNState *target, size_t label) : Transition(target), _label(label) { -} - -Transition::SerializationType AtomTransition::getSerializationType() const { - return ATOM; +AtomTransition::AtomTransition(ATNState *target, size_t label) : Transition(TransitionType::ATOM, target), _label(label) { } IntervalSet AtomTransition::label() const { diff --git a/runtime/Cpp/runtime/src/atn/AtomTransition.h b/runtime/Cpp/runtime/src/atn/AtomTransition.h index cc22e5ad9e..db62a7feab 100755 --- a/runtime/Cpp/runtime/src/atn/AtomTransition.h +++ b/runtime/Cpp/runtime/src/atn/AtomTransition.h @@ -13,13 +13,16 @@ namespace atn { /// TODO: make all transitions sets? no, should remove set edges. class ANTLR4CPP_PUBLIC AtomTransition final : public Transition { public: + static bool is(const Transition &transition) { return transition.getTransitionType() == TransitionType::ATOM; } + + static bool is(const Transition *transition) { return transition != nullptr && is(*transition); } + /// The token type or character value; or, signifies special label. + /// TODO: rename this to label const size_t _label; AtomTransition(ATNState *target, size_t label); - virtual SerializationType getSerializationType() const override; - virtual misc::IntervalSet label() const override; virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; diff --git a/runtime/Cpp/runtime/src/atn/BasicBlockStartState.cpp b/runtime/Cpp/runtime/src/atn/BasicBlockStartState.cpp deleted file mode 100755 index dc3673723f..0000000000 --- a/runtime/Cpp/runtime/src/atn/BasicBlockStartState.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/BasicBlockStartState.h" - -using namespace antlr4::atn; - -size_t BasicBlockStartState::getStateType() { - return BLOCK_START; -} diff --git a/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h b/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h index 471fbc7bdd..c5a588fbfd 100755 --- a/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h +++ b/runtime/Cpp/runtime/src/atn/BasicBlockStartState.h @@ -12,10 +12,12 @@ namespace antlr4 { namespace atn { class ANTLR4CPP_PUBLIC BasicBlockStartState final : public BlockStartState { - public: - virtual size_t getStateType() override; + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::BLOCK_START; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } + BasicBlockStartState() : BlockStartState(ATNStateType::BLOCK_START) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/BasicState.cpp b/runtime/Cpp/runtime/src/atn/BasicState.cpp deleted file mode 100755 index c8cda80134..0000000000 --- a/runtime/Cpp/runtime/src/atn/BasicState.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/BasicState.h" - -using namespace antlr4::atn; - -size_t BasicState::getStateType() { - return BASIC; -} diff --git a/runtime/Cpp/runtime/src/atn/BasicState.h b/runtime/Cpp/runtime/src/atn/BasicState.h index b650dc2fe0..311a966e1d 100755 --- a/runtime/Cpp/runtime/src/atn/BasicState.h +++ b/runtime/Cpp/runtime/src/atn/BasicState.h @@ -11,10 +11,12 @@ namespace antlr4 { namespace atn { class ANTLR4CPP_PUBLIC BasicState final : public ATNState { - public: - virtual size_t getStateType() override; + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::BASIC; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } + BasicState() : ATNState(ATNStateType::BASIC) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/BlockEndState.cpp b/runtime/Cpp/runtime/src/atn/BlockEndState.cpp deleted file mode 100755 index 098d52af0b..0000000000 --- a/runtime/Cpp/runtime/src/atn/BlockEndState.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/BlockEndState.h" - -using namespace antlr4::atn; - -BlockEndState::BlockEndState() : startState(nullptr) { -} - -size_t BlockEndState::getStateType() { - return BLOCK_END; -} diff --git a/runtime/Cpp/runtime/src/atn/BlockEndState.h b/runtime/Cpp/runtime/src/atn/BlockEndState.h index b24bee1b4f..a3e067109e 100755 --- a/runtime/Cpp/runtime/src/atn/BlockEndState.h +++ b/runtime/Cpp/runtime/src/atn/BlockEndState.h @@ -13,11 +13,13 @@ namespace atn { /// Terminal node of a simple {@code (a|b|c)} block. class ANTLR4CPP_PUBLIC BlockEndState final : public ATNState { public: - BlockStartState *startState = nullptr; + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::BLOCK_END; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } - BlockEndState(); + BlockStartState *startState = nullptr; - virtual size_t getStateType() override; + BlockEndState() : ATNState(ATNStateType::BLOCK_END) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/BlockStartState.cpp b/runtime/Cpp/runtime/src/atn/BlockStartState.cpp deleted file mode 100644 index 44cca8f775..0000000000 --- a/runtime/Cpp/runtime/src/atn/BlockStartState.cpp +++ /dev/null @@ -1,9 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "BlockStartState.h" - -antlr4::atn::BlockStartState::~BlockStartState() { -} diff --git a/runtime/Cpp/runtime/src/atn/BlockStartState.h b/runtime/Cpp/runtime/src/atn/BlockStartState.h index 725c700f04..1e4006aef8 100755 --- a/runtime/Cpp/runtime/src/atn/BlockStartState.h +++ b/runtime/Cpp/runtime/src/atn/BlockStartState.h @@ -13,8 +13,17 @@ namespace atn { /// The start of a regular {@code (...)} block. class ANTLR4CPP_PUBLIC BlockStartState : public DecisionState { public: - ~BlockStartState(); + static bool is(const ATNState &atnState) { + const auto stateType = atnState.getStateType(); + return stateType >= ATNStateType::BLOCK_START && stateType <= ATNStateType::STAR_BLOCK_START; + } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } + BlockEndState *endState = nullptr; + + protected: + using DecisionState::DecisionState; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/DecisionInfo.h b/runtime/Cpp/runtime/src/atn/DecisionInfo.h index cfbb2e9baf..2b43ad8be9 100755 --- a/runtime/Cpp/runtime/src/atn/DecisionInfo.h +++ b/runtime/Cpp/runtime/src/atn/DecisionInfo.h @@ -218,7 +218,7 @@ namespace atn { /// statistics for a particular decision. /// /// The decision number - DecisionInfo(size_t decision); + explicit DecisionInfo(size_t decision); std::string toString() const; }; diff --git a/runtime/Cpp/runtime/src/atn/DecisionState.cpp b/runtime/Cpp/runtime/src/atn/DecisionState.cpp index 924f814a9c..464ca9c020 100755 --- a/runtime/Cpp/runtime/src/atn/DecisionState.cpp +++ b/runtime/Cpp/runtime/src/atn/DecisionState.cpp @@ -7,11 +7,6 @@ using namespace antlr4::atn; -void DecisionState::InitializeInstanceFields() { - decision = -1; - nonGreedy = false; -} - std::string DecisionState::toString() const { return "DECISION " + ATNState::toString(); } diff --git a/runtime/Cpp/runtime/src/atn/DecisionState.h b/runtime/Cpp/runtime/src/atn/DecisionState.h index 005de251a2..f26ad07c93 100755 --- a/runtime/Cpp/runtime/src/atn/DecisionState.h +++ b/runtime/Cpp/runtime/src/atn/DecisionState.h @@ -12,18 +12,22 @@ namespace atn { class ANTLR4CPP_PUBLIC DecisionState : public ATNState { public: - int decision; - bool nonGreedy; + static bool is(const ATNState &atnState) { + const auto stateType = atnState.getStateType(); + return (stateType >= ATNStateType::BLOCK_START && stateType <= ATNStateType::TOKEN_START) || + stateType == ATNStateType::PLUS_LOOP_BACK || + stateType == ATNStateType::STAR_LOOP_ENTRY; + } - private: - void InitializeInstanceFields(); + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } - public: - DecisionState() { - InitializeInstanceFields(); - } + int decision = -1; + bool nonGreedy = false; virtual std::string toString() const override; + + protected: + using ATNState::ATNState; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.cpp b/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.cpp deleted file mode 100755 index 17223bf1e4..0000000000 --- a/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/EmptyPredictionContext.h" - -using namespace antlr4::atn; - -EmptyPredictionContext::EmptyPredictionContext() : SingletonPredictionContext(nullptr, EMPTY_RETURN_STATE) { -} - -bool EmptyPredictionContext::isEmpty() const { - return true; -} - -size_t EmptyPredictionContext::size() const { - return 1; -} - -Ref EmptyPredictionContext::getParent(size_t /*index*/) const { - return nullptr; -} - -size_t EmptyPredictionContext::getReturnState(size_t /*index*/) const { - return returnState; -} - -bool EmptyPredictionContext::operator == (const PredictionContext &o) const { - return this == &o; -} - -std::string EmptyPredictionContext::toString() const { - return "$"; -} diff --git a/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.h b/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.h deleted file mode 100755 index 93c036c549..0000000000 --- a/runtime/Cpp/runtime/src/atn/EmptyPredictionContext.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#pragma once - -#include "atn/SingletonPredictionContext.h" - -namespace antlr4 { -namespace atn { - - class ANTLR4CPP_PUBLIC EmptyPredictionContext : public SingletonPredictionContext { - public: - EmptyPredictionContext(); - - virtual bool isEmpty() const override; - virtual size_t size() const override; - virtual Ref getParent(size_t index) const override; - virtual size_t getReturnState(size_t index) const override; - virtual std::string toString() const override; - - virtual bool operator == (const PredictionContext &o) const override; - }; - -} // namespace atn -} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp b/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp index 550605d32b..1dba801760 100755 --- a/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp +++ b/runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp @@ -11,17 +11,13 @@ EpsilonTransition::EpsilonTransition(ATNState *target) : EpsilonTransition(targe } EpsilonTransition::EpsilonTransition(ATNState *target, size_t outermostPrecedenceReturn) - : Transition(target), _outermostPrecedenceReturn(outermostPrecedenceReturn) { + : Transition(TransitionType::EPSILON, target), _outermostPrecedenceReturn(outermostPrecedenceReturn) { } -size_t EpsilonTransition::outermostPrecedenceReturn() { +size_t EpsilonTransition::outermostPrecedenceReturn() const { return _outermostPrecedenceReturn; } -Transition::SerializationType EpsilonTransition::getSerializationType() const { - return EPSILON; -} - bool EpsilonTransition::isEpsilon() const { return true; } diff --git a/runtime/Cpp/runtime/src/atn/EpsilonTransition.h b/runtime/Cpp/runtime/src/atn/EpsilonTransition.h index 41fb0fbf82..2cc9cf0b61 100755 --- a/runtime/Cpp/runtime/src/atn/EpsilonTransition.h +++ b/runtime/Cpp/runtime/src/atn/EpsilonTransition.h @@ -12,7 +12,11 @@ namespace atn { class ANTLR4CPP_PUBLIC EpsilonTransition final : public Transition { public: - EpsilonTransition(ATNState *target); + static bool is(const Transition &transition) { return transition.getTransitionType() == TransitionType::EPSILON; } + + static bool is(const Transition *transition) { return transition != nullptr && is(*transition); } + + explicit EpsilonTransition(ATNState *target); EpsilonTransition(ATNState *target, size_t outermostPrecedenceReturn); /** @@ -23,8 +27,7 @@ namespace atn { * @see ParserATNSimulator#applyPrecedenceFilter(ATNConfigSet) * @since 4.4.1 */ - size_t outermostPrecedenceReturn(); - virtual SerializationType getSerializationType() const override; + size_t outermostPrecedenceReturn() const; virtual bool isEpsilon() const override; virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; diff --git a/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp b/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp index ddca800889..1e6da892e0 100755 --- a/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp +++ b/runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp @@ -7,12 +7,10 @@ #include "atn/Transition.h" #include "atn/RuleTransition.h" #include "atn/SingletonPredictionContext.h" -#include "atn/AbstractPredicateTransition.h" #include "atn/WildcardTransition.h" #include "atn/NotSetTransition.h" #include "misc/IntervalSet.h" #include "atn/ATNConfig.h" -#include "atn/EmptyPredictionContext.h" #include "support/CPPUtils.h" @@ -22,10 +20,140 @@ using namespace antlr4; using namespace antlr4::atn; using namespace antlrcpp; -LL1Analyzer::LL1Analyzer(const ATN &atn) : _atn(atn) { -} +namespace { + + struct ATNConfigHasher final { + size_t operator()(const ATNConfig& atn_config) const { + return atn_config.hashCode(); + } + }; + + struct ATNConfigComparer final { + bool operator()(const ATNConfig& lhs, const ATNConfig& rhs) const { + return lhs == rhs; + } + }; + + class LL1AnalyzerImpl final { + public: + LL1AnalyzerImpl(const ATN& atn, misc::IntervalSet& look, bool seeThruPreds, bool addEOF) : _atn(atn), _look(look), _seeThruPreds(seeThruPreds), _addEOF(addEOF) {} + + /// + /// Compute set of tokens that can follow {@code s} in the ATN in the + /// specified {@code ctx}. + ///

+ /// If {@code ctx} is {@code null} and {@code stopState} or the end of the + /// rule containing {@code s} is reached, is added to + /// the result set. If {@code ctx} is not {@code null} and {@code addEOF} is + /// {@code true} and {@code stopState} or the end of the outermost rule is + /// reached, is added to the result set. + ///

+ /// the ATN state. + /// the ATN state to stop at. This can be a + /// to detect epsilon paths through a closure. + /// The outer context, or {@code null} if the outer context should + /// not be used. + /// The result lookahead set. + /// A set used for preventing epsilon closures in the ATN + /// from causing a stack overflow. Outside code should pass + /// {@code new HashSet} for this argument. + /// A set used for preventing left recursion in the + /// ATN from causing a stack overflow. Outside code should pass + /// {@code new BitSet()} for this argument. + /// {@code true} to true semantic predicates as + /// implicitly {@code true} and "see through them", otherwise {@code false} + /// to treat semantic predicates as opaque and add to the + /// result if one is encountered. + /// Add to the result if the end of the + /// outermost context is reached. This parameter has no effect if {@code ctx} + /// is {@code null}. + void LOOK(ATNState *s, ATNState *stopState, Ref const& ctx) { + if (!_lookBusy.insert(ATNConfig(s, 0, ctx)).second) { + return; + } + + // ml: s can never be null, hence no need to check if stopState is != null. + if (s == stopState) { + if (ctx == nullptr) { + _look.add(Token::EPSILON); + return; + } else if (ctx->isEmpty() && _addEOF) { + _look.add(Token::EOF); + return; + } + } + + if (s->getStateType() == ATNStateType::RULE_STOP) { + if (ctx == nullptr) { + _look.add(Token::EPSILON); + return; + } else if (ctx->isEmpty() && _addEOF) { + _look.add(Token::EOF); + return; + } + + if (ctx != PredictionContext::EMPTY) { + bool removed = _calledRuleStack.test(s->ruleIndex); + _calledRuleStack[s->ruleIndex] = false; + // run thru all possible stack tops in ctx + for (size_t i = 0; i < ctx->size(); i++) { + ATNState *returnState = _atn.states[ctx->getReturnState(i)]; + LOOK(returnState, stopState, ctx->getParent(i)); + } + if (removed) { + _calledRuleStack.set(s->ruleIndex); + } + return; + } + } + + size_t n = s->transitions.size(); + for (size_t i = 0; i < n; i++) { + const Transition *t = s->transitions[i].get(); + const auto tType = t->getTransitionType(); + + if (tType == TransitionType::RULE) { + if (_calledRuleStack[(static_cast(t))->target->ruleIndex]) { + continue; + } + + Ref newContext = SingletonPredictionContext::create(ctx, (static_cast(t))->followState->stateNumber); + + _calledRuleStack.set((static_cast(t))->target->ruleIndex); + LOOK(t->target, stopState, newContext); + _calledRuleStack[(static_cast(t))->target->ruleIndex] = false; + + } else if (tType == TransitionType::PREDICATE || tType == TransitionType::PRECEDENCE) { + if (_seeThruPreds) { + LOOK(t->target, stopState, ctx); + } else { + _look.add(LL1Analyzer::HIT_PRED); + } + } else if (t->isEpsilon()) { + LOOK(t->target, stopState, ctx); + } else if (tType == TransitionType::WILDCARD) { + _look.addAll(misc::IntervalSet::of(Token::MIN_USER_TOKEN_TYPE, static_cast(_atn.maxTokenType))); + } else { + misc::IntervalSet set = t->label(); + if (!set.isEmpty()) { + if (tType == TransitionType::NOT_SET) { + set = set.complement(misc::IntervalSet::of(Token::MIN_USER_TOKEN_TYPE, static_cast(_atn.maxTokenType))); + } + _look.addAll(set); + } + } + } + } + + private: + const ATN& _atn; + misc::IntervalSet& _look; + antlrcpp::BitSet _calledRuleStack; + std::unordered_set _lookBusy; + bool _seeThruPreds; + bool _addEOF; + }; -LL1Analyzer::~LL1Analyzer() { } std::vector LL1Analyzer::getDecisionLookahead(ATNState *s) const { @@ -37,16 +165,11 @@ std::vector LL1Analyzer::getDecisionLookahead(ATNState *s) co look.resize(s->transitions.size()); // Fills all interval sets with defaults. for (size_t alt = 0; alt < s->transitions.size(); alt++) { - bool seeThruPreds = false; // fail to get lookahead upon pred - - ATNConfig::Set lookBusy; - antlrcpp::BitSet callRuleStack; - _LOOK(s->transitions[alt]->target, nullptr, PredictionContext::EMPTY, - look[alt], lookBusy, callRuleStack, seeThruPreds, false); - + LL1AnalyzerImpl impl(_atn, look[alt], false, false); + impl.LOOK(s->transitions[alt]->target, nullptr, PredictionContext::EMPTY); // Wipe out lookahead for this alternative if we found nothing // or we had a predicate when we !seeThruPreds - if (look[alt].size() == 0 || look[alt].contains(HIT_PRED)) { + if (look[alt].size() == 0 || look[alt].contains(LL1Analyzer::HIT_PRED)) { look[alt].clear(); } } @@ -58,99 +181,9 @@ misc::IntervalSet LL1Analyzer::LOOK(ATNState *s, RuleContext *ctx) const { } misc::IntervalSet LL1Analyzer::LOOK(ATNState *s, ATNState *stopState, RuleContext *ctx) const { + Ref lookContext = ctx != nullptr ? PredictionContext::fromRuleContext(_atn, ctx) : nullptr; misc::IntervalSet r; - bool seeThruPreds = true; // ignore preds; get all lookahead - Ref lookContext = ctx != nullptr ? PredictionContext::fromRuleContext(_atn, ctx) : nullptr; - - ATNConfig::Set lookBusy; - antlrcpp::BitSet callRuleStack; - _LOOK(s, stopState, lookContext, r, lookBusy, callRuleStack, seeThruPreds, true); - + LL1AnalyzerImpl impl(_atn, r, true, true); + impl.LOOK(s, stopState, lookContext); return r; } - -void LL1Analyzer::_LOOK(ATNState *s, ATNState *stopState, Ref const& ctx, misc::IntervalSet &look, - ATNConfig::Set &lookBusy, antlrcpp::BitSet &calledRuleStack, bool seeThruPreds, bool addEOF) const { - - Ref c = std::make_shared(s, 0, ctx); - - if (lookBusy.count(c) > 0) // Keep in mind comparison is based on members of the class, not the actual instance. - return; - - lookBusy.insert(c); - - // ml: s can never be null, hence no need to check if stopState is != null. - if (s == stopState) { - if (ctx == nullptr) { - look.add(Token::EPSILON); - return; - } else if (ctx->isEmpty() && addEOF) { - look.add(Token::EOF); - return; - } - } - - if (s->getStateType() == ATNState::RULE_STOP) { - if (ctx == nullptr) { - look.add(Token::EPSILON); - return; - } else if (ctx->isEmpty() && addEOF) { - look.add(Token::EOF); - return; - } - - if (ctx != PredictionContext::EMPTY) { - bool removed = calledRuleStack.test(s->ruleIndex); - calledRuleStack[s->ruleIndex] = false; - auto onExit = finally([removed, &calledRuleStack, s] { - if (removed) { - calledRuleStack.set(s->ruleIndex); - } - }); - // run thru all possible stack tops in ctx - for (size_t i = 0; i < ctx->size(); i++) { - ATNState *returnState = _atn.states[ctx->getReturnState(i)]; - _LOOK(returnState, stopState, ctx->getParent(i), look, lookBusy, calledRuleStack, seeThruPreds, addEOF); - } - return; - } - } - - size_t n = s->transitions.size(); - for (size_t i = 0; i < n; i++) { - Transition *t = s->transitions[i]; - - if (t->getSerializationType() == Transition::RULE) { - if (calledRuleStack[(static_cast(t))->target->ruleIndex]) { - continue; - } - - Ref newContext = SingletonPredictionContext::create(ctx, (static_cast(t))->followState->stateNumber); - auto onExit = finally([t, &calledRuleStack] { - calledRuleStack[(static_cast(t))->target->ruleIndex] = false; - }); - - calledRuleStack.set((static_cast(t))->target->ruleIndex); - _LOOK(t->target, stopState, newContext, look, lookBusy, calledRuleStack, seeThruPreds, addEOF); - - } else if (is(t)) { - if (seeThruPreds) { - _LOOK(t->target, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF); - } else { - look.add(HIT_PRED); - } - } else if (t->isEpsilon()) { - _LOOK(t->target, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF); - } else if (t->getSerializationType() == Transition::WILDCARD) { - look.addAll(misc::IntervalSet::of(Token::MIN_USER_TOKEN_TYPE, static_cast(_atn.maxTokenType))); - } else { - misc::IntervalSet set = t->label(); - if (!set.isEmpty()) { - if (is(t)) { - set = set.complement(misc::IntervalSet::of(Token::MIN_USER_TOKEN_TYPE, static_cast(_atn.maxTokenType))); - } - look.addAll(set); - } - } - } -} diff --git a/runtime/Cpp/runtime/src/atn/LL1Analyzer.h b/runtime/Cpp/runtime/src/atn/LL1Analyzer.h index e297bc9a94..cf17501d24 100755 --- a/runtime/Cpp/runtime/src/atn/LL1Analyzer.h +++ b/runtime/Cpp/runtime/src/atn/LL1Analyzer.h @@ -6,29 +6,20 @@ #pragma once #include "Token.h" -#include "support/BitSet.h" -#include "atn/PredictionContext.h" #include "atn/ATNConfig.h" +#include "atn/PredictionContext.h" +#include "support/BitSet.h" namespace antlr4 { namespace atn { - class ANTLR4CPP_PUBLIC LL1Analyzer { + class ANTLR4CPP_PUBLIC LL1Analyzer final { public: /// Special value added to the lookahead sets to indicate that we hit /// a predicate during analysis if {@code seeThruPreds==false}. -#if __cplusplus >= 201703L static constexpr size_t HIT_PRED = Token::INVALID_TYPE; -#else - enum : size_t { - HIT_PRED = Token::INVALID_TYPE, - }; -#endif - const atn::ATN &_atn; - - LL1Analyzer(const atn::ATN &atn); - virtual ~LL1Analyzer(); + explicit LL1Analyzer(const atn::ATN &atn) : _atn(atn) {} /// /// Calculates the SLL(1) expected lookahead set for each outgoing transition @@ -39,7 +30,7 @@ namespace atn { /// /// the ATN state /// the expected symbols for each outgoing transition of {@code s}. - virtual std::vector getDecisionLookahead(ATNState *s) const; + std::vector getDecisionLookahead(ATNState *s) const; /// /// Compute set of tokens that can follow {@code s} in the ATN in the @@ -56,7 +47,7 @@ namespace atn { /// /// The set of tokens that can follow {@code s} in the ATN in the /// specified {@code ctx}. - virtual misc::IntervalSet LOOK(ATNState *s, RuleContext *ctx) const; + misc::IntervalSet LOOK(ATNState *s, RuleContext *ctx) const; /// /// Compute set of tokens that can follow {@code s} in the ATN in the @@ -75,40 +66,10 @@ namespace atn { /// /// The set of tokens that can follow {@code s} in the ATN in the /// specified {@code ctx}. - virtual misc::IntervalSet LOOK(ATNState *s, ATNState *stopState, RuleContext *ctx) const; + misc::IntervalSet LOOK(ATNState *s, ATNState *stopState, RuleContext *ctx) const; - /// - /// Compute set of tokens that can follow {@code s} in the ATN in the - /// specified {@code ctx}. - ///

- /// If {@code ctx} is {@code null} and {@code stopState} or the end of the - /// rule containing {@code s} is reached, is added to - /// the result set. If {@code ctx} is not {@code null} and {@code addEOF} is - /// {@code true} and {@code stopState} or the end of the outermost rule is - /// reached, is added to the result set. - ///

- /// the ATN state. - /// the ATN state to stop at. This can be a - /// to detect epsilon paths through a closure. - /// The outer context, or {@code null} if the outer context should - /// not be used. - /// The result lookahead set. - /// A set used for preventing epsilon closures in the ATN - /// from causing a stack overflow. Outside code should pass - /// {@code new HashSet} for this argument. - /// A set used for preventing left recursion in the - /// ATN from causing a stack overflow. Outside code should pass - /// {@code new BitSet()} for this argument. - /// {@code true} to true semantic predicates as - /// implicitly {@code true} and "see through them", otherwise {@code false} - /// to treat semantic predicates as opaque and add to the - /// result if one is encountered. - /// Add to the result if the end of the - /// outermost context is reached. This parameter has no effect if {@code ctx} - /// is {@code null}. - protected: - virtual void _LOOK(ATNState *s, ATNState *stopState, Ref const& ctx, misc::IntervalSet &look, - ATNConfig::Set &lookBusy, antlrcpp::BitSet &calledRuleStack, bool seeThruPreds, bool addEOF) const; + private: + const atn::ATN &_atn; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp b/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp index db91c3f8ce..055f8bbdab 100755 --- a/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp @@ -10,44 +10,27 @@ #include "atn/LexerActionExecutor.h" #include "support/CPPUtils.h" +#include "support/Casts.h" #include "atn/LexerATNConfig.h" using namespace antlr4::atn; using namespace antlrcpp; -LexerATNConfig::LexerATNConfig(ATNState *state, int alt, Ref const& context) - : ATNConfig(state, alt, context, SemanticContext::NONE), _passedThroughNonGreedyDecision(false) { -} +LexerATNConfig::LexerATNConfig(ATNState *state, int alt, Ref context) + : ATNConfig(state, alt, std::move(context)) {} -LexerATNConfig::LexerATNConfig(ATNState *state, int alt, Ref const& context, - Ref const& lexerActionExecutor) - : ATNConfig(state, alt, context, SemanticContext::NONE), _lexerActionExecutor(lexerActionExecutor), - _passedThroughNonGreedyDecision(false) { -} +LexerATNConfig::LexerATNConfig(ATNState *state, int alt, Ref context, Ref lexerActionExecutor) + : ATNConfig(state, alt, std::move(context)), _lexerActionExecutor(std::move(lexerActionExecutor)) {} -LexerATNConfig::LexerATNConfig(Ref const& c, ATNState *state) - : ATNConfig(c, state, c->context, c->semanticContext), _lexerActionExecutor(c->_lexerActionExecutor), - _passedThroughNonGreedyDecision(checkNonGreedyDecision(c, state)) { -} +LexerATNConfig::LexerATNConfig(LexerATNConfig const& other, ATNState *state) + : ATNConfig(other, state), _lexerActionExecutor(other._lexerActionExecutor), _passedThroughNonGreedyDecision(checkNonGreedyDecision(other, state)) {} -LexerATNConfig::LexerATNConfig(Ref const& c, ATNState *state, Ref const& lexerActionExecutor) - : ATNConfig(c, state, c->context, c->semanticContext), _lexerActionExecutor(lexerActionExecutor), - _passedThroughNonGreedyDecision(checkNonGreedyDecision(c, state)) { -} +LexerATNConfig::LexerATNConfig(LexerATNConfig const& other, ATNState *state, Ref lexerActionExecutor) + : ATNConfig(other, state), _lexerActionExecutor(std::move(lexerActionExecutor)), _passedThroughNonGreedyDecision(checkNonGreedyDecision(other, state)) {} -LexerATNConfig::LexerATNConfig(Ref const& c, ATNState *state, Ref const& context) - : ATNConfig(c, state, context, c->semanticContext), _lexerActionExecutor(c->_lexerActionExecutor), - _passedThroughNonGreedyDecision(checkNonGreedyDecision(c, state)) { -} - -Ref LexerATNConfig::getLexerActionExecutor() const { - return _lexerActionExecutor; -} - -bool LexerATNConfig::hasPassedThroughNonGreedyDecision() { - return _passedThroughNonGreedyDecision; -} +LexerATNConfig::LexerATNConfig(LexerATNConfig const& other, ATNState *state, Ref context) + : ATNConfig(other, state, std::move(context)), _lexerActionExecutor(other._lexerActionExecutor), _passedThroughNonGreedyDecision(checkNonGreedyDecision(other, state)) {} size_t LexerATNConfig::hashCode() const { size_t hashCode = misc::MurmurHash::initialize(7); @@ -61,7 +44,7 @@ size_t LexerATNConfig::hashCode() const { return hashCode; } -bool LexerATNConfig::operator == (const LexerATNConfig& other) const +bool LexerATNConfig::operator==(const LexerATNConfig& other) const { if (this == &other) return true; @@ -75,10 +58,10 @@ bool LexerATNConfig::operator == (const LexerATNConfig& other) const return false; } - return ATNConfig::operator == (other); + return ATNConfig::operator==(other); } -bool LexerATNConfig::checkNonGreedyDecision(Ref const& source, ATNState *target) { - return source->_passedThroughNonGreedyDecision || - (is(target) && (static_cast(target))->nonGreedy); +bool LexerATNConfig::checkNonGreedyDecision(LexerATNConfig const& source, ATNState *target) { + return source._passedThroughNonGreedyDecision || + (DecisionState::is(target) && downCast(target)->nonGreedy); } diff --git a/runtime/Cpp/runtime/src/atn/LexerATNConfig.h b/runtime/Cpp/runtime/src/atn/LexerATNConfig.h index e25d3d1c54..05d804f639 100755 --- a/runtime/Cpp/runtime/src/atn/LexerATNConfig.h +++ b/runtime/Cpp/runtime/src/atn/LexerATNConfig.h @@ -10,34 +10,34 @@ namespace antlr4 { namespace atn { - class ANTLR4CPP_PUBLIC LexerATNConfig : public ATNConfig { + class ANTLR4CPP_PUBLIC LexerATNConfig final : public ATNConfig { public: - LexerATNConfig(ATNState *state, int alt, Ref const& context); - LexerATNConfig(ATNState *state, int alt, Ref const& context, Ref const& lexerActionExecutor); + LexerATNConfig(ATNState *state, int alt, Ref context); + LexerATNConfig(ATNState *state, int alt, Ref context, Ref lexerActionExecutor); - LexerATNConfig(Ref const& c, ATNState *state); - LexerATNConfig(Ref const& c, ATNState *state, Ref const& lexerActionExecutor); - LexerATNConfig(Ref const& c, ATNState *state, Ref const& context); + LexerATNConfig(LexerATNConfig const& other, ATNState *state); + LexerATNConfig(LexerATNConfig const& other, ATNState *state, Ref lexerActionExecutor); + LexerATNConfig(LexerATNConfig const& other, ATNState *state, Ref context); /** * Gets the {@link LexerActionExecutor} capable of executing the embedded * action(s) for the current configuration. */ - Ref getLexerActionExecutor() const; - bool hasPassedThroughNonGreedyDecision(); + const Ref& getLexerActionExecutor() const { return _lexerActionExecutor; } + bool hasPassedThroughNonGreedyDecision() const { return _passedThroughNonGreedyDecision; } virtual size_t hashCode() const override; - bool operator == (const LexerATNConfig& other) const; + bool operator==(const LexerATNConfig& other) const; private: /** * This is the backing field for {@link #getLexerActionExecutor}. */ - const Ref _lexerActionExecutor; - const bool _passedThroughNonGreedyDecision; + const Ref _lexerActionExecutor; + const bool _passedThroughNonGreedyDecision = false; - static bool checkNonGreedyDecision(Ref const& source, ATNState *target); + static bool checkNonGreedyDecision(LexerATNConfig const& source, ATNState *target); }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp b/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp index 381351a95a..d973343426 100755 --- a/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp @@ -20,7 +20,6 @@ #include "dfa/DFAState.h" #include "atn/LexerATNConfig.h" #include "atn/LexerActionExecutor.h" -#include "atn/EmptyPredictionContext.h" #include "atn/LexerATNSimulator.h" @@ -31,25 +30,10 @@ using namespace antlr4; using namespace antlr4::atn; using namespace antlrcpp; -LexerATNSimulator::SimState::~SimState() { -} - void LexerATNSimulator::SimState::reset() { - index = INVALID_INDEX; - line = 0; - charPos = INVALID_INDEX; - dfaState = nullptr; // Don't delete. It's just a reference. -} - -void LexerATNSimulator::SimState::InitializeInstanceFields() { - index = INVALID_INDEX; - line = 0; - charPos = INVALID_INDEX; + *this = SimState(); } -std::atomic LexerATNSimulator::match_calls(0); - - LexerATNSimulator::LexerATNSimulator(const ATN &atn, std::vector &decisionToDFA, PredictionContextCache &sharedContextCache) : LexerATNSimulator(nullptr, atn, decisionToDFA, sharedContextCache) { @@ -69,7 +53,6 @@ void LexerATNSimulator::copyState(LexerATNSimulator *simulator) { } size_t LexerATNSimulator::match(CharStream *input, size_t mode) { - match_calls.fetch_add(1, std::memory_order_relaxed); _mode = mode; ssize_t mark = input->mark(); @@ -80,10 +63,15 @@ size_t LexerATNSimulator::match(CharStream *input, size_t mode) { _startIndex = input->index(); _prevAccept.reset(); const dfa::DFA &dfa = _decisionToDFA[mode]; - if (dfa.s0 == nullptr) { + dfa::DFAState* s0; + { + std::shared_lock stateLock(atn._stateMutex); + s0 = dfa.s0; + } + if (s0 == nullptr) { return matchATN(input); } else { - return execATN(input, dfa.s0); + return execATN(input, s0); } } @@ -111,10 +99,7 @@ size_t LexerATNSimulator::matchATN(CharStream *input) { bool suppressEdge = s0_closure->hasSemanticContext; s0_closure->hasSemanticContext = false; - dfa::DFAState *next = addDFAState(s0_closure.release()); - if (!suppressEdge) { - _decisionToDFA[_mode].s0 = next; - } + dfa::DFAState *next = addDFAState(s0_closure.release(), suppressEdge); size_t predict = execATN(input, next); @@ -182,7 +167,7 @@ size_t LexerATNSimulator::execATN(CharStream *input, dfa::DFAState *ds0) { dfa::DFAState *LexerATNSimulator::getExistingTargetState(dfa::DFAState *s, size_t t) { dfa::DFAState* retval = nullptr; - _edgeLock.readLock(); + std::shared_lock edgeLock(atn._edgeMutex); if (t <= MAX_DFA_EDGE) { auto iterator = s->edges.find(t - MIN_DFA_EDGE); #if DEBUG_ATN == 1 @@ -194,7 +179,6 @@ dfa::DFAState *LexerATNSimulator::getExistingTargetState(dfa::DFAState *s, size_ if (iterator != s->edges.end()) retval = iterator->second; } - _edgeLock.readUnlock(); return retval; } @@ -209,9 +193,9 @@ dfa::DFAState *LexerATNSimulator::computeTargetState(CharStream *input, dfa::DFA if (!reach->hasSemanticContext) { // we got nowhere on t, don't throw out this knowledge; it'd // cause a failover from DFA later. - delete reach; addDFAEdge(s, t, ERROR.get()); } + delete reach; // stop when we can't match any more char return ERROR.get(); @@ -223,8 +207,7 @@ dfa::DFAState *LexerATNSimulator::computeTargetState(CharStream *input, dfa::DFA size_t LexerATNSimulator::failOrAccept(CharStream *input, ATNConfigSet *reach, size_t t) { if (_prevAccept.dfaState != nullptr) { - Ref lexerActionExecutor = _prevAccept.dfaState->lexerActionExecutor; - accept(input, lexerActionExecutor, _startIndex, _prevAccept.index, _prevAccept.line, _prevAccept.charPos); + accept(input, _prevAccept.dfaState->lexerActionExecutor, _startIndex, _prevAccept.index, _prevAccept.line, _prevAccept.charPos); return _prevAccept.dfaState->prediction; } else { // if no accept and EOF is first char, return EOF @@ -241,7 +224,7 @@ void LexerATNSimulator::getReachableConfigSet(CharStream *input, ATNConfigSet *c // than a config that already reached an accept state for the same rule size_t skipAlt = ATN::INVALID_ALT_NUMBER; - for (auto c : closure_->configs) { + for (const auto &c : closure_->configs) { bool currentAltReachedAcceptState = c->alt == skipAlt; if (currentAltReachedAcceptState && (std::static_pointer_cast(c))->hasPassedThroughNonGreedyDecision()) { continue; @@ -253,17 +236,17 @@ void LexerATNSimulator::getReachableConfigSet(CharStream *input, ATNConfigSet *c size_t n = c->state->transitions.size(); for (size_t ti = 0; ti < n; ti++) { // for each transition - Transition *trans = c->state->transitions[ti]; + const Transition *trans = c->state->transitions[ti].get(); ATNState *target = getReachableTarget(trans, (int)t); if (target != nullptr) { - Ref lexerActionExecutor = std::static_pointer_cast(c)->getLexerActionExecutor(); + auto lexerActionExecutor = downCast(*c).getLexerActionExecutor(); if (lexerActionExecutor != nullptr) { lexerActionExecutor = lexerActionExecutor->fixOffsetBeforeMatch((int)input->index() - (int)_startIndex); } bool treatEofAsEpsilon = t == Token::EOF; - Ref config = std::make_shared(std::static_pointer_cast(c), - target, lexerActionExecutor); + Ref config = std::make_shared(downCast(*c), + target, std::move(lexerActionExecutor)); if (closure(input, config, reach, currentAltReachedAcceptState, true, treatEofAsEpsilon)) { // any remaining configs for this alt have a lower priority than @@ -276,7 +259,7 @@ void LexerATNSimulator::getReachableConfigSet(CharStream *input, ATNConfigSet *c } } -void LexerATNSimulator::accept(CharStream *input, const Ref &lexerActionExecutor, size_t /*startIndex*/, +void LexerATNSimulator::accept(CharStream *input, const Ref &lexerActionExecutor, size_t /*startIndex*/, size_t index, size_t line, size_t charPos) { #if DEBUG_ATN == 1 std::cout << "ACTION "; @@ -293,7 +276,7 @@ void LexerATNSimulator::accept(CharStream *input, const Ref } } -atn::ATNState *LexerATNSimulator::getReachableTarget(Transition *trans, size_t t) { +atn::ATNState *LexerATNSimulator::getReachableTarget(const Transition *trans, size_t t) { if (trans->matches(t, Lexer::MIN_CHAR_VALUE, Lexer::MAX_CHAR_VALUE)) { return trans->target; } @@ -302,7 +285,7 @@ atn::ATNState *LexerATNSimulator::getReachableTarget(Transition *trans, size_t t } std::unique_ptr LexerATNSimulator::computeStartState(CharStream *input, ATNState *p) { - Ref initialContext = PredictionContext::EMPTY; // ml: the purpose of this assignment is unclear + Ref initialContext = PredictionContext::EMPTY; // ml: the purpose of this assignment is unclear std::unique_ptr configs(new OrderedATNConfigSet()); for (size_t i = 0; i < p->transitions.size(); i++) { ATNState *target = p->transitions[i]->target; @@ -319,7 +302,7 @@ bool LexerATNSimulator::closure(CharStream *input, const Ref &co std::cout << "closure(" << config->toString(true) << ")" << std::endl; #endif - if (is(config->state)) { + if (config->state != nullptr && config->state->getStateType() == ATNStateType::RULE_STOP) { #if DEBUG_ATN == 1 if (_recog != nullptr) { std::cout << "closure at " << _recog->getRuleNames()[config->state->ruleIndex] << " rule stop " << config << std::endl; @@ -333,7 +316,7 @@ bool LexerATNSimulator::closure(CharStream *input, const Ref &co configs->add(config); return true; } else { - configs->add(std::make_shared(config, config->state, PredictionContext::EMPTY)); + configs->add(std::make_shared(*config, config->state, PredictionContext::EMPTY)); currentAltReachedAcceptState = true; } } @@ -341,9 +324,9 @@ bool LexerATNSimulator::closure(CharStream *input, const Ref &co if (config->context != nullptr && !config->context->isEmpty()) { for (size_t i = 0; i < config->context->size(); i++) { if (config->context->getReturnState(i) != PredictionContext::EMPTY_RETURN_STATE) { - std::weak_ptr newContext = config->context->getParent(i); // "pop" return state + Ref newContext = config->context->getParent(i); // "pop" return state ATNState *returnState = atn.states[config->context->getReturnState(i)]; - Ref c = std::make_shared(config, returnState, newContext.lock()); + Ref c = std::make_shared(*config, returnState, newContext); currentAltReachedAcceptState = closure(input, c, configs, currentAltReachedAcceptState, speculative, treatEofAsEpsilon); } } @@ -361,7 +344,7 @@ bool LexerATNSimulator::closure(CharStream *input, const Ref &co ATNState *p = config->state; for (size_t i = 0; i < p->transitions.size(); i++) { - Transition *t = p->transitions[i]; + const Transition *t = p->transitions[i].get(); Ref c = getEpsilonTarget(input, config, t, configs, speculative, treatEofAsEpsilon); if (c != nullptr) { currentAltReachedAcceptState = closure(input, c, configs, currentAltReachedAcceptState, speculative, treatEofAsEpsilon); @@ -371,22 +354,22 @@ bool LexerATNSimulator::closure(CharStream *input, const Ref &co return currentAltReachedAcceptState; } -Ref LexerATNSimulator::getEpsilonTarget(CharStream *input, const Ref &config, Transition *t, +Ref LexerATNSimulator::getEpsilonTarget(CharStream *input, const Ref &config, const Transition *t, ATNConfigSet *configs, bool speculative, bool treatEofAsEpsilon) { Ref c = nullptr; - switch (t->getSerializationType()) { - case Transition::RULE: { - RuleTransition *ruleTransition = static_cast(t); - Ref newContext = SingletonPredictionContext::create(config->context, ruleTransition->followState->stateNumber); - c = std::make_shared(config, t->target, newContext); + switch (t->getTransitionType()) { + case TransitionType::RULE: { + const RuleTransition *ruleTransition = static_cast(t); + Ref newContext = SingletonPredictionContext::create(config->context, ruleTransition->followState->stateNumber); + c = std::make_shared(*config, t->target, newContext); break; } - case Transition::PRECEDENCE: + case TransitionType::PRECEDENCE: throw UnsupportedOperationException("Precedence predicates are not supported in lexers."); - case Transition::PREDICATE: { + case TransitionType::PREDICATE: { /* Track traversing semantic predicates. If we traverse, we cannot add a DFA state for this "reach" computation because the DFA would not test the predicate again in the @@ -405,20 +388,20 @@ Ref LexerATNSimulator::getEpsilonTarget(CharStream *input, const states reached by traversing predicates. Since this is when we test them, we cannot cash the DFA state target of ID. */ - PredicateTransition *pt = static_cast(t); + const PredicateTransition *pt = static_cast(t); #if DEBUG_ATN == 1 - std::cout << "EVAL rule " << pt->ruleIndex << ":" << pt->predIndex << std::endl; + std::cout << "EVAL rule " << pt->getRuleIndex() << ":" << pt->getPredIndex() << std::endl; #endif configs->hasSemanticContext = true; - if (evaluatePredicate(input, pt->ruleIndex, pt->predIndex, speculative)) { - c = std::make_shared(config, t->target); + if (evaluatePredicate(input, pt->getRuleIndex(), pt->getPredIndex(), speculative)) { + c = std::make_shared(*config, t->target); } break; } - case Transition::ACTION: + case TransitionType::ACTION: if (config->context == nullptr|| config->context->hasEmptyPath()) { // execute actions anywhere in the start rule for a token. // @@ -432,27 +415,27 @@ Ref LexerATNSimulator::getEpsilonTarget(CharStream *input, const // getEpsilonTarget to return two configurations, so // additional modifications are needed before we can support // the split operation. - Ref lexerActionExecutor = LexerActionExecutor::append(config->getLexerActionExecutor(), - atn.lexerActions[static_cast(t)->actionIndex]); - c = std::make_shared(config, t->target, lexerActionExecutor); + auto lexerActionExecutor = LexerActionExecutor::append(config->getLexerActionExecutor(), + atn.lexerActions[static_cast(t)->actionIndex]); + c = std::make_shared(*config, t->target, std::move(lexerActionExecutor)); break; } else { // ignore actions in referenced rules - c = std::make_shared(config, t->target); + c = std::make_shared(*config, t->target); break; } - case Transition::EPSILON: - c = std::make_shared(config, t->target); + case TransitionType::EPSILON: + c = std::make_shared(*config, t->target); break; - case Transition::ATOM: - case Transition::RANGE: - case Transition::SET: + case TransitionType::ATOM: + case TransitionType::RANGE: + case TransitionType::SET: if (treatEofAsEpsilon) { if (t->matches(Token::EOF, Lexer::MIN_CHAR_VALUE, Lexer::MAX_CHAR_VALUE)) { - c = std::make_shared(config, t->target); + c = std::make_shared(*config, t->target); break; } } @@ -530,12 +513,15 @@ void LexerATNSimulator::addDFAEdge(dfa::DFAState *p, size_t t, dfa::DFAState *q) return; } - _edgeLock.writeLock(); + std::unique_lock edgeLock(atn._edgeMutex); p->edges[t - MIN_DFA_EDGE] = q; // connect - _edgeLock.writeUnlock(); } dfa::DFAState *LexerATNSimulator::addDFAState(ATNConfigSet *configs) { + return addDFAState(configs, true); +} + +dfa::DFAState *LexerATNSimulator::addDFAState(ATNConfigSet *configs, bool suppressEdge) { /* the lexer evaluates predicates on-the-fly; by this point configs * should not contain any configurations with unevaluated predicates. */ @@ -543,8 +529,8 @@ dfa::DFAState *LexerATNSimulator::addDFAState(ATNConfigSet *configs) { dfa::DFAState *proposed = new dfa::DFAState(std::unique_ptr(configs)); /* mem-check: managed by the DFA or deleted below */ Ref firstConfigWithRuleStopState = nullptr; - for (auto &c : configs->configs) { - if (is(c->state)) { + for (const auto &c : configs->configs) { + if (RuleStopState::is(c->state)) { firstConfigWithRuleStopState = c; break; } @@ -552,28 +538,29 @@ dfa::DFAState *LexerATNSimulator::addDFAState(ATNConfigSet *configs) { if (firstConfigWithRuleStopState != nullptr) { proposed->isAcceptState = true; - proposed->lexerActionExecutor = std::dynamic_pointer_cast(firstConfigWithRuleStopState)->getLexerActionExecutor(); + proposed->lexerActionExecutor = downCast(*firstConfigWithRuleStopState).getLexerActionExecutor(); proposed->prediction = atn.ruleToTokenType[firstConfigWithRuleStopState->state->ruleIndex]; } dfa::DFA &dfa = _decisionToDFA[_mode]; - _stateLock.writeLock(); - if (!dfa.states.empty()) { - auto iterator = dfa.states.find(proposed); - if (iterator != dfa.states.end()) { + { + std::unique_lock stateLock(atn._stateMutex); + auto [existing, inserted] = dfa.states.insert(proposed); + if (!inserted) { delete proposed; - _stateLock.writeUnlock(); - return *iterator; + proposed = *existing; + } else { + // Previously we did a lookup, then set fields, then inserted. It was `dfa.states.size()`, + // since we already inserted we need to subtract one. + proposed->stateNumber = static_cast(dfa.states.size() - 1); + proposed->configs->setReadonly(true); + } + if (!suppressEdge) { + dfa.s0 = proposed; } } - proposed->stateNumber = (int)dfa.states.size(); - proposed->configs->setReadonly(true); - - dfa.states.insert(proposed); - _stateLock.writeUnlock(); - return proposed; } diff --git a/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h b/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h index cfe2d913be..46bc22614a 100755 --- a/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h +++ b/runtime/Cpp/runtime/src/atn/LexerATNSimulator.h @@ -17,38 +17,18 @@ namespace atn { /// "dup" of ParserInterpreter class ANTLR4CPP_PUBLIC LexerATNSimulator : public ATNSimulator { protected: - class SimState { - public: - virtual ~SimState(); - - protected: - size_t index; - size_t line; - size_t charPos; - dfa::DFAState *dfaState; - virtual void reset(); - friend class LexerATNSimulator; - - private: - void InitializeInstanceFields(); - - public: - SimState() { - InitializeInstanceFields(); - } - }; + struct ANTLR4CPP_PUBLIC SimState final { + size_t index = INVALID_INDEX; + size_t line = 0; + size_t charPos = INVALID_INDEX; + dfa::DFAState *dfaState = nullptr; + void reset(); + }; public: -#if __cplusplus >= 201703L static constexpr size_t MIN_DFA_EDGE = 0; static constexpr size_t MAX_DFA_EDGE = 127; // forces unicode to stay in ATN -#else - enum : size_t { - MIN_DFA_EDGE = 0, - MAX_DFA_EDGE = 127, // forces unicode to stay in ATN - }; -#endif protected: /// @@ -91,11 +71,9 @@ namespace atn { SimState _prevAccept; public: - static std::atomic match_calls; - LexerATNSimulator(const ATN &atn, std::vector &decisionToDFA, PredictionContextCache &sharedContextCache); LexerATNSimulator(Lexer *recog, const ATN &atn, std::vector &decisionToDFA, PredictionContextCache &sharedContextCache); - virtual ~LexerATNSimulator () {} + virtual ~LexerATNSimulator() = default; virtual void copyState(LexerATNSimulator *simulator); virtual size_t match(CharStream *input, size_t mode); @@ -142,10 +120,10 @@ namespace atn { void getReachableConfigSet(CharStream *input, ATNConfigSet *closure_, // closure_ as we have a closure() already ATNConfigSet *reach, size_t t); - virtual void accept(CharStream *input, const Ref &lexerActionExecutor, size_t startIndex, size_t index, + virtual void accept(CharStream *input, const Ref &lexerActionExecutor, size_t startIndex, size_t index, size_t line, size_t charPos); - virtual ATNState *getReachableTarget(Transition *trans, size_t t); + virtual ATNState *getReachableTarget(const Transition *trans, size_t t); virtual std::unique_ptr computeStartState(CharStream *input, ATNState *p); @@ -162,7 +140,7 @@ namespace atn { bool currentAltReachedAcceptState, bool speculative, bool treatEofAsEpsilon); // side-effect: can alter configs.hasSemanticContext - virtual Ref getEpsilonTarget(CharStream *input, const Ref &config, Transition *t, + virtual Ref getEpsilonTarget(CharStream *input, const Ref &config, const Transition *t, ATNConfigSet *configs, bool speculative, bool treatEofAsEpsilon); /// @@ -199,6 +177,8 @@ namespace atn { /// virtual dfa::DFAState *addDFAState(ATNConfigSet *configs); + virtual dfa::DFAState *addDFAState(ATNConfigSet *configs, bool suppressEdge); + public: dfa::DFA& getDFA(size_t mode); diff --git a/runtime/Cpp/runtime/src/atn/LexerAction.cpp b/runtime/Cpp/runtime/src/atn/LexerAction.cpp index 983ba6d52c..a9d9a6771b 100644 --- a/runtime/Cpp/runtime/src/atn/LexerAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerAction.cpp @@ -1,9 +1,15 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - #include "LexerAction.h" -antlr4::atn::LexerAction::~LexerAction() { +using namespace antlr4::atn; + +size_t LexerAction::hashCode() const { + auto hash = cachedHashCode(); + if (hash == 0) { + hash = hashCodeImpl(); + if (hash == 0) { + hash = std::numeric_limits::max(); + } + _hashCode.store(hash, std::memory_order_relaxed); + } + return hash; } diff --git a/runtime/Cpp/runtime/src/atn/LexerAction.h b/runtime/Cpp/runtime/src/atn/LexerAction.h index 8e833b669f..5c30a89608 100755 --- a/runtime/Cpp/runtime/src/atn/LexerAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerAction.h @@ -21,13 +21,17 @@ namespace atn { /// class ANTLR4CPP_PUBLIC LexerAction { public: - virtual ~LexerAction(); + virtual ~LexerAction() = default; /// /// Gets the serialization type of the lexer action. /// /// The serialization type of the lexer action. - virtual LexerActionType getActionType() const = 0; + /// + /// IMPORTANT: Unlike Java, this returns LexerActionType::INDEXED_CUSTOM for instances of + /// LexerIndexedCustomAction. If you need the wrapped action type, use + /// LexerIndexedCustomAction::getAction()->getActionType(). + LexerActionType getActionType() const { return _actionType; } /// /// Gets whether the lexer action is position-dependent. Position-dependent @@ -42,7 +46,7 @@ namespace atn { /// {@code true} if the lexer action semantics can be affected by the /// position of the input at the time it is executed; /// otherwise, {@code false}. - virtual bool isPositionDependent() const = 0; + bool isPositionDependent() const { return _positionDependent; } /// /// Execute the lexer action in the context of the specified . @@ -51,16 +55,46 @@ namespace atn { /// positioned correctly prior to calling this method. /// /// The lexer instance. - virtual void execute(Lexer *lexer) = 0; + virtual void execute(Lexer *lexer) const = 0; - virtual size_t hashCode() const = 0; - virtual bool operator == (const LexerAction &obj) const = 0; - virtual bool operator != (const LexerAction &obj) const { - return !(*this == obj); - } + size_t hashCode() const; + + virtual bool equals(const LexerAction &other) const = 0; virtual std::string toString() const = 0; + + protected: + LexerAction(LexerActionType actionType, bool positionDependent) + : _actionType(actionType), _hashCode(0), _positionDependent(positionDependent) {} + + virtual size_t hashCodeImpl() const = 0; + + size_t cachedHashCode() const { return _hashCode.load(std::memory_order_relaxed); } + + private: + const LexerActionType _actionType; + mutable std::atomic _hashCode; + const bool _positionDependent; + }; + + inline bool operator==(const LexerAction &lhs, const LexerAction &rhs) { + return lhs.equals(rhs); + } + + inline bool operator!=(const LexerAction &lhs, const LexerAction &rhs) { + return !operator==(lhs, rhs); + } + +} // namespace atn +} // namespace antlr4 + +namespace std { + + template <> + struct hash<::antlr4::atn::LexerAction> { + size_t operator()(const ::antlr4::atn::LexerAction &lexerAction) const { + return lexerAction.hashCode(); + } }; -} // namespace atn -} // namespace antlr4 +} // namespace std diff --git a/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp b/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp index 1ae510f751..490351b892 100755 --- a/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp @@ -7,6 +7,7 @@ #include "atn/LexerIndexedCustomAction.h" #include "support/CPPUtils.h" #include "support/Arrays.h" +#include "support/Casts.h" #include "atn/LexerActionExecutor.h" @@ -15,48 +16,54 @@ using namespace antlr4::atn; using namespace antlr4::misc; using namespace antlrcpp; -LexerActionExecutor::LexerActionExecutor(const std::vector> &lexerActions) - : _lexerActions(lexerActions), _hashCode(generateHashCode()) { -} +namespace { + + bool cachedHashCodeEqual(size_t lhs, size_t rhs) { + return lhs == rhs || lhs == 0 || rhs == 0; + } + + bool lexerActionEqual(const Ref &lhs, const Ref &rhs) { + return *lhs == *rhs; + } -LexerActionExecutor::~LexerActionExecutor() { } -Ref LexerActionExecutor::append(Ref const& lexerActionExecutor, - Ref const& lexerAction) { +LexerActionExecutor::LexerActionExecutor(std::vector> lexerActions) + : _lexerActions(std::move(lexerActions)), _hashCode(0) {} + +Ref LexerActionExecutor::append(const Ref &lexerActionExecutor, + Ref lexerAction) { if (lexerActionExecutor == nullptr) { - return std::make_shared(std::vector> { lexerAction }); + return std::make_shared(std::vector>{ std::move(lexerAction) }); } - - std::vector> lexerActions = lexerActionExecutor->_lexerActions; // Make a copy. - lexerActions.push_back(lexerAction); - return std::make_shared(lexerActions); + std::vector> lexerActions; + lexerActions.reserve(lexerActionExecutor->_lexerActions.size() + 1); + lexerActions.insert(lexerActions.begin(), lexerActionExecutor->_lexerActions.begin(), lexerActionExecutor->_lexerActions.end()); + lexerActions.push_back(std::move(lexerAction)); + return std::make_shared(std::move(lexerActions)); } -Ref LexerActionExecutor::fixOffsetBeforeMatch(int offset) { - std::vector> updatedLexerActions; +Ref LexerActionExecutor::fixOffsetBeforeMatch(int offset) const { + std::vector> updatedLexerActions; for (size_t i = 0; i < _lexerActions.size(); i++) { - if (_lexerActions[i]->isPositionDependent() && !is(_lexerActions[i])) { + if (_lexerActions[i]->isPositionDependent() && !LexerIndexedCustomAction::is(*_lexerActions[i])) { if (updatedLexerActions.empty()) { updatedLexerActions = _lexerActions; // Make a copy. } - updatedLexerActions[i] = std::make_shared(offset, _lexerActions[i]); } } - if (updatedLexerActions.empty()) { return shared_from_this(); } - - return std::make_shared(updatedLexerActions); + return std::make_shared(std::move(updatedLexerActions)); } -std::vector> LexerActionExecutor::getLexerActions() const { +const std::vector>& LexerActionExecutor::getLexerActions() const { return _lexerActions; } -void LexerActionExecutor::execute(Lexer *lexer, CharStream *input, size_t startIndex) { +void LexerActionExecutor::execute(Lexer *lexer, CharStream *input, size_t startIndex) const { bool requiresSeek = false; size_t stopIndex = input->index(); @@ -65,43 +72,40 @@ void LexerActionExecutor::execute(Lexer *lexer, CharStream *input, size_t startI input->seek(stopIndex); } }); - for (auto lexerAction : _lexerActions) { - if (is(lexerAction)) { - int offset = (std::static_pointer_cast(lexerAction))->getOffset(); + for (const auto &lexerAction : _lexerActions) { + if (LexerIndexedCustomAction::is(*lexerAction)) { + int offset = downCast(*lexerAction).getOffset(); input->seek(startIndex + offset); - lexerAction = std::static_pointer_cast(lexerAction)->getAction(); requiresSeek = (startIndex + offset) != stopIndex; } else if (lexerAction->isPositionDependent()) { input->seek(stopIndex); requiresSeek = false; } - lexerAction->execute(lexer); } } size_t LexerActionExecutor::hashCode() const { - return _hashCode; -} - -bool LexerActionExecutor::operator == (const LexerActionExecutor &obj) const { - if (&obj == this) { - return true; + auto hash = _hashCode.load(std::memory_order_relaxed); + if (hash == 0) { + hash = MurmurHash::initialize(); + for (const auto &lexerAction : _lexerActions) { + hash = MurmurHash::update(hash, lexerAction); + } + hash = MurmurHash::finish(hash, _lexerActions.size()); + if (hash == 0) { + hash = std::numeric_limits::max(); + } + _hashCode.store(hash, std::memory_order_relaxed); } - - return _hashCode == obj._hashCode && Arrays::equals(_lexerActions, obj._lexerActions); -} - -bool LexerActionExecutor::operator != (const LexerActionExecutor &obj) const { - return !operator==(obj); + return hash; } -size_t LexerActionExecutor::generateHashCode() const { - size_t hash = MurmurHash::initialize(); - for (auto lexerAction : _lexerActions) { - hash = MurmurHash::update(hash, lexerAction); +bool LexerActionExecutor::equals(const LexerActionExecutor &other) const { + if (this == std::addressof(other)) { + return true; } - hash = MurmurHash::finish(hash, _lexerActions.size()); - - return hash; + return cachedHashCodeEqual(_hashCode.load(std::memory_order_relaxed), other._hashCode.load(std::memory_order_relaxed)) && + _lexerActions.size() == other._lexerActions.size() && + std::equal(_lexerActions.begin(), _lexerActions.end(), other._lexerActions.begin(), lexerActionEqual); } diff --git a/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h b/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h index 488b54c01d..28bb1e28ec 100755 --- a/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h +++ b/runtime/Cpp/runtime/src/atn/LexerActionExecutor.h @@ -17,13 +17,12 @@ namespace atn { /// The executor tracks position information for position-dependent lexer actions /// efficiently, ensuring that actions appearing only at the end of the rule do /// not cause bloating of the created for the lexer. - class ANTLR4CPP_PUBLIC LexerActionExecutor : public std::enable_shared_from_this { + class ANTLR4CPP_PUBLIC LexerActionExecutor final : public std::enable_shared_from_this { public: /// /// Constructs an executor for a sequence of actions. /// The lexer actions to execute. - LexerActionExecutor(const std::vector> &lexerActions); - virtual ~LexerActionExecutor(); + explicit LexerActionExecutor(std::vector> lexerActions); /// /// Creates a which executes the actions for @@ -39,8 +38,8 @@ namespace atn { /// /// A for executing the combine actions /// of {@code lexerActionExecutor} and {@code lexerAction}. - static Ref append(Ref const& lexerActionExecutor, - Ref const& lexerAction); + static Ref append(const Ref &lexerActionExecutor, + Ref lexerAction); /// /// Creates a which encodes the current offset @@ -70,12 +69,12 @@ namespace atn { /// /// A which stores input stream offsets /// for all position-dependent lexer actions. - virtual Ref fixOffsetBeforeMatch(int offset); + Ref fixOffsetBeforeMatch(int offset) const; /// /// Gets the lexer actions to be executed by this executor. /// The lexer actions to be executed by this executor. - virtual std::vector> getLexerActions() const; + const std::vector>& getLexerActions() const; /// /// Execute the actions encapsulated by this executor within the context of a @@ -95,21 +94,35 @@ namespace atn { /// The token start index. This value may be passed to /// to set the {@code input} position to the beginning /// of the token. - virtual void execute(Lexer *lexer, CharStream *input, size_t startIndex); + void execute(Lexer *lexer, CharStream *input, size_t startIndex) const; - virtual size_t hashCode() const; - virtual bool operator == (const LexerActionExecutor &obj) const; - virtual bool operator != (const LexerActionExecutor &obj) const; + size_t hashCode() const; + + bool equals(const LexerActionExecutor &other) const; private: - const std::vector> _lexerActions; + const std::vector> _lexerActions; + mutable std::atomic _hashCode; + }; + + inline bool operator==(const LexerActionExecutor &lhs, const LexerActionExecutor &rhs) { + return lhs.equals(rhs); + } + + inline bool operator!=(const LexerActionExecutor &lhs, const LexerActionExecutor &rhs) { + return !operator==(lhs, rhs); + } + +} // namespace atn +} // namespace antlr4 - /// Caches the result of since the hash code is an element - /// of the performance-critical operation. - const size_t _hashCode; +namespace std { - size_t generateHashCode() const; + template <> + struct hash<::antlr4::atn::LexerActionExecutor> { + size_t operator()(const ::antlr4::atn::LexerActionExecutor &lexerActionExecutor) const { + return lexerActionExecutor.hashCode(); + } }; -} // namespace atn -} // namespace antlr4 +} // namespace std diff --git a/runtime/Cpp/runtime/src/atn/LexerActionType.h b/runtime/Cpp/runtime/src/atn/LexerActionType.h index a72f15c4b5..aab4033415 100755 --- a/runtime/Cpp/runtime/src/atn/LexerActionType.h +++ b/runtime/Cpp/runtime/src/atn/LexerActionType.h @@ -20,7 +20,7 @@ namespace atn { /// /// The type of a action. /// - CHANNEL, + CHANNEL = 0, /// /// The type of a action. /// @@ -49,6 +49,8 @@ namespace atn { /// The type of a action. /// TYPE, + + INDEXED_CUSTOM, }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp b/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp index 959beab3d5..b6cda6cff0 100755 --- a/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp @@ -5,51 +5,39 @@ #include "misc/MurmurHash.h" #include "Lexer.h" +#include "support/Casts.h" #include "atn/LexerChannelAction.h" using namespace antlr4::atn; using namespace antlr4::misc; +using namespace antlrcpp; -LexerChannelAction::LexerChannelAction(int channel) : _channel(channel) { -} - -int LexerChannelAction::getChannel() const { - return _channel; -} - -LexerActionType LexerChannelAction::getActionType() const { - return LexerActionType::CHANNEL; -} +LexerChannelAction::LexerChannelAction(int channel) + : LexerAction(LexerActionType::CHANNEL, false), _channel(channel) {} -bool LexerChannelAction::isPositionDependent() const { - return false; +void LexerChannelAction::execute(Lexer *lexer) const { + lexer->setChannel(getChannel()); } -void LexerChannelAction::execute(Lexer *lexer) { - lexer->setChannel(_channel); -} - -size_t LexerChannelAction::hashCode() const { +size_t LexerChannelAction::hashCodeImpl() const { size_t hash = MurmurHash::initialize(); hash = MurmurHash::update(hash, static_cast(getActionType())); - hash = MurmurHash::update(hash, _channel); + hash = MurmurHash::update(hash, getChannel()); return MurmurHash::finish(hash, 2); } -bool LexerChannelAction::operator == (const LexerAction &obj) const { - if (&obj == this) { +bool LexerChannelAction::equals(const LexerAction &other) const { + if (this == std::addressof(other)) { return true; } - - const LexerChannelAction *action = dynamic_cast(&obj); - if (action == nullptr) { + if (getActionType() != other.getActionType()) { return false; } - - return _channel == action->_channel; + const auto &lexerAction = downCast(other); + return getChannel() == lexerAction.getChannel(); } std::string LexerChannelAction::toString() const { - return "channel(" + std::to_string(_channel) + ")"; + return "channel(" + std::to_string(getChannel()) + ")"; } diff --git a/runtime/Cpp/runtime/src/atn/LexerChannelAction.h b/runtime/Cpp/runtime/src/atn/LexerChannelAction.h index 73e3a26bf6..1a5c53efef 100755 --- a/runtime/Cpp/runtime/src/atn/LexerChannelAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerChannelAction.h @@ -22,26 +22,20 @@ namespace atn { /// class ANTLR4CPP_PUBLIC LexerChannelAction final : public LexerAction { public: + static bool is(const LexerAction &lexerAction) { return lexerAction.getActionType() == LexerActionType::CHANNEL; } + + static bool is(const LexerAction *lexerAction) { return lexerAction != nullptr && is(*lexerAction); } + /// /// Constructs a new {@code channel} action with the specified channel value. /// The channel value to pass to . - LexerChannelAction(int channel); + explicit LexerChannelAction(int channel); /// /// Gets the channel to use for the created by the lexer. /// /// The channel to use for the created by the lexer. - int getChannel() const; - - /// - /// {@inheritDoc} - /// This method returns . - virtual LexerActionType getActionType() const override; - - /// - /// {@inheritDoc} - /// This method returns {@code false}. - virtual bool isPositionDependent() const override; + int getChannel() const { return _channel; } /// /// {@inheritDoc} @@ -49,11 +43,13 @@ namespace atn { /// This action is implemented by calling with the /// value provided by . /// - virtual void execute(Lexer *lexer) override; + void execute(Lexer *lexer) const override; + + bool equals(const LexerAction &other) const override; + std::string toString() const override; - virtual size_t hashCode() const override; - virtual bool operator == (const LexerAction &obj) const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; private: const int _channel; diff --git a/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp b/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp index 1e977a310d..b6edd89ea1 100755 --- a/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp @@ -4,59 +4,42 @@ */ #include "misc/MurmurHash.h" -#include "support/CPPUtils.h" #include "Lexer.h" +#include "support/Casts.h" #include "atn/LexerCustomAction.h" using namespace antlr4; using namespace antlr4::atn; using namespace antlr4::misc; +using namespace antlrcpp; -LexerCustomAction::LexerCustomAction(size_t ruleIndex, size_t actionIndex) : _ruleIndex(ruleIndex), _actionIndex(actionIndex) { -} - -size_t LexerCustomAction::getRuleIndex() const { - return _ruleIndex; -} +LexerCustomAction::LexerCustomAction(size_t ruleIndex, size_t actionIndex) + : LexerAction(LexerActionType::CUSTOM, true), _ruleIndex(ruleIndex), _actionIndex(actionIndex) {} -size_t LexerCustomAction::getActionIndex() const { - return _actionIndex; +void LexerCustomAction::execute(Lexer *lexer) const { + lexer->action(nullptr, getRuleIndex(), getActionIndex()); } -LexerActionType LexerCustomAction::getActionType() const { - return LexerActionType::CUSTOM; -} - -bool LexerCustomAction::isPositionDependent() const { - return true; -} - -void LexerCustomAction::execute(Lexer *lexer) { - lexer->action(nullptr, _ruleIndex, _actionIndex); -} - -size_t LexerCustomAction::hashCode() const { +size_t LexerCustomAction::hashCodeImpl() const { size_t hash = MurmurHash::initialize(); hash = MurmurHash::update(hash, static_cast(getActionType())); - hash = MurmurHash::update(hash, _ruleIndex); - hash = MurmurHash::update(hash, _actionIndex); + hash = MurmurHash::update(hash, getRuleIndex()); + hash = MurmurHash::update(hash, getActionIndex()); return MurmurHash::finish(hash, 3); } -bool LexerCustomAction::operator == (const LexerAction &obj) const { - if (&obj == this) { +bool LexerCustomAction::equals(const LexerAction &other) const { + if (this == std::addressof(other)) { return true; } - - const LexerCustomAction *action = dynamic_cast(&obj); - if (action == nullptr) { + if (getActionType() != other.getActionType()) { return false; } - - return _ruleIndex == action->_ruleIndex && _actionIndex == action->_actionIndex; + const auto &lexerAction = downCast(other); + return getRuleIndex() == lexerAction.getRuleIndex() && getActionIndex() == lexerAction.getActionIndex(); } std::string LexerCustomAction::toString() const { - return antlrcpp::toString(this); + return "custom(" + std::to_string(getRuleIndex()) + ", " + std::to_string(getActionIndex()) + ")"; } diff --git a/runtime/Cpp/runtime/src/atn/LexerCustomAction.h b/runtime/Cpp/runtime/src/atn/LexerCustomAction.h index bd1c5d3566..7973271c62 100755 --- a/runtime/Cpp/runtime/src/atn/LexerCustomAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerCustomAction.h @@ -26,6 +26,10 @@ namespace atn { /// class ANTLR4CPP_PUBLIC LexerCustomAction final : public LexerAction { public: + static bool is(const LexerAction &lexerAction) { return lexerAction.getActionType() == LexerActionType::CUSTOM; } + + static bool is(const LexerAction *lexerAction) { return lexerAction != nullptr && is(*lexerAction); } + /// /// Constructs a custom lexer action with the specified rule and action /// indexes. @@ -40,31 +44,13 @@ namespace atn { /// Gets the rule index to use for calls to . /// /// The rule index for the custom action. - size_t getRuleIndex() const; + size_t getRuleIndex() const { return _ruleIndex; } /// /// Gets the action index to use for calls to . /// /// The action index for the custom action. - size_t getActionIndex() const; - - /// - /// {@inheritDoc} - /// - /// This method returns . - virtual LexerActionType getActionType() const override; - - /// - /// Gets whether the lexer action is position-dependent. Position-dependent - /// actions may have different semantics depending on the - /// index at the time the action is executed. - /// - /// Custom actions are position-dependent since they may represent a - /// user-defined embedded action which makes calls to methods like - /// . - /// - /// This method returns {@code true}. - virtual bool isPositionDependent() const override; + size_t getActionIndex() const { return _actionIndex; } /// /// {@inheritDoc} @@ -72,11 +58,13 @@ namespace atn { /// Custom actions are implemented by calling with the /// appropriate rule and action indexes. /// - virtual void execute(Lexer *lexer) override; + void execute(Lexer *lexer) const override; + + bool equals(const LexerAction &other) const override; + std::string toString() const override; - virtual size_t hashCode() const override; - virtual bool operator == (const LexerAction &obj) const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; private: const size_t _ruleIndex; diff --git a/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp b/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp index 9ea396a4c5..114863702c 100755 --- a/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp @@ -6,58 +6,52 @@ #include "misc/MurmurHash.h" #include "Lexer.h" #include "support/CPPUtils.h" +#include "support/Casts.h" #include "atn/LexerIndexedCustomAction.h" using namespace antlr4; using namespace antlr4::atn; using namespace antlr4::misc; +using namespace antlrcpp; -LexerIndexedCustomAction::LexerIndexedCustomAction(int offset, Ref const& action) - : _offset(offset), _action(action) { -} - -int LexerIndexedCustomAction::getOffset() const { - return _offset; -} +namespace { -Ref LexerIndexedCustomAction::getAction() const { - return _action; -} + bool cachedHashCodeEqual(size_t lhs, size_t rhs) { + return lhs == rhs || lhs == 0 || rhs == 0; + } -LexerActionType LexerIndexedCustomAction::getActionType() const { - return _action->getActionType(); } -bool LexerIndexedCustomAction::isPositionDependent() const { - return true; -} +LexerIndexedCustomAction::LexerIndexedCustomAction(int offset, Ref action) + : LexerAction(LexerActionType::INDEXED_CUSTOM, true), _action(std::move(action)), _offset(offset) {} -void LexerIndexedCustomAction::execute(Lexer *lexer) { +void LexerIndexedCustomAction::execute(Lexer *lexer) const { // assume the input stream position was properly set by the calling code - _action->execute(lexer); + getAction()->execute(lexer); } -size_t LexerIndexedCustomAction::hashCode() const { +size_t LexerIndexedCustomAction::hashCodeImpl() const { size_t hash = MurmurHash::initialize(); - hash = MurmurHash::update(hash, _offset); - hash = MurmurHash::update(hash, _action); - return MurmurHash::finish(hash, 2); + hash = MurmurHash::update(hash, static_cast(getActionType())); + hash = MurmurHash::update(hash, getOffset()); + hash = MurmurHash::update(hash, getAction()); + return MurmurHash::finish(hash, 3); } -bool LexerIndexedCustomAction::operator == (const LexerAction &obj) const { - if (&obj == this) { +bool LexerIndexedCustomAction::equals(const LexerAction &other) const { + if (this == std::addressof(other)) { return true; } - - const LexerIndexedCustomAction *action = dynamic_cast(&obj); - if (action == nullptr) { + if (getActionType() != other.getActionType()) { return false; } - - return _offset == action->_offset && *_action == *action->_action; + const auto &lexerAction = downCast(other); + return getOffset() == lexerAction.getOffset() && + cachedHashCodeEqual(cachedHashCode(), lexerAction.cachedHashCode()) && + *getAction() == *lexerAction.getAction(); } std::string LexerIndexedCustomAction::toString() const { - return antlrcpp::toString(this); + return "indexedCustom(" + std::to_string(getOffset()) + ", " + getAction()->toString() + ")"; } diff --git a/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h b/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h index bb371f8e3a..5693bac62b 100755 --- a/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.h @@ -26,6 +26,10 @@ namespace atn { /// class ANTLR4CPP_PUBLIC LexerIndexedCustomAction final : public LexerAction { public: + static bool is(const LexerAction &lexerAction) { return lexerAction.getActionType() == LexerActionType::INDEXED_CUSTOM; } + + static bool is(const LexerAction *lexerAction) { return lexerAction != nullptr && is(*lexerAction); } + /// /// Constructs a new indexed custom action by associating a character offset /// with a . @@ -38,7 +42,7 @@ namespace atn { /// executed. /// The lexer action to execute at a particular offset in the /// input . - LexerIndexedCustomAction(int offset, Ref const& action); + LexerIndexedCustomAction(int offset, Ref action); /// /// Gets the location in the input at which the lexer @@ -47,34 +51,24 @@ namespace atn { /// /// The location in the input at which the lexer /// action should be executed. - int getOffset() const; + int getOffset() const { return _offset; } /// /// Gets the lexer action to execute. /// /// A object which executes the lexer action. - Ref getAction() const; - - /// - /// {@inheritDoc} - /// - /// This method returns the result of calling - /// on the returned by . - virtual LexerActionType getActionType() const override; + const Ref& getAction() const { return _action; } - /// - /// {@inheritDoc} - /// This method returns {@code true}. - virtual bool isPositionDependent() const override; + void execute(Lexer *lexer) const override; + bool equals(const LexerAction &other) const override; + std::string toString() const override; - virtual void execute(Lexer *lexer) override; - virtual size_t hashCode() const override; - virtual bool operator == (const LexerAction &obj) const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; private: + const Ref _action; const int _offset; - const Ref _action; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp b/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp index 0bda8b7afe..a4ca3b3d79 100755 --- a/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerModeAction.cpp @@ -5,52 +5,39 @@ #include "misc/MurmurHash.h" #include "Lexer.h" +#include "support/Casts.h" #include "atn/LexerModeAction.h" using namespace antlr4; using namespace antlr4::atn; using namespace antlr4::misc; +using namespace antlrcpp; -LexerModeAction::LexerModeAction(int mode) : _mode(mode) { -} - -int LexerModeAction::getMode() { - return _mode; -} - -LexerActionType LexerModeAction::getActionType() const { - return LexerActionType::MODE; -} +LexerModeAction::LexerModeAction(int mode) : LexerAction(LexerActionType::MODE, false), _mode(mode) {} -bool LexerModeAction::isPositionDependent() const { - return false; +void LexerModeAction::execute(Lexer *lexer) const { + lexer->setMode(getMode()); } -void LexerModeAction::execute(Lexer *lexer) { - lexer->setMode(_mode); -} - -size_t LexerModeAction::hashCode() const { +size_t LexerModeAction::hashCodeImpl() const { size_t hash = MurmurHash::initialize(); hash = MurmurHash::update(hash, static_cast(getActionType())); - hash = MurmurHash::update(hash, _mode); + hash = MurmurHash::update(hash, getMode()); return MurmurHash::finish(hash, 2); } -bool LexerModeAction::operator == (const LexerAction &obj) const { - if (&obj == this) { +bool LexerModeAction::equals(const LexerAction &other) const { + if (this == std::addressof(other)) { return true; } - - const LexerModeAction *action = dynamic_cast(&obj); - if (action == nullptr) { + if (getActionType() != other.getActionType()) { return false; } - - return _mode == action->_mode; + const auto &lexerAction = downCast(other); + return getMode() == lexerAction.getMode(); } std::string LexerModeAction::toString() const { - return "mode(" + std::to_string(_mode) + ")"; + return "mode(" + std::to_string(getMode()) + ")"; } diff --git a/runtime/Cpp/runtime/src/atn/LexerModeAction.h b/runtime/Cpp/runtime/src/atn/LexerModeAction.h index 49a858b371..6fa61a2e67 100755 --- a/runtime/Cpp/runtime/src/atn/LexerModeAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerModeAction.h @@ -20,26 +20,20 @@ namespace atn { /// class ANTLR4CPP_PUBLIC LexerModeAction final : public LexerAction { public: + static bool is(const LexerAction &lexerAction) { return lexerAction.getActionType() == LexerActionType::MODE; } + + static bool is(const LexerAction *lexerAction) { return lexerAction != nullptr && is(*lexerAction); } + /// /// Constructs a new {@code mode} action with the specified mode value. /// The mode value to pass to . - LexerModeAction(int mode); + explicit LexerModeAction(int mode); /// /// Get the lexer mode this action should transition the lexer to. /// /// The lexer mode for this {@code mode} command. - int getMode(); - - /// - /// {@inheritDoc} - /// This method returns . - virtual LexerActionType getActionType() const override; - - /// - /// {@inheritDoc} - /// This method returns {@code false}. - virtual bool isPositionDependent() const override; + int getMode() const { return _mode; } /// /// {@inheritDoc} @@ -47,11 +41,13 @@ namespace atn { /// This action is implemented by calling with the /// value provided by . /// - virtual void execute(Lexer *lexer) override; + void execute(Lexer *lexer) const override; + + bool equals(const LexerAction &obj) const override; + std::string toString() const override; - virtual size_t hashCode() const override; - virtual bool operator == (const LexerAction &obj) const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; private: const int _mode; diff --git a/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp b/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp index 99b2dd99bf..30df87b7b6 100755 --- a/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp @@ -12,34 +12,23 @@ using namespace antlr4; using namespace antlr4::atn; using namespace antlr4::misc; -const Ref LexerMoreAction::getInstance() { - static Ref instance(new LexerMoreAction()); +const Ref& LexerMoreAction::getInstance() { + static const Ref instance(new LexerMoreAction()); return instance; } -LexerMoreAction::LexerMoreAction() { -} - -LexerActionType LexerMoreAction::getActionType() const { - return LexerActionType::MORE; -} - -bool LexerMoreAction::isPositionDependent() const { - return false; -} - -void LexerMoreAction::execute(Lexer *lexer) { +void LexerMoreAction::execute(Lexer *lexer) const { lexer->more(); } -size_t LexerMoreAction::hashCode() const { +size_t LexerMoreAction::hashCodeImpl() const { size_t hash = MurmurHash::initialize(); hash = MurmurHash::update(hash, static_cast(getActionType())); return MurmurHash::finish(hash, 1); } -bool LexerMoreAction::operator == (const LexerAction &obj) const { - return &obj == this; +bool LexerMoreAction::equals(const LexerAction &other) const { + return this == std::addressof(other); } std::string LexerMoreAction::toString() const { diff --git a/runtime/Cpp/runtime/src/atn/LexerMoreAction.h b/runtime/Cpp/runtime/src/atn/LexerMoreAction.h index ee3b2aa617..fc4b8fcbfc 100755 --- a/runtime/Cpp/runtime/src/atn/LexerMoreAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerMoreAction.h @@ -22,35 +22,31 @@ namespace atn { ///
class ANTLR4CPP_PUBLIC LexerMoreAction final : public LexerAction { public: - /// - /// Provides a singleton instance of this parameterless lexer action. - /// - static const Ref getInstance(); + static bool is(const LexerAction &lexerAction) { return lexerAction.getActionType() == LexerActionType::MORE; } - /// - /// {@inheritDoc} - /// This method returns . - virtual LexerActionType getActionType() const override; + static bool is(const LexerAction *lexerAction) { return lexerAction != nullptr && is(*lexerAction); } /// - /// {@inheritDoc} - /// This method returns {@code false}. - virtual bool isPositionDependent() const override; + /// Provides a singleton instance of this parameterless lexer action. + ///
+ static const Ref& getInstance(); /// /// {@inheritDoc} /// /// This action is implemented by calling . /// - virtual void execute(Lexer *lexer) override; + void execute(Lexer *lexer) const override; + + bool equals(const LexerAction &obj) const override; + std::string toString() const override; - virtual size_t hashCode() const override; - virtual bool operator == (const LexerAction &obj) const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; private: /// Constructs the singleton instance of the lexer {@code more} command. - LexerMoreAction(); + LexerMoreAction() : LexerAction(LexerActionType::MORE, false) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp b/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp index cac0996f48..5192049348 100755 --- a/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp @@ -12,34 +12,23 @@ using namespace antlr4; using namespace antlr4::atn; using namespace antlr4::misc; -const Ref LexerPopModeAction::getInstance() { - static Ref instance(new LexerPopModeAction()); +const Ref& LexerPopModeAction::getInstance() { + static const Ref instance(new LexerPopModeAction()); return instance; } -LexerPopModeAction::LexerPopModeAction() { -} - -LexerActionType LexerPopModeAction::getActionType() const { - return LexerActionType::POP_MODE; -} - -bool LexerPopModeAction::isPositionDependent() const { - return false; -} - -void LexerPopModeAction::execute(Lexer *lexer) { +void LexerPopModeAction::execute(Lexer *lexer) const { lexer->popMode(); } -size_t LexerPopModeAction::hashCode() const { +size_t LexerPopModeAction::hashCodeImpl() const { size_t hash = MurmurHash::initialize(); hash = MurmurHash::update(hash, static_cast(getActionType())); return MurmurHash::finish(hash, 1); } -bool LexerPopModeAction::operator == (const LexerAction &obj) const { - return &obj == this; +bool LexerPopModeAction::equals(const LexerAction &other) const { + return this == std::addressof(other); } std::string LexerPopModeAction::toString() const { diff --git a/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h b/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h index 497305c963..8d712cad8c 100755 --- a/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerPopModeAction.h @@ -22,35 +22,31 @@ namespace atn { ///
class ANTLR4CPP_PUBLIC LexerPopModeAction final : public LexerAction { public: - /// - /// Provides a singleton instance of this parameterless lexer action. - /// - static const Ref getInstance(); + static bool is(const LexerAction &lexerAction) { return lexerAction.getActionType() == LexerActionType::POP_MODE; } - /// - /// {@inheritDoc} - /// This method returns . - virtual LexerActionType getActionType() const override; + static bool is(const LexerAction *lexerAction) { return lexerAction != nullptr && is(*lexerAction); } /// - /// {@inheritDoc} - /// This method returns {@code false}. - virtual bool isPositionDependent() const override; + /// Provides a singleton instance of this parameterless lexer action. + ///
+ static const Ref& getInstance(); /// /// {@inheritDoc} /// /// This action is implemented by calling . /// - virtual void execute(Lexer *lexer) override; + void execute(Lexer *lexer) const override; + + bool equals(const LexerAction &other) const override; + std::string toString() const override; - virtual size_t hashCode() const override; - virtual bool operator == (const LexerAction &obj) const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; private: /// Constructs the singleton instance of the lexer {@code popMode} command. - LexerPopModeAction(); + LexerPopModeAction() : LexerAction(LexerActionType::POP_MODE, false) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp b/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp index 017abed04c..3ebd21fab2 100755 --- a/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp @@ -5,52 +5,39 @@ #include "misc/MurmurHash.h" #include "Lexer.h" +#include "support/Casts.h" #include "atn/LexerPushModeAction.h" using namespace antlr4; using namespace antlr4::atn; using namespace antlr4::misc; +using namespace antlrcpp; -LexerPushModeAction::LexerPushModeAction(int mode) : _mode(mode) { -} - -int LexerPushModeAction::getMode() const { - return _mode; -} - -LexerActionType LexerPushModeAction::getActionType() const { - return LexerActionType::PUSH_MODE; -} +LexerPushModeAction::LexerPushModeAction(int mode) : LexerAction(LexerActionType::PUSH_MODE, false), _mode(mode) {} -bool LexerPushModeAction::isPositionDependent() const { - return false; +void LexerPushModeAction::execute(Lexer *lexer) const { + lexer->pushMode(getMode()); } -void LexerPushModeAction::execute(Lexer *lexer) { - lexer->pushMode(_mode); -} - -size_t LexerPushModeAction::hashCode() const { +size_t LexerPushModeAction::hashCodeImpl() const { size_t hash = MurmurHash::initialize(); hash = MurmurHash::update(hash, static_cast(getActionType())); - hash = MurmurHash::update(hash, _mode); + hash = MurmurHash::update(hash, getMode()); return MurmurHash::finish(hash, 2); } -bool LexerPushModeAction::operator == (const LexerAction &obj) const { - if (&obj == this) { +bool LexerPushModeAction::equals(const LexerAction &other) const { + if (this == std::addressof(other)) { return true; } - - const LexerPushModeAction *action = dynamic_cast(&obj); - if (action == nullptr) { + if (getActionType() != other.getActionType()) { return false; } - - return _mode == action->_mode; + const auto &lexerAction = downCast(other); + return getMode() == lexerAction.getMode(); } std::string LexerPushModeAction::toString() const { - return "pushMode(" + std::to_string(_mode) + ")"; + return "pushMode(" + std::to_string(getMode()) + ")"; } diff --git a/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h b/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h index 43cb888c79..32b706b583 100755 --- a/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerPushModeAction.h @@ -20,26 +20,20 @@ namespace atn { ///
class ANTLR4CPP_PUBLIC LexerPushModeAction final : public LexerAction { public: + static bool is(const LexerAction &lexerAction) { return lexerAction.getActionType() == LexerActionType::PUSH_MODE; } + + static bool is(const LexerAction *lexerAction) { return lexerAction != nullptr && is(*lexerAction); } + /// /// Constructs a new {@code pushMode} action with the specified mode value. /// The mode value to pass to . - LexerPushModeAction(int mode); + explicit LexerPushModeAction(int mode); /// /// Get the lexer mode this action should transition the lexer to. /// /// The lexer mode for this {@code pushMode} command. - int getMode() const; - - /// - /// {@inheritDoc} - /// This method returns . - virtual LexerActionType getActionType() const override; - - /// - /// {@inheritDoc} - /// This method returns {@code false}. - virtual bool isPositionDependent() const override; + int getMode() const { return _mode; } /// /// {@inheritDoc} @@ -47,11 +41,13 @@ namespace atn { /// This action is implemented by calling with the /// value provided by . /// - virtual void execute(Lexer *lexer) override; + void execute(Lexer *lexer) const override; + + bool equals(const LexerAction &obj) const override; + std::string toString() const override; - virtual size_t hashCode() const override; - virtual bool operator == (const LexerAction &obj) const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; private: const int _mode; diff --git a/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp b/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp index 01947ce78c..72f9de3e1f 100755 --- a/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp @@ -12,34 +12,23 @@ using namespace antlr4; using namespace antlr4::atn; using namespace antlr4::misc; -const Ref LexerSkipAction::getInstance() { - static Ref instance(new LexerSkipAction()); +const Ref& LexerSkipAction::getInstance() { + static const Ref instance(new LexerSkipAction()); return instance; } -LexerSkipAction::LexerSkipAction() { -} - -LexerActionType LexerSkipAction::getActionType() const { - return LexerActionType::SKIP; -} - -bool LexerSkipAction::isPositionDependent() const { - return false; -} - -void LexerSkipAction::execute(Lexer *lexer) { +void LexerSkipAction::execute(Lexer *lexer) const { lexer->skip(); } -size_t LexerSkipAction::hashCode() const { +size_t LexerSkipAction::hashCodeImpl() const { size_t hash = MurmurHash::initialize(); hash = MurmurHash::update(hash, static_cast(getActionType())); return MurmurHash::finish(hash, 1); } -bool LexerSkipAction::operator == (const LexerAction &obj) const { - return &obj == this; +bool LexerSkipAction::equals(const LexerAction &other) const { + return this == std::addressof(other); } std::string LexerSkipAction::toString() const { diff --git a/runtime/Cpp/runtime/src/atn/LexerSkipAction.h b/runtime/Cpp/runtime/src/atn/LexerSkipAction.h index 5bd2e1c166..afdf4702f2 100755 --- a/runtime/Cpp/runtime/src/atn/LexerSkipAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerSkipAction.h @@ -22,33 +22,29 @@ namespace atn { ///
class ANTLR4CPP_PUBLIC LexerSkipAction final : public LexerAction { public: - /// Provides a singleton instance of this parameterless lexer action. - static const Ref getInstance(); + static bool is(const LexerAction &lexerAction) { return lexerAction.getActionType() == LexerActionType::SKIP; } - /// - /// {@inheritDoc} - /// This method returns . - virtual LexerActionType getActionType() const override; + static bool is(const LexerAction *lexerAction) { return lexerAction != nullptr && is(*lexerAction); } - /// - /// {@inheritDoc} - /// This method returns {@code false}. - virtual bool isPositionDependent() const override; + /// Provides a singleton instance of this parameterless lexer action. + static const Ref& getInstance(); /// /// {@inheritDoc} /// /// This action is implemented by calling . /// - virtual void execute(Lexer *lexer) override; + void execute(Lexer *lexer) const override; + + bool equals(const LexerAction &obj) const override; + std::string toString() const override; - virtual size_t hashCode() const override; - virtual bool operator == (const LexerAction &obj) const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; private: /// Constructs the singleton instance of the lexer {@code skip} command. - LexerSkipAction(); + LexerSkipAction() : LexerAction(LexerActionType::SKIP, false) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp b/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp index 006778adc6..55ccf358ba 100755 --- a/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp +++ b/runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp @@ -5,52 +5,39 @@ #include "misc/MurmurHash.h" #include "Lexer.h" +#include "support/Casts.h" #include "atn/LexerTypeAction.h" using namespace antlr4; using namespace antlr4::atn; using namespace antlr4::misc; +using namespace antlrcpp; -LexerTypeAction::LexerTypeAction(int type) : _type(type) { -} - -int LexerTypeAction::getType() const { - return _type; -} - -LexerActionType LexerTypeAction::getActionType() const { - return LexerActionType::TYPE; -} +LexerTypeAction::LexerTypeAction(int type) : LexerAction(LexerActionType::TYPE, false), _type(type) {} -bool LexerTypeAction::isPositionDependent() const { - return false; +void LexerTypeAction::execute(Lexer *lexer) const { + lexer->setType(getType()); } -void LexerTypeAction::execute(Lexer *lexer) { - lexer->setType(_type); -} - -size_t LexerTypeAction::hashCode() const { +size_t LexerTypeAction::hashCodeImpl() const { size_t hash = MurmurHash::initialize(); hash = MurmurHash::update(hash, static_cast(getActionType())); - hash = MurmurHash::update(hash, _type); + hash = MurmurHash::update(hash, getType()); return MurmurHash::finish(hash, 2); } -bool LexerTypeAction::operator == (const LexerAction &obj) const { - if (&obj == this) { +bool LexerTypeAction::equals(const LexerAction &other) const { + if (this == std::addressof(other)) { return true; } - - const LexerTypeAction *action = dynamic_cast(&obj); - if (action == nullptr) { + if (getActionType() != other.getActionType()) { return false; } - - return _type == action->_type; + const auto &lexerAction = downCast(other); + return getType() == lexerAction.getType(); } std::string LexerTypeAction::toString() const { - return "type(" + std::to_string(_type) + ")"; + return "type(" + std::to_string(getType()) + ")"; } diff --git a/runtime/Cpp/runtime/src/atn/LexerTypeAction.h b/runtime/Cpp/runtime/src/atn/LexerTypeAction.h index 1c4a8a17c1..1cd7d71fd3 100755 --- a/runtime/Cpp/runtime/src/atn/LexerTypeAction.h +++ b/runtime/Cpp/runtime/src/atn/LexerTypeAction.h @@ -13,27 +13,21 @@ namespace atn { /// Implements the {@code type} lexer action by calling /// with the assigned type. - class ANTLR4CPP_PUBLIC LexerTypeAction : public LexerAction { + class ANTLR4CPP_PUBLIC LexerTypeAction final : public LexerAction { public: + static bool is(const LexerAction &lexerAction) { return lexerAction.getActionType() == LexerActionType::TYPE; } + + static bool is(const LexerAction *lexerAction) { return lexerAction != nullptr && is(*lexerAction); } + /// /// Constructs a new {@code type} action with the specified token type value. /// The type to assign to the token using . - LexerTypeAction(int type); + explicit LexerTypeAction(int type); /// /// Gets the type to assign to a token created by the lexer. /// The type to assign to a token created by the lexer. - virtual int getType() const; - - /// - /// {@inheritDoc} - /// This method returns . - virtual LexerActionType getActionType() const override; - - /// - /// {@inheritDoc} - /// This method returns {@code false}. - virtual bool isPositionDependent() const override; + int getType() const { return _type; } /// /// {@inheritDoc} @@ -41,11 +35,13 @@ namespace atn { /// This action is implemented by calling with the /// value provided by . /// - virtual void execute(Lexer *lexer) override; + void execute(Lexer *lexer) const override; + + bool equals(const LexerAction &obj) const override; + std::string toString() const override; - virtual size_t hashCode() const override; - virtual bool operator == (const LexerAction &obj) const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; private: const int _type; diff --git a/runtime/Cpp/runtime/src/atn/LoopEndState.cpp b/runtime/Cpp/runtime/src/atn/LoopEndState.cpp deleted file mode 100755 index e00889856e..0000000000 --- a/runtime/Cpp/runtime/src/atn/LoopEndState.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/LoopEndState.h" - -using namespace antlr4::atn; - -size_t LoopEndState::getStateType() { - return LOOP_END; -} diff --git a/runtime/Cpp/runtime/src/atn/LoopEndState.h b/runtime/Cpp/runtime/src/atn/LoopEndState.h index c90efa398c..b680414ebf 100755 --- a/runtime/Cpp/runtime/src/atn/LoopEndState.h +++ b/runtime/Cpp/runtime/src/atn/LoopEndState.h @@ -13,9 +13,13 @@ namespace atn { /// Mark the end of a * or + loop. class ANTLR4CPP_PUBLIC LoopEndState final : public ATNState { public: + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::LOOP_END; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } + ATNState *loopBackState = nullptr; - virtual size_t getStateType() override; + LoopEndState() : ATNState(ATNStateType::LOOP_END) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/Makefile b/runtime/Cpp/runtime/src/atn/Makefile deleted file mode 100644 index 480bd85929..0000000000 --- a/runtime/Cpp/runtime/src/atn/Makefile +++ /dev/null @@ -1,67 +0,0 @@ - -CXXFLAGS += -g -std=c++0x -Wall #-Wextra -CXXFLAGS += -I. -I../ -I../misc/ -I../tree/ -I../dfa/ \ - -I../../../../../antlrcpp/ - -#TODO LDFLAGS += ? - -ALL_CXXFLAGS = $(CPPFLAGS) $(CXXFLAGS) -ALL_LDFLAGS = $(LDFLAGS) - -# Escote's files -SRCS = \ - AbstractPredicateTransition.cpp \ - ActionTransition.cpp \ - ArrayPredictionContext.cpp \ - ATNDeserializationOptions.cpp \ - ATNDeserializer.cpp \ - ATNState.cpp \ - ATNType.cpp \ - AtomTransition.cpp \ - BasicBlockStartState.cpp \ - BasicState.cpp \ - BlockEndState.cpp \ - BlockStartState.cpp \ - DecisionState.cpp \ - EmptyPredictionContext.cpp \ - EpsilonTransition.cpp \ - LexerATNConfig.cpp \ - LoopEndState.cpp -# Escote's TODO: LL1Analyzer.cpp LexerATNSimulator.cpp ATNSimulator.cpp \ - ATNSerializer.cpp ATNConfigSet.cpp ATNConfig.cpp \ - ATN.cpp - -# Alejandro's files -SRCS += \ - NotSetTransition.cpp \ - OrderedATNConfigSet.cpp \ - PlusBlockStartState.cpp \ - PlusLoopbackState.cpp \ - PredicateTransition.cpp \ - PredictionMode.cpp \ - RangeTransition.cpp \ - RuleStartState.cpp \ - RuleStopState.cpp \ - RuleTransition.cpp \ - SemanticContext.cpp \ - SetTransition.cpp \ - SingletonPredictionContext.cpp \ - StarBlockStartState.cpp \ - StarLoopbackState.cpp \ - StarLoopEntryState.cpp \ - TokensStartState.cpp \ - Transition.cpp \ - WildcardTransition.cpp -# Alejandro's TODO: PredictionContext.cpp PredictionContextCache.cpp \ - PrecedencePredicateTransition.cpp ParserATNSimulator.cpp - -OBJS = $(SRCS:.cpp=.o) - -all: $(OBJS) - -%.o: %.cpp - $(CXX) -c $(ALL_CXXFLAGS) $< -o $@ - -clean: - $(RM) $(OBJS) - diff --git a/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp b/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp index b02910dd06..b652290d4e 100755 --- a/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp +++ b/runtime/Cpp/runtime/src/atn/NotSetTransition.cpp @@ -10,12 +10,7 @@ using namespace antlr4; using namespace antlr4::atn; -NotSetTransition::NotSetTransition(ATNState *target, const misc::IntervalSet &set) : SetTransition(target, set) { -} - -Transition::SerializationType NotSetTransition::getSerializationType() const { - return NOT_SET; -} +NotSetTransition::NotSetTransition(ATNState *target, misc::IntervalSet set) : SetTransition(TransitionType::NOT_SET, target, std::move(set)) {} bool NotSetTransition::matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const { return symbol >= minVocabSymbol && symbol <= maxVocabSymbol diff --git a/runtime/Cpp/runtime/src/atn/NotSetTransition.h b/runtime/Cpp/runtime/src/atn/NotSetTransition.h index 214fb06031..5c88ec1094 100755 --- a/runtime/Cpp/runtime/src/atn/NotSetTransition.h +++ b/runtime/Cpp/runtime/src/atn/NotSetTransition.h @@ -12,9 +12,11 @@ namespace atn { class ANTLR4CPP_PUBLIC NotSetTransition final : public SetTransition { public: - NotSetTransition(ATNState *target, const misc::IntervalSet &set); + static bool is(const Transition &transition) { return transition.getTransitionType() == TransitionType::NOT_SET; } - virtual SerializationType getSerializationType() const override; + static bool is(const Transition *transition) { return transition != nullptr && is(*transition); } + + NotSetTransition(ATNState *target, misc::IntervalSet set); virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; diff --git a/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp b/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp index a731def936..a7e76cd17e 100755 --- a/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp +++ b/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp @@ -7,6 +7,10 @@ using namespace antlr4::atn; -size_t OrderedATNConfigSet::getHash(ATNConfig *c) { - return c->hashCode(); +size_t OrderedATNConfigSet::hashCode(const ATNConfig &atnConfig) const { + return atnConfig.hashCode(); +} + +bool OrderedATNConfigSet::equals(const ATNConfig &lhs, const ATNConfig &rhs) const { + return lhs == rhs; } diff --git a/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h b/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h index 4ce43bb965..b6b344fde9 100755 --- a/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h +++ b/runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.h @@ -11,9 +11,14 @@ namespace antlr4 { namespace atn { - class ANTLR4CPP_PUBLIC OrderedATNConfigSet : public ATNConfigSet { - protected: - virtual size_t getHash(ATNConfig *c) override; + class ANTLR4CPP_PUBLIC OrderedATNConfigSet final : public ATNConfigSet { + public: + OrderedATNConfigSet() = default; + + private: + size_t hashCode(const ATNConfig &atnConfig) const override; + + bool equals(const ATNConfig &lhs, const ATNConfig &rhs) const override; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp b/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp index 01c83c15e6..8a82814458 100755 --- a/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +++ b/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp @@ -10,12 +10,12 @@ #include "misc/IntervalSet.h" #include "Parser.h" #include "CommonTokenStream.h" -#include "atn/EmptyPredictionContext.h" #include "atn/NotSetTransition.h" #include "atn/AtomTransition.h" #include "atn/RuleTransition.h" #include "atn/PredicateTransition.h" #include "atn/PrecedencePredicateTransition.h" +#include "atn/SingletonPredictionContext.h" #include "atn/ActionTransition.h" #include "atn/EpsilonTransition.h" #include "atn/RuleStopState.h" @@ -31,6 +31,7 @@ #include "Vocabulary.h" #include "support/Arrays.h" +#include "support/Casts.h" #include "atn/ParserATNSimulator.h" @@ -53,7 +54,13 @@ ParserATNSimulator::ParserATNSimulator(const ATN &atn, std::vector &de ParserATNSimulator::ParserATNSimulator(Parser *parser, const ATN &atn, std::vector &decisionToDFA, PredictionContextCache &sharedContextCache) -: ATNSimulator(atn, sharedContextCache), decisionToDFA(decisionToDFA), parser(parser) { +: ParserATNSimulator(parser, atn, decisionToDFA, sharedContextCache, ParserATNSimulatorOptions()) {} + +ParserATNSimulator::ParserATNSimulator(Parser *parser, const ATN &atn, std::vector &decisionToDFA, + PredictionContextCache &sharedContextCache, + const ParserATNSimulatorOptions &options) +: ATNSimulator(atn, sharedContextCache), decisionToDFA(decisionToDFA), parser(parser), + mergeCache(options.getPredictionContextMergeCacheOptions()) { InitializeInstanceFields(); } @@ -87,28 +94,37 @@ size_t ParserATNSimulator::adaptivePredict(TokenStream *input, size_t decision, // Now we are certain to have a specific decision's DFA // But, do we still need an initial state? auto onExit = finally([this, input, index, m] { - mergeCache.clear(); // wack cache after each prediction + if (mergeCache.getOptions().getClearEveryN() != 0) { + if (++_mergeCacheCounter == mergeCache.getOptions().getClearEveryN()) { + mergeCache.clear(); + _mergeCacheCounter = 0; + } + } _dfa = nullptr; input->seek(index); input->release(m); }); dfa::DFAState *s0; - if (dfa.isPrecedenceDfa()) { - // the start state for a precedence DFA depends on the current - // parser precedence, and is provided by a DFA method. - s0 = dfa.getPrecedenceStartState(parser->getPrecedence()); - } else { - // the start state for a "regular" DFA is just s0 - s0 = dfa.s0; + { + std::shared_lock stateLock(atn._stateMutex); + if (dfa.isPrecedenceDfa()) { + // the start state for a precedence DFA depends on the current + // parser precedence, and is provided by a DFA method. + std::shared_lock edgeLock(atn._edgeMutex); + s0 = dfa.getPrecedenceStartState(parser->getPrecedence()); + } else { + // the start state for a "regular" DFA is just s0 + s0 = dfa.s0; + } } if (s0 == nullptr) { - bool fullCtx = false; - std::unique_ptr s0_closure = computeStartState(dynamic_cast(dfa.atnStartState), - &ParserRuleContext::EMPTY, fullCtx); - - _stateLock.writeLock(); + auto s0_closure = computeStartState(dfa.atnStartState, &ParserRuleContext::EMPTY, false); + std::unique_ptr newState; + std::unique_ptr oldState; + std::unique_lock stateLock(atn._stateMutex); + dfa::DFAState* ds0 = dfa.s0; if (dfa.isPrecedenceDfa()) { /* If this is a precedence DFA, we use applyPrecedenceFilter * to convert the computed start state to a precedence start @@ -116,26 +132,22 @@ size_t ParserATNSimulator::adaptivePredict(TokenStream *input, size_t decision, * appropriate start state for the precedence level rather * than simply setting DFA.s0. */ - dfa.s0->configs = std::move(s0_closure); // not used for prediction but useful to know start configs anyway - dfa::DFAState *newState = new dfa::DFAState(applyPrecedenceFilter(dfa.s0->configs.get())); /* mem-check: managed by the DFA or deleted below */ - s0 = addDFAState(dfa, newState); - dfa.setPrecedenceStartState(parser->getPrecedence(), s0, _edgeLock); - if (s0 != newState) { - delete newState; // If there was already a state with this config set we don't need the new one. - } + ds0->configs = std::move(s0_closure); // not used for prediction but useful to know start configs anyway + newState = std::make_unique(applyPrecedenceFilter(ds0->configs.get())); + s0 = addDFAState(dfa, newState.get()); + std::unique_lock edgeLock(atn._edgeMutex); + dfa.setPrecedenceStartState(parser->getPrecedence(), s0); } else { - dfa::DFAState *newState = new dfa::DFAState(std::move(s0_closure)); /* mem-check: managed by the DFA or deleted below */ - s0 = addDFAState(dfa, newState); - - if (dfa.s0 != s0) { - delete dfa.s0; // Delete existing s0 DFA state, if there's any. + newState = std::make_unique(std::move(s0_closure)); + s0 = addDFAState(dfa, newState.get()); + if (ds0 != s0) { + oldState.reset(ds0); dfa.s0 = s0; } - if (s0 != newState) { - delete newState; // If there was already a state with this config set we don't need the new one. - } } - _stateLock.writeUnlock(); + if (s0 == newState.get()) { + newState.release(); + } } // We can start with an existing DFA. @@ -220,7 +232,7 @@ size_t ParserATNSimulator::execATN(dfa::DFA &dfa, dfa::DFAState *s0, TokenStream #endif bool fullCtx = true; - Ref s0_closure = computeStartState(dfa.atnStartState, outerContext, fullCtx); + std::unique_ptr s0_closure = computeStartState(dfa.atnStartState, outerContext, fullCtx); reportAttemptingFullContext(dfa, conflictingAlts, D->configs.get(), startIndex, input->index()); size_t alt = execATNWithFullContext(dfa, D, s0_closure.get(), input, startIndex, outerContext); return alt; @@ -260,10 +272,9 @@ size_t ParserATNSimulator::execATN(dfa::DFA &dfa, dfa::DFAState *s0, TokenStream dfa::DFAState *ParserATNSimulator::getExistingTargetState(dfa::DFAState *previousD, size_t t) { dfa::DFAState* retval; - _edgeLock.readLock(); + std::shared_lock edgeLock(atn._edgeMutex); auto iterator = previousD->edges.find(t); retval = (iterator == previousD->edges.end()) ? nullptr : iterator->second; - _edgeLock.readUnlock(); return retval; } @@ -315,7 +326,7 @@ void ParserATNSimulator::predicateDFAState(dfa::DFAState *dfaState, DecisionStat // Update DFA so reach becomes accept state with (predicate,alt) // pairs if preds found for conflicting alts BitSet altsToCollectPredsFrom = getConflictingAltsOrUniqueAlt(dfaState->configs.get()); - std::vector> altToPred = getPredsForAmbigAlts(altsToCollectPredsFrom, dfaState->configs.get(), nalts); + std::vector> altToPred = getPredsForAmbigAlts(altsToCollectPredsFrom, dfaState->configs.get(), nalts); if (!altToPred.empty()) { dfaState->predicates = getPredicatePredictions(altsToCollectPredsFrom, altToPred); dfaState->prediction = ATN::INVALID_ALT_NUMBER; // make sure we use preds @@ -452,8 +463,8 @@ std::unique_ptr ParserATNSimulator::computeReachSet(ATNConfigSet * std::vector> skippedStopStates; // First figure out where we can reach on input t - for (auto &c : closure_->configs) { - if (is(c->state)) { + for (const auto &c : closure_->configs) { + if (RuleStopState::is(c->state)) { assert(c->context->isEmpty()); if (fullCtx || t == Token::EOF) { @@ -465,10 +476,10 @@ std::unique_ptr ParserATNSimulator::computeReachSet(ATNConfigSet * size_t n = c->state->transitions.size(); for (size_t ti = 0; ti < n; ti++) { // for each transition - Transition *trans = c->state->transitions[ti]; + const Transition *trans = c->state->transitions[ti].get(); ATNState *target = getReachableTarget(trans, (int)t); if (target != nullptr) { - intermediate->add(std::make_shared(c, target), &mergeCache); + intermediate->add(std::make_shared(*c, target), &mergeCache); } } } @@ -507,7 +518,7 @@ std::unique_ptr ParserATNSimulator::computeReachSet(ATNConfigSet * ATNConfig::Set closureBusy; bool treatEofAsEpsilon = t == Token::EOF; - for (auto c : intermediate->configs) { + for (const auto &c : intermediate->configs) { closure(c, reach.get(), closureBusy, false, fullCtx, treatEofAsEpsilon); } } @@ -546,7 +557,7 @@ std::unique_ptr ParserATNSimulator::computeReachSet(ATNConfigSet * if (skippedStopStates.size() > 0 && (!fullCtx || !PredictionModeClass::hasConfigInRuleStopState(reach.get()))) { assert(!skippedStopStates.empty()); - for (auto c : skippedStopStates) { + for (const auto &c : skippedStopStates) { reach->add(c, &mergeCache); } } @@ -565,8 +576,8 @@ ATNConfigSet* ParserATNSimulator::removeAllConfigsNotInRuleStopState(ATNConfigSe ATNConfigSet *result = new ATNConfigSet(configs->fullCtx); /* mem-check: released by caller */ - for (auto &config : configs->configs) { - if (is(config->state)) { + for (const auto &config : configs->configs) { + if (config->state != nullptr && config->state->getStateType() == ATNStateType::RULE_STOP) { result->add(config, &mergeCache); continue; } @@ -575,7 +586,7 @@ ATNConfigSet* ParserATNSimulator::removeAllConfigsNotInRuleStopState(ATNConfigSe misc::IntervalSet nextTokens = atn.nextTokens(config->state); if (nextTokens.contains(Token::EPSILON)) { ATNState *endOfRuleState = atn.ruleToStopState[config->state->ruleIndex]; - result->add(std::make_shared(config, endOfRuleState), &mergeCache); + result->add(std::make_shared(*config, endOfRuleState), &mergeCache); } } } @@ -585,7 +596,7 @@ ATNConfigSet* ParserATNSimulator::removeAllConfigsNotInRuleStopState(ATNConfigSe std::unique_ptr ParserATNSimulator::computeStartState(ATNState *p, RuleContext *ctx, bool fullCtx) { // always at least the implicit call to start rule - Ref initialContext = PredictionContext::fromRuleContext(atn, ctx); + Ref initialContext = PredictionContext::fromRuleContext(atn, ctx); std::unique_ptr configs(new ATNConfigSet(fullCtx)); for (size_t i = 0; i < p->transitions.size(); i++) { @@ -599,15 +610,15 @@ std::unique_ptr ParserATNSimulator::computeStartState(ATNState *p, } std::unique_ptr ParserATNSimulator::applyPrecedenceFilter(ATNConfigSet *configs) { - std::map> statesFromAlt1; + std::map> statesFromAlt1; std::unique_ptr configSet(new ATNConfigSet(configs->fullCtx)); - for (Ref &config : configs->configs) { + for (const auto &config : configs->configs) { // handle alt 1 first if (config->alt != 1) { continue; } - Ref updatedContext = config->semanticContext->evalPrecedence(parser, _outerContext); + Ref updatedContext = config->semanticContext->evalPrecedence(parser, _outerContext); if (updatedContext == nullptr) { // the configuration was eliminated continue; @@ -615,14 +626,14 @@ std::unique_ptr ParserATNSimulator::applyPrecedenceFilter(ATNConfi statesFromAlt1[config->state->stateNumber] = config->context; if (updatedContext != config->semanticContext) { - configSet->add(std::make_shared(config, updatedContext), &mergeCache); + configSet->add(std::make_shared(*config, updatedContext), &mergeCache); } else { configSet->add(config, &mergeCache); } } - for (Ref &config : configs->configs) { + for (const auto &config : configs->configs) { if (config->alt == 1) { // already handled continue; @@ -646,7 +657,7 @@ std::unique_ptr ParserATNSimulator::applyPrecedenceFilter(ATNConfi return configSet; } -atn::ATNState* ParserATNSimulator::getReachableTarget(Transition *trans, size_t ttype) { +atn::ATNState* ParserATNSimulator::getReachableTarget(const Transition *trans, size_t ttype) { if (trans->matches(ttype, 0, atn.maxTokenType)) { return trans->target; } @@ -655,7 +666,7 @@ atn::ATNState* ParserATNSimulator::getReachableTarget(Transition *trans, size_t } // Note that caller must memory manage the returned value from this function -std::vector> ParserATNSimulator::getPredsForAmbigAlts(const BitSet &ambigAlts, +std::vector> ParserATNSimulator::getPredsForAmbigAlts(const BitSet &ambigAlts, ATNConfigSet *configs, size_t nalts) { // REACH=[1|1|[]|0:0, 1|2|[]|0:1] /* altToPred starts as an array of all null contexts. The entry at index i @@ -669,9 +680,9 @@ std::vector> ParserATNSimulator::getPredsForAmbigAlts(const * * From this, it is clear that NONE||anything==NONE. */ - std::vector> altToPred(nalts + 1); + std::vector> altToPred(nalts + 1); - for (auto &c : configs->configs) { + for (const auto &c : configs->configs) { if (ambigAlts.test(c->alt)) { altToPred[c->alt] = SemanticContext::Or(altToPred[c->alt], c->semanticContext); } @@ -697,21 +708,19 @@ std::vector> ParserATNSimulator::getPredsForAmbigAlts(const return altToPred; } -std::vector ParserATNSimulator::getPredicatePredictions(const antlrcpp::BitSet &ambigAlts, - std::vector> const& altToPred) { - bool containsPredicate = std::find_if(altToPred.begin(), altToPred.end(), [](Ref const context) { +std::vector ParserATNSimulator::getPredicatePredictions(const antlrcpp::BitSet &ambigAlts, + const std::vector> &altToPred) { + bool containsPredicate = std::find_if(altToPred.begin(), altToPred.end(), [](const Ref &context) { return context != SemanticContext::NONE; }) != altToPred.end(); - if (!containsPredicate) - return {}; - - std::vector pairs; - for (size_t i = 1; i < altToPred.size(); ++i) { - Ref const& pred = altToPred[i]; - assert(pred != nullptr); // unpredicted is indicated by SemanticContext.NONE - - if (ambigAlts.test(i)) { - pairs.push_back(new dfa::DFAState::PredPrediction(pred, (int)i)); /* mem-check: managed by the DFAState it will be assigned to after return */ + std::vector pairs; + if (containsPredicate) { + for (size_t i = 0; i < altToPred.size(); i++) { + const auto &pred = altToPred[i]; + assert(pred != nullptr); // unpredicted is indicated by SemanticContext.NONE + if (ambigAlts.test(i)) { + pairs.emplace_back(pred, static_cast(i)); + } } } return pairs; @@ -739,8 +748,8 @@ size_t ParserATNSimulator::getSynValidOrSemInvalidAltThatFinishedDecisionEntryRu size_t ParserATNSimulator::getAltThatFinishedDecisionEntryRule(ATNConfigSet *configs) { misc::IntervalSet alts; - for (auto &c : configs->configs) { - if (c->getOuterContextDepth() > 0 || (is(c->state) && c->context->hasEmptyPath())) { + for (const auto &c : configs->configs) { + if (c->getOuterContextDepth() > 0 || (c->state != nullptr && c->state->getStateType() == ATNStateType::RULE_STOP && c->context->hasEmptyPath())) { alts.add(c->alt); } } @@ -756,7 +765,7 @@ std::pair ParserATNSimulator::splitAccordingToSe // mem-check: both pointers must be freed by the caller. ATNConfigSet *succeeded(new ATNConfigSet(configs->fullCtx)); ATNConfigSet *failed(new ATNConfigSet(configs->fullCtx)); - for (Ref &c : configs->configs) { + for (const auto &c : configs->configs) { if (c->semanticContext != SemanticContext::NONE) { bool predicateEvaluationResult = evalSemanticContext(c->semanticContext, outerContext, c->alt, configs->fullCtx); if (predicateEvaluationResult) { @@ -771,12 +780,12 @@ std::pair ParserATNSimulator::splitAccordingToSe return { succeeded, failed }; } -BitSet ParserATNSimulator::evalSemanticContext(std::vector predPredictions, +BitSet ParserATNSimulator::evalSemanticContext(const std::vector &predPredictions, ParserRuleContext *outerContext, bool complete) { BitSet predictions; - for (auto *prediction : predPredictions) { - if (prediction->pred == SemanticContext::NONE) { - predictions.set(prediction->alt); + for (const auto &prediction : predPredictions) { + if (prediction.pred == SemanticContext::NONE) { + predictions.set(prediction.alt); if (!complete) { break; } @@ -784,17 +793,17 @@ BitSet ParserATNSimulator::evalSemanticContext(std::vectorpred, outerContext, prediction->alt, fullCtx); + bool predicateEvaluationResult = evalSemanticContext(prediction.pred, outerContext, prediction.alt, fullCtx); #if DEBUG_ATN == 1 || DEBUG_DFA == 1 - std::cout << "eval pred " << prediction->toString() << " = " << predicateEvaluationResult << std::endl; + std::cout << "eval pred " << prediction.toString() << " = " << predicateEvaluationResult << std::endl; #endif if (predicateEvaluationResult) { #if DEBUG_ATN == 1 || DEBUG_DFA == 1 - std::cout << "PREDICT " << prediction->alt << std::endl; + std::cout << "PREDICT " << prediction.alt << std::endl; #endif - predictions.set(prediction->alt); + predictions.set(prediction.alt); if (!complete) { break; } @@ -804,7 +813,7 @@ BitSet ParserATNSimulator::evalSemanticContext(std::vector const& pred, ParserRuleContext *parserCallStack, +bool ParserATNSimulator::evalSemanticContext(Ref const& pred, ParserRuleContext *parserCallStack, size_t /*alt*/, bool /*fullCtx*/) { return pred->eval(parser, parserCallStack); } @@ -824,14 +833,14 @@ void ParserATNSimulator::closureCheckingStopState(Ref const& config, std::cout << "closure(" << config->toString(true) << ")" << std::endl; #endif - if (is(config->state)) { + if (config->state != nullptr && config->state->getStateType() == ATNStateType::RULE_STOP) { // We hit rule end. If we have context info, use it // run thru all possible stack tops in ctx if (!config->context->isEmpty()) { for (size_t i = 0; i < config->context->size(); i++) { if (config->context->getReturnState(i) == PredictionContext::EMPTY_RETURN_STATE) { if (fullCtx) { - configs->add(std::make_shared(config, config->state, PredictionContext::EMPTY), &mergeCache); + configs->add(std::make_shared(*config, config->state, PredictionContext::EMPTY), &mergeCache); continue; } else { // we have no context info, just chase follow links (if greedy) @@ -843,8 +852,8 @@ void ParserATNSimulator::closureCheckingStopState(Ref const& config, continue; } ATNState *returnState = atn.states[config->context->getReturnState(i)]; - std::weak_ptr newContext = config->context->getParent(i); // "pop" return state - Ref c = std::make_shared(returnState, config->alt, newContext.lock(), config->semanticContext); + Ref newContext = config->context->getParent(i); // "pop" return state + Ref c = std::make_shared(returnState, config->alt, newContext, config->semanticContext); // While we have context to pop back from, we may have // gotten that context AFTER having falling off a rule. // Make sure we track that we are now out of context. @@ -884,12 +893,12 @@ void ParserATNSimulator::closure_(Ref const& config, ATNConfigSet *co if (i == 0 && canDropLoopEntryEdgeInLeftRecursiveRule(config.get())) continue; - Transition *t = p->transitions[i]; - bool continueCollecting = !is(t) && collectPredicates; + const Transition *t = p->transitions[i].get(); + bool continueCollecting = !(t != nullptr && t->getTransitionType() == TransitionType::ACTION) && collectPredicates; Ref c = getEpsilonTarget(config, t, continueCollecting, depth == 0, fullCtx, treatEofAsEpsilon); if (c != nullptr) { int newDepth = depth; - if (is(config->state)) { + if (config->state != nullptr && config->state->getStateType() == ATNStateType::RULE_STOP) { assert(!fullCtx); // target fell off end of rule; mark resulting c as having dipped into outer context @@ -905,7 +914,7 @@ void ParserATNSimulator::closure_(Ref const& config, ATNConfigSet *co closureBusy.insert(c); if (_dfa != nullptr && _dfa->isPrecedenceDfa()) { - size_t outermostPrecedenceReturn = dynamic_cast(t)->outermostPrecedenceReturn(); + size_t outermostPrecedenceReturn = downCast(t)->outermostPrecedenceReturn(); if (outermostPrecedenceReturn == _dfa->atnStartState->ruleIndex) { c->setPrecedenceFilterSuppressed(true); } @@ -939,7 +948,7 @@ void ParserATNSimulator::closure_(Ref const& config, ATNConfigSet *co } } - if (is(t)) { + if (t != nullptr && t->getTransitionType() == TransitionType::RULE) { // latch when newDepth goes negative - once we step out of the entry context we can't return if (newDepth >= 0) { newDepth++; @@ -961,7 +970,7 @@ bool ParserATNSimulator::canDropLoopEntryEdgeInLeftRecursiveRule(ATNConfig *conf // left-recursion elimination. For efficiency, also check if // the context has an empty stack case. If so, it would mean // global FOLLOW so we can't perform optimization - if (p->getStateType() != ATNState::STAR_LOOP_ENTRY || + if (p->getStateType() != ATNStateType::STAR_LOOP_ENTRY || !((StarLoopEntryState *)p)->isPrecedenceDecision || // Are we the special loop entry/exit state? config->context->isEmpty() || // If SLL wildcard config->context->hasEmptyPath()) @@ -995,7 +1004,7 @@ bool ParserATNSimulator::canDropLoopEntryEdgeInLeftRecursiveRule(ATNConfig *conf // Look for prefix op case like 'not expr', (' type ')' expr ATNState *returnStateTarget = returnState->transitions[0]->target; - if (returnState->getStateType() == ATNState::BLOCK_END && returnStateTarget == p) { + if (returnState->getStateType() == ATNStateType::BLOCK_END && returnStateTarget == p) { continue; } @@ -1014,7 +1023,7 @@ bool ParserATNSimulator::canDropLoopEntryEdgeInLeftRecursiveRule(ATNConfig *conf // Look for complex prefix 'between expr and expr' case where 2nd expr's // return state points at block end state of (...)* internal block - if (returnStateTarget->getStateType() == ATNState::BLOCK_END && + if (returnStateTarget->getStateType() == ATNStateType::BLOCK_END && returnStateTarget->transitions.size() == 1 && returnStateTarget->transitions[0]->isEpsilon() && returnStateTarget->transitions[0]->target == p) @@ -1036,32 +1045,32 @@ std::string ParserATNSimulator::getRuleName(size_t index) { return ""; } -Ref ParserATNSimulator::getEpsilonTarget(Ref const& config, Transition *t, bool collectPredicates, +Ref ParserATNSimulator::getEpsilonTarget(Ref const& config, const Transition *t, bool collectPredicates, bool inContext, bool fullCtx, bool treatEofAsEpsilon) { - switch (t->getSerializationType()) { - case Transition::RULE: - return ruleTransition(config, static_cast(t)); + switch (t->getTransitionType()) { + case TransitionType::RULE: + return ruleTransition(config, static_cast(t)); - case Transition::PRECEDENCE: - return precedenceTransition(config, static_cast(t), collectPredicates, inContext, fullCtx); + case TransitionType::PRECEDENCE: + return precedenceTransition(config, static_cast(t), collectPredicates, inContext, fullCtx); - case Transition::PREDICATE: - return predTransition(config, static_cast(t), collectPredicates, inContext, fullCtx); + case TransitionType::PREDICATE: + return predTransition(config, static_cast(t), collectPredicates, inContext, fullCtx); - case Transition::ACTION: - return actionTransition(config, static_cast(t)); + case TransitionType::ACTION: + return actionTransition(config, static_cast(t)); - case Transition::EPSILON: - return std::make_shared(config, t->target); + case TransitionType::EPSILON: + return std::make_shared(*config, t->target); - case Transition::ATOM: - case Transition::RANGE: - case Transition::SET: + case TransitionType::ATOM: + case TransitionType::RANGE: + case TransitionType::SET: // EOF transitions act like epsilon transitions after the first EOF // transition is traversed if (treatEofAsEpsilon) { if (t->matches(Token::EOF, 0, 1)) { - return std::make_shared(config, t->target); + return std::make_shared(*config, t->target); } } @@ -1072,18 +1081,18 @@ Ref ParserATNSimulator::getEpsilonTarget(Ref const& config } } -Ref ParserATNSimulator::actionTransition(Ref const& config, ActionTransition *t) { +Ref ParserATNSimulator::actionTransition(Ref const& config, const ActionTransition *t) { #if DEBUG_DFA == 1 std::cout << "ACTION edge " << t->ruleIndex << ":" << t->actionIndex << std::endl; #endif - return std::make_shared(config, t->target); + return std::make_shared(*config, t->target); } -Ref ParserATNSimulator::precedenceTransition(Ref const& config, PrecedencePredicateTransition *pt, +Ref ParserATNSimulator::precedenceTransition(Ref const& config, const PrecedencePredicateTransition *pt, bool collectPredicates, bool inContext, bool fullCtx) { #if DEBUG_DFA == 1 - std::cout << "PRED (collectPredicates=" << collectPredicates << ") " << pt->precedence << ">=_p" << ", ctx dependent=true" << std::endl; + std::cout << "PRED (collectPredicates=" << collectPredicates << ") " << pt->getPrecedence() << ">=_p" << ", ctx dependent=true" << std::endl; if (parser != nullptr) { std::cout << "context surrounding pred is " << Arrays::listToString(parser->getRuleInvocationStack(), ", ") << std::endl; } @@ -1091,7 +1100,7 @@ Ref ParserATNSimulator::precedenceTransition(Ref const& co Ref c; if (collectPredicates && inContext) { - Ref predicate = pt->getPredicate(); + const auto &predicate = pt->getPredicate(); if (fullCtx) { // In full context mode, we can evaluate predicates on-the-fly @@ -1100,17 +1109,17 @@ Ref ParserATNSimulator::precedenceTransition(Ref const& co // later during conflict resolution. size_t currentPosition = _input->index(); _input->seek(_startIndex); - bool predSucceeds = evalSemanticContext(pt->getPredicate(), _outerContext, config->alt, fullCtx); + bool predSucceeds = evalSemanticContext(predicate, _outerContext, config->alt, fullCtx); _input->seek(currentPosition); if (predSucceeds) { - c = std::make_shared(config, pt->target); // no pred context + c = std::make_shared(*config, pt->target); // no pred context } } else { - Ref newSemCtx = SemanticContext::And(config->semanticContext, predicate); - c = std::make_shared(config, pt->target, newSemCtx); + Ref newSemCtx = SemanticContext::And(config->semanticContext, predicate); + c = std::make_shared(*config, pt->target, std::move(newSemCtx)); } } else { - c = std::make_shared(config, pt->target); + c = std::make_shared(*config, pt->target); } #if DEBUG_DFA == 1 @@ -1120,18 +1129,18 @@ Ref ParserATNSimulator::precedenceTransition(Ref const& co return c; } -Ref ParserATNSimulator::predTransition(Ref const& config, PredicateTransition *pt, +Ref ParserATNSimulator::predTransition(Ref const& config, const PredicateTransition *pt, bool collectPredicates, bool inContext, bool fullCtx) { #if DEBUG_DFA == 1 - std::cout << "PRED (collectPredicates=" << collectPredicates << ") " << pt->ruleIndex << ":" << pt->predIndex << ", ctx dependent=" << pt->isCtxDependent << std::endl; + std::cout << "PRED (collectPredicates=" << collectPredicates << ") " << pt->getRuleIndex() << ":" << pt->getPredIndex() << ", ctx dependent=" << pt->isCtxDependent() << std::endl; if (parser != nullptr) { std::cout << "context surrounding pred is " << Arrays::listToString(parser->getRuleInvocationStack(), ", ") << std::endl; } #endif Ref c = nullptr; - if (collectPredicates && (!pt->isCtxDependent || (pt->isCtxDependent && inContext))) { - Ref predicate = pt->getPredicate(); + if (collectPredicates && (!pt->isCtxDependent() || (pt->isCtxDependent() && inContext))) { + const auto &predicate = pt->getPredicate(); if (fullCtx) { // In full context mode, we can evaluate predicates on-the-fly // during closure, which dramatically reduces the size of @@ -1139,17 +1148,17 @@ Ref ParserATNSimulator::predTransition(Ref const& config, // later during conflict resolution. size_t currentPosition = _input->index(); _input->seek(_startIndex); - bool predSucceeds = evalSemanticContext(pt->getPredicate(), _outerContext, config->alt, fullCtx); + bool predSucceeds = evalSemanticContext(predicate, _outerContext, config->alt, fullCtx); _input->seek(currentPosition); if (predSucceeds) { - c = std::make_shared(config, pt->target); // no pred context + c = std::make_shared(*config, pt->target); // no pred context } } else { - Ref newSemCtx = SemanticContext::And(config->semanticContext, predicate); - c = std::make_shared(config, pt->target, newSemCtx); + Ref newSemCtx = SemanticContext::And(config->semanticContext, predicate); + c = std::make_shared(*config, pt->target, std::move(newSemCtx)); } } else { - c = std::make_shared(config, pt->target); + c = std::make_shared(*config, pt->target); } #if DEBUG_DFA == 1 @@ -1159,14 +1168,14 @@ Ref ParserATNSimulator::predTransition(Ref const& config, return c; } -Ref ParserATNSimulator::ruleTransition(Ref const& config, RuleTransition *t) { +Ref ParserATNSimulator::ruleTransition(Ref const& config, const RuleTransition *t) { #if DEBUG_DFA == 1 std::cout << "CALL rule " << getRuleName(t->target->ruleIndex) << ", ctx=" << config->context << std::endl; #endif atn::ATNState *returnState = t->followState; - Ref newContext = SingletonPredictionContext::create(config->context, returnState->stateNumber); - return std::make_shared(config, t->target, newContext); + Ref newContext = SingletonPredictionContext::create(config->context, returnState->stateNumber); + return std::make_shared(*config, t->target, newContext); } BitSet ParserATNSimulator::getConflictingAlts(ATNConfigSet *configs) { @@ -1189,7 +1198,7 @@ std::string ParserATNSimulator::getTokenName(size_t t) { return "EOF"; } - const dfa::Vocabulary &vocabulary = parser != nullptr ? parser->getVocabulary() : dfa::Vocabulary::EMPTY_VOCABULARY; + const dfa::Vocabulary &vocabulary = parser != nullptr ? parser->getVocabulary() : dfa::Vocabulary(); std::string displayName = vocabulary.getDisplayName(t); if (displayName == std::to_string(t)) { return displayName; @@ -1204,18 +1213,20 @@ std::string ParserATNSimulator::getLookaheadName(TokenStream *input) { void ParserATNSimulator::dumpDeadEndConfigs(NoViableAltException &nvae) { std::cerr << "dead end configs: "; - for (auto c : nvae.getDeadEndConfigs()->configs) { + for (const auto &c : nvae.getDeadEndConfigs()->configs) { std::string trans = "no edges"; if (c->state->transitions.size() > 0) { - Transition *t = c->state->transitions[0]; - if (is(t)) { - AtomTransition *at = static_cast(t); + const Transition *t = c->state->transitions[0].get(); + if (t != nullptr && t->getTransitionType() == TransitionType::ATOM) { + const AtomTransition *at = static_cast(t); trans = "Atom " + getTokenName(at->_label); - } else if (is(t)) { - SetTransition *st = static_cast(t); - bool is_not = is(st); - trans = (is_not ? "~" : ""); - trans += "Set "; + } else if (t != nullptr && t->getTransitionType() == TransitionType::SET) { + const SetTransition *st = static_cast(t); + trans = "Set "; + trans += st->set.toString(); + } else if (t != nullptr && t->getTransitionType() == TransitionType::NOT_SET) { + const SetTransition *st = static_cast(t); + trans = "~Set "; trans += st->set.toString(); } } @@ -1230,7 +1241,7 @@ NoViableAltException ParserATNSimulator::noViableAlt(TokenStream *input, ParserR size_t ParserATNSimulator::getUniqueAlt(ATNConfigSet *configs) { size_t alt = ATN::INVALID_ALT_NUMBER; - for (auto &c : configs->configs) { + for (const auto &c : configs->configs) { if (alt == ATN::INVALID_ALT_NUMBER) { alt = c->alt; // found first alt } else if (c->alt != alt) { @@ -1249,17 +1260,17 @@ dfa::DFAState *ParserATNSimulator::addDFAEdge(dfa::DFA &dfa, dfa::DFAState *from return nullptr; } - _stateLock.writeLock(); - to = addDFAState(dfa, to); // used existing if possible not incoming - _stateLock.writeUnlock(); + { + std::unique_lock stateLock(atn._stateMutex); + to = addDFAState(dfa, to); // used existing if possible not incoming + } if (from == nullptr || t > (int)atn.maxTokenType) { return to; } { - _edgeLock.writeLock(); + std::unique_lock edgeLock(atn._edgeMutex); from->edges[t] = to; // connect - _edgeLock.writeUnlock(); } #if DEBUG_DFA == 1 @@ -1267,7 +1278,7 @@ dfa::DFAState *ParserATNSimulator::addDFAEdge(dfa::DFA &dfa, dfa::DFAState *from if (parser != nullptr) { dfaText = dfa.toString(parser->getVocabulary()); } else { - dfaText = dfa.toString(dfa::Vocabulary::EMPTY_VOCABULARY); + dfaText = dfa.toString(dfa::Vocabulary()); } std::cout << "DFA=\n" << dfaText << std::endl; #endif @@ -1280,19 +1291,21 @@ dfa::DFAState *ParserATNSimulator::addDFAState(dfa::DFA &dfa, dfa::DFAState *D) return D; } - auto existing = dfa.states.find(D); - if (existing != dfa.states.end()) { + // Optimizing the configs below should not alter the hash code. Thus we can just do an insert + // which will only succeed if an equivalent DFAState does not already exist. + auto [existing, inserted] = dfa.states.insert(D); + if (!inserted) { return *existing; } - D->stateNumber = (int)dfa.states.size(); + // Previously we did a lookup, then set fields, then inserted. It was `dfa.states.size()`, since + // we already inserted we need to subtract one. + D->stateNumber = static_cast(dfa.states.size() - 1); if (!D->configs->isReadonly()) { D->configs->optimizeConfigs(this); D->configs->setReadonly(true); } - dfa.states.insert(D); - #if DEBUG_DFA == 1 std::cout << "adding new DFA state: " << D << std::endl; #endif diff --git a/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h b/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h index 6520a44bde..28fd059dd2 100755 --- a/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h +++ b/runtime/Cpp/runtime/src/atn/ParserATNSimulator.h @@ -9,6 +9,8 @@ #include "dfa/DFAState.h" #include "atn/ATNSimulator.h" #include "atn/PredictionContext.h" +#include "atn/PredictionContextMergeCache.h" +#include "atn/ParserATNSimulatorOptions.h" #include "SemanticContext.h" #include "atn/ATNConfig.h" @@ -251,14 +253,18 @@ namespace atn { ParserATNSimulator(Parser *parser, const ATN &atn, std::vector &decisionToDFA, PredictionContextCache &sharedContextCache); + ParserATNSimulator(Parser *parser, const ATN &atn, std::vector &decisionToDFA, + PredictionContextCache &sharedContextCache, + const ParserATNSimulatorOptions &options); + virtual void reset() override; virtual void clearDFA() override; virtual size_t adaptivePredict(TokenStream *input, size_t decision, ParserRuleContext *outerContext); - + static const bool TURN_OFF_LR_LOOP_ENTRY_BRANCH_OPT; std::vector &decisionToDFA; - + /** Implements first-edge (loop entry) elimination as an optimization * during closure operations. See antlr/antlr4#1398. * @@ -348,14 +354,14 @@ namespace atn { bool canDropLoopEntryEdgeInLeftRecursiveRule(ATNConfig *config) const; virtual std::string getRuleName(size_t index); - virtual Ref precedenceTransition(Ref const& config, PrecedencePredicateTransition *pt, + virtual Ref precedenceTransition(Ref const& config, const PrecedencePredicateTransition *pt, bool collectPredicates, bool inContext, bool fullCtx); void setPredictionMode(PredictionMode newMode); PredictionMode getPredictionMode(); Parser* getParser(); - + virtual std::string getTokenName(size_t t); virtual std::string getLookaheadName(TokenStream *input); @@ -366,7 +372,7 @@ namespace atn { /// "dead" code for a bit. ///
virtual void dumpDeadEndConfigs(NoViableAltException &nvae); - + protected: Parser *const parser; @@ -380,13 +386,14 @@ namespace atn { /// also be examined during cache lookup. ///
PredictionContextMergeCache mergeCache; + size_t _mergeCacheCounter = 0; // LAME globals to avoid parameters!!!!! I need these down deep in predTransition TokenStream *_input; size_t _startIndex; ParserRuleContext *_outerContext; dfa::DFA *_dfa; // Reference into the decisionToDFA vector. - + /// /// Performs ATN simulation to compute a predicted alternative based /// upon the remaining input, but also updates the DFA cache to avoid @@ -646,13 +653,13 @@ namespace atn { */ std::unique_ptr applyPrecedenceFilter(ATNConfigSet *configs); - virtual ATNState *getReachableTarget(Transition *trans, size_t ttype); + virtual ATNState *getReachableTarget(const Transition *trans, size_t ttype); - virtual std::vector> getPredsForAmbigAlts(const antlrcpp::BitSet &ambigAlts, + virtual std::vector> getPredsForAmbigAlts(const antlrcpp::BitSet &ambigAlts, ATNConfigSet *configs, size_t nalts); - virtual std::vector getPredicatePredictions(const antlrcpp::BitSet &ambigAlts, - std::vector> const& altToPred); + std::vector getPredicatePredictions(const antlrcpp::BitSet &ambigAlts, + const std::vector> &altToPred); /** * This method is used to improve the localization of error messages by @@ -724,8 +731,8 @@ namespace atn { /// then we stop at the first predicate that evaluates to true. This /// includes pairs with null predicates. /// - virtual antlrcpp::BitSet evalSemanticContext(std::vector predPredictions, - ParserRuleContext *outerContext, bool complete); + antlrcpp::BitSet evalSemanticContext(const std::vector &predPredictions, + ParserRuleContext *outerContext, bool complete); /** * Evaluate a semantic context within a specific parser context. @@ -757,7 +764,7 @@ namespace atn { * * @since 4.3 */ - virtual bool evalSemanticContext(Ref const& pred, ParserRuleContext *parserCallStack, + virtual bool evalSemanticContext(Ref const& pred, ParserRuleContext *parserCallStack, size_t alt, bool fullCtx); /* TODO: If we are doing predicates, there is no point in pursuing @@ -771,19 +778,19 @@ namespace atn { virtual void closureCheckingStopState(Ref const& config, ATNConfigSet *configs, ATNConfig::Set &closureBusy, bool collectPredicates, bool fullCtx, int depth, bool treatEofAsEpsilon); - + /// Do the actual work of walking epsilon edges. virtual void closure_(Ref const& config, ATNConfigSet *configs, ATNConfig::Set &closureBusy, bool collectPredicates, bool fullCtx, int depth, bool treatEofAsEpsilon); - - virtual Ref getEpsilonTarget(Ref const& config, Transition *t, bool collectPredicates, + + virtual Ref getEpsilonTarget(Ref const& config, const Transition *t, bool collectPredicates, bool inContext, bool fullCtx, bool treatEofAsEpsilon); - virtual Ref actionTransition(Ref const& config, ActionTransition *t); + virtual Ref actionTransition(Ref const& config, const ActionTransition *t); - virtual Ref predTransition(Ref const& config, PredicateTransition *pt, bool collectPredicates, + virtual Ref predTransition(Ref const& config, const PredicateTransition *pt, bool collectPredicates, bool inContext, bool fullCtx); - virtual Ref ruleTransition(Ref const& config, RuleTransition *t); + virtual Ref ruleTransition(Ref const& config, const RuleTransition *t); /** * Gets a {@link BitSet} containing the alternatives in {@code configs} diff --git a/runtime/Cpp/runtime/src/atn/ParserATNSimulatorOptions.h b/runtime/Cpp/runtime/src/atn/ParserATNSimulatorOptions.h new file mode 100644 index 0000000000..ea31226d25 --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/ParserATNSimulatorOptions.h @@ -0,0 +1,50 @@ +// Copyright 2012-2022 The ANTLR Project +// +// 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 name of the copyright holder 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 HOLDER 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. + +#pragma once + +#include "atn/PredictionContextMergeCacheOptions.h" + +namespace antlr4 { +namespace atn { + + class ANTLR4CPP_PUBLIC ParserATNSimulatorOptions final { + public: + ParserATNSimulatorOptions& setPredictionContextMergeCacheOptions( + PredictionContextMergeCacheOptions predictionContextMergeCacheOptions) { + _predictionContextMergeCacheOptions = std::move(predictionContextMergeCacheOptions); + return *this; + } + + const PredictionContextMergeCacheOptions& getPredictionContextMergeCacheOptions() const { + return _predictionContextMergeCacheOptions; + } + + private: + PredictionContextMergeCacheOptions _predictionContextMergeCacheOptions; + }; + +} // namespace atn +} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/PlusBlockStartState.cpp b/runtime/Cpp/runtime/src/atn/PlusBlockStartState.cpp deleted file mode 100755 index b0ee12aee4..0000000000 --- a/runtime/Cpp/runtime/src/atn/PlusBlockStartState.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/PlusBlockStartState.h" - -using namespace antlr4::atn; - -size_t PlusBlockStartState::getStateType() { - return PLUS_BLOCK_START; -} diff --git a/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h b/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h index a3affb823e..6f67a8acad 100755 --- a/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h +++ b/runtime/Cpp/runtime/src/atn/PlusBlockStartState.h @@ -16,9 +16,13 @@ namespace atn { /// real decision-making note for {@code A+}. class ANTLR4CPP_PUBLIC PlusBlockStartState final : public BlockStartState { public: + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::PLUS_BLOCK_START; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } + PlusLoopbackState *loopBackState = nullptr; - virtual size_t getStateType() override; + PlusBlockStartState() : BlockStartState(ATNStateType::PLUS_BLOCK_START) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/PlusLoopbackState.cpp b/runtime/Cpp/runtime/src/atn/PlusLoopbackState.cpp deleted file mode 100755 index 1edab24b41..0000000000 --- a/runtime/Cpp/runtime/src/atn/PlusLoopbackState.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/PlusLoopbackState.h" - -using namespace antlr4::atn; - -size_t PlusLoopbackState::getStateType() { - return PLUS_LOOP_BACK; -} diff --git a/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h b/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h index ba7a4b64e3..d83ed7d021 100755 --- a/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h +++ b/runtime/Cpp/runtime/src/atn/PlusLoopbackState.h @@ -13,9 +13,12 @@ namespace atn { /// Decision state for {@code A+} and {@code (A|B)+}. It has two transitions: /// one to the loop back to start of the block and one to exit. class ANTLR4CPP_PUBLIC PlusLoopbackState final : public DecisionState { - public: - virtual size_t getStateType() override; + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::PLUS_LOOP_BACK; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } + + PlusLoopbackState() : DecisionState(ATNStateType::PLUS_LOOP_BACK) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp b/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp index 9aedc9de4a..a0d123fd33 100755 --- a/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp +++ b/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp @@ -8,12 +8,7 @@ using namespace antlr4::atn; PrecedencePredicateTransition::PrecedencePredicateTransition(ATNState *target, int precedence) - : AbstractPredicateTransition(target), precedence(precedence) { -} - -Transition::SerializationType PrecedencePredicateTransition::getSerializationType() const { - return PRECEDENCE; -} + : Transition(TransitionType::PRECEDENCE, target), _predicate(std::make_shared(precedence)) {} bool PrecedencePredicateTransition::isEpsilon() const { return true; @@ -23,10 +18,6 @@ bool PrecedencePredicateTransition::matches(size_t /*symbol*/, size_t /*minVocab return false; } -Ref PrecedencePredicateTransition::getPredicate() const { - return std::make_shared(precedence); -} - std::string PrecedencePredicateTransition::toString() const { - return "PRECEDENCE " + Transition::toString() + " { precedence: " + std::to_string(precedence) + " }"; + return "PRECEDENCE " + Transition::toString() + " { precedence: " + std::to_string(getPrecedence()) + " }"; } diff --git a/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h b/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h index bc22146e7e..1bf83fb721 100755 --- a/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h +++ b/runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.h @@ -5,24 +5,30 @@ #pragma once -#include "atn/AbstractPredicateTransition.h" -#include "SemanticContext.h" +#include "atn/Transition.h" +#include "atn/SemanticContext.h" namespace antlr4 { namespace atn { - class ANTLR4CPP_PUBLIC PrecedencePredicateTransition final : public AbstractPredicateTransition { + class ANTLR4CPP_PUBLIC PrecedencePredicateTransition final : public Transition { public: - const int precedence; + static bool is(const Transition &transition) { return transition.getTransitionType() == TransitionType::PRECEDENCE; } + + static bool is(const Transition *transition) { return transition != nullptr && is(*transition); } PrecedencePredicateTransition(ATNState *target, int precedence); - virtual SerializationType getSerializationType() const override; - virtual bool isEpsilon() const override; - virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; - Ref getPredicate() const; - virtual std::string toString() const override; + int getPrecedence() const { return _predicate->precedence; } + + bool isEpsilon() const override; + bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; + std::string toString() const override; + + const Ref& getPredicate() const { return _predicate; } + private: + const std::shared_ptr _predicate; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp b/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp index 3d86bfee0b..73ee2a2b97 100755 --- a/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp +++ b/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp @@ -11,7 +11,7 @@ using namespace antlr4; using namespace antlr4::atn; PredicateEvalInfo::PredicateEvalInfo(size_t decision, TokenStream *input, size_t startIndex, size_t stopIndex, - Ref const& semctx, bool evalResult, size_t predictedAlt, bool fullCtx) + Ref semctx, bool evalResult, size_t predictedAlt, bool fullCtx) : DecisionEventInfo(decision, nullptr, input, startIndex, stopIndex, fullCtx), - semctx(semctx), predictedAlt(predictedAlt), evalResult(evalResult) { + semctx(std::move(semctx)), predictedAlt(predictedAlt), evalResult(evalResult) { } diff --git a/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h b/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h index b0513aea2b..f343f541cb 100755 --- a/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h +++ b/runtime/Cpp/runtime/src/atn/PredicateEvalInfo.h @@ -20,7 +20,7 @@ namespace atn { class ANTLR4CPP_PUBLIC PredicateEvalInfo : public DecisionEventInfo { public: /// The semantic context which was evaluated. - const Ref semctx; + const Ref semctx; /// /// The alternative number for the decision which is guarded by the semantic @@ -55,7 +55,7 @@ namespace atn { /// /// PredicateEvalInfo(size_t decision, TokenStream *input, size_t startIndex, size_t stopIndex, - Ref const& semctx, bool evalResult, size_t predictedAlt, bool fullCtx); + Ref semctx, bool evalResult, size_t predictedAlt, bool fullCtx); }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp b/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp index 984fc20562..4ba50730a2 100755 --- a/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp +++ b/runtime/Cpp/runtime/src/atn/PredicateTransition.cpp @@ -7,12 +7,8 @@ using namespace antlr4::atn; -PredicateTransition::PredicateTransition(ATNState *target, size_t ruleIndex, size_t predIndex, bool isCtxDependent) : AbstractPredicateTransition(target), ruleIndex(ruleIndex), predIndex(predIndex), isCtxDependent(isCtxDependent) { -} - -Transition::SerializationType PredicateTransition::getSerializationType() const { - return PREDICATE; -} +PredicateTransition::PredicateTransition(ATNState *target, size_t ruleIndex, size_t predIndex, bool isCtxDependent) + : Transition(TransitionType::PREDICATE, target), _predicate(std::make_shared(ruleIndex, predIndex, isCtxDependent)) {} bool PredicateTransition::isEpsilon() const { return true; @@ -22,13 +18,7 @@ bool PredicateTransition::matches(size_t /*symbol*/, size_t /*minVocabSymbol*/, return false; } -Ref PredicateTransition::getPredicate() const { - return std::make_shared(ruleIndex, predIndex, isCtxDependent); -} - std::string PredicateTransition::toString() const { - return "PREDICATE " + Transition::toString() + " { ruleIndex: " + std::to_string(ruleIndex) + - ", predIndex: " + std::to_string(predIndex) + ", isCtxDependent: " + std::to_string(isCtxDependent) + " }"; - - // Generate and add a predicate context here? + return "PREDICATE " + Transition::toString() + " { ruleIndex: " + std::to_string(getRuleIndex()) + + ", predIndex: " + std::to_string(getPredIndex()) + ", isCtxDependent: " + std::to_string(isCtxDependent()) + " }"; } diff --git a/runtime/Cpp/runtime/src/atn/PredicateTransition.h b/runtime/Cpp/runtime/src/atn/PredicateTransition.h index 4d9b4205dc..e889b1c198 100755 --- a/runtime/Cpp/runtime/src/atn/PredicateTransition.h +++ b/runtime/Cpp/runtime/src/atn/PredicateTransition.h @@ -5,8 +5,8 @@ #pragma once -#include "atn/AbstractPredicateTransition.h" -#include "SemanticContext.h" +#include "atn/Transition.h" +#include "atn/SemanticContext.h" namespace antlr4 { namespace atn { @@ -16,23 +16,34 @@ namespace atn { /// In the ATN, labels will always be exactly one predicate, but the DFA /// may have to combine a bunch of them as it collects predicates from /// multiple ATN configurations into a single DFA state. - class ANTLR4CPP_PUBLIC PredicateTransition final : public AbstractPredicateTransition { + class ANTLR4CPP_PUBLIC PredicateTransition final : public Transition { public: - const size_t ruleIndex; - const size_t predIndex; - const bool isCtxDependent; // e.g., $i ref in pred + static bool is(const Transition &transition) { return transition.getTransitionType() == TransitionType::PREDICATE; } + + static bool is(const Transition *transition) { return transition != nullptr && is(*transition); } PredicateTransition(ATNState *target, size_t ruleIndex, size_t predIndex, bool isCtxDependent); - virtual SerializationType getSerializationType() const override; + size_t getRuleIndex() const { + return _predicate->ruleIndex; + } + + size_t getPredIndex() const { + return _predicate->predIndex; + } - virtual bool isEpsilon() const override; - virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; + bool isCtxDependent() const { + return _predicate->isCtxDependent; + } - Ref getPredicate() const; + bool isEpsilon() const override; + bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; + std::string toString() const override; - virtual std::string toString() const override; + const Ref& getPredicate() const { return _predicate; } + private: + const std::shared_ptr _predicate; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/PredictionContext.cpp b/runtime/Cpp/runtime/src/atn/PredictionContext.cpp index 126d403fe4..704408f04d 100755 --- a/runtime/Cpp/runtime/src/atn/PredictionContext.cpp +++ b/runtime/Cpp/runtime/src/atn/PredictionContext.cpp @@ -3,35 +3,136 @@ * can be found in the LICENSE.txt file in the project root. */ -#include "atn/EmptyPredictionContext.h" +#include "atn/SingletonPredictionContext.h" #include "misc/MurmurHash.h" #include "atn/ArrayPredictionContext.h" +#include "atn/PredictionContextCache.h" +#include "atn/PredictionContextMergeCache.h" #include "RuleContext.h" #include "ParserRuleContext.h" #include "atn/RuleTransition.h" #include "support/Arrays.h" #include "support/CPPUtils.h" +#include "support/Casts.h" #include "atn/PredictionContext.h" using namespace antlr4; using namespace antlr4::misc; using namespace antlr4::atn; - using namespace antlrcpp; -std::atomic PredictionContext::globalNodeCount(0); -const Ref PredictionContext::EMPTY = std::make_shared(); +namespace { -//----------------- PredictionContext ---------------------------------------------------------------------------------- + void combineCommonParents(std::vector> &parents) { + std::unordered_set> uniqueParents; + uniqueParents.reserve(parents.size()); + for (const auto &parent : parents) { + uniqueParents.insert(parent); + } + for (auto &parent : parents) { + parent = *uniqueParents.find(parent); + } + } -PredictionContext::PredictionContext(size_t cachedHashCode) : id(globalNodeCount.fetch_add(1, std::memory_order_relaxed)), cachedHashCode(cachedHashCode) { -} + Ref getCachedContextImpl(const Ref &context, + PredictionContextCache &contextCache, + std::unordered_map, + Ref> &visited) { + if (context->isEmpty()) { + return context; + } + + { + auto iterator = visited.find(context); + if (iterator != visited.end()) { + return iterator->second; // Not necessarly the same as context. + } + } + + auto cached = contextCache.get(context); + if (cached) { + visited[context] = cached; + return cached; + } + + bool changed = false; + + std::vector> parents(context->size()); + for (size_t i = 0; i < parents.size(); i++) { + auto parent = getCachedContextImpl(context->getParent(i), contextCache, visited); + if (changed || parent != context->getParent(i)) { + if (!changed) { + parents.clear(); + for (size_t j = 0; j < context->size(); j++) { + parents.push_back(context->getParent(j)); + } + + changed = true; + } + + parents[i] = std::move(parent); + } + } + + if (!changed) { + visited[context] = context; + contextCache.put(context); + return context; + } + + Ref updated; + if (parents.empty()) { + updated = PredictionContext::EMPTY; + } else if (parents.size() == 1) { + updated = SingletonPredictionContext::create(std::move(parents[0]), context->getReturnState(0)); + contextCache.put(updated); + } else { + updated = std::make_shared(std::move(parents), downCast(context.get())->returnStates); + contextCache.put(updated); + } + + visited[updated] = updated; + visited[context] = updated; + + return updated; + } + + void getAllContextNodesImpl(const Ref &context, + std::vector> &nodes, + std::unordered_set &visited) { + + if (visited.find(context.get()) != visited.end()) { + return; // Already done. + } + + visited.insert(context.get()); + nodes.push_back(context); + + for (size_t i = 0; i < context->size(); i++) { + getAllContextNodesImpl(context->getParent(i), nodes, visited); + } + } + + size_t insertOrAssignNodeId(std::unordered_map &nodeIds, size_t &nodeId, const PredictionContext *node) { + auto existing = nodeIds.find(node); + if (existing != nodeIds.end()) { + return existing->second; + } + return nodeIds.insert({node, nodeId++}).first->second; + } -PredictionContext::~PredictionContext() { } -Ref PredictionContext::fromRuleContext(const ATN &atn, RuleContext *outerContext) { +const Ref PredictionContext::EMPTY = std::make_shared(nullptr, PredictionContext::EMPTY_RETURN_STATE); + +//----------------- PredictionContext ---------------------------------------------------------------------------------- + +PredictionContext::PredictionContext(PredictionContextType contextType) : _contextType(contextType), _hashCode(0) {} + +PredictionContext::PredictionContext(PredictionContext&& other) : _contextType(other._contextType), _hashCode(other._hashCode.exchange(0, std::memory_order_relaxed)) {} + +Ref PredictionContext::fromRuleContext(const ATN &atn, RuleContext *outerContext) { if (outerContext == nullptr) { return PredictionContext::EMPTY; } @@ -43,15 +144,9 @@ Ref PredictionContext::fromRuleContext(const ATN &atn, RuleCo } // If we have a parent, convert it to a PredictionContext graph - Ref parent = PredictionContext::fromRuleContext(atn, dynamic_cast(outerContext->parent)); - - ATNState *state = atn.states.at(outerContext->invokingState); - RuleTransition *transition = (RuleTransition *)state->transitions[0]; - return SingletonPredictionContext::create(parent, transition->followState->stateNumber); -} - -bool PredictionContext::isEmpty() const { - return this == EMPTY.get(); + auto parent = PredictionContext::fromRuleContext(atn, RuleContext::is(outerContext->parent) ? downCast(outerContext->parent) : nullptr); + const auto *transition = downCast(atn.states[outerContext->invokingState]->transitions[0].get()); + return SingletonPredictionContext::create(std::move(parent), transition->followState->stateNumber); } bool PredictionContext::hasEmptyPath() const { @@ -60,40 +155,19 @@ bool PredictionContext::hasEmptyPath() const { } size_t PredictionContext::hashCode() const { - return cachedHashCode; -} - -size_t PredictionContext::calculateEmptyHashCode() { - size_t hash = MurmurHash::initialize(INITIAL_HASH); - hash = MurmurHash::finish(hash, 0); - return hash; -} - -size_t PredictionContext::calculateHashCode(Ref parent, size_t returnState) { - size_t hash = MurmurHash::initialize(INITIAL_HASH); - hash = MurmurHash::update(hash, parent); - hash = MurmurHash::update(hash, returnState); - hash = MurmurHash::finish(hash, 2); - return hash; -} - -size_t PredictionContext::calculateHashCode(const std::vector> &parents, - const std::vector &returnStates) { - size_t hash = MurmurHash::initialize(INITIAL_HASH); - - for (auto parent : parents) { - hash = MurmurHash::update(hash, parent); - } - - for (auto returnState : returnStates) { - hash = MurmurHash::update(hash, returnState); + auto hash = cachedHashCode(); + if (hash == 0) { + hash = hashCodeImpl(); + if (hash == 0) { + hash = std::numeric_limits::max(); + } + _hashCode.store(hash, std::memory_order_relaxed); } - - return MurmurHash::finish(hash, parents.size() + returnStates.size()); + return hash; } -Ref PredictionContext::merge(const Ref &a, - const Ref &b, bool rootIsWildcard, PredictionContextMergeCache *mergeCache) { +Ref PredictionContext::merge(Ref a, Ref b, + bool rootIsWildcard, PredictionContextMergeCache *mergeCache) { assert(a && b); // share same graph if both same @@ -101,42 +175,45 @@ Ref PredictionContext::merge(const Ref &a, return a; } - if (is(a) && is(b)) { - return mergeSingletons(std::dynamic_pointer_cast(a), - std::dynamic_pointer_cast(b), rootIsWildcard, mergeCache); + const auto aType = a->getContextType(); + const auto bType = b->getContextType(); + + if (aType == PredictionContextType::SINGLETON && bType == PredictionContextType::SINGLETON) { + return mergeSingletons(std::static_pointer_cast(std::move(a)), + std::static_pointer_cast(std::move(b)), rootIsWildcard, mergeCache); } // At least one of a or b is array. // If one is $ and rootIsWildcard, return $ as * wildcard. if (rootIsWildcard) { - if (is(a)) { + if (a == PredictionContext::EMPTY) { return a; } - if (is(b)) { + if (b == PredictionContext::EMPTY) { return b; } } // convert singleton so both are arrays to normalize - Ref left; - if (is(a)) { - left = std::make_shared(std::dynamic_pointer_cast(a)); + Ref left; + if (aType == PredictionContextType::SINGLETON) { + left = std::make_shared(downCast(*a)); } else { - left = std::dynamic_pointer_cast(a); + left = std::static_pointer_cast(std::move(a)); } - Ref right; - if (is(b)) { - right = std::make_shared(std::dynamic_pointer_cast(b)); + Ref right; + if (bType == PredictionContextType::SINGLETON) { + right = std::make_shared(downCast(*b)); } else { - right = std::dynamic_pointer_cast(b); + right = std::static_pointer_cast(std::move(b)); } - return mergeArrays(left, right, rootIsWildcard, mergeCache); + return mergeArrays(std::move(left), std::move(right), rootIsWildcard, mergeCache); } -Ref PredictionContext::mergeSingletons(const Ref &a, - const Ref &b, bool rootIsWildcard, PredictionContextMergeCache *mergeCache) { +Ref PredictionContext::mergeSingletons(Ref a, Ref b, + bool rootIsWildcard, PredictionContextMergeCache *mergeCache) { - if (mergeCache != nullptr) { // Can be null if not given to the ATNState from which this call originates. + if (mergeCache) { auto existing = mergeCache->get(a, b); if (existing) { return existing; @@ -147,18 +224,18 @@ Ref PredictionContext::mergeSingletons(const Ref rootMerge = mergeRoot(a, b, rootIsWildcard); + auto rootMerge = mergeRoot(a, b, rootIsWildcard); if (rootMerge) { - if (mergeCache != nullptr) { - mergeCache->put(a, b, rootMerge); + if (mergeCache) { + return mergeCache->put(a, b, std::move(rootMerge)); } return rootMerge; } - Ref parentA = a->parent; - Ref parentB = b->parent; + const auto& parentA = a->parent; + const auto& parentB = b->parent; if (a->returnState == b->returnState) { // a == b - Ref parent = merge(parentA, parentB, rootIsWildcard, mergeCache); + auto parent = merge(parentA, parentB, rootIsWildcard, mergeCache); // If parent is same as existing a or b parent or reduced to a parent, return it. if (parent == parentA) { // ax + bx = ax, if a=b @@ -172,55 +249,55 @@ Ref PredictionContext::mergeSingletons(const Ref a_ = SingletonPredictionContext::create(parent, a->returnState); - if (mergeCache != nullptr) { - mergeCache->put(a, b, a_); - } - return a_; - } else { - // a != b payloads differ - // see if we can collapse parents due to $+x parents if local ctx - Ref singleParent; - if (a == b || (*parentA == *parentB)) { // ax + bx = [a,b]x - singleParent = parentA; - } - if (singleParent) { // parents are same, sort payloads and use same parent - std::vector payloads = { a->returnState, b->returnState }; - if (a->returnState > b->returnState) { - payloads[0] = b->returnState; - payloads[1] = a->returnState; - } - std::vector> parents = { singleParent, singleParent }; - Ref a_ = std::make_shared(parents, payloads); - if (mergeCache != nullptr) { - mergeCache->put(a, b, a_); - } - return a_; - } - - // parents differ and can't merge them. Just pack together - // into array; can't merge. - // ax + by = [ax,by] - Ref a_; - if (a->returnState > b->returnState) { // sort by payload - std::vector payloads = { b->returnState, a->returnState }; - std::vector> parents = { b->parent, a->parent }; - a_ = std::make_shared(parents, payloads); - } else { - std::vector payloads = {a->returnState, b->returnState}; - std::vector> parents = { a->parent, b->parent }; - a_ = std::make_shared(parents, payloads); - } - - if (mergeCache != nullptr) { - mergeCache->put(a, b, a_); - } - return a_; - } + auto c = SingletonPredictionContext::create(std::move(parent), a->returnState); + if (mergeCache) { + return mergeCache->put(a, b, std::move(c)); + } + return c; + } + // a != b payloads differ + // see if we can collapse parents due to $+x parents if local ctx + Ref singleParent; + if (a == b || (*parentA == *parentB)) { // ax + bx = [a,b]x + singleParent = parentA; + } + if (singleParent) { // parents are same, sort payloads and use same parent + std::vector payloads = { a->returnState, b->returnState }; + if (a->returnState > b->returnState) { + payloads[0] = b->returnState; + payloads[1] = a->returnState; + } + std::vector> parents = { singleParent, singleParent }; + auto c = std::make_shared(std::move(parents), std::move(payloads)); + if (mergeCache) { + return mergeCache->put(a, b, std::move(c)); + } + return c; + } + + // parents differ and can't merge them. Just pack together + // into array; can't merge. + // ax + by = [ax,by] + if (a->returnState > b->returnState) { // sort by payload + std::vector payloads = { b->returnState, a->returnState }; + std::vector> parents = { b->parent, a->parent }; + auto c = std::make_shared(std::move(parents), std::move(payloads)); + if (mergeCache) { + return mergeCache->put(a, b, std::move(c)); + } + return c; + } + std::vector payloads = {a->returnState, b->returnState}; + std::vector> parents = { a->parent, b->parent }; + auto c = std::make_shared(std::move(parents), std::move(payloads)); + if (mergeCache) { + return mergeCache->put(a, b, std::move(c)); + } + return c; } -Ref PredictionContext::mergeRoot(const Ref &a, - const Ref &b, bool rootIsWildcard) { +Ref PredictionContext::mergeRoot(Ref a, Ref b, + bool rootIsWildcard) { if (rootIsWildcard) { if (a == EMPTY) { // * + b = * return EMPTY; @@ -234,24 +311,22 @@ Ref PredictionContext::mergeRoot(const Ref payloads = { b->returnState, EMPTY_RETURN_STATE }; - std::vector> parents = { b->parent, nullptr }; - Ref joined = std::make_shared(parents, payloads); - return joined; + std::vector> parents = { b->parent, nullptr }; + return std::make_shared(std::move(parents), std::move(payloads)); } if (b == EMPTY) { // x + $ = [$,x] ($ is always first if present) std::vector payloads = { a->returnState, EMPTY_RETURN_STATE }; - std::vector> parents = { a->parent, nullptr }; - Ref joined = std::make_shared(parents, payloads); - return joined; + std::vector> parents = { a->parent, nullptr }; + return std::make_shared(std::move(parents), std::move(payloads)); } } return nullptr; } -Ref PredictionContext::mergeArrays(const Ref &a, - const Ref &b, bool rootIsWildcard, PredictionContextMergeCache *mergeCache) { +Ref PredictionContext::mergeArrays(Ref a, Ref b, + bool rootIsWildcard, PredictionContextMergeCache *mergeCache) { - if (mergeCache != nullptr) { + if (mergeCache) { auto existing = mergeCache->get(a, b); if (existing) { return existing; @@ -268,36 +343,33 @@ Ref PredictionContext::mergeArrays(const Ref mergedReturnStates(a->returnStates.size() + b->returnStates.size()); - std::vector> mergedParents(a->returnStates.size() + b->returnStates.size()); + std::vector> mergedParents(a->returnStates.size() + b->returnStates.size()); // walk and merge to yield mergedParents, mergedReturnStates while (i < a->returnStates.size() && j < b->returnStates.size()) { - Ref a_parent = a->parents[i]; - Ref b_parent = b->parents[j]; + const auto& parentA = a->parents[i]; + const auto& parentB = b->parents[j]; if (a->returnStates[i] == b->returnStates[j]) { // same payload (stack tops are equal), must yield merged singleton size_t payload = a->returnStates[i]; // $+$ = $ - bool both$ = payload == EMPTY_RETURN_STATE && !a_parent && !b_parent; - bool ax_ax = (a_parent && b_parent) && *a_parent == *b_parent; // ax+ax -> ax + bool both$ = payload == EMPTY_RETURN_STATE && !parentA && !parentB; + bool ax_ax = (parentA && parentB) && *parentA == *parentB; // ax+ax -> ax if (both$ || ax_ax) { - mergedParents[k] = a_parent; // choose left + mergedParents[k] = parentA; // choose left mergedReturnStates[k] = payload; - } - else { // ax+ay -> a'[x,y] - Ref mergedParent = merge(a_parent, b_parent, rootIsWildcard, mergeCache); - mergedParents[k] = mergedParent; + } else { // ax+ay -> a'[x,y] + mergedParents[k] = merge(parentA, parentB, rootIsWildcard, mergeCache); mergedReturnStates[k] = payload; } i++; // hop over left one as usual j++; // but also skip one in right side since we merge } else if (a->returnStates[i] < b->returnStates[j]) { // copy a[i] to M - mergedParents[k] = a_parent; + mergedParents[k] = parentA; mergedReturnStates[k] = a->returnStates[i]; i++; - } - else { // b > a, copy b[j] to M - mergedParents[k] = b_parent; + } else { // b > a, copy b[j] to M + mergedParents[k] = parentB; mergedReturnStates[k] = b->returnStates[j]; j++; } @@ -306,13 +378,13 @@ Ref PredictionContext::mergeArrays(const RefreturnStates.size()) { - for (std::vector::size_type p = i; p < a->returnStates.size(); p++) { + for (auto p = i; p < a->returnStates.size(); p++) { mergedParents[k] = a->parents[p]; mergedReturnStates[k] = a->returnStates[p]; k++; } } else { - for (std::vector::size_type p = j; p < b->returnStates.size(); p++) { + for (auto p = j; p < b->returnStates.size(); p++) { mergedParents[k] = b->parents[p]; mergedReturnStates[k] = b->returnStates[p]; k++; @@ -322,63 +394,42 @@ Ref PredictionContext::mergeArrays(const Ref a_ = SingletonPredictionContext::create(mergedParents[0], mergedReturnStates[0]); - if (mergeCache != nullptr) { - mergeCache->put(a, b, a_); + auto c = SingletonPredictionContext::create(std::move(mergedParents[0]), mergedReturnStates[0]); + if (mergeCache) { + return mergeCache->put(a, b, std::move(c)); } - return a_; + return c; } mergedParents.resize(k); mergedReturnStates.resize(k); } - Ref M = std::make_shared(mergedParents, mergedReturnStates); + ArrayPredictionContext m(std::move(mergedParents), std::move(mergedReturnStates)); // if we created same array as a or b, return that instead // TODO: track whether this is possible above during merge sort for speed - if (*M == *a) { - if (mergeCache != nullptr) { - mergeCache->put(a, b, a); + if (m == *a) { + if (mergeCache) { + return mergeCache->put(a, b, a); } return a; } - if (*M == *b) { - if (mergeCache != nullptr) { - mergeCache->put(a, b, b); + if (m == *b) { + if (mergeCache) { + return mergeCache->put(a, b, b); } return b; } - // ml: this part differs from Java code. We have to recreate the context as the parents array is copied on creation. - if (combineCommonParents(mergedParents)) { - mergedReturnStates.resize(mergedParents.size()); - M = std::make_shared(mergedParents, mergedReturnStates); - } - - if (mergeCache != nullptr) { - mergeCache->put(a, b, M); - } - return M; -} - -bool PredictionContext::combineCommonParents(std::vector> &parents) { - - std::set> uniqueParents; - for (size_t p = 0; p < parents.size(); ++p) { - Ref parent = parents[p]; - if (uniqueParents.find(parent) == uniqueParents.end()) { // don't replace - uniqueParents.insert(parent); - } - } - - for (size_t p = 0; p < parents.size(); ++p) { - parents[p] = *uniqueParents.find(parents[p]); + combineCommonParents(m.parents); + auto c = std::make_shared(std::move(m)); + if (mergeCache) { + return mergeCache->put(a, b, std::move(c)); } - - return true; + return c; } -std::string PredictionContext::toDOTString(const Ref &context) { +std::string PredictionContext::toDOTString(const Ref &context) { if (context == nullptr) { return ""; } @@ -386,24 +437,23 @@ std::string PredictionContext::toDOTString(const Ref &context std::stringstream ss; ss << "digraph G {\n" << "rankdir=LR;\n"; - std::vector> nodes = getAllContextNodes(context); - std::sort(nodes.begin(), nodes.end(), [](const Ref &o1, const Ref &o2) { - return o1->id - o2->id; - }); + std::vector> nodes = getAllContextNodes(context); + std::unordered_map nodeIds; + size_t nodeId = 0; - for (auto current : nodes) { - if (is(current)) { - std::string s = std::to_string(current->id); + for (const auto ¤t : nodes) { + if (current->getContextType() == PredictionContextType::SINGLETON) { + std::string s = std::to_string(insertOrAssignNodeId(nodeIds, nodeId, current.get())); ss << " s" << s; std::string returnState = std::to_string(current->getReturnState(0)); - if (is(current)) { + if (current == PredictionContext::EMPTY) { returnState = "$"; } ss << " [label=\"" << returnState << "\"];\n"; continue; } - Ref arr = std::static_pointer_cast(current); - ss << " s" << arr->id << " [shape=box, label=\"" << "["; + Ref arr = std::static_pointer_cast(current); + ss << " s" << insertOrAssignNodeId(nodeIds, nodeId, arr.get()) << " [shape=box, label=\"" << "["; bool first = true; for (auto inv : arr->returnStates) { if (!first) { @@ -420,7 +470,7 @@ std::string PredictionContext::toDOTString(const Ref &context ss << "\"];\n"; } - for (auto current : nodes) { + for (const auto ¤t : nodes) { if (current == EMPTY) { continue; } @@ -428,7 +478,7 @@ std::string PredictionContext::toDOTString(const Ref &context if (!current->getParent(i)) { continue; } - ss << " s" << current->id << "->" << "s" << current->getParent(i)->id; + ss << " s" << insertOrAssignNodeId(nodeIds, nodeId, current.get()) << "->" << "s" << insertOrAssignNodeId(nodeIds, nodeId, current->getParent(i).get()); if (current->size() > 1) { ss << " [label=\"parent[" << i << "]\"];\n"; } else { @@ -442,112 +492,31 @@ std::string PredictionContext::toDOTString(const Ref &context } // The "visited" map is just a temporary structure to control the retrieval process (which is recursive). -Ref PredictionContext::getCachedContext(const Ref &context, - PredictionContextCache &contextCache, std::map, Ref> &visited) { - if (context->isEmpty()) { - return context; - } - - { - auto iterator = visited.find(context); - if (iterator != visited.end()) - return iterator->second; // Not necessarly the same as context. - } - - auto iterator = contextCache.find(context); - if (iterator != contextCache.end()) { - visited[context] = *iterator; - - return *iterator; - } - - bool changed = false; - - std::vector> parents(context->size()); - for (size_t i = 0; i < parents.size(); i++) { - Ref parent = getCachedContext(context->getParent(i), contextCache, visited); - if (changed || parent != context->getParent(i)) { - if (!changed) { - parents.clear(); - for (size_t j = 0; j < context->size(); j++) { - parents.push_back(context->getParent(j)); - } - - changed = true; - } - - parents[i] = parent; - } - } - - if (!changed) { - contextCache.insert(context); - visited[context] = context; - - return context; - } - - Ref updated; - if (parents.empty()) { - updated = EMPTY; - } else if (parents.size() == 1) { - updated = SingletonPredictionContext::create(parents[0], context->getReturnState(0)); - contextCache.insert(updated); - } else { - updated = std::make_shared(parents, std::dynamic_pointer_cast(context)->returnStates); - contextCache.insert(updated); - } - - visited[updated] = updated; - visited[context] = updated; - - return updated; +Ref PredictionContext::getCachedContext(const Ref &context, + PredictionContextCache &contextCache) { + std::unordered_map, Ref> visited; + return getCachedContextImpl(context, contextCache, visited); } -std::vector> PredictionContext::getAllContextNodes(const Ref &context) { - std::vector> nodes; - std::set visited; - getAllContextNodes_(context, nodes, visited); +std::vector> PredictionContext::getAllContextNodes(const Ref &context) { + std::vector> nodes; + std::unordered_set visited; + getAllContextNodesImpl(context, nodes, visited); return nodes; } - -void PredictionContext::getAllContextNodes_(const Ref &context, std::vector> &nodes, - std::set &visited) { - - if (visited.find(context.get()) != visited.end()) { - return; // Already done. - } - - visited.insert(context.get()); - nodes.push_back(context); - - for (size_t i = 0; i < context->size(); i++) { - getAllContextNodes_(context->getParent(i), nodes, visited); - } -} - -std::string PredictionContext::toString() const { - - return antlrcpp::toString(this); -} - -std::string PredictionContext::toString(Recognizer * /*recog*/) const { - return toString(); -} - -std::vector PredictionContext::toStrings(Recognizer *recognizer, int currentState) { +std::vector PredictionContext::toStrings(Recognizer *recognizer, int currentState) const { return toStrings(recognizer, EMPTY, currentState); } -std::vector PredictionContext::toStrings(Recognizer *recognizer, const Ref &stop, int currentState) { +std::vector PredictionContext::toStrings(Recognizer *recognizer, const Ref &stop, int currentState) const { std::vector result; for (size_t perm = 0; ; perm++) { size_t offset = 0; bool last = true; - PredictionContext *p = this; + const PredictionContext *p = this; size_t stateNumber = currentState; std::stringstream ss; @@ -608,55 +577,3 @@ std::vector PredictionContext::toStrings(Recognizer *recognizer, co return result; } - -//----------------- PredictionContextMergeCache ------------------------------------------------------------------------ - -Ref PredictionContextMergeCache::put(Ref const& key1, Ref const& key2, - Ref const& value) { - Ref previous; - - auto iterator = _data.find(key1); - if (iterator == _data.end()) - _data[key1][key2] = value; - else { - auto iterator2 = iterator->second.find(key2); - if (iterator2 != iterator->second.end()) - previous = iterator2->second; - iterator->second[key2] = value; - } - - return previous; -} - -Ref PredictionContextMergeCache::get(Ref const& key1, Ref const& key2) { - auto iterator = _data.find(key1); - if (iterator == _data.end()) - return nullptr; - - auto iterator2 = iterator->second.find(key2); - if (iterator2 == iterator->second.end()) - return nullptr; - - return iterator2->second; -} - -void PredictionContextMergeCache::clear() { - _data.clear(); -} - -std::string PredictionContextMergeCache::toString() const { - std::string result; - for (auto pair : _data) - for (auto pair2 : pair.second) - result += pair2.second->toString() + "\n"; - - return result; -} - -size_t PredictionContextMergeCache::count() const { - size_t result = 0; - for (auto entry : _data) - result += entry.second.size(); - return result; -} - diff --git a/runtime/Cpp/runtime/src/atn/PredictionContext.h b/runtime/Cpp/runtime/src/atn/PredictionContext.h index 887c53ba50..23b68c30d1 100755 --- a/runtime/Cpp/runtime/src/atn/PredictionContext.h +++ b/runtime/Cpp/runtime/src/atn/PredictionContext.h @@ -10,21 +10,25 @@ #include "Recognizer.h" #include "atn/ATN.h" #include "atn/ATNState.h" +#include "atn/PredictionContextType.h" namespace antlr4 { + + class RuleContext; + namespace atn { - struct PredictionContextHasher; - struct PredictionContextComparer; + class ATN; + class ArrayPredictionContext; + class SingletonPredictionContext; + class PredictionContextCache; class PredictionContextMergeCache; - typedef std::unordered_set, PredictionContextHasher, PredictionContextComparer> PredictionContextCache; - class ANTLR4CPP_PUBLIC PredictionContext { public: /// Represents $ in local context prediction, which means wildcard. /// *+x = *. - static const Ref EMPTY; + static const Ref EMPTY; /// Represents $ in an array in full context mode, when $ /// doesn't mean wildcard: $ + x = [$,x]. Here, @@ -32,80 +36,13 @@ namespace atn { // ml: originally Integer.MAX_VALUE, which would be -1 for us, but this is already used in places where // -1 is converted to unsigned, so we use a different value here. Any value does the job provided it doesn't // conflict with real return states. -#if __cplusplus >= 201703L static constexpr size_t EMPTY_RETURN_STATE = std::numeric_limits::max() - 9; -#else - enum : size_t { - EMPTY_RETURN_STATE = static_cast(-10), // std::numeric_limits::max() - 9; doesn't work in VS 2013 - }; -#endif - - private: -#if __cplusplus >= 201703L - static constexpr size_t INITIAL_HASH = 1; -#else - enum : size_t { - INITIAL_HASH = 1, - }; -#endif - - public: - static std::atomic globalNodeCount; - const size_t id; - /// - /// Stores the computed hash code of this . The hash - /// code is computed in parts to match the following reference algorithm. - /// - ///
-    ///  private int referenceHashCode() {
-    ///      int hash = ();
-    ///
-    ///      for (int i = 0; i < ; i++) {
-    ///          hash = (hash, (i));
-    ///      }
-    ///
-    ///      for (int i = 0; i < ; i++) {
-    ///          hash = (hash, (i));
-    ///      }
-    ///
-    ///      hash = (hash, 2 * );
-    ///      return hash;
-    ///  }
-    /// 
- ///
- const size_t cachedHashCode; - - protected: - PredictionContext(size_t cachedHashCode); - ~PredictionContext(); - - public: - /// Convert a RuleContext tree to a PredictionContext graph. - /// Return EMPTY if outerContext is empty. - static Ref fromRuleContext(const ATN &atn, RuleContext *outerContext); - - virtual size_t size() const = 0; - virtual Ref getParent(size_t index) const = 0; - virtual size_t getReturnState(size_t index) const = 0; - - virtual bool operator == (const PredictionContext &o) const = 0; - - /// This means only the EMPTY (wildcard? not sure) context is in set. - virtual bool isEmpty() const; - virtual bool hasEmptyPath() const; - virtual size_t hashCode() const; - - protected: - static size_t calculateEmptyHashCode(); - static size_t calculateHashCode(Ref parent, size_t returnState); - static size_t calculateHashCode(const std::vector> &parents, - const std::vector &returnStates); - - public: // dispatch - static Ref merge(const Ref &a, const Ref &b, - bool rootIsWildcard, PredictionContextMergeCache *mergeCache); + static Ref merge(Ref a, + Ref b, + bool rootIsWildcard, + PredictionContextMergeCache *mergeCache); /// /// Merge two instances. @@ -141,8 +78,10 @@ namespace atn { /// {@code true} if this is a local-context merge, /// otherwise false to indicate a full-context merge /// - static Ref mergeSingletons(const Ref &a, - const Ref &b, bool rootIsWildcard, PredictionContextMergeCache *mergeCache); + static Ref mergeSingletons(Ref a, + Ref b, + bool rootIsWildcard, + PredictionContextMergeCache *mergeCache); /** * Handle case where at least one of {@code a} or {@code b} is @@ -182,8 +121,9 @@ namespace atn { * @param rootIsWildcard {@code true} if this is a local-context merge, * otherwise false to indicate a full-context merge */ - static Ref mergeRoot(const Ref &a, - const Ref &b, bool rootIsWildcard); + static Ref mergeRoot(Ref a, + Ref b, + bool rootIsWildcard); /** * Merge two {@link ArrayPredictionContext} instances. @@ -204,65 +144,82 @@ namespace atn { * {@link SingletonPredictionContext}.
*

*/ - static Ref mergeArrays(const Ref &a, - const Ref &b, bool rootIsWildcard, PredictionContextMergeCache *mergeCache); + static Ref mergeArrays(Ref a, + Ref b, + bool rootIsWildcard, + PredictionContextMergeCache *mergeCache); - protected: - /// Make pass over all M parents; merge any equal() ones. - /// @returns true if the list has been changed (i.e. duplicates where found). - static bool combineCommonParents(std::vector> &parents); + static std::string toDOTString(const Ref &context); - public: - static std::string toDOTString(const Ref &context); + static Ref getCachedContext(const Ref &context, + PredictionContextCache &contextCache); - static Ref getCachedContext(const Ref &context, - PredictionContextCache &contextCache, - std::map, Ref> &visited); + static std::vector> getAllContextNodes(const Ref &context); - // ter's recursive version of Sam's getAllNodes() - static std::vector> getAllContextNodes(const Ref &context); - static void getAllContextNodes_(const Ref &context, - std::vector> &nodes, std::set &visited); + /// Convert a RuleContext tree to a PredictionContext graph. + /// Return EMPTY if outerContext is empty. + static Ref fromRuleContext(const ATN &atn, RuleContext *outerContext); - virtual std::string toString() const; - virtual std::string toString(Recognizer *recog) const; + PredictionContext(const PredictionContext&) = delete; - std::vector toStrings(Recognizer *recognizer, int currentState); - std::vector toStrings(Recognizer *recognizer, const Ref &stop, int currentState); - }; + virtual ~PredictionContext() = default; - struct PredictionContextHasher { - size_t operator () (const Ref &k) const { - return k->hashCode(); - } - }; + PredictionContext& operator=(const PredictionContext&) = delete; + PredictionContext& operator=(PredictionContext&&) = delete; - struct PredictionContextComparer { - bool operator () (const Ref &lhs, const Ref &rhs) const - { - if (lhs == rhs) // Object identity. - return true; - return (lhs->hashCode() == rhs->hashCode()) && (*lhs == *rhs); - } - }; + PredictionContextType getContextType() const { return _contextType; } - class PredictionContextMergeCache { - public: - Ref put(Ref const& key1, Ref const& key2, - Ref const& value); - Ref get(Ref const& key1, Ref const& key2); + virtual size_t size() const = 0; + virtual const Ref& getParent(size_t index) const = 0; + virtual size_t getReturnState(size_t index) const = 0; - void clear(); - std::string toString() const; - size_t count() const; + /// This means only the EMPTY (wildcard? not sure) context is in set. + virtual bool isEmpty() const = 0; + bool hasEmptyPath() const; - private: - std::unordered_map, - std::unordered_map, Ref, PredictionContextHasher, PredictionContextComparer>, - PredictionContextHasher, PredictionContextComparer> _data; + size_t hashCode() const; + + virtual bool equals(const PredictionContext &other) const = 0; + virtual std::string toString() const = 0; + + std::vector toStrings(Recognizer *recognizer, int currentState) const; + std::vector toStrings(Recognizer *recognizer, + const Ref &stop, + int currentState) const; + + protected: + explicit PredictionContext(PredictionContextType contextType); + + PredictionContext(PredictionContext&& other); + + virtual size_t hashCodeImpl() const = 0; + + size_t cachedHashCode() const { return _hashCode.load(std::memory_order_relaxed); } + + private: + const PredictionContextType _contextType; + mutable std::atomic _hashCode; }; -} // namespace atn -} // namespace antlr4 + inline bool operator==(const PredictionContext &lhs, const PredictionContext &rhs) { + return lhs.equals(rhs); + } + + inline bool operator!=(const PredictionContext &lhs, const PredictionContext &rhs) { + return !operator==(lhs, rhs); + } + +} // namespace atn +} // namespace antlr4 + +namespace std { + + template <> + struct hash<::antlr4::atn::PredictionContext> { + size_t operator()(const ::antlr4::atn::PredictionContext &predictionContext) const { + return predictionContext.hashCode(); + } + }; +} // namespace std diff --git a/runtime/Cpp/runtime/src/atn/PredictionContextCache.cpp b/runtime/Cpp/runtime/src/atn/PredictionContextCache.cpp new file mode 100644 index 0000000000..031a35cbf7 --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/PredictionContextCache.cpp @@ -0,0 +1,56 @@ +// Copyright 2012-2022 The ANTLR Project +// +// 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 name of the copyright holder 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 HOLDER 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. + +#include "atn/PredictionContextCache.h" + +using namespace antlr4::atn; + +void PredictionContextCache::put(const Ref &value) { + assert(value); + + _data.insert(value); +} + +Ref PredictionContextCache::get( + const Ref &value) const { + assert(value); + + auto iterator = _data.find(value); + if (iterator == _data.end()) { + return nullptr; + } + return *iterator; +} + +size_t PredictionContextCache::PredictionContextHasher::operator()( + const Ref &predictionContext) const { + return predictionContext->hashCode(); +} + +bool PredictionContextCache::PredictionContextComparer::operator()( + const Ref &lhs, + const Ref &rhs) const { + return *lhs == *rhs; +} diff --git a/runtime/Cpp/runtime/src/atn/PredictionContextCache.h b/runtime/Cpp/runtime/src/atn/PredictionContextCache.h new file mode 100644 index 0000000000..909cae1887 --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/PredictionContextCache.h @@ -0,0 +1,64 @@ +// Copyright 2012-2022 The ANTLR Project +// +// 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 name of the copyright holder 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 HOLDER 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. + +#pragma once + +#include + +#include "atn/PredictionContext.h" + +namespace antlr4 { +namespace atn { + + class ANTLR4CPP_PUBLIC PredictionContextCache final { + public: + PredictionContextCache() = default; + + PredictionContextCache(const PredictionContextCache&) = delete; + PredictionContextCache(PredictionContextCache&&) = delete; + + PredictionContextCache& operator=(const PredictionContextCache&) = delete; + PredictionContextCache& operator=(PredictionContextCache&&) = delete; + + void put(const Ref &value); + + Ref get(const Ref &value) const; + + private: + struct ANTLR4CPP_PUBLIC PredictionContextHasher final { + size_t operator()(const Ref &predictionContext) const; + }; + + struct ANTLR4CPP_PUBLIC PredictionContextComparer final { + bool operator()(const Ref &lhs, + const Ref &rhs) const; + }; + + std::unordered_set, + PredictionContextHasher, PredictionContextComparer> _data; + }; + +} // namespace atn +} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.cpp b/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.cpp new file mode 100644 index 0000000000..463b556b71 --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.cpp @@ -0,0 +1,159 @@ +// Copyright 2012-2022 The ANTLR Project +// +// 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 name of the copyright holder 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 HOLDER 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. + +#include "atn/PredictionContextMergeCache.h" + +#include "misc/MurmurHash.h" + +using namespace antlr4::atn; +using namespace antlr4::misc; + +PredictionContextMergeCache::PredictionContextMergeCache( + const PredictionContextMergeCacheOptions &options) : _options(options) {} + +Ref PredictionContextMergeCache::put( + const Ref &key1, + const Ref &key2, + Ref value) { + assert(key1); + assert(key2); + + if (getOptions().getMaxSize() == 0) { + // Cache is effectively disabled. + return value; + } + + auto [existing, inserted] = _entries.try_emplace(std::make_pair(key1.get(), key2.get())); + if (inserted) { + _size++; + try { + existing->second.reset(new Entry()); + } catch (...) { + _entries.erase(existing); + throw; + } + existing->second->key = std::make_pair(key1, key2); + existing->second->value = std::move(value); + pushFront(existing->second.get()); + } else { + if (existing->second->value != value) { + existing->second->value = std::move(value); + } + moveToFront(existing->second.get()); + } + compact(existing->second.get()); + return existing->second->value; +} + +Ref PredictionContextMergeCache::get( + const Ref &key1, + const Ref &key2) const { + assert(key1); + assert(key2); + + if (getOptions().getMaxSize() == 0) { + // Cache is effectively disabled. + return nullptr; + } + + auto iterator = _entries.find(std::make_pair(key1.get(), key2.get())); + if (iterator == _entries.end()) { + return nullptr; + } + moveToFront(iterator->second.get()); + return iterator->second->value; +} + +void PredictionContextMergeCache::clear() { + Container().swap(_entries); + _head = _tail = nullptr; + _size = 0; +} + +void PredictionContextMergeCache::moveToFront(Entry *entry) const { + if (entry->prev == nullptr) { + return; + } + entry->prev->next = entry->next; + if (entry->next) { + entry->next->prev = entry->prev; + } else { + _tail = entry->prev; + } + entry->prev = nullptr; + entry->next = _head; + _head->prev = entry; + _head = entry; +} + +void PredictionContextMergeCache::pushFront(Entry *entry) { + entry->prev = nullptr; + entry->next = _head; + if (_head) { + _head->prev = entry; + } else { + _head = entry; + _tail = entry; + } +} + +void PredictionContextMergeCache::remove(Entry *entry) { + if (entry->prev) { + entry->prev->next = entry->next; + } else { + _head = entry->next; + } + if (entry->next) { + entry->next->prev = entry->prev; + } else { + _tail = entry->prev; + } + --_size; + _entries.erase(std::make_pair(entry->key.first.get(), entry->key.second.get())); +} + +void PredictionContextMergeCache::compact(const Entry *preserve) { + Entry *entry = _tail; + while (entry != nullptr && _size > getOptions().getMaxSize()) { + Entry *next = entry->next; + if (entry != preserve) { + remove(entry); + } + entry = next; + } +} + +size_t PredictionContextMergeCache::PredictionContextHasher::operator()( + const PredictionContextPair &value) const { + size_t hash = MurmurHash::initialize(); + hash = MurmurHash::update(hash, value.first->hashCode()); + hash = MurmurHash::update(hash, value.second->hashCode()); + return MurmurHash::finish(hash, 2); +} + +bool PredictionContextMergeCache::PredictionContextComparer::operator()( + const PredictionContextPair &lhs, const PredictionContextPair &rhs) const { + return *lhs.first == *rhs.first && *lhs.second == *rhs.second; +} diff --git a/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.h b/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.h new file mode 100644 index 0000000000..694ffd08aa --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.h @@ -0,0 +1,101 @@ +// Copyright 2012-2022 The ANTLR Project +// +// 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 name of the copyright holder 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 HOLDER 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. + +#pragma once + +#include +#include + +#include "atn/PredictionContext.h" +#include "atn/PredictionContextMergeCacheOptions.h" + +namespace antlr4 { +namespace atn { + + class ANTLR4CPP_PUBLIC PredictionContextMergeCache final { + public: + PredictionContextMergeCache() + : PredictionContextMergeCache(PredictionContextMergeCacheOptions()) {} + + explicit PredictionContextMergeCache(const PredictionContextMergeCacheOptions &options); + + PredictionContextMergeCache(const PredictionContextMergeCache&) = delete; + PredictionContextMergeCache(PredictionContextMergeCache&&) = delete; + + PredictionContextMergeCache& operator=(const PredictionContextMergeCache&) = delete; + PredictionContextMergeCache& operator=(PredictionContextMergeCache&&) = delete; + + Ref put(const Ref &key1, + const Ref &key2, + Ref value); + + Ref get(const Ref &key1, + const Ref &key2) const; + + const PredictionContextMergeCacheOptions& getOptions() const { return _options; } + + void clear(); + + private: + using PredictionContextPair = std::pair; + + struct ANTLR4CPP_PUBLIC PredictionContextHasher final { + size_t operator()(const PredictionContextPair &value) const; + }; + + struct ANTLR4CPP_PUBLIC PredictionContextComparer final { + bool operator()(const PredictionContextPair &lhs, const PredictionContextPair &rhs) const; + }; + + struct ANTLR4CPP_PUBLIC Entry final { + std::pair, Ref> key; + Ref value; + Entry *prev = nullptr; + Entry *next = nullptr; + }; + + void moveToFront(Entry *entry) const; + + void pushFront(Entry *entry); + + void remove(Entry *entry); + + void compact(const Entry *preserve); + + using Container = std::unordered_map, + PredictionContextHasher, PredictionContextComparer>; + + const PredictionContextMergeCacheOptions _options; + + Container _entries; + + mutable Entry *_head = nullptr; + mutable Entry *_tail = nullptr; + + size_t _size = 0; + }; + +} // namespace atn +} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/PredictionContextMergeCacheOptions.h b/runtime/Cpp/runtime/src/atn/PredictionContextMergeCacheOptions.h new file mode 100644 index 0000000000..7331cc17e0 --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/PredictionContextMergeCacheOptions.h @@ -0,0 +1,71 @@ +// Copyright 2012-2022 The ANTLR Project +// +// 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 name of the copyright holder 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 HOLDER 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. + +#pragma once + +#include +#include +#include + +#include "antlr4-common.h" + +namespace antlr4 { +namespace atn { + + class ANTLR4CPP_PUBLIC PredictionContextMergeCacheOptions final { + public: + PredictionContextMergeCacheOptions() = default; + + size_t getMaxSize() const { return _maxSize; } + + bool hasMaxSize() const { return getMaxSize() != std::numeric_limits::max(); } + + PredictionContextMergeCacheOptions& setMaxSize(size_t maxSize) { + _maxSize = maxSize; + return *this; + } + + size_t getClearEveryN() const { + return _clearEveryN; + } + + bool hasClearEveryN() const { return getClearEveryN() != 0; } + + PredictionContextMergeCacheOptions& setClearEveryN(uint64_t clearEveryN) { + _clearEveryN = clearEveryN; + return *this; + } + + PredictionContextMergeCacheOptions& neverClear() { + return setClearEveryN(0); + } + + private: + size_t _maxSize = std::numeric_limits::max(); + uint64_t _clearEveryN = 1; + }; + +} // namespace atn +} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/PredictionContextType.h b/runtime/Cpp/runtime/src/atn/PredictionContextType.h new file mode 100644 index 0000000000..c8c4473e13 --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/PredictionContextType.h @@ -0,0 +1,21 @@ +/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +#pragma once + +#include + +#include "antlr4-common.h" + +namespace antlr4 { +namespace atn { + + enum class PredictionContextType : size_t { + SINGLETON = 1, + ARRAY = 2, + }; + +} // namespace atn +} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/PredictionMode.cpp b/runtime/Cpp/runtime/src/atn/PredictionMode.cpp index d15a8268f4..8537747813 100755 --- a/runtime/Cpp/runtime/src/atn/PredictionMode.cpp +++ b/runtime/Cpp/runtime/src/atn/PredictionMode.cpp @@ -62,7 +62,7 @@ bool PredictionModeClass::hasSLLConflictTerminatingPrediction(PredictionMode mod // dup configs, tossing out semantic predicates ATNConfigSet dup(true); for (auto &config : configs->configs) { - Ref c = std::make_shared(config, SemanticContext::NONE); + Ref c = std::make_shared(*config, SemanticContext::NONE); dup.add(c); } std::vector altsets = getConflictingAltSubsets(&dup); @@ -73,8 +73,8 @@ bool PredictionModeClass::hasSLLConflictTerminatingPrediction(PredictionMode mod } bool PredictionModeClass::hasConfigInRuleStopState(ATNConfigSet *configs) { - for (auto &c : configs->configs) { - if (is(c->state)) { + for (const auto &config : configs->configs) { + if (RuleStopState::is(config->state)) { return true; } } @@ -83,8 +83,8 @@ bool PredictionModeClass::hasConfigInRuleStopState(ATNConfigSet *configs) { } bool PredictionModeClass::allConfigsInRuleStopStates(ATNConfigSet *configs) { - for (auto &config : configs->configs) { - if (!is(config->state)) { + for (const auto &config : configs->configs) { + if (!RuleStopState::is(config->state)) { return false; } } @@ -142,7 +142,7 @@ size_t PredictionModeClass::getUniqueAlt(const std::vector& al antlrcpp::BitSet PredictionModeClass::getAlts(const std::vector& altsets) { antlrcpp::BitSet all; - for (antlrcpp::BitSet alts : altsets) { + for (const auto &alts : altsets) { all |= alts; } @@ -151,43 +151,44 @@ antlrcpp::BitSet PredictionModeClass::getAlts(const std::vectorconfigs) { + for (const auto &config : configs->configs) { alts.set(config->alt); } return alts; } std::vector PredictionModeClass::getConflictingAltSubsets(ATNConfigSet *configs) { - std::unordered_map configToAlts; + std::unordered_map configToAlts; for (auto &config : configs->configs) { configToAlts[config.get()].set(config->alt); } std::vector values; - for (auto it : configToAlts) { - values.push_back(it.second); + values.reserve(configToAlts.size()); + for (const auto &pair : configToAlts) { + values.push_back(pair.second); } return values; } -std::map PredictionModeClass::getStateToAltMap(ATNConfigSet *configs) { - std::map m; - for (auto &c : configs->configs) { +std::unordered_map PredictionModeClass::getStateToAltMap(ATNConfigSet *configs) { + std::unordered_map m; + for (const auto &c : configs->configs) { m[c->state].set(c->alt); } return m; } bool PredictionModeClass::hasStateAssociatedWithOneAlt(ATNConfigSet *configs) { - std::map x = getStateToAltMap(configs); - for (std::map::iterator it = x.begin(); it != x.end(); it++){ - if (it->second.count() == 1) return true; + auto x = getStateToAltMap(configs); + for (const auto &pair : x){ + if (pair.second.count() == 1) return true; } return false; } size_t PredictionModeClass::getSingleViableAlt(const std::vector& altsets) { antlrcpp::BitSet viableAlts; - for (antlrcpp::BitSet alts : altsets) { + for (const auto &alts : altsets) { size_t minAlt = alts.nextSetBit(0); viableAlts.set(minAlt); diff --git a/runtime/Cpp/runtime/src/atn/PredictionMode.h b/runtime/Cpp/runtime/src/atn/PredictionMode.h index 726f4cf40f..11d1bbe034 100755 --- a/runtime/Cpp/runtime/src/atn/PredictionMode.h +++ b/runtime/Cpp/runtime/src/atn/PredictionMode.h @@ -425,7 +425,7 @@ namespace atn { /// cref="ATNConfig#alt alt"/> /// ///
- static std::map getStateToAltMap(ATNConfigSet *configs); + static std::unordered_map getStateToAltMap(ATNConfigSet *configs); static bool hasStateAssociatedWithOneAlt(ATNConfigSet *configs); diff --git a/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp b/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp index 62fc12f0ac..9fd86d67d4 100755 --- a/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp +++ b/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp @@ -112,10 +112,10 @@ std::unique_ptr ProfilingATNSimulator::computeReachSet(ATNConfigSe return reachConfigs; } -bool ProfilingATNSimulator::evalSemanticContext(Ref const& pred, ParserRuleContext *parserCallStack, +bool ProfilingATNSimulator::evalSemanticContext(Ref const& pred, ParserRuleContext *parserCallStack, size_t alt, bool fullCtx) { bool result = ParserATNSimulator::evalSemanticContext(pred, parserCallStack, alt, fullCtx); - if (!(std::dynamic_pointer_cast(pred) != nullptr)) { + if (!(std::dynamic_pointer_cast(pred) != nullptr)) { bool fullContext = _llStopIndex >= 0; int stopIndex = fullContext ? _llStopIndex : _sllStopIndex; _decisions[_currentDecision].predicateEvals.push_back( diff --git a/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h b/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h index 79ecd00b48..551efb8556 100755 --- a/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h +++ b/runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.h @@ -13,7 +13,7 @@ namespace atn { class ANTLR4CPP_PUBLIC ProfilingATNSimulator : public ParserATNSimulator { public: - ProfilingATNSimulator(Parser *parser); + explicit ProfilingATNSimulator(Parser *parser); virtual size_t adaptivePredict(TokenStream *input, size_t decision, ParserRuleContext *outerContext) override; @@ -46,7 +46,7 @@ namespace atn { virtual dfa::DFAState* getExistingTargetState(dfa::DFAState *previousD, size_t t) override; virtual dfa::DFAState* computeTargetState(dfa::DFA &dfa, dfa::DFAState *previousD, size_t t) override; virtual std::unique_ptr computeReachSet(ATNConfigSet *closure, size_t t, bool fullCtx) override; - virtual bool evalSemanticContext(Ref const& pred, ParserRuleContext *parserCallStack, + virtual bool evalSemanticContext(Ref const& pred, ParserRuleContext *parserCallStack, size_t alt, bool fullCtx) override; virtual void reportAttemptingFullContext(dfa::DFA &dfa, const antlrcpp::BitSet &conflictingAlts, ATNConfigSet *configs, size_t startIndex, size_t stopIndex) override; diff --git a/runtime/Cpp/runtime/src/atn/RangeTransition.cpp b/runtime/Cpp/runtime/src/atn/RangeTransition.cpp index 58d668c45e..101a3bb0c3 100755 --- a/runtime/Cpp/runtime/src/atn/RangeTransition.cpp +++ b/runtime/Cpp/runtime/src/atn/RangeTransition.cpp @@ -10,11 +10,7 @@ using namespace antlr4; using namespace antlr4::atn; -RangeTransition::RangeTransition(ATNState *target, size_t from, size_t to) : Transition(target), from(from), to(to) { -} - -Transition::SerializationType RangeTransition::getSerializationType() const { - return RANGE; +RangeTransition::RangeTransition(ATNState *target, size_t from, size_t to) : Transition(TransitionType::RANGE, target), from(from), to(to) { } misc::IntervalSet RangeTransition::label() const { diff --git a/runtime/Cpp/runtime/src/atn/RangeTransition.h b/runtime/Cpp/runtime/src/atn/RangeTransition.h index 14093e2f91..721b712d41 100755 --- a/runtime/Cpp/runtime/src/atn/RangeTransition.h +++ b/runtime/Cpp/runtime/src/atn/RangeTransition.h @@ -12,13 +12,15 @@ namespace atn { class ANTLR4CPP_PUBLIC RangeTransition final : public Transition { public: + static bool is(const Transition &transition) { return transition.getTransitionType() == TransitionType::RANGE; } + + static bool is(const Transition *transition) { return transition != nullptr && is(*transition); } + const size_t from; const size_t to; RangeTransition(ATNState *target, size_t from, size_t to); - virtual SerializationType getSerializationType() const override; - virtual misc::IntervalSet label() const override; virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; diff --git a/runtime/Cpp/runtime/src/atn/RuleStartState.cpp b/runtime/Cpp/runtime/src/atn/RuleStartState.cpp deleted file mode 100755 index 555f8c2e93..0000000000 --- a/runtime/Cpp/runtime/src/atn/RuleStartState.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/RuleStartState.h" - -using namespace antlr4::atn; - -RuleStartState::RuleStartState() { - isLeftRecursiveRule = false; -} - -size_t RuleStartState::getStateType() { - return RULE_START; -} diff --git a/runtime/Cpp/runtime/src/atn/RuleStartState.h b/runtime/Cpp/runtime/src/atn/RuleStartState.h index 94ab0e4138..0d396dfcbb 100755 --- a/runtime/Cpp/runtime/src/atn/RuleStartState.h +++ b/runtime/Cpp/runtime/src/atn/RuleStartState.h @@ -12,13 +12,14 @@ namespace atn { class ANTLR4CPP_PUBLIC RuleStartState final : public ATNState { public: - RuleStartState(); + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::RULE_START; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } RuleStopState *stopState = nullptr; bool isLeftRecursiveRule = false; - virtual size_t getStateType() override; - + RuleStartState() : ATNState(ATNStateType::RULE_START) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/RuleStopState.cpp b/runtime/Cpp/runtime/src/atn/RuleStopState.cpp deleted file mode 100755 index 3ceece4c77..0000000000 --- a/runtime/Cpp/runtime/src/atn/RuleStopState.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/RuleStopState.h" - -using namespace antlr4::atn; - -size_t RuleStopState::getStateType() { - return RULE_STOP; -} diff --git a/runtime/Cpp/runtime/src/atn/RuleStopState.h b/runtime/Cpp/runtime/src/atn/RuleStopState.h index 8a4a580f6a..e5f4dc4ca9 100755 --- a/runtime/Cpp/runtime/src/atn/RuleStopState.h +++ b/runtime/Cpp/runtime/src/atn/RuleStopState.h @@ -15,10 +15,12 @@ namespace atn { /// references to all calls to this rule to compute FOLLOW sets for /// error handling. class ANTLR4CPP_PUBLIC RuleStopState final : public ATNState { - public: - virtual size_t getStateType() override; + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::RULE_STOP; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } + RuleStopState() : ATNState(ATNStateType::RULE_STOP) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/RuleTransition.cpp b/runtime/Cpp/runtime/src/atn/RuleTransition.cpp index c52f16d187..f2f7f70729 100755 --- a/runtime/Cpp/runtime/src/atn/RuleTransition.cpp +++ b/runtime/Cpp/runtime/src/atn/RuleTransition.cpp @@ -13,14 +13,10 @@ RuleTransition::RuleTransition(RuleStartState *ruleStart, size_t ruleIndex, ATNS } RuleTransition::RuleTransition(RuleStartState *ruleStart, size_t ruleIndex, int precedence, ATNState *followState) - : Transition(ruleStart), ruleIndex(ruleIndex), precedence(precedence) { + : Transition(TransitionType::RULE, ruleStart), ruleIndex(ruleIndex), precedence(precedence) { this->followState = followState; } -Transition::SerializationType RuleTransition::getSerializationType() const { - return RULE; -} - bool RuleTransition::isEpsilon() const { return true; } diff --git a/runtime/Cpp/runtime/src/atn/RuleTransition.h b/runtime/Cpp/runtime/src/atn/RuleTransition.h index 50d3d29dee..943152d09a 100755 --- a/runtime/Cpp/runtime/src/atn/RuleTransition.h +++ b/runtime/Cpp/runtime/src/atn/RuleTransition.h @@ -10,8 +10,12 @@ namespace antlr4 { namespace atn { - class ANTLR4CPP_PUBLIC RuleTransition : public Transition { + class ANTLR4CPP_PUBLIC RuleTransition final : public Transition { public: + static bool is(const Transition &transition) { return transition.getTransitionType() == TransitionType::RULE; } + + static bool is(const Transition *transition) { return transition != nullptr && is(*transition); } + /// Ptr to the rule definition object for this rule ref. const size_t ruleIndex; // no Rule object at runtime @@ -28,8 +32,6 @@ namespace atn { RuleTransition(RuleTransition const&) = delete; RuleTransition& operator=(RuleTransition const&) = delete; - virtual SerializationType getSerializationType() const override; - virtual bool isEpsilon() const override; virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; diff --git a/runtime/Cpp/runtime/src/atn/SemanticContext.cpp b/runtime/Cpp/runtime/src/atn/SemanticContext.cpp index 0531e37f8c..7ac88cceeb 100755 --- a/runtime/Cpp/runtime/src/atn/SemanticContext.cpp +++ b/runtime/Cpp/runtime/src/atn/SemanticContext.cpp @@ -3,7 +3,11 @@ * can be found in the LICENSE.txt file in the project root. */ +#include +#include + #include "misc/MurmurHash.h" +#include "support/Casts.h" #include "support/CPPUtils.h" #include "support/Arrays.h" @@ -13,41 +17,109 @@ using namespace antlr4; using namespace antlr4::atn; using namespace antlrcpp; -//------------------ Predicate ----------------------------------------------------------------------------------------- +namespace { -SemanticContext::Predicate::Predicate() : Predicate(INVALID_INDEX, INVALID_INDEX, false) { -} + struct SemanticContextHasher final { + size_t operator()(const SemanticContext *semanticContext) const { + return semanticContext->hashCode(); + } + }; + + struct SemanticContextComparer final { + bool operator()(const SemanticContext *lhs, const SemanticContext *rhs) const { + return *lhs == *rhs; + } + }; + + template + void insertSemanticContext(const Ref &semanticContext, + std::unordered_set &operandSet, + std::vector> &operandList, + Ref &precedencePredicate, + Comparer comparer) { + if (semanticContext != nullptr) { + if (semanticContext->getContextType() == SemanticContextType::PRECEDENCE) { + if (precedencePredicate == nullptr || comparer(downCast(semanticContext.get())->precedence, precedencePredicate->precedence)) { + precedencePredicate = std::static_pointer_cast(semanticContext); + } + } else { + auto [existing, inserted] = operandSet.insert(semanticContext.get()); + if (inserted) { + operandList.push_back(semanticContext); + } + } + } + } + + template + void insertSemanticContext(Ref &&semanticContext, + std::unordered_set &operandSet, + std::vector> &operandList, + Ref &precedencePredicate, + Comparer comparer) { + if (semanticContext != nullptr) { + if (semanticContext->getContextType() == SemanticContextType::PRECEDENCE) { + if (precedencePredicate == nullptr || comparer(downCast(semanticContext.get())->precedence, precedencePredicate->precedence)) { + precedencePredicate = std::static_pointer_cast(std::move(semanticContext)); + } + } else { + auto [existing, inserted] = operandSet.insert(semanticContext.get()); + if (inserted) { + operandList.push_back(std::move(semanticContext)); + } + } + } + } + + size_t predictOperandCapacity(const Ref &x) { + switch (x->getContextType()) { + case SemanticContextType::AND: + return downCast(*x).getOperands().size(); + case SemanticContextType::OR: + return downCast(*x).getOperands().size(); + default: + return 1; + } + } + + size_t predictOperandCapacity(const Ref &a, const Ref &b) { + return predictOperandCapacity(a) + predictOperandCapacity(b); + } -SemanticContext::Predicate::Predicate(size_t ruleIndex, size_t predIndex, bool isCtxDependent) -: ruleIndex(ruleIndex), predIndex(predIndex), isCtxDependent(isCtxDependent) { } +//------------------ Predicate ----------------------------------------------------------------------------------------- -bool SemanticContext::Predicate::eval(Recognizer *parser, RuleContext *parserCallStack) { +SemanticContext::Predicate::Predicate(size_t ruleIndex, size_t predIndex, bool isCtxDependent) + : SemanticContext(SemanticContextType::PREDICATE), ruleIndex(ruleIndex), predIndex(predIndex), isCtxDependent(isCtxDependent) {} + +bool SemanticContext::Predicate::eval(Recognizer *parser, RuleContext *parserCallStack) const { RuleContext *localctx = nullptr; - if (isCtxDependent) + if (isCtxDependent) { localctx = parserCallStack; + } return parser->sempred(localctx, ruleIndex, predIndex); } size_t SemanticContext::Predicate::hashCode() const { size_t hashCode = misc::MurmurHash::initialize(); + hashCode = misc::MurmurHash::update(hashCode, static_cast(getContextType())); hashCode = misc::MurmurHash::update(hashCode, ruleIndex); hashCode = misc::MurmurHash::update(hashCode, predIndex); hashCode = misc::MurmurHash::update(hashCode, isCtxDependent ? 1 : 0); - hashCode = misc::MurmurHash::finish(hashCode, 3); + hashCode = misc::MurmurHash::finish(hashCode, 4); return hashCode; } -bool SemanticContext::Predicate::operator == (const SemanticContext &other) const { - if (this == &other) +bool SemanticContext::Predicate::equals(const SemanticContext &other) const { + if (this == &other) { return true; - - const Predicate *p = dynamic_cast(&other); - if (p == nullptr) + } + if (getContextType() != other.getContextType()) { return false; - - return ruleIndex == p->ruleIndex && predIndex == p->predIndex && isCtxDependent == p->isCtxDependent; + } + const Predicate &p = downCast(other); + return ruleIndex == p.ruleIndex && predIndex == p.predIndex && isCtxDependent == p.isCtxDependent; } std::string SemanticContext::Predicate::toString() const { @@ -56,45 +128,36 @@ std::string SemanticContext::Predicate::toString() const { //------------------ PrecedencePredicate ------------------------------------------------------------------------------- -SemanticContext::PrecedencePredicate::PrecedencePredicate() : precedence(0) { -} +SemanticContext::PrecedencePredicate::PrecedencePredicate(int precedence) : SemanticContext(SemanticContextType::PRECEDENCE), precedence(precedence) {} -SemanticContext::PrecedencePredicate::PrecedencePredicate(int precedence) : precedence(precedence) { -} - -bool SemanticContext::PrecedencePredicate::eval(Recognizer *parser, RuleContext *parserCallStack) { +bool SemanticContext::PrecedencePredicate::eval(Recognizer *parser, RuleContext *parserCallStack) const { return parser->precpred(parserCallStack, precedence); } -Ref SemanticContext::PrecedencePredicate::evalPrecedence(Recognizer *parser, - RuleContext *parserCallStack) { +Ref SemanticContext::PrecedencePredicate::evalPrecedence(Recognizer *parser, + RuleContext *parserCallStack) const { if (parser->precpred(parserCallStack, precedence)) { return SemanticContext::NONE; } - else { - return nullptr; - } -} - -int SemanticContext::PrecedencePredicate::compareTo(PrecedencePredicate *o) { - return precedence - o->precedence; + return nullptr; } size_t SemanticContext::PrecedencePredicate::hashCode() const { - size_t hashCode = 1; - hashCode = 31 * hashCode + static_cast(precedence); - return hashCode; + size_t hashCode = misc::MurmurHash::initialize(); + hashCode = misc::MurmurHash::update(hashCode, static_cast(getContextType())); + hashCode = misc::MurmurHash::update(hashCode, static_cast(precedence)); + return misc::MurmurHash::finish(hashCode, 2); } -bool SemanticContext::PrecedencePredicate::operator == (const SemanticContext &other) const { - if (this == &other) +bool SemanticContext::PrecedencePredicate::equals(const SemanticContext &other) const { + if (this == &other) { return true; - - const PrecedencePredicate *predicate = dynamic_cast(&other); - if (predicate == nullptr) + } + if (getContextType() != other.getContextType()) { return false; - - return precedence == predicate->precedence; + } + const PrecedencePredicate &predicate = downCast(other); + return precedence == predicate.precedence; } std::string SemanticContext::PrecedencePredicate::toString() const { @@ -103,61 +166,60 @@ std::string SemanticContext::PrecedencePredicate::toString() const { //------------------ AND ----------------------------------------------------------------------------------------------- -SemanticContext::AND::AND(Ref const& a, Ref const& b) { - Set operands; +SemanticContext::AND::AND(Ref a, Ref b) : Operator(SemanticContextType::AND) { + std::unordered_set operands; + Ref precedencePredicate; - if (is(a)) { - for (auto operand : std::dynamic_pointer_cast(a)->opnds) { - operands.insert(operand); + _opnds.reserve(predictOperandCapacity(a, b) + 1); + + if (a->getContextType() == SemanticContextType::AND) { + for (const auto &operand : downCast(a.get())->getOperands()) { + insertSemanticContext(operand, operands, _opnds, precedencePredicate, std::less{}); } } else { - operands.insert(a); + insertSemanticContext(std::move(a), operands, _opnds, precedencePredicate, std::less{}); } - if (is(b)) { - for (auto operand : std::dynamic_pointer_cast(b)->opnds) { - operands.insert(operand); + if (b->getContextType() == SemanticContextType::AND) { + for (const auto &operand : downCast(b.get())->getOperands()) { + insertSemanticContext(operand, operands, _opnds, precedencePredicate, std::less{}); } } else { - operands.insert(b); + insertSemanticContext(std::move(b), operands, _opnds, precedencePredicate, std::less{}); } - std::vector> precedencePredicates = filterPrecedencePredicates(operands); - - if (!precedencePredicates.empty()) { + if (precedencePredicate != nullptr) { // interested in the transition with the lowest precedence - auto predicate = [](Ref const& a, Ref const& b) { - return a->precedence < b->precedence; - }; - - auto reduced = std::min_element(precedencePredicates.begin(), precedencePredicates.end(), predicate); - operands.insert(*reduced); + auto [existing, inserted] = operands.insert(precedencePredicate.get()); + if (inserted) { + _opnds.push_back(std::move(precedencePredicate)); + } } - - std::copy(operands.begin(), operands.end(), std::back_inserter(opnds)); } -std::vector> SemanticContext::AND::getOperands() const { - return opnds; +const std::vector>& SemanticContext::AND::getOperands() const { + return _opnds; } -bool SemanticContext::AND::operator == (const SemanticContext &other) const { - if (this == &other) +bool SemanticContext::AND::equals(const SemanticContext &other) const { + if (this == &other) { return true; - - const AND *context = dynamic_cast(&other); - if (context == nullptr) + } + if (getContextType() != other.getContextType()) { return false; - - return Arrays::equals(opnds, context->opnds); + } + const AND &context = downCast(other); + return Arrays::equals(getOperands(), context.getOperands()); } size_t SemanticContext::AND::hashCode() const { - return misc::MurmurHash::hashCode(opnds, typeid(AND).hash_code()); + size_t hash = misc::MurmurHash::initialize(); + hash = misc::MurmurHash::update(hash, static_cast(getContextType())); + return misc::MurmurHash::hashCode(getOperands(), hash); } -bool SemanticContext::AND::eval(Recognizer *parser, RuleContext *parserCallStack) { - for (auto opnd : opnds) { +bool SemanticContext::AND::eval(Recognizer *parser, RuleContext *parserCallStack) const { + for (const auto &opnd : getOperands()) { if (!opnd->eval(parser, parserCallStack)) { return false; } @@ -165,18 +227,19 @@ bool SemanticContext::AND::eval(Recognizer *parser, RuleContext *parserCallStack return true; } -Ref SemanticContext::AND::evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) { +Ref SemanticContext::AND::evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) const { bool differs = false; - std::vector> operands; - for (auto context : opnds) { - Ref evaluated = context->evalPrecedence(parser, parserCallStack); + std::vector> operands; + for (const auto &context : getOperands()) { + auto evaluated = context->evalPrecedence(parser, parserCallStack); differs |= (evaluated != context); if (evaluated == nullptr) { // The AND context is false if any element is false. return nullptr; - } else if (evaluated != NONE) { + } + if (evaluated != NONE) { // Reduce the result by skipping true elements. - operands.push_back(evaluated); + operands.push_back(std::move(evaluated)); } } @@ -189,9 +252,9 @@ Ref SemanticContext::AND::evalPrecedence(Recognizer *parser, Ru return NONE; } - Ref result = operands[0]; + Ref result = std::move(operands[0]); for (size_t i = 1; i < operands.size(); ++i) { - result = SemanticContext::And(result, operands[i]); + result = SemanticContext::And(std::move(result), std::move(operands[i])); } return result; @@ -199,7 +262,7 @@ Ref SemanticContext::AND::evalPrecedence(Recognizer *parser, Ru std::string SemanticContext::AND::toString() const { std::string tmp; - for (auto var : opnds) { + for (const auto &var : getOperands()) { tmp += var->toString() + " && "; } return tmp; @@ -207,59 +270,60 @@ std::string SemanticContext::AND::toString() const { //------------------ OR ------------------------------------------------------------------------------------------------ -SemanticContext::OR::OR(Ref const& a, Ref const& b) { - Set operands; +SemanticContext::OR::OR(Ref a, Ref b) : Operator(SemanticContextType::OR) { + std::unordered_set operands; + Ref precedencePredicate; + + _opnds.reserve(predictOperandCapacity(a, b) + 1); - if (is(a)) { - for (auto operand : std::dynamic_pointer_cast(a)->opnds) { - operands.insert(operand); + if (a->getContextType() == SemanticContextType::OR) { + for (const auto &operand : downCast(a.get())->getOperands()) { + insertSemanticContext(operand, operands, _opnds, precedencePredicate, std::greater{}); } } else { - operands.insert(a); + insertSemanticContext(std::move(a), operands, _opnds, precedencePredicate, std::greater{}); } - if (is(b)) { - for (auto operand : std::dynamic_pointer_cast(b)->opnds) { - operands.insert(operand); + if (b->getContextType() == SemanticContextType::OR) { + for (const auto &operand : downCast(b.get())->getOperands()) { + insertSemanticContext(operand, operands, _opnds, precedencePredicate, std::greater{}); } } else { - operands.insert(b); + insertSemanticContext(std::move(b), operands, _opnds, precedencePredicate, std::greater{}); } - std::vector> precedencePredicates = filterPrecedencePredicates(operands); - if (!precedencePredicates.empty()) { + if (precedencePredicate != nullptr) { // interested in the transition with the highest precedence - auto predicate = [](Ref const& a, Ref const& b) { - return a->precedence < b->precedence; - }; - auto reduced = std::max_element(precedencePredicates.begin(), precedencePredicates.end(), predicate); - operands.insert(*reduced); + auto [existing, inserted] = operands.insert(precedencePredicate.get()); + if (inserted) { + _opnds.push_back(std::move(precedencePredicate)); + } } - - std::copy(operands.begin(), operands.end(), std::back_inserter(opnds)); } -std::vector> SemanticContext::OR::getOperands() const { - return opnds; +const std::vector>& SemanticContext::OR::getOperands() const { + return _opnds; } -bool SemanticContext::OR::operator == (const SemanticContext &other) const { - if (this == &other) +bool SemanticContext::OR::equals(const SemanticContext &other) const { + if (this == &other) { return true; - - const OR *context = dynamic_cast(&other); - if (context == nullptr) + } + if (getContextType() != other.getContextType()) { return false; - - return Arrays::equals(opnds, context->opnds); + } + const OR &context = downCast(other); + return Arrays::equals(getOperands(), context.getOperands()); } size_t SemanticContext::OR::hashCode() const { - return misc::MurmurHash::hashCode(opnds, typeid(OR).hash_code()); + size_t hash = misc::MurmurHash::initialize(); + hash = misc::MurmurHash::update(hash, static_cast(getContextType())); + return misc::MurmurHash::hashCode(getOperands(), hash); } -bool SemanticContext::OR::eval(Recognizer *parser, RuleContext *parserCallStack) { - for (auto opnd : opnds) { +bool SemanticContext::OR::eval(Recognizer *parser, RuleContext *parserCallStack) const { + for (const auto &opnd : getOperands()) { if (opnd->eval(parser, parserCallStack)) { return true; } @@ -267,18 +331,19 @@ bool SemanticContext::OR::eval(Recognizer *parser, RuleContext *parserCallStack) return false; } -Ref SemanticContext::OR::evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) { +Ref SemanticContext::OR::evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) const { bool differs = false; - std::vector> operands; - for (auto context : opnds) { - Ref evaluated = context->evalPrecedence(parser, parserCallStack); + std::vector> operands; + for (const auto &context : getOperands()) { + auto evaluated = context->evalPrecedence(parser, parserCallStack); differs |= (evaluated != context); if (evaluated == NONE) { // The OR context is true if any element is true. return NONE; - } else if (evaluated != nullptr) { + } + if (evaluated != nullptr) { // Reduce the result by skipping false elements. - operands.push_back(evaluated); + operands.push_back(std::move(evaluated)); } } @@ -291,9 +356,9 @@ Ref SemanticContext::OR::evalPrecedence(Recognizer *parser, Rul return nullptr; } - Ref result = operands[0]; + Ref result = std::move(operands[0]); for (size_t i = 1; i < operands.size(); ++i) { - result = SemanticContext::Or(result, operands[i]); + result = SemanticContext::Or(std::move(result), std::move(operands[i])); } return result; @@ -301,7 +366,7 @@ Ref SemanticContext::OR::evalPrecedence(Recognizer *parser, Rul std::string SemanticContext::OR::toString() const { std::string tmp; - for(auto var : opnds) { + for(const auto &var : getOperands()) { tmp += var->toString() + " || "; } return tmp; @@ -309,20 +374,13 @@ std::string SemanticContext::OR::toString() const { //------------------ SemanticContext ----------------------------------------------------------------------------------- -const Ref SemanticContext::NONE = std::make_shared(INVALID_INDEX, INVALID_INDEX, false); - -SemanticContext::~SemanticContext() { -} +const Ref SemanticContext::NONE = std::make_shared(INVALID_INDEX, INVALID_INDEX, false); -bool SemanticContext::operator != (const SemanticContext &other) const { - return !(*this == other); -} - -Ref SemanticContext::evalPrecedence(Recognizer * /*parser*/, RuleContext * /*parserCallStack*/) { +Ref SemanticContext::evalPrecedence(Recognizer * /*parser*/, RuleContext * /*parserCallStack*/) const { return shared_from_this(); } -Ref SemanticContext::And(Ref const& a, Ref const& b) { +Ref SemanticContext::And(Ref a, Ref b) { if (!a || a == NONE) { return b; } @@ -331,15 +389,15 @@ Ref SemanticContext::And(Ref const& a, Ref result = std::make_shared(a, b); - if (result->opnds.size() == 1) { - return result->opnds[0]; + Ref result = std::make_shared(std::move(a), std::move(b)); + if (result->getOperands().size() == 1) { + return result->getOperands()[0]; } return result; } -Ref SemanticContext::Or(Ref const& a, Ref const& b) { +Ref SemanticContext::Or(Ref a, Ref b) { if (!a) { return b; } @@ -351,27 +409,10 @@ Ref SemanticContext::Or(Ref const& a, Ref result = std::make_shared(a, b); - if (result->opnds.size() == 1) { - return result->opnds[0]; + Ref result = std::make_shared(std::move(a), std::move(b)); + if (result->getOperands().size() == 1) { + return result->getOperands()[0]; } return result; } - -std::vector> SemanticContext::filterPrecedencePredicates(const Set &collection) { - std::vector> result; - for (auto context : collection) { - if (antlrcpp::is(context)) { - result.push_back(std::dynamic_pointer_cast(context)); - } - } - - return result; -} - - -//------------------ Operator ----------------------------------------------------------------------------------------- - -SemanticContext::Operator::~Operator() { -} diff --git a/runtime/Cpp/runtime/src/atn/SemanticContext.h b/runtime/Cpp/runtime/src/atn/SemanticContext.h index 7ccc16c841..367b726a4a 100755 --- a/runtime/Cpp/runtime/src/atn/SemanticContext.h +++ b/runtime/Cpp/runtime/src/atn/SemanticContext.h @@ -7,6 +7,7 @@ #include "Recognizer.h" #include "support/CPPUtils.h" +#include "atn/SemanticContextType.h" namespace antlr4 { namespace atn { @@ -19,36 +20,15 @@ namespace atn { /// SemanticContext within the scope of this outer class. class ANTLR4CPP_PUBLIC SemanticContext : public std::enable_shared_from_this { public: - struct Hasher - { - size_t operator()(Ref const& k) const { - return k->hashCode(); - } - }; - - struct Comparer { - bool operator()(Ref const& lhs, Ref const& rhs) const { - if (lhs == rhs) - return true; - return (lhs->hashCode() == rhs->hashCode()) && (*lhs == *rhs); - } - }; - - - using Set = std::unordered_set, Hasher, Comparer>; - /** * The default {@link SemanticContext}, which is semantically equivalent to * a predicate of the form {@code {true}?}. */ - static const Ref NONE; + static const Ref NONE; - virtual ~SemanticContext(); + virtual ~SemanticContext() = default; - virtual size_t hashCode() const = 0; - virtual std::string toString() const = 0; - virtual bool operator == (const SemanticContext &other) const = 0; - virtual bool operator != (const SemanticContext &other) const; + SemanticContextType getContextType() const { return _contextType; } /// /// For context independent predicates, we evaluate them without a local @@ -63,7 +43,7 @@ namespace atn { /// prediction, so we passed in the outer context here in case of context /// dependent predicate evaluation. /// - virtual bool eval(Recognizer *parser, RuleContext *parserCallStack) = 0; + virtual bool eval(Recognizer *parser, RuleContext *parserCallStack) const = 0; /** * Evaluate the precedence predicates for the context and reduce the result. @@ -83,12 +63,18 @@ namespace atn { * semantic context after precedence predicates are evaluated. * */ - virtual Ref evalPrecedence(Recognizer *parser, RuleContext *parserCallStack); + virtual Ref evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) const; + + virtual size_t hashCode() const = 0; + + virtual bool equals(const SemanticContext &other) const = 0; - static Ref And(Ref const& a, Ref const& b); + virtual std::string toString() const = 0; + + static Ref And(Ref a, Ref b); /// See also: ParserATNSimulator::getPredsForAmbigAlts. - static Ref Or(Ref const& a, Ref const& b); + static Ref Or(Ref a, Ref b); class Predicate; class PrecedencePredicate; @@ -96,44 +82,54 @@ namespace atn { class AND; class OR; + protected: + explicit SemanticContext(SemanticContextType contextType) : _contextType(contextType) {} + private: - static std::vector> filterPrecedencePredicates(const Set &collection); + const SemanticContextType _contextType; }; - class ANTLR4CPP_PUBLIC SemanticContext::Predicate : public SemanticContext { + inline bool operator==(const SemanticContext &lhs, const SemanticContext &rhs) { + return lhs.equals(rhs); + } + + inline bool operator!=(const SemanticContext &lhs, const SemanticContext &rhs) { + return !operator==(lhs, rhs); + } + + class ANTLR4CPP_PUBLIC SemanticContext::Predicate final : public SemanticContext { public: + static bool is(const SemanticContext &semanticContext) { return semanticContext.getContextType() == SemanticContextType::PREDICATE; } + + static bool is(const SemanticContext *semanticContext) { return semanticContext != nullptr && is(*semanticContext); } + const size_t ruleIndex; const size_t predIndex; const bool isCtxDependent; // e.g., $i ref in pred - protected: - Predicate(); - - public: Predicate(size_t ruleIndex, size_t predIndex, bool isCtxDependent); - virtual bool eval(Recognizer *parser, RuleContext *parserCallStack) override; - virtual size_t hashCode() const override; - virtual bool operator == (const SemanticContext &other) const override; - virtual std::string toString() const override; + bool eval(Recognizer *parser, RuleContext *parserCallStack) const override; + size_t hashCode() const override; + bool equals(const SemanticContext &other) const override; + std::string toString() const override; }; - class ANTLR4CPP_PUBLIC SemanticContext::PrecedencePredicate : public SemanticContext { + class ANTLR4CPP_PUBLIC SemanticContext::PrecedencePredicate final : public SemanticContext { public: + static bool is(const SemanticContext &semanticContext) { return semanticContext.getContextType() == SemanticContextType::PRECEDENCE; } + + static bool is(const SemanticContext *semanticContext) { return semanticContext != nullptr && is(*semanticContext); } + const int precedence; - protected: - PrecedencePredicate(); + explicit PrecedencePredicate(int precedence); - public: - PrecedencePredicate(int precedence); - - virtual bool eval(Recognizer *parser, RuleContext *parserCallStack) override; - virtual Ref evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) override; - virtual int compareTo(PrecedencePredicate *o); - virtual size_t hashCode() const override; - virtual bool operator == (const SemanticContext &other) const override; - virtual std::string toString() const override; + bool eval(Recognizer *parser, RuleContext *parserCallStack) const override; + Ref evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) const override; + size_t hashCode() const override; + bool equals(const SemanticContext &other) const override; + std::string toString() const override; }; /** @@ -144,7 +140,12 @@ namespace atn { */ class ANTLR4CPP_PUBLIC SemanticContext::Operator : public SemanticContext { public: - virtual ~Operator() override; + static bool is(const SemanticContext &semanticContext) { + const auto contextType = semanticContext.getContextType(); + return contextType == SemanticContextType::AND || contextType == SemanticContextType::OR; + } + + static bool is(const SemanticContext *semanticContext) { return semanticContext != nullptr && is(*semanticContext); } /** * Gets the operands for the semantic context operator. @@ -155,68 +156,78 @@ namespace atn { * @since 4.3 */ - virtual std::vector> getOperands() const = 0; + virtual const std::vector>& getOperands() const = 0; + + protected: + using SemanticContext::SemanticContext; }; /** * A semantic context which is true whenever none of the contained contexts * is false. */ - class ANTLR4CPP_PUBLIC SemanticContext::AND : public SemanticContext::Operator { + class ANTLR4CPP_PUBLIC SemanticContext::AND final : public SemanticContext::Operator { public: - std::vector> opnds; + static bool is(const SemanticContext &semanticContext) { return semanticContext.getContextType() == SemanticContextType::AND; } + + static bool is(const SemanticContext *semanticContext) { return semanticContext != nullptr && is(*semanticContext); } - AND(Ref const& a, Ref const& b) ; + AND(Ref a, Ref b) ; - virtual std::vector> getOperands() const override; - virtual bool operator == (const SemanticContext &other) const override; - virtual size_t hashCode() const override; + const std::vector>& getOperands() const override; /** * The evaluation of predicates by this context is short-circuiting, but * unordered.

*/ - virtual bool eval(Recognizer *parser, RuleContext *parserCallStack) override; - virtual Ref evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) override; - virtual std::string toString() const override; + bool eval(Recognizer *parser, RuleContext *parserCallStack) const override; + Ref evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) const override; + size_t hashCode() const override; + bool equals(const SemanticContext &other) const override; + std::string toString() const override; + + private: + std::vector> _opnds; }; /** * A semantic context which is true whenever at least one of the contained * contexts is true. */ - class ANTLR4CPP_PUBLIC SemanticContext::OR : public SemanticContext::Operator { + class ANTLR4CPP_PUBLIC SemanticContext::OR final : public SemanticContext::Operator { public: - std::vector> opnds; + static bool is(const SemanticContext &semanticContext) { return semanticContext.getContextType() == SemanticContextType::OR; } + + static bool is(const SemanticContext *semanticContext) { return semanticContext != nullptr && is(*semanticContext); } - OR(Ref const& a, Ref const& b); + OR(Ref a, Ref b); - virtual std::vector> getOperands() const override; - virtual bool operator == (const SemanticContext &other) const override; - virtual size_t hashCode() const override; + const std::vector>& getOperands() const override; /** * The evaluation of predicates by this context is short-circuiting, but * unordered. */ - virtual bool eval(Recognizer *parser, RuleContext *parserCallStack) override; - virtual Ref evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) override; - virtual std::string toString() const override; - }; + bool eval(Recognizer *parser, RuleContext *parserCallStack) const override; + Ref evalPrecedence(Recognizer *parser, RuleContext *parserCallStack) const override; + size_t hashCode() const override; + bool equals(const SemanticContext &other) const override; + std::string toString() const override; -} // namespace atn -} // namespace antlr4 + private: + std::vector> _opnds; + }; -// Hash function for SemanticContext, used in the MurmurHash::update function +} // namespace atn +} // namespace antlr4 namespace std { - using antlr4::atn::SemanticContext; - template <> struct hash - { - size_t operator () (SemanticContext &x) const - { - return x.hashCode(); + template <> + struct hash<::antlr4::atn::SemanticContext> { + size_t operator()(const ::antlr4::atn::SemanticContext &semanticContext) const { + return semanticContext.hashCode(); } }; -} + +} // namespace std diff --git a/runtime/Cpp/runtime/src/atn/SemanticContextType.h b/runtime/Cpp/runtime/src/atn/SemanticContextType.h new file mode 100644 index 0000000000..bca6e421d2 --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/SemanticContextType.h @@ -0,0 +1,23 @@ +/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +#pragma once + +#include + +#include "antlr4-common.h" + +namespace antlr4 { +namespace atn { + + enum class SemanticContextType : size_t { + PREDICATE = 1, + PRECEDENCE = 2, + AND = 3, + OR = 4, + }; + +} // namespace atn +} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/SerializedATNView.h b/runtime/Cpp/runtime/src/atn/SerializedATNView.h new file mode 100644 index 0000000000..a723589bc3 --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/SerializedATNView.h @@ -0,0 +1,101 @@ +/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "antlr4-common.h" +#include "misc/MurmurHash.h" + +namespace antlr4 { +namespace atn { + + class ANTLR4CPP_PUBLIC SerializedATNView final { + public: + using value_type = int32_t; + using size_type = size_t; + using difference_type = ptrdiff_t; + using reference = int32_t&; + using const_reference = const int32_t&; + using pointer = int32_t*; + using const_pointer = const int32_t*; + using iterator = const_pointer; + using const_iterator = const_pointer; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; + + SerializedATNView() = default; + + SerializedATNView(const_pointer data, size_type size) : _data(data), _size(size) {} + + SerializedATNView(const std::vector &serializedATN) : _data(serializedATN.data()), _size(serializedATN.size()) {} + + SerializedATNView(const SerializedATNView&) = default; + + SerializedATNView& operator=(const SerializedATNView&) = default; + + const_iterator begin() const { return data(); } + + const_iterator cbegin() const { return data(); } + + const_iterator end() const { return data() + size(); } + + const_iterator cend() const { return data() + size(); } + + const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } + + const_reverse_iterator crbegin() const { return const_reverse_iterator(cend()); } + + const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } + + const_reverse_iterator crend() const { return const_reverse_iterator(cbegin()); } + + bool empty() const { return size() == 0; } + + const_pointer data() const { return _data; } + + size_type size() const { return _size; } + + size_type size_bytes() const { return size() * sizeof(value_type); } + + const_reference operator[](size_type index) const { return _data[index]; } + + private: + const_pointer _data = nullptr; + size_type _size = 0; + }; + + inline bool operator==(const SerializedATNView &lhs, const SerializedATNView &rhs) { + return (lhs.data() == rhs.data() && lhs.size() == rhs.size()) || + (lhs.size() == rhs.size() && std::memcmp(lhs.data(), rhs.data(), lhs.size_bytes()) == 0); + } + + inline bool operator!=(const SerializedATNView &lhs, const SerializedATNView &rhs) { + return !operator==(lhs, rhs); + } + + inline bool operator<(const SerializedATNView &lhs, const SerializedATNView &rhs) { + int diff = std::memcmp(lhs.data(), rhs.data(), std::min(lhs.size_bytes(), rhs.size_bytes())); + return diff < 0 || (diff == 0 && lhs.size() < rhs.size()); + } + +} // namespace atn +} // namespace antlr4 + +namespace std { + + template <> + struct hash<::antlr4::atn::SerializedATNView> { + size_t operator()(const ::antlr4::atn::SerializedATNView &serializedATNView) const { + return ::antlr4::misc::MurmurHash::hashCode(serializedATNView.data(), serializedATNView.size()); + } + }; + +} // namespace std diff --git a/runtime/Cpp/runtime/src/atn/SetTransition.cpp b/runtime/Cpp/runtime/src/atn/SetTransition.cpp index 35d6905be4..69395832e8 100755 --- a/runtime/Cpp/runtime/src/atn/SetTransition.cpp +++ b/runtime/Cpp/runtime/src/atn/SetTransition.cpp @@ -11,12 +11,8 @@ using namespace antlr4; using namespace antlr4::atn; -SetTransition::SetTransition(ATNState *target, const misc::IntervalSet &aSet) - : Transition(target), set(aSet.isEmpty() ? misc::IntervalSet::of(Token::INVALID_TYPE) : aSet) { -} - -Transition::SerializationType SetTransition::getSerializationType() const { - return SET; +SetTransition::SetTransition(TransitionType transitionType, ATNState *target, misc::IntervalSet aSet) + : Transition(transitionType, target), set(aSet.isEmpty() ? misc::IntervalSet::of(Token::INVALID_TYPE) : std::move(aSet)) { } misc::IntervalSet SetTransition::label() const { diff --git a/runtime/Cpp/runtime/src/atn/SetTransition.h b/runtime/Cpp/runtime/src/atn/SetTransition.h index 044d41a6a3..cc514c3d01 100755 --- a/runtime/Cpp/runtime/src/atn/SetTransition.h +++ b/runtime/Cpp/runtime/src/atn/SetTransition.h @@ -14,16 +14,24 @@ namespace atn { /// A transition containing a set of values.
class ANTLR4CPP_PUBLIC SetTransition : public Transition { public: - const misc::IntervalSet set; + static bool is(const Transition &transition) { + const auto transitionType = transition.getTransitionType(); + return transitionType == TransitionType::SET || transitionType == TransitionType::NOT_SET; + } + + static bool is(const Transition *transition) { return transition != nullptr && is(*transition); } - SetTransition(ATNState *target, const misc::IntervalSet &set); + const misc::IntervalSet set; - virtual SerializationType getSerializationType() const override; + SetTransition(ATNState *target, misc::IntervalSet set) : SetTransition(TransitionType::SET, target, std::move(set)) {} virtual misc::IntervalSet label() const override; virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; virtual std::string toString() const override; + + protected: + SetTransition(TransitionType transitionType, ATNState *target, misc::IntervalSet set); }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp b/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp index 39ad9fb835..33dd21ac2c 100755 --- a/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp +++ b/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp @@ -3,69 +3,74 @@ * can be found in the LICENSE.txt file in the project root. */ -#include "atn/EmptyPredictionContext.h" - #include "atn/SingletonPredictionContext.h" +#include "support/Casts.h" +#include "misc/MurmurHash.h" + using namespace antlr4::atn; +using namespace antlrcpp; -SingletonPredictionContext::SingletonPredictionContext(Ref const& parent, size_t returnState) - : PredictionContext(parent ? calculateHashCode(parent, returnState) : calculateEmptyHashCode()), - parent(parent), returnState(returnState) { - assert(returnState != ATNState::INVALID_STATE_NUMBER); -} +namespace { + + bool cachedHashCodeEqual(size_t lhs, size_t rhs) { + return lhs == rhs || lhs == 0 || rhs == 0; + } -SingletonPredictionContext::~SingletonPredictionContext() { } -Ref SingletonPredictionContext::create(Ref const& parent, size_t returnState) { +SingletonPredictionContext::SingletonPredictionContext(Ref parent, size_t returnState) + : PredictionContext(PredictionContextType::SINGLETON), parent(std::move(parent)), returnState(returnState) { + assert(returnState != ATNState::INVALID_STATE_NUMBER); +} - if (returnState == EMPTY_RETURN_STATE && parent) { +Ref SingletonPredictionContext::create(Ref parent, size_t returnState) { + if (returnState == EMPTY_RETURN_STATE && parent == nullptr) { // someone can pass in the bits of an array ctx that mean $ - return std::dynamic_pointer_cast(EMPTY); + return std::dynamic_pointer_cast(EMPTY); } - return std::make_shared(parent, returnState); + return std::make_shared(std::move(parent), returnState); +} + +bool SingletonPredictionContext::isEmpty() const { + return parent == nullptr && returnState == EMPTY_RETURN_STATE; } size_t SingletonPredictionContext::size() const { return 1; } -Ref SingletonPredictionContext::getParent(size_t index) const { +const Ref& SingletonPredictionContext::getParent(size_t index) const { assert(index == 0); - ((void)(index)); // Make Release build happy. + static_cast(index); return parent; } size_t SingletonPredictionContext::getReturnState(size_t index) const { assert(index == 0); - ((void)(index)); // Make Release build happy. + static_cast(index); return returnState; } -bool SingletonPredictionContext::operator == (const PredictionContext &o) const { - if (this == &o) { +size_t SingletonPredictionContext::hashCodeImpl() const { + size_t hash = misc::MurmurHash::initialize(); + hash = misc::MurmurHash::update(hash, static_cast(getContextType())); + hash = misc::MurmurHash::update(hash, parent); + hash = misc::MurmurHash::update(hash, returnState); + return misc::MurmurHash::finish(hash, 3); +} + +bool SingletonPredictionContext::equals(const PredictionContext &other) const { + if (this == std::addressof(other)) { return true; } - - const SingletonPredictionContext *other = dynamic_cast(&o); - if (other == nullptr) { + if (getContextType() != other.getContextType()) { return false; } - - if (this->hashCode() != other->hashCode()) { - return false; // can't be same if hash is different - } - - if (returnState != other->returnState) - return false; - - if (!parent && !other->parent) - return true; - if (!parent || !other->parent) - return false; - - return *parent == *other->parent; + const auto &singleton = downCast(other); + return returnState == singleton.returnState && + cachedHashCodeEqual(cachedHashCode(), singleton.cachedHashCode()) && + (parent == singleton.parent || (parent != nullptr && singleton.parent != nullptr && *parent == *singleton.parent)); } std::string SingletonPredictionContext::toString() const { diff --git a/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h b/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h index f1e993bbae..646a6fddcc 100755 --- a/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h +++ b/runtime/Cpp/runtime/src/atn/SingletonPredictionContext.h @@ -10,26 +10,33 @@ namespace antlr4 { namespace atn { - class ANTLR4CPP_PUBLIC SingletonPredictionContext : public PredictionContext { + class ANTLR4CPP_PUBLIC SingletonPredictionContext final : public PredictionContext { public: + static bool is(const PredictionContext &predictionContext) { return predictionContext.getContextType() == PredictionContextType::SINGLETON; } + + static bool is(const PredictionContext *predictionContext) { return predictionContext != nullptr && is(*predictionContext); } + + static Ref create(Ref parent, size_t returnState); + // Usually a parent is linked via a weak ptr. Not so here as we have kinda reverse reference chain. // There are no child contexts stored here and often the parent context is left dangling when it's // owning ATNState is released. In order to avoid having this context released as well (leaving all other contexts // which got this one as parent with a null reference) we use a shared_ptr here instead, to keep those left alone // parent contexts alive. - const Ref parent; + const Ref parent; const size_t returnState; - SingletonPredictionContext(Ref const& parent, size_t returnState); - virtual ~SingletonPredictionContext(); + SingletonPredictionContext(Ref parent, size_t returnState); - static Ref create(Ref const& parent, size_t returnState); + bool isEmpty() const override; + size_t size() const override; + const Ref& getParent(size_t index) const override; + size_t getReturnState(size_t index) const override; + bool equals(const PredictionContext &other) const override; + std::string toString() const override; - virtual size_t size() const override; - virtual Ref getParent(size_t index) const override; - virtual size_t getReturnState(size_t index) const override; - virtual bool operator == (const PredictionContext &o) const override; - virtual std::string toString() const override; + protected: + size_t hashCodeImpl() const override; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/StarBlockStartState.cpp b/runtime/Cpp/runtime/src/atn/StarBlockStartState.cpp deleted file mode 100755 index e62c0de11e..0000000000 --- a/runtime/Cpp/runtime/src/atn/StarBlockStartState.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/StarBlockStartState.h" - -using namespace antlr4::atn; - -size_t StarBlockStartState::getStateType() { - return STAR_BLOCK_START; -} diff --git a/runtime/Cpp/runtime/src/atn/StarBlockStartState.h b/runtime/Cpp/runtime/src/atn/StarBlockStartState.h index 8fae316089..a162631dec 100755 --- a/runtime/Cpp/runtime/src/atn/StarBlockStartState.h +++ b/runtime/Cpp/runtime/src/atn/StarBlockStartState.h @@ -12,9 +12,12 @@ namespace atn { /// The block that begins a closure loop. class ANTLR4CPP_PUBLIC StarBlockStartState final : public BlockStartState { - public: - virtual size_t getStateType() override; + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::STAR_BLOCK_START; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } + + StarBlockStartState() : BlockStartState(ATNStateType::STAR_BLOCK_START) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/StarLoopEntryState.cpp b/runtime/Cpp/runtime/src/atn/StarLoopEntryState.cpp deleted file mode 100755 index 766a858f2e..0000000000 --- a/runtime/Cpp/runtime/src/atn/StarLoopEntryState.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/StarLoopEntryState.h" - -using namespace antlr4::atn; - -StarLoopEntryState::StarLoopEntryState() : DecisionState(), isPrecedenceDecision(false) { -} - -size_t StarLoopEntryState::getStateType() { - return STAR_LOOP_ENTRY; -} diff --git a/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h b/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h index a062c58f79..c3f47b8f70 100755 --- a/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h +++ b/runtime/Cpp/runtime/src/atn/StarLoopEntryState.h @@ -12,7 +12,9 @@ namespace atn { class ANTLR4CPP_PUBLIC StarLoopEntryState final : public DecisionState { public: - StarLoopEntryState(); + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::STAR_LOOP_ENTRY; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } /** * Indicates whether this state can benefit from a precedence DFA during SLL @@ -28,7 +30,7 @@ namespace atn { StarLoopbackState *loopBackState = nullptr; - virtual size_t getStateType() override; + StarLoopEntryState() : DecisionState(ATNStateType::STAR_LOOP_ENTRY) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp b/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp index f5105896b1..40d05e699b 100755 --- a/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp +++ b/runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp @@ -5,15 +5,15 @@ #include "atn/StarLoopEntryState.h" #include "atn/Transition.h" +#include "support/Casts.h" #include "atn/StarLoopbackState.h" using namespace antlr4::atn; -StarLoopEntryState *StarLoopbackState::getLoopEntryState() { - return dynamic_cast(transitions[0]->target); -} - -size_t StarLoopbackState::getStateType() { - return STAR_LOOP_BACK; +StarLoopEntryState *StarLoopbackState::getLoopEntryState() const { + if (transitions[0]->target != nullptr && transitions[0]->target->getStateType() == ATNStateType::STAR_LOOP_ENTRY) { + return antlrcpp::downCast(transitions[0]->target); + } + return nullptr; } diff --git a/runtime/Cpp/runtime/src/atn/StarLoopbackState.h b/runtime/Cpp/runtime/src/atn/StarLoopbackState.h index f5db3efd85..0780b4c25d 100755 --- a/runtime/Cpp/runtime/src/atn/StarLoopbackState.h +++ b/runtime/Cpp/runtime/src/atn/StarLoopbackState.h @@ -12,9 +12,13 @@ namespace atn { class ANTLR4CPP_PUBLIC StarLoopbackState final : public ATNState { public: - StarLoopEntryState *getLoopEntryState(); + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::STAR_LOOP_BACK; } - virtual size_t getStateType() override; + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } + + StarLoopbackState() : ATNState(ATNStateType::STAR_LOOP_BACK) {} + + StarLoopEntryState *getLoopEntryState() const; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/TokensStartState.cpp b/runtime/Cpp/runtime/src/atn/TokensStartState.cpp deleted file mode 100755 index a764278e7b..0000000000 --- a/runtime/Cpp/runtime/src/atn/TokensStartState.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "atn/TokensStartState.h" - -using namespace antlr4::atn; - -size_t TokensStartState::getStateType() { - return TOKEN_START; -} diff --git a/runtime/Cpp/runtime/src/atn/TokensStartState.h b/runtime/Cpp/runtime/src/atn/TokensStartState.h index e534d04ee9..e1d043e78f 100755 --- a/runtime/Cpp/runtime/src/atn/TokensStartState.h +++ b/runtime/Cpp/runtime/src/atn/TokensStartState.h @@ -12,9 +12,12 @@ namespace atn { /// The Tokens rule start state linking to each lexer rule start state. class ANTLR4CPP_PUBLIC TokensStartState final : public DecisionState { - public: - virtual size_t getStateType() override; + static bool is(const ATNState &atnState) { return atnState.getStateType() == ATNStateType::TOKEN_START; } + + static bool is(const ATNState *atnState) { return atnState != nullptr && is(*atnState); } + + TokensStartState() : DecisionState(ATNStateType::TOKEN_START) {} }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/atn/Transition.cpp b/runtime/Cpp/runtime/src/atn/Transition.cpp index 15922a324e..da9b7fd4e5 100755 --- a/runtime/Cpp/runtime/src/atn/Transition.cpp +++ b/runtime/Cpp/runtime/src/atn/Transition.cpp @@ -10,14 +10,9 @@ using namespace antlr4; using namespace antlr4::atn; - using namespace antlrcpp; -const std::vector Transition::serializationNames = { - "INVALID", "EPSILON", "RANGE", "RULE", "PREDICATE", "ATOM", "ACTION", "SET", "NOT_SET", "WILDCARD", "PRECEDENCE" -}; - -Transition::Transition(ATNState *target) { +Transition::Transition(TransitionType transitionType, ATNState *target) : _transitionType(transitionType) { if (target == nullptr) { throw NullPointerException("target cannot be null."); } @@ -25,9 +20,6 @@ Transition::Transition(ATNState *target) { this->target = target; } -Transition::~Transition() { -} - bool Transition::isEpsilon() const { return false; } diff --git a/runtime/Cpp/runtime/src/atn/Transition.h b/runtime/Cpp/runtime/src/atn/Transition.h index ffed2f58f0..72db7512eb 100755 --- a/runtime/Cpp/runtime/src/atn/Transition.h +++ b/runtime/Cpp/runtime/src/atn/Transition.h @@ -6,6 +6,7 @@ #pragma once #include "misc/IntervalSet.h" +#include "atn/TransitionType.h" namespace antlr4 { namespace atn { @@ -25,33 +26,13 @@ namespace atn { ///
class ANTLR4CPP_PUBLIC Transition { public: - // constants for serialization - enum SerializationType { - EPSILON = 1, - RANGE = 2, - RULE = 3, - PREDICATE = 4, // e.g., {isType(input.LT(1))}? - ATOM = 5, - ACTION = 6, - SET = 7, // ~(A|B) or ~atom, wildcard, which convert to next 2 - NOT_SET = 8, - WILDCARD = 9, - PRECEDENCE = 10, - }; - - static const std::vector serializationNames; - /// The target of this transition. // ml: this is a reference into the ATN. ATNState *target; - virtual ~Transition(); + virtual ~Transition() = default; - protected: - Transition(ATNState *target); - - public: - virtual SerializationType getSerializationType() const = 0; + TransitionType getTransitionType() const { return _transitionType; } /** * Determines if the transition is an "epsilon" transition. @@ -70,7 +51,15 @@ namespace atn { Transition(Transition const&) = delete; Transition& operator=(Transition const&) = delete; + + protected: + Transition(TransitionType transitionType, ATNState *target); + + private: + const TransitionType _transitionType; }; + using ConstTransitionPtr = std::unique_ptr; + } // namespace atn } // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/TransitionType.cpp b/runtime/Cpp/runtime/src/atn/TransitionType.cpp new file mode 100644 index 0000000000..78769b2ada --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/TransitionType.cpp @@ -0,0 +1,27 @@ +#include "atn/TransitionType.h" + +std::string antlr4::atn::transitionTypeName(TransitionType transitionType) { + switch (transitionType) { + case TransitionType::EPSILON: + return "EPSILON"; + case TransitionType::RANGE: + return "RANGE"; + case TransitionType::RULE: + return "RULE"; + case TransitionType::PREDICATE: + return "PREDICATE"; + case TransitionType::ATOM: + return "ATOM"; + case TransitionType::ACTION: + return "ACTION"; + case TransitionType::SET: + return "SET"; + case TransitionType::NOT_SET: + return "NOT_SET"; + case TransitionType::WILDCARD: + return "WILDCARD"; + case TransitionType::PRECEDENCE: + return "PRECEDENCE"; + } + return "UNKNOWN"; +} diff --git a/runtime/Cpp/runtime/src/atn/TransitionType.h b/runtime/Cpp/runtime/src/atn/TransitionType.h new file mode 100644 index 0000000000..d5d5f3bd97 --- /dev/null +++ b/runtime/Cpp/runtime/src/atn/TransitionType.h @@ -0,0 +1,33 @@ +/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +#pragma once + +#include +#include + +#include "antlr4-common.h" + +namespace antlr4 { +namespace atn { + + // Constants for transition serialization. + enum class TransitionType : size_t { + EPSILON = 1, + RANGE = 2, + RULE = 3, + PREDICATE = 4, // e.g., {isType(input.LT(1))}? + ATOM = 5, + ACTION = 6, + SET = 7, // ~(A|B) or ~atom, wildcard, which convert to next 2 + NOT_SET = 8, + WILDCARD = 9, + PRECEDENCE = 10, + }; + + ANTLR4CPP_PUBLIC std::string transitionTypeName(TransitionType transitionType); + +} // namespace atn +} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp b/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp index dc47413167..9614815e6f 100755 --- a/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp +++ b/runtime/Cpp/runtime/src/atn/WildcardTransition.cpp @@ -9,11 +9,7 @@ using namespace antlr4::atn; -WildcardTransition::WildcardTransition(ATNState *target) : Transition(target) { -} - -Transition::SerializationType WildcardTransition::getSerializationType() const { - return WILDCARD; +WildcardTransition::WildcardTransition(ATNState *target) : Transition(TransitionType::WILDCARD, target) { } bool WildcardTransition::matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const { diff --git a/runtime/Cpp/runtime/src/atn/WildcardTransition.h b/runtime/Cpp/runtime/src/atn/WildcardTransition.h index c47c717759..e088e8934f 100755 --- a/runtime/Cpp/runtime/src/atn/WildcardTransition.h +++ b/runtime/Cpp/runtime/src/atn/WildcardTransition.h @@ -12,9 +12,11 @@ namespace atn { class ANTLR4CPP_PUBLIC WildcardTransition final : public Transition { public: - WildcardTransition(ATNState *target); + static bool is(const Transition &transition) { return transition.getTransitionType() == TransitionType::WILDCARD; } - virtual SerializationType getSerializationType() const override; + static bool is(const Transition *transition) { return transition != nullptr && is(*transition); } + + explicit WildcardTransition(ATNState *target); virtual bool matches(size_t symbol, size_t minVocabSymbol, size_t maxVocabSymbol) const override; diff --git a/runtime/Cpp/runtime/src/dfa/DFA.cpp b/runtime/Cpp/runtime/src/dfa/DFA.cpp index 3f83180afa..ef5b07c5ea 100755 --- a/runtime/Cpp/runtime/src/dfa/DFA.cpp +++ b/runtime/Cpp/runtime/src/dfa/DFA.cpp @@ -8,6 +8,7 @@ #include "support/CPPUtils.h" #include "atn/StarLoopEntryState.h" #include "atn/ATNConfigSet.h" +#include "support/Casts.h" #include "dfa/DFA.h" @@ -22,8 +23,8 @@ DFA::DFA(atn::DecisionState *atnStartState, size_t decision) : atnStartState(atnStartState), s0(nullptr), decision(decision) { _precedenceDfa = false; - if (is(atnStartState)) { - if (static_cast(atnStartState)->isPrecedenceDecision) { + if (atn::StarLoopEntryState::is(atnStartState)) { + if (downCast(atnStartState)->isPrecedenceDecision) { _precedenceDfa = true; s0 = new DFAState(std::unique_ptr(new atn::ATNConfigSet())); s0->isAcceptState = false; @@ -32,13 +33,12 @@ DFA::DFA(atn::DecisionState *atnStartState, size_t decision) } } -DFA::DFA(DFA &&other) : atnStartState(other.atnStartState), decision(other.decision) { +DFA::DFA(DFA &&other) : atnStartState(other.atnStartState), s0(other.s0), decision(other.decision) { // Source states are implicitly cleared by the move. states = std::move(other.states); other.atnStartState = nullptr; other.decision = 0; - s0 = other.s0; other.s0 = nullptr; _precedenceDfa = other._precedenceDfa; other._precedenceDfa = false; @@ -52,8 +52,9 @@ DFA::~DFA() { delete state; } - if (!s0InList) + if (!s0InList) { delete s0; + } } bool DFA::isPrecedenceDfa() const { @@ -70,7 +71,7 @@ DFAState* DFA::getPrecedenceStartState(int precedence) const { return iterator->second; } -void DFA::setPrecedenceStartState(int precedence, DFAState *startState, SingleWriteMultipleReadLock &lock) { +void DFA::setPrecedenceStartState(int precedence, DFAState *startState) { if (!isPrecedenceDfa()) { throw IllegalStateException("Only precedence DFAs may contain a precedence start state."); } @@ -79,11 +80,7 @@ void DFA::setPrecedenceStartState(int precedence, DFAState *startState, SingleWr return; } - { - lock.writeLock(); - s0->edges[precedence] = startState; - lock.writeUnlock(); - } + s0->edges[precedence] = startState; } std::vector DFA::getStates() const { @@ -98,15 +95,6 @@ std::vector DFA::getStates() const { return result; } -std::string DFA::toString(const std::vector &tokenNames) { - if (s0 == nullptr) { - return ""; - } - DFASerializer serializer(this, tokenNames); - - return serializer.toString(); -} - std::string DFA::toString(const Vocabulary &vocabulary) const { if (s0 == nullptr) { return ""; @@ -116,7 +104,7 @@ std::string DFA::toString(const Vocabulary &vocabulary) const { return serializer.toString(); } -std::string DFA::toLexerString() { +std::string DFA::toLexerString() const { if (s0 == nullptr) { return ""; } diff --git a/runtime/Cpp/runtime/src/dfa/DFA.h b/runtime/Cpp/runtime/src/dfa/DFA.h index 99daf0a157..f676655749 100755 --- a/runtime/Cpp/runtime/src/dfa/DFA.h +++ b/runtime/Cpp/runtime/src/dfa/DFA.h @@ -7,29 +7,38 @@ #include "dfa/DFAState.h" -namespace antlrcpp { - class SingleWriteMultipleReadLock; -} - namespace antlr4 { namespace dfa { - class ANTLR4CPP_PUBLIC DFA { + class ANTLR4CPP_PUBLIC DFA final { + private: + struct DFAStateHasher final { + size_t operator()(const DFAState *dfaState) const { + return dfaState->hashCode(); + } + }; + + struct DFAStateComparer final { + bool operator()(const DFAState *lhs, const DFAState *rhs) const { + return lhs == rhs || *lhs == *rhs; + } + }; + public: /// A set of all DFA states. Use a map so we can get old state back. /// Set only allows you to see if it's there. /// From which ATN state did we create this DFA? atn::DecisionState *atnStartState; - std::unordered_set states; // States are owned by this class. + std::unordered_set states; // States are owned by this class. DFAState *s0; size_t decision; - DFA(atn::DecisionState *atnStartState); + explicit DFA(atn::DecisionState *atnStartState); DFA(atn::DecisionState *atnStartState, size_t decision); DFA(const DFA &other) = delete; DFA(DFA &&other); - virtual ~DFA(); + ~DFA(); /** * Gets whether this DFA is a precedence DFA. Precedence DFAs use a special @@ -66,18 +75,14 @@ namespace dfa { * @throws IllegalStateException if this is not a precedence DFA. * @see #isPrecedenceDfa() */ - void setPrecedenceStartState(int precedence, DFAState *startState, antlrcpp::SingleWriteMultipleReadLock &lock); + void setPrecedenceStartState(int precedence, DFAState *startState); /// Return a list of all states in this DFA, ordered by state number. - virtual std::vector getStates() const; + std::vector getStates() const; - /** - * @deprecated Use {@link #toString(Vocabulary)} instead. - */ - virtual std::string toString(const std::vector& tokenNames); std::string toString(const Vocabulary &vocabulary) const; - virtual std::string toLexerString(); + std::string toLexerString() const; private: /** diff --git a/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp b/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp index d27e53fa75..50c86c436a 100755 --- a/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp +++ b/runtime/Cpp/runtime/src/dfa/DFASerializer.cpp @@ -10,16 +10,9 @@ using namespace antlr4::dfa; -DFASerializer::DFASerializer(const DFA *dfa, const std::vector& tokenNames) - : DFASerializer(dfa, Vocabulary::fromTokenNames(tokenNames)) { -} - DFASerializer::DFASerializer(const DFA *dfa, const Vocabulary &vocabulary) : _dfa(dfa), _vocabulary(vocabulary) { } -DFASerializer::~DFASerializer() { -} - std::string DFASerializer::toString() const { if (_dfa->s0 == nullptr) { return ""; @@ -55,7 +48,7 @@ std::string DFASerializer::getStateString(DFAState *s) const { if (!s->predicates.empty()) { std::string buf; for (size_t i = 0; i < s->predicates.size(); i++) { - buf.append(s->predicates[i]->toString()); + buf.append(s->predicates[i].toString()); } return baseStateStr + "=>" + buf; } else { diff --git a/runtime/Cpp/runtime/src/dfa/DFASerializer.h b/runtime/Cpp/runtime/src/dfa/DFASerializer.h index a1fe5a539c..155c8b2085 100755 --- a/runtime/Cpp/runtime/src/dfa/DFASerializer.h +++ b/runtime/Cpp/runtime/src/dfa/DFASerializer.h @@ -13,15 +13,15 @@ namespace dfa { /// A DFA walker that knows how to dump them to serialized strings. class ANTLR4CPP_PUBLIC DFASerializer { public: - DFASerializer(const DFA *dfa, const std::vector& tnames); DFASerializer(const DFA *dfa, const Vocabulary &vocabulary); - virtual ~DFASerializer(); - virtual std::string toString() const; + virtual ~DFASerializer() = default; + + std::string toString() const; protected: virtual std::string getEdgeLabel(size_t i) const; - virtual std::string getStateString(DFAState *s) const; + std::string getStateString(DFAState *s) const; private: const DFA *_dfa; diff --git a/runtime/Cpp/runtime/src/dfa/DFAState.cpp b/runtime/Cpp/runtime/src/dfa/DFAState.cpp index 998fed3fba..f678072b02 100755 --- a/runtime/Cpp/runtime/src/dfa/DFAState.cpp +++ b/runtime/Cpp/runtime/src/dfa/DFAState.cpp @@ -13,41 +13,11 @@ using namespace antlr4::dfa; using namespace antlr4::atn; -DFAState::PredPrediction::PredPrediction(const Ref &pred, int alt) : pred(pred) { - InitializeInstanceFields(); - this->alt = alt; -} - -DFAState::PredPrediction::~PredPrediction() { -} - -std::string DFAState::PredPrediction::toString() { +std::string DFAState::PredPrediction::toString() const { return std::string("(") + pred->toString() + ", " + std::to_string(alt) + ")"; } -void DFAState::PredPrediction::InitializeInstanceFields() { - alt = 0; -} - -DFAState::DFAState() { - InitializeInstanceFields(); -} - -DFAState::DFAState(int state) : DFAState() { - stateNumber = state; -} - -DFAState::DFAState(std::unique_ptr configs_) : DFAState() { - configs = std::move(configs_); -} - -DFAState::~DFAState() { - for (auto *predicate : predicates) { - delete predicate; - } -} - -std::set DFAState::getAltSet() { +std::set DFAState::getAltSet() const { std::set alts; if (configs != nullptr) { for (size_t i = 0; i < configs->size(); i++) { @@ -58,22 +28,18 @@ std::set DFAState::getAltSet() { } size_t DFAState::hashCode() const { - size_t hash = misc::MurmurHash::initialize(7); - hash = misc::MurmurHash::update(hash, configs->hashCode()); - hash = misc::MurmurHash::finish(hash, 1); - return hash; + return configs != nullptr ? configs->hashCode() : 0; } -bool DFAState::operator == (const DFAState &o) const { - // compare set of ATN configurations in this set with other - if (this == &o) { +bool DFAState::equals(const DFAState &other) const { + if (this == std::addressof(other)) { return true; } - - return *configs == *o.configs; + return configs == other.configs || + (configs != nullptr && other.configs != nullptr && *configs == *other.configs); } -std::string DFAState::toString() { +std::string DFAState::toString() const { std::stringstream ss; ss << stateNumber; if (configs) { @@ -83,7 +49,7 @@ std::string DFAState::toString() { ss << " => "; if (!predicates.empty()) { for (size_t i = 0; i < predicates.size(); i++) { - ss << predicates[i]->toString(); + ss << predicates[i].toString(); } } else { ss << prediction; @@ -91,10 +57,3 @@ std::string DFAState::toString() { } return ss.str(); } - -void DFAState::InitializeInstanceFields() { - stateNumber = -1; - isAcceptState = false; - prediction = 0; - requiresFullContext = false; -} diff --git a/runtime/Cpp/runtime/src/dfa/DFAState.h b/runtime/Cpp/runtime/src/dfa/DFAState.h index 2f0ddba26a..6d94176648 100755 --- a/runtime/Cpp/runtime/src/dfa/DFAState.h +++ b/runtime/Cpp/runtime/src/dfa/DFAState.h @@ -7,6 +7,8 @@ #include "antlr4-common.h" +#include "atn/ATNConfigSet.h" + namespace antlr4 { namespace dfa { @@ -35,23 +37,25 @@ namespace dfa { /// but with different ATN contexts (with same or different alts) /// meaning that state was reached via a different set of rule invocations. ///
- class ANTLR4CPP_PUBLIC DFAState { + class ANTLR4CPP_PUBLIC DFAState final { public: - class PredPrediction { + struct ANTLR4CPP_PUBLIC PredPrediction final { public: - Ref pred; // never null; at least SemanticContext.NONE + Ref pred; // never null; at least SemanticContext.NONE int alt; - PredPrediction(const Ref &pred, int alt); - virtual ~PredPrediction(); + PredPrediction() = delete; - virtual std::string toString(); + PredPrediction(const PredPrediction&) = default; + PredPrediction(PredPrediction&&) = default; - private: - void InitializeInstanceFields(); - }; + PredPrediction(Ref pred, int alt) : pred(std::move(pred)), alt(alt) {} - int stateNumber; + PredPrediction& operator=(const PredPrediction&) = default; + PredPrediction& operator=(PredPrediction&&) = default; + + std::string toString() const; + }; std::unique_ptr configs; @@ -59,24 +63,14 @@ namespace dfa { /// maps to {@code edges[0]}. // ml: this is a sparse list, so we use a map instead of a vector. // Watch out: we no longer have the -1 offset, as it isn't needed anymore. - std::unordered_map edges; - - bool isAcceptState; + std::unordered_map edges; /// if accept state, what ttype do we match or alt do we predict? /// This is set to when {@code !=null} or /// . - size_t prediction; - - Ref lexerActionExecutor; + size_t prediction = 0; - /// - /// Indicates that this state was created during SLL prediction that - /// discovered a conflict between the configurations in the state. Future - /// invocations immediately jumped doing - /// full context prediction if this field is true. - /// - bool requiresFullContext; + Ref lexerActionExecutor; /// /// During SLL parsing, this is a list of predicates associated with the @@ -91,21 +85,34 @@ namespace dfa { ///

/// This list is computed by . ///

- std::vector predicates; + std::vector predicates; + + int stateNumber = -1; + + bool isAcceptState = false; + + /// + /// Indicates that this state was created during SLL prediction that + /// discovered a conflict between the configurations in the state. Future + /// invocations immediately jumped doing + /// full context prediction if this field is true. + /// + bool requiresFullContext = false; /// Map a predicate to a predicted alternative. - DFAState(); - DFAState(int state); - DFAState(std::unique_ptr configs); - virtual ~DFAState(); + DFAState() = default; + + explicit DFAState(int stateNumber) : stateNumber(stateNumber) {} + + explicit DFAState(std::unique_ptr configs) : configs(std::move(configs)) {} /// /// Get the set of all alts mentioned by all ATN configurations in this /// DFA state. /// - virtual std::set getAltSet(); + std::set getAltSet() const; - virtual size_t hashCode() const; + size_t hashCode() const; /// Two DFAState instances are equal if their ATN configuration sets /// are the same. This method is used to see if a state already exists. @@ -118,27 +125,29 @@ namespace dfa { /// ParserATNSimulator#addDFAState we need to know if any other state /// exists that has this exact set of ATN configurations. The /// stateNumber is irrelevant. - bool operator == (const DFAState &o) const; + bool equals(const DFAState &other) const; - virtual std::string toString(); + std::string toString() const; + }; - struct Hasher - { - size_t operator()(DFAState *k) const { - return k->hashCode(); - } - }; + inline bool operator==(const DFAState &lhs, const DFAState &rhs) { + return lhs.equals(rhs); + } - struct Comparer { - bool operator()(DFAState *lhs, DFAState *rhs) const - { - return *lhs == *rhs; - } - }; + inline bool operator!=(const DFAState &lhs, const DFAState &rhs) { + return !operator==(lhs, rhs); + } + +} // namespace dfa +} // namespace antlr4 + +namespace std { - private: - void InitializeInstanceFields(); + template <> + struct hash<::antlr4::dfa::DFAState> { + size_t operator()(const ::antlr4::dfa::DFAState &dfaState) const { + return dfaState.hashCode(); + } }; -} // namespace atn -} // namespace antlr4 +} // namespace std diff --git a/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp b/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp index c3af41c1cc..fe95fd19fc 100755 --- a/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp +++ b/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp @@ -9,10 +9,7 @@ using namespace antlr4::dfa; -LexerDFASerializer::LexerDFASerializer(DFA *dfa) : DFASerializer(dfa, Vocabulary::EMPTY_VOCABULARY) { -} - -LexerDFASerializer::~LexerDFASerializer() { +LexerDFASerializer::LexerDFASerializer(const DFA *dfa) : DFASerializer(dfa, Vocabulary()) { } std::string LexerDFASerializer::getEdgeLabel(size_t i) const { diff --git a/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h b/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h index d1571071de..3a6c782290 100755 --- a/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h +++ b/runtime/Cpp/runtime/src/dfa/LexerDFASerializer.h @@ -10,13 +10,12 @@ namespace antlr4 { namespace dfa { - class ANTLR4CPP_PUBLIC LexerDFASerializer : public DFASerializer { + class ANTLR4CPP_PUBLIC LexerDFASerializer final : public DFASerializer { public: - LexerDFASerializer(DFA *dfa); - virtual ~LexerDFASerializer(); + explicit LexerDFASerializer(const DFA *dfa); protected: - virtual std::string getEdgeLabel(size_t i) const override; + std::string getEdgeLabel(size_t i) const override; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp b/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp index c77b8bca2b..0bcaf07b54 100755 --- a/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp +++ b/runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp @@ -101,7 +101,7 @@ InterpreterData InterpreterDataReader::parseFile(std::string const& fileName) { }; } - std::vector serializedATN; + std::vector serializedATN; std::getline(input, line, '\n'); assert(line == "atn:"); @@ -115,7 +115,7 @@ InterpreterData InterpreterDataReader::parseFile(std::string const& fileName) { number = std::strtoul(&value[1], nullptr, 10); else number = std::strtoul(value.c_str(), nullptr, 10); - serializedATN.push_back(static_cast(number)); + serializedATN.push_back(static_cast(number)); } ATNDeserializer deserializer; diff --git a/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h b/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h index 0c32ac62fc..c0cf9880a1 100755 --- a/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h +++ b/runtime/Cpp/runtime/src/misc/InterpreterDataReader.h @@ -6,12 +6,14 @@ #pragma once #include "antlr4-common.h" +#include "atn/ATN.h" +#include "Vocabulary.h" namespace antlr4 { namespace misc { struct InterpreterData { - atn::ATN atn; + std::unique_ptr atn; dfa::Vocabulary vocabulary; std::vector ruleNames; std::vector channels; // Only valid for lexer grammars. diff --git a/runtime/Cpp/runtime/src/misc/Interval.cpp b/runtime/Cpp/runtime/src/misc/Interval.cpp index bb521eb9df..16eec34340 100755 --- a/runtime/Cpp/runtime/src/misc/Interval.cpp +++ b/runtime/Cpp/runtime/src/misc/Interval.cpp @@ -7,35 +7,7 @@ using namespace antlr4::misc; -size_t antlr4::misc::numericToSymbol(ssize_t v) { - return static_cast(v); -} - -ssize_t antlr4::misc::symbolToNumeric(size_t v) { - return static_cast(v); -} - -Interval const Interval::INVALID; - -Interval::Interval() : Interval(static_cast(-1), -2) { // Need an explicit cast here for VS. -} - -Interval::Interval(size_t a_, size_t b_) : Interval(symbolToNumeric(a_), symbolToNumeric(b_)) { -} - -Interval::Interval(ssize_t a_, ssize_t b_) : a(a_), b(b_) { -} - -size_t Interval::length() const { - if (b < a) { - return 0; - } - return size_t(b - a + 1); -} - -bool Interval::operator == (const Interval &other) const { - return a == other.a && b == other.b; -} +const Interval Interval::INVALID; size_t Interval::hashCode() const { size_t hash = 23; diff --git a/runtime/Cpp/runtime/src/misc/Interval.h b/runtime/Cpp/runtime/src/misc/Interval.h index 0198ee5ae1..4ca3cfcdbc 100755 --- a/runtime/Cpp/runtime/src/misc/Interval.h +++ b/runtime/Cpp/runtime/src/misc/Interval.h @@ -13,11 +13,11 @@ namespace misc { // Helpers to convert certain unsigned symbols (e.g. Token::EOF) to their original numeric value (e.g. -1) // and vice versa. This is needed mostly for intervals to keep their original order and for toString() // methods to print the original numeric value (e.g. for tests). - size_t numericToSymbol(ssize_t v); - ssize_t symbolToNumeric(size_t v); + constexpr size_t numericToSymbol(ssize_t v) { return static_cast(v); } + constexpr ssize_t symbolToNumeric(size_t v) { return static_cast(v); } /// An immutable inclusive interval a..b - class ANTLR4CPP_PUBLIC Interval { + class ANTLR4CPP_PUBLIC Interval final { public: static const Interval INVALID; @@ -25,15 +25,17 @@ namespace misc { ssize_t a; ssize_t b; - Interval(); - explicit Interval(size_t a_, size_t b_); // For unsigned -> signed mappings. - Interval(ssize_t a_, ssize_t b_); + constexpr Interval() : Interval(static_cast(-1), static_cast(-2)) {} + + constexpr explicit Interval(size_t a_, size_t b_) : Interval(symbolToNumeric(a_), symbolToNumeric(b_)) {} + + constexpr Interval(ssize_t a_, ssize_t b_) : a(a_), b(b_) {} /// return number of elements between a and b inclusively. x..x is length 1. /// if b < a, then length is 0. 9..10 has length 2. - size_t length() const; + constexpr size_t length() const { return b >= a ? static_cast(b - a + 1) : 0; } - bool operator == (const Interval &other) const; + constexpr bool operator==(const Interval &other) const { return a == other.a && b == other.b; } size_t hashCode() const; @@ -76,8 +78,6 @@ namespace misc { Interval intersection(const Interval &other) const; std::string toString() const; - - private: }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/misc/IntervalSet.cpp b/runtime/Cpp/runtime/src/misc/IntervalSet.cpp index 80182da008..ea910afe6e 100755 --- a/runtime/Cpp/runtime/src/misc/IntervalSet.cpp +++ b/runtime/Cpp/runtime/src/misc/IntervalSet.cpp @@ -13,7 +13,7 @@ using namespace antlr4; using namespace antlr4::misc; -IntervalSet const IntervalSet::COMPLETE_CHAR_SET = +IntervalSet const IntervalSet::COMPLETE_CHAR_SET = IntervalSet::of(Lexer::MIN_CHAR_VALUE, Lexer::MAX_CHAR_VALUE); IntervalSet const IntervalSet::EMPTY_SET; @@ -265,18 +265,13 @@ bool IntervalSet::contains(size_t el) const { } bool IntervalSet::contains(ssize_t el) const { - if (_intervals.empty()) + if (_intervals.empty() || el < _intervals.front().a || el > _intervals.back().b) { return false; - - if (el < _intervals[0].a) // list is sorted and el is before first interval; not here - return false; - - for (const auto &interval : _intervals) { - if (el >= interval.a && el <= interval.b) { - return true; // found in this interval - } } - return false; + + return std::binary_search(_intervals.begin(), _intervals.end(), Interval(el, el), [](const Interval &lhs, const Interval &rhs) { + return lhs.b < rhs.a; + }); } bool IntervalSet::isEmpty() const { @@ -306,7 +301,7 @@ ssize_t IntervalSet::getMinElement() const { return Token::INVALID_TYPE; } - return _intervals[0].a; + return _intervals.front().a; } std::vector const& IntervalSet::getIntervals() const { @@ -379,10 +374,6 @@ std::string IntervalSet::toString(bool elemAreChar) const { return ss.str(); } -std::string IntervalSet::toString(const std::vector &tokenNames) const { - return toString(dfa::Vocabulary::fromTokenNames(tokenNames)); -} - std::string IntervalSet::toString(const dfa::Vocabulary &vocabulary) const { if (_intervals.empty()) { return "{}"; @@ -420,10 +411,6 @@ std::string IntervalSet::toString(const dfa::Vocabulary &vocabulary) const { return ss.str(); } -std::string IntervalSet::elementName(const std::vector &tokenNames, ssize_t a) const { - return elementName(dfa::Vocabulary::fromTokenNames(tokenNames), a); -} - std::string IntervalSet::elementName(const dfa::Vocabulary &vocabulary, ssize_t a) const { if (a == -1) { return ""; diff --git a/runtime/Cpp/runtime/src/misc/IntervalSet.h b/runtime/Cpp/runtime/src/misc/IntervalSet.h index aa2adf66fa..7f24b78138 100755 --- a/runtime/Cpp/runtime/src/misc/IntervalSet.h +++ b/runtime/Cpp/runtime/src/misc/IntervalSet.h @@ -23,7 +23,7 @@ namespace misc { * the range {@link Integer#MIN_VALUE} to {@link Integer#MAX_VALUE} * (inclusive).

*/ - class ANTLR4CPP_PUBLIC IntervalSet { + class ANTLR4CPP_PUBLIC IntervalSet final { public: static IntervalSet const COMPLETE_CHAR_SET; static IntervalSet const EMPTY_SET; @@ -151,17 +151,9 @@ namespace misc { std::string toString() const; std::string toString(bool elemAreChar) const; - /** - * @deprecated Use {@link #toString(Vocabulary)} instead. - */ - std::string toString(const std::vector &tokenNames) const; std::string toString(const dfa::Vocabulary &vocabulary) const; protected: - /** - * @deprecated Use {@link #elementName(Vocabulary, int)} instead. - */ - std::string elementName(const std::vector &tokenNames, ssize_t a) const; std::string elementName(const dfa::Vocabulary &vocabulary, ssize_t a) const; public: diff --git a/runtime/Cpp/runtime/src/misc/MurmurHash.cpp b/runtime/Cpp/runtime/src/misc/MurmurHash.cpp index 55e96c9e31..73562cd9bd 100755 --- a/runtime/Cpp/runtime/src/misc/MurmurHash.cpp +++ b/runtime/Cpp/runtime/src/misc/MurmurHash.cpp @@ -3,6 +3,10 @@ * can be found in the LICENSE.txt file in the project root. */ +#include +#include +#include + #include "misc/MurmurHash.h" using namespace antlr4::misc; @@ -17,118 +21,100 @@ using namespace antlr4::misc; #if defined(_MSC_VER) -#define FORCE_INLINE __forceinline - #include #define ROTL32(x,y) _rotl(x,y) #define ROTL64(x,y) _rotl64(x,y) -#define BIG_CONSTANT(x) (x) +#elif ANTLR4CPP_HAVE_BUILTIN(__builtin_rotateleft32) && ANTLR4CPP_HAVE_BUILTIN(__builtin_rotateleft64) + +#define ROTL32(x, y) __builtin_rotateleft32(x, y) +#define ROTL64(x, y) __builtin_rotateleft64(x, y) #else // defined(_MSC_VER) // Other compilers -#define FORCE_INLINE inline __attribute__((always_inline)) +namespace { -inline uint32_t rotl32 (uint32_t x, int8_t r) -{ +constexpr uint32_t ROTL32(uint32_t x, int r) { return (x << r) | (x >> (32 - r)); } - -inline uint64_t rotl64 (uint64_t x, int8_t r) -{ +constexpr uint64_t ROTL64(uint64_t x, int r) { return (x << r) | (x >> (64 - r)); } -#define ROTL32(x,y) rotl32(x,y) -#define ROTL64(x,y) rotl64(x,y) - -#define BIG_CONSTANT(x) (x##LLU) - -#endif // !defined(_MSC_VER) - -size_t MurmurHash::initialize() { - return initialize(DEFAULT_SEED); -} - -size_t MurmurHash::initialize(size_t seed) { - return seed; } -#if defined(_WIN32) || defined(_WIN64) - #if _WIN64 - #define ENVIRONMENT64 - #else - #define ENVIRONMENT32 - #endif -#endif - -#if defined(__GNUC__) - #if defined(__x86_64__) || defined(__ppc64__) - #define ENVIRONMENT64 - #else - #define ENVIRONMENT32 - #endif -#endif +#endif // !defined(_MSC_VER) -#if defined(ENVIRONMENT32) +#if SIZE_MAX == UINT64_MAX size_t MurmurHash::update(size_t hash, size_t value) { - static const size_t c1 = 0xCC9E2D51; - static const size_t c2 = 0x1B873593; - size_t k1 = value; - k1 *= c1; - k1 = ROTL32(k1, 15); - k1 *= c2; + k1 *= UINT64_C(0x87c37b91114253d5); + k1 = ROTL64(k1, 31); + k1 *= UINT64_C(0x4cf5ad432745937f); hash ^= k1; - hash = ROTL32(hash, 13); - hash = hash * 5 + 0xE6546B64; + hash = ROTL64(hash, 27); + hash = hash * 5 + UINT64_C(0x52dce729); return hash; } +size_t MurmurHash::update(size_t hash, const void *data, size_t size) { + size_t value; + const uint8_t *bytes = static_cast(data); + while (size >= sizeof(size_t)) { + std::memcpy(&value, bytes, sizeof(size_t)); + hash = update(hash, value); + bytes += sizeof(size_t); + size -= sizeof(size_t); + } + if (size != 0) { + value = 0; + std::memcpy(&value, bytes, size); + hash = update(hash, value); + } + return hash; +} size_t MurmurHash::finish(size_t hash, size_t entryCount) { - hash ^= entryCount * 4; - hash ^= hash >> 16; - hash *= 0x85EBCA6B; - hash ^= hash >> 13; - hash *= 0xC2B2AE35; - hash ^= hash >> 16; + hash ^= entryCount * 8; + hash ^= hash >> 33; + hash *= UINT64_C(0xff51afd7ed558ccd); + hash ^= hash >> 33; + hash *= UINT64_C(0xc4ceb9fe1a85ec53); + hash ^= hash >> 33; return hash; } -#else +#elif SIZE_MAX == UINT32_MAX size_t MurmurHash::update(size_t hash, size_t value) { - static const size_t c1 = BIG_CONSTANT(0x87c37b91114253d5); - static const size_t c2 = BIG_CONSTANT(0x4cf5ad432745937f); - size_t k1 = value; - k1 *= c1; - k1 = ROTL64(k1, 31); - k1 *= c2; + k1 *= UINT32_C(0xCC9E2D51); + k1 = ROTL32(k1, 15); + k1 *= UINT32_C(0x1B873593); hash ^= k1; - hash = ROTL64(hash, 27); - hash = hash * 5 + 0x52dce729; + hash = ROTL32(hash, 13); + hash = hash * 5 + UINT32_C(0xE6546B64); return hash; } - size_t MurmurHash::finish(size_t hash, size_t entryCount) { - hash ^= entryCount * 8; - hash ^= hash >> 33; - hash *= 0xff51afd7ed558ccd; - hash ^= hash >> 33; - hash *= 0xc4ceb9fe1a85ec53; - hash ^= hash >> 33; + hash ^= entryCount * 4; + hash ^= hash >> 16; + hash *= UINT32_C(0x85EBCA6B); + hash ^= hash >> 13; + hash *= UINT32_C(0xC2B2AE35); + hash ^= hash >> 16; return hash; } +#else +#error "Expected sizeof(size_t) to be 4 or 8." #endif diff --git a/runtime/Cpp/runtime/src/misc/MurmurHash.h b/runtime/Cpp/runtime/src/misc/MurmurHash.h index 598e13d4c3..940ee67155 100755 --- a/runtime/Cpp/runtime/src/misc/MurmurHash.h +++ b/runtime/Cpp/runtime/src/misc/MurmurHash.h @@ -5,29 +5,25 @@ #pragma once +#include +#include + #include "antlr4-common.h" namespace antlr4 { namespace misc { - class ANTLR4CPP_PUBLIC MurmurHash { - + class ANTLR4CPP_PUBLIC MurmurHash final { private: -#if __cplusplus >= 201703L static constexpr size_t DEFAULT_SEED = 0; -#else - enum : size_t { - DEFAULT_SEED = 0, - }; -#endif /// Initialize the hash using the default seed value. /// Returns the intermediate hash value. public: - static size_t initialize(); + static size_t initialize() { return initialize(DEFAULT_SEED); } /// Initialize the hash using the specified seed. - static size_t initialize(size_t seed); + static size_t initialize(size_t seed) { return seed; } /// Update the intermediate hash value for the next input {@code value}. /// the intermediate hash value @@ -52,6 +48,13 @@ namespace misc { return update(hash, value != nullptr ? value->hashCode() : 0); } + static size_t update(size_t hash, const void *data, size_t size); + + template + static size_t update(size_t hash, const T *data, size_t size) { + return update(hash, static_cast(data), size * sizeof(std::remove_reference_t)); + } + /// /// Apply the final computation steps to the intermediate value {@code hash} /// to form the final result of the MurmurHash 3 hash function. @@ -68,14 +71,31 @@ namespace misc { /// the seed for the MurmurHash algorithm /// the hash code of the data template // where T is C array type - static size_t hashCode(const std::vector> &data, size_t seed) { + static size_t hashCode(const std::vector> &data, size_t seed = DEFAULT_SEED) { size_t hash = initialize(seed); - for (auto entry : data) { - hash = update(hash, entry->hashCode()); + for (auto &entry : data) { + hash = update(hash, entry); } - return finish(hash, data.size()); } + + static size_t hashCode(const void *data, size_t size, size_t seed = DEFAULT_SEED) { + size_t hash = initialize(seed); + hash = update(hash, data, size); + return finish(hash, size); + } + + template + static size_t hashCode(const T *data, size_t size, size_t seed = DEFAULT_SEED) { + return hashCode(static_cast(data), size * sizeof(std::remove_reference_t), seed); + } + + private: + MurmurHash() = delete; + + MurmurHash(const MurmurHash&) = delete; + + MurmurHash& operator=(const MurmurHash&) = delete; }; } // namespace atn diff --git a/runtime/Cpp/runtime/src/support/Any.cpp b/runtime/Cpp/runtime/src/support/Any.cpp index b324cc15db..a1ed50d456 100644 --- a/runtime/Cpp/runtime/src/support/Any.cpp +++ b/runtime/Cpp/runtime/src/support/Any.cpp @@ -6,8 +6,3 @@ #include "Any.h" using namespace antlrcpp; - -Any::~Any() -{ - delete _ptr; -} diff --git a/runtime/Cpp/runtime/src/support/Any.h b/runtime/Cpp/runtime/src/support/Any.h index e80bedeb2d..fa5df58946 100644 --- a/runtime/Cpp/runtime/src/support/Any.h +++ b/runtime/Cpp/runtime/src/support/Any.h @@ -9,172 +9,8 @@ #include "antlr4-common.h" -#ifdef _MSC_VER - #pragma warning(push) - #pragma warning(disable: 4521) // 'antlrcpp::Any': multiple copy constructors specified -#endif - namespace antlrcpp { -template - using StorageType = typename std::decay::type; - -struct ANTLR4CPP_PUBLIC Any -{ - bool isNull() const { return _ptr == nullptr; } - bool isNotNull() const { return _ptr != nullptr; } - - Any() : _ptr(nullptr) { - } - - Any(Any& that) : _ptr(that.clone()) { - } - - Any(Any&& that) : _ptr(that._ptr) { - that._ptr = nullptr; - } - - Any(const Any& that) : _ptr(that.clone()) { - } - - Any(const Any&& that) : _ptr(that.clone()) { - } - - template - Any(U&& value) : _ptr(new Derived>(std::forward(value))) { - } - - template - bool is() const { - auto derived = getDerived(false); - - return derived != nullptr; - } - - template - StorageType& as() { - auto derived = getDerived(true); - - return derived->value; - } - - template - const StorageType& as() const { - auto derived = getDerived(true); - - return derived->value; - } - - template::value || std::is_copy_assignable::value>::value> - operator U() { - return as>(); - } - - template::value && !std::is_copy_assignable::value) && (std::is_move_constructible::value || std::is_move_assignable::value)>::value> - operator U() { - return std::move(as>()); - } - - template::value || std::is_copy_assignable::value>::value> - operator const U() const { - return as>(); - } - - template::value && !std::is_copy_assignable::value) && (std::is_move_constructible::value || std::is_move_assignable::value)>::value> - operator const U() const { - return std::move(as>()); - } - - Any& operator = (const Any& a) { - if (_ptr == a._ptr) - return *this; - - auto * old_ptr = _ptr; - _ptr = a.clone(); - - if (old_ptr) - delete old_ptr; - - return *this; - } - - Any& operator = (Any&& a) { - if (_ptr == a._ptr) - return *this; - - std::swap(_ptr, a._ptr); - - return *this; - } - - virtual ~Any(); - - virtual bool equals(const Any& other) const { - return _ptr == other._ptr; - } - -private: - struct Base { - virtual ~Base() {}; - virtual Base* clone() const = 0; - }; - - template - struct Derived : Base - { - template Derived(U&& value_) : value(std::forward(value_)) { - } - - T value; - - Base* clone() const { - return clone<>(); - } - - private: - template::value, int>::type = 0> - Base* clone() const { - return new Derived(value); - } - - template::value, int>::type = 0> - Base* clone() const { - return nullptr; - } - - }; - - Base* clone() const - { - if (_ptr) - return _ptr->clone(); - else - return nullptr; - } - - template - Derived>* getDerived(bool checkCast) const { - typedef StorageType T; - - auto derived = dynamic_cast*>(_ptr); - - if (checkCast && !derived) - throw std::bad_cast(); - - return derived; - } - - Base *_ptr; - -}; - - template<> inline - Any::Any(std::nullptr_t&& ) : _ptr(nullptr) { - } - + using Any = std::any; } // namespace antlrcpp - -#ifdef _MSC_VER -#pragma warning(pop) -#endif diff --git a/runtime/Cpp/runtime/src/support/Arrays.h b/runtime/Cpp/runtime/src/support/Arrays.h index 18e6a8a712..04b852d986 100644 --- a/runtime/Cpp/runtime/src/support/Arrays.h +++ b/runtime/Cpp/runtime/src/support/Arrays.h @@ -32,8 +32,13 @@ namespace antlrcpp { return false; for (size_t i = 0; i < a.size(); ++i) { + if (!a[i] && !b[i]) + continue; + if (!a[i] || !b[i]) + return false; if (a[i] == b[i]) continue; + if (!(*a[i] == *b[i])) return false; } @@ -61,6 +66,26 @@ namespace antlrcpp { return true; } + template + static bool equals(const std::vector> &a, const std::vector> &b) { + if (a.size() != b.size()) + return false; + + for (size_t i = 0; i < a.size(); ++i) { + if (!a[i] && !b[i]) + continue; + if (!a[i] || !b[i]) + return false; + if (a[i] == b[i]) + continue; + + if (!(*a[i] == *b[i])) + return false; + } + + return true; + } + template static std::string toString(const std::vector &source) { std::string result = "["; @@ -89,6 +114,20 @@ namespace antlrcpp { return result + "]"; } + template + static std::string toString(const std::vector> &source) { + std::string result = "["; + bool firstEntry = true; + for (auto &value : source) { + result += value->toString(); + if (firstEntry) { + result += ", "; + firstEntry = false; + } + } + return result + "]"; + } + template static std::string toString(const std::vector &source) { std::string result = "["; diff --git a/runtime/Cpp/runtime/src/support/BitSet.h b/runtime/Cpp/runtime/src/support/BitSet.h index bf849b1874..bb30364be0 100644 --- a/runtime/Cpp/runtime/src/support/BitSet.h +++ b/runtime/Cpp/runtime/src/support/BitSet.h @@ -54,7 +54,7 @@ namespace antlrcpp { return result; } - std::string toString(){ + std::string toString() const { std::stringstream stream; stream << "{"; bool valueAdded = false; diff --git a/runtime/Cpp/runtime/src/support/CPPUtils.cpp b/runtime/Cpp/runtime/src/support/CPPUtils.cpp index 496f6c9327..95321b3dc1 100755 --- a/runtime/Cpp/runtime/src/support/CPPUtils.cpp +++ b/runtime/Cpp/runtime/src/support/CPPUtils.cpp @@ -7,10 +7,10 @@ namespace antlrcpp { - std::string join(std::vector strings, const std::string &separator) { + std::string join(const std::vector &strings, const std::string &separator) { std::string str; bool firstItem = true; - for (std::string s : strings) { + for (const std::string &s : strings) { if (!firstItem) { str.append(separator); } @@ -49,15 +49,12 @@ namespace antlrcpp { result += "\u00B7"; break; } - // else fall through -#ifndef _MSC_VER -#if __has_cpp_attribute(clang::fallthrough) - [[clang::fallthrough]]; -#endif -#endif + result += c; + break; default: result += c; + break; } } @@ -72,8 +69,13 @@ namespace antlrcpp { std::string arrayToString(const std::vector &data) { std::string answer; - for (auto sub: data) { - answer += sub; + size_t toReserve = 0; + for (const auto &sub : data) { + toReserve += sub.size(); + } + answer.reserve(toReserve); + for (const auto &sub: data) { + answer.append(sub); } return answer; } @@ -202,41 +204,4 @@ namespace antlrcpp { return result; } - //----------------- SingleWriteMultipleRead -------------------------------------------------------------------------- - - void SingleWriteMultipleReadLock::readLock() { - std::unique_lock lock(_mutex); - while (_waitingWriters != 0) - _readerGate.wait(lock); - ++_activeReaders; - lock.unlock(); - } - - void SingleWriteMultipleReadLock::readUnlock() { - std::unique_lock lock(_mutex); - --_activeReaders; - lock.unlock(); - _writerGate.notify_one(); - } - - void SingleWriteMultipleReadLock::writeLock() { - std::unique_lock lock(_mutex); - ++_waitingWriters; - while (_activeReaders != 0 || _activeWriters != 0) - _writerGate.wait(lock); - ++_activeWriters; - lock.unlock(); - } - - void SingleWriteMultipleReadLock::writeUnlock() { - std::unique_lock lock(_mutex); - --_waitingWriters; - --_activeWriters; - if (_waitingWriters > 0) - _writerGate.notify_one(); - else - _readerGate.notify_all(); - lock.unlock(); - } - } // namespace antlrcpp diff --git a/runtime/Cpp/runtime/src/support/CPPUtils.h b/runtime/Cpp/runtime/src/support/CPPUtils.h index 5f2ad609fd..2eb1a36037 100644 --- a/runtime/Cpp/runtime/src/support/CPPUtils.h +++ b/runtime/Cpp/runtime/src/support/CPPUtils.h @@ -9,14 +9,14 @@ namespace antlrcpp { - std::string join(std::vector strings, const std::string &separator); - std::map toMap(const std::vector &keys); - std::string escapeWhitespace(std::string str, bool escapeSpaces); - std::string toHexString(const int t); - std::string arrayToString(const std::vector &data); - std::string replaceString(const std::string &s, const std::string &from, const std::string &to); - std::vector split(const std::string &s, const std::string &sep, int count); - std::string indent(const std::string &s, const std::string &indentation, bool includingFirst = true); + ANTLR4CPP_PUBLIC std::string join(const std::vector &strings, const std::string &separator); + ANTLR4CPP_PUBLIC std::map toMap(const std::vector &keys); + ANTLR4CPP_PUBLIC std::string escapeWhitespace(std::string str, bool escapeSpaces); + ANTLR4CPP_PUBLIC std::string toHexString(const int t); + ANTLR4CPP_PUBLIC std::string arrayToString(const std::vector &data); + ANTLR4CPP_PUBLIC std::string replaceString(const std::string &s, const std::string &from, const std::string &to); + ANTLR4CPP_PUBLIC std::vector split(const std::string &s, const std::string &sep, int count); + ANTLR4CPP_PUBLIC std::string indent(const std::string &s, const std::string &indentation, bool includingFirst = true); // Using RAII + a lambda to implement a "finally" replacement. template @@ -60,23 +60,6 @@ namespace antlrcpp { } // Get the error text from an exception pointer or the current exception. - std::string what(std::exception_ptr eptr = std::current_exception()); - - class SingleWriteMultipleReadLock { - public: - void readLock(); - void readUnlock(); - void writeLock(); - void writeUnlock(); - - private: - std::condition_variable _readerGate; - std::condition_variable _writerGate; - - std::mutex _mutex; - size_t _activeReaders = 0; - size_t _waitingWriters = 0; - size_t _activeWriters = 0; - }; + ANTLR4CPP_PUBLIC std::string what(std::exception_ptr eptr = std::current_exception()); } // namespace antlrcpp diff --git a/runtime/Cpp/runtime/src/support/Casts.h b/runtime/Cpp/runtime/src/support/Casts.h index 5c5bfb2424..2ded955dcd 100644 --- a/runtime/Cpp/runtime/src/support/Casts.h +++ b/runtime/Cpp/runtime/src/support/Casts.h @@ -6,28 +6,29 @@ #pragma once #include +#include #include namespace antlrcpp { -template -To downCast(From* from) { - static_assert(std::is_pointer::value, "Target type not a pointer."); - static_assert((std::is_base_of::type>::value), "Target type not derived from source type."); -#if !defined(__GNUC__) || defined(__GXX_RTTI) - assert(from == nullptr || dynamic_cast(from) != nullptr); -#endif - return static_cast(from); -} + template + To downCast(From* from) { + static_assert(std::is_pointer_v, "Target type not a pointer."); + static_assert(std::is_base_of_v>, "Target type not derived from source type."); + #if !defined(__GNUC__) || defined(__GXX_RTTI) + assert(from == nullptr || dynamic_cast(from) != nullptr); + #endif + return static_cast(from); + } -template -To downCast(From& from) { - static_assert(std::is_lvalue_reference::value, "Target type not a lvalue reference."); - static_assert((std::is_base_of::type>::value), "Target type not derived from source type."); -#if !defined(__GNUC__) || defined(__GXX_RTTI) - assert(dynamic_cast::type>::type>(&from) != nullptr); -#endif - return static_cast(from); -} + template + To downCast(From& from) { + static_assert(std::is_lvalue_reference_v, "Target type not a lvalue reference."); + static_assert(std::is_base_of_v>, "Target type not derived from source type."); + #if !defined(__GNUC__) || defined(__GXX_RTTI) + assert(dynamic_cast>>(std::addressof(from)) != nullptr); + #endif + return static_cast(from); + } } diff --git a/runtime/Cpp/runtime/src/support/Declarations.h b/runtime/Cpp/runtime/src/support/Declarations.h index a355d9b5bf..8e960676cf 100644 --- a/runtime/Cpp/runtime/src/support/Declarations.h +++ b/runtime/Cpp/runtime/src/support/Declarations.h @@ -69,7 +69,6 @@ namespace antlr4 { class ATNSimulator; class ATNState; enum class ATNType; - class AbstractPredicateTransition; class ActionTransition; class ArrayPredictionContext; class AtomTransition; @@ -78,7 +77,6 @@ namespace antlr4 { class BlockEndState; class BlockStartState; class DecisionState; - class EmptyPredictionContext; class EpsilonTransition; class LL1Analyzer; class LexerAction; diff --git a/runtime/Cpp/runtime/src/support/Guid.cpp b/runtime/Cpp/runtime/src/support/Guid.cpp deleted file mode 100755 index 76a78851f7..0000000000 --- a/runtime/Cpp/runtime/src/support/Guid.cpp +++ /dev/null @@ -1,270 +0,0 @@ -/* - The MIT License (MIT) - - Copyright (c) 2014 Graeme Hill (http://graemehill.ca) - - 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 - -#include "Guid.h" - -#ifdef GUID_LIBUUID -#include -#endif - -#ifdef GUID_CFUUID -#include -#endif - -#ifdef GUID_WINDOWS -#include -#endif - -#ifdef GUID_ANDROID -#include -#endif - -namespace antlrcpp { - -// overload << so that it's easy to convert to a string -std::ostream &operator<<(std::ostream &s, const Guid &guid) { - return s << std::hex << std::setfill('0') - << std::setw(2) << static_cast(guid.bytes_[0]) - << std::setw(2) << static_cast(guid.bytes_[1]) - << std::setw(2) << static_cast(guid.bytes_[2]) - << std::setw(2) << static_cast(guid.bytes_[3]) - << "-" - << std::setw(2) << static_cast(guid.bytes_[4]) - << std::setw(2) << static_cast(guid.bytes_[5]) - << "-" - << std::setw(2) << static_cast(guid.bytes_[6]) - << std::setw(2) << static_cast(guid.bytes_[7]) - << "-" - << std::setw(2) << static_cast(guid.bytes_[8]) - << std::setw(2) << static_cast(guid.bytes_[9]) - << "-" - << std::setw(2) << static_cast(guid.bytes_[10]) - << std::setw(2) << static_cast(guid.bytes_[11]) - << std::setw(2) << static_cast(guid.bytes_[12]) - << std::setw(2) << static_cast(guid.bytes_[13]) - << std::setw(2) << static_cast(guid.bytes_[14]) - << std::setw(2) << static_cast(guid.bytes_[15]); -} - -// create a guid from vector of bytes -Guid::Guid(const std::vector &bytes) { - std::memcpy(bytes_.data(), bytes.data(), std::min(bytes.size(), bytes_.size())); -} - -Guid::Guid(const std::array &bytes) : bytes_(bytes) {} - -// create a guid from array of bytes -Guid::Guid(const uint8_t *bytes) { - std::memcpy(bytes_.data(), bytes, 16); -} - -// create a guid from array of words -Guid::Guid(const uint16_t *bytes, bool reverse) { - size_t j = 0; - if (reverse) { - for (size_t i = 8; i > 0; --i) { - bytes_[j++] = static_cast(bytes[i - 1] >> 8); - bytes_[j++] = static_cast(bytes[i - 1] & 0xFF); - } - } else { - for (size_t i = 0; i < 8; ++i) { - bytes_[j++] = static_cast(bytes[i] & 0xFF); - bytes_[j++] = static_cast(bytes[i] >> 8); - } - } -} - -namespace { - -// converts a single hex char to a number (0 - 15) -uint8_t hexDigitToChar(char ch) { - if (ch > 47 && ch < 58) - return (uint8_t)(ch - 48); - - if (ch > 96 && ch < 103) - return (uint8_t)(ch - 87); - - if (ch > 64 && ch < 71) - return (uint8_t)(ch - 55); - - return 0; -} - -// converts the two hexadecimal characters to an unsigned char (a byte) -uint8_t hexPairToChar(char a, char b) { - return hexDigitToChar(a) * 16 + hexDigitToChar(b); -} - -} - -// create a guid from string -Guid::Guid(const std::string &fromString) { - char charOne = 0, charTwo; - bool lookingForFirstChar = true; - - size_t i = 0; - for (const char &ch : fromString) - { - if (ch == '-') - continue; - - if (lookingForFirstChar) - { - charOne = ch; - lookingForFirstChar = false; - } - else - { - charTwo = ch; - bytes_[i++] = hexPairToChar(charOne, charTwo); - lookingForFirstChar = true; - } - } -} - -std::string Guid::toString() const { - std::stringstream os; - os << *this; - return os.str(); -} - -// This is the linux friendly implementation, but it could work on other -// systems that have libuuid available -#ifdef GUID_LIBUUID -Guid GuidGenerator::newGuid() -{ - uuid_t id; - uuid_generate(id); - return id; -} -#endif - -// this is the mac and ios version -#ifdef GUID_CFUUID -Guid GuidGenerator::newGuid() -{ - auto newId = CFUUIDCreate(NULL); - auto bytes = CFUUIDGetUUIDBytes(newId); - CFRelease(newId); - - const unsigned char byteArray[16] = - { - bytes.byte0, - bytes.byte1, - bytes.byte2, - bytes.byte3, - bytes.byte4, - bytes.byte5, - bytes.byte6, - bytes.byte7, - bytes.byte8, - bytes.byte9, - bytes.byte10, - bytes.byte11, - bytes.byte12, - bytes.byte13, - bytes.byte14, - bytes.byte15 - }; - return byteArray; -} -#endif - -// obviously this is the windows version -#ifdef GUID_WINDOWS -Guid GuidGenerator::newGuid() -{ - GUID newId; - CoCreateGuid(&newId); - - const unsigned char bytes[16] = - { - (newId.Data1 >> 24) & 0xFF, - (newId.Data1 >> 16) & 0xFF, - (newId.Data1 >> 8) & 0xFF, - (newId.Data1) & 0xff, - - (newId.Data2 >> 8) & 0xFF, - (newId.Data2) & 0xff, - - (newId.Data3 >> 8) & 0xFF, - (newId.Data3) & 0xFF, - - newId.Data4[0], - newId.Data4[1], - newId.Data4[2], - newId.Data4[3], - newId.Data4[4], - newId.Data4[5], - newId.Data4[6], - newId.Data4[7] - }; - - return bytes; -} -#endif - -// android version that uses a call to a java api -#ifdef GUID_ANDROID -GuidGenerator::GuidGenerator(JNIEnv *env) -{ - _env = env; - _uuidClass = env->FindClass("java/util/UUID"); - _newGuidMethod = env->GetStaticMethodID(_uuidClass, "randomUUID", "()Ljava/util/UUID;"); - _mostSignificantBitsMethod = env->GetMethodID(_uuidClass, "getMostSignificantBits", "()J"); - _leastSignificantBitsMethod = env->GetMethodID(_uuidClass, "getLeastSignificantBits", "()J"); -} - -Guid GuidGenerator::newGuid() -{ - jobject javaUuid = _env->CallStaticObjectMethod(_uuidClass, _newGuidMethod); - jlong mostSignificant = _env->CallLongMethod(javaUuid, _mostSignificantBitsMethod); - jlong leastSignificant = _env->CallLongMethod(javaUuid, _leastSignificantBitsMethod); - - unsigned char bytes[16] = - { - (mostSignificant >> 56) & 0xFF, - (mostSignificant >> 48) & 0xFF, - (mostSignificant >> 40) & 0xFF, - (mostSignificant >> 32) & 0xFF, - (mostSignificant >> 24) & 0xFF, - (mostSignificant >> 16) & 0xFF, - (mostSignificant >> 8) & 0xFF, - (mostSignificant) & 0xFF, - (leastSignificant >> 56) & 0xFF, - (leastSignificant >> 48) & 0xFF, - (leastSignificant >> 40) & 0xFF, - (leastSignificant >> 32) & 0xFF, - (leastSignificant >> 24) & 0xFF, - (leastSignificant >> 16) & 0xFF, - (leastSignificant >> 8) & 0xFF, - (leastSignificant) & 0xFF, - }; - return bytes; -} -#endif - -} diff --git a/runtime/Cpp/runtime/src/support/Guid.h b/runtime/Cpp/runtime/src/support/Guid.h deleted file mode 100755 index 3efc686891..0000000000 --- a/runtime/Cpp/runtime/src/support/Guid.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - The MIT License (MIT) - - Copyright (c) 2014 Graeme Hill (http://graemehill.ca) - - 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. - */ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef GUID_ANDROID -#include -#endif - -namespace antlrcpp { - -// Class to represent a GUID/UUID. Each instance acts as a wrapper around a -// 16 byte value that can be passed around by value. It also supports -// conversion to string (via the stream operator <<) and conversion from a -// string via constructor. -class Guid final { -public: - using size_type = typename std::array::size_type; - using pointer = typename std::array::pointer; - using const_pointer = typename std::array::const_pointer; - using iterator = typename std::array::iterator; - using reverse_iterator = typename std::array::reverse_iterator; - using const_iterator = typename std::array::const_iterator; - using const_reverse_iterator = typename std::array::const_reverse_iterator; - - // create a guid from vector of bytes - Guid(const std::vector &bytes); - - explicit Guid(const std::array &bytes); - - // create a guid from array of bytes - Guid(const uint8_t *bytes); - - // Create a guid from array of words. - Guid(const uint16_t *bytes, bool reverse); - - // create a guid from string - Guid(const std::string &fromString); - - // create empty guid - Guid() = default; - - // copy constructor - Guid(const Guid &other) = default; - - // overload assignment operator - Guid &operator=(const Guid &other) = default; - - // overload equality and inequality operator - friend bool operator==(const Guid &lhs, const Guid &rhs) { - return std::memcmp(lhs.data(), rhs.data(), 16) == 0; - } - - friend bool operator!=(const Guid &lhs, const Guid &rhs) { - return !operator==(lhs, rhs); - } - - // make the << operator a friend so it can access bytes_ - friend std::ostream &operator<<(std::ostream &s, const Guid &guid); - - pointer data() { return bytes_.data(); } - - const_pointer data() const { return bytes_.data(); } - - size_type size() const { return bytes_.size(); } - - std::string toString() const; - - iterator begin() { return bytes_.begin(); } - - iterator end() { return bytes_.end(); } - - reverse_iterator rbegin() { return bytes_.rbegin(); } - - reverse_iterator rend() { return bytes_.rend(); } - - const_iterator cbegin() const { return bytes_.begin(); } - - const_iterator cend() const { return bytes_.end(); } - - const_reverse_iterator crbegin() const { return bytes_.rbegin(); } - - const_reverse_iterator crend() const { return bytes_.rend(); } - - const_iterator begin() const { return bytes_.begin(); } - - const_iterator end() const { return bytes_.end(); } - - const_reverse_iterator rbegin() const { return bytes_.rbegin(); } - - const_reverse_iterator rend() const { return bytes_.rend(); } - -private: - // actual data - std::array bytes_; -}; - -// Class that can create new guids. The only reason this exists instead of -// just a global "newGuid" function is because some platforms will require -// that there is some attached context. In the case of android, we need to -// know what JNIEnv is being used to call back to Java, but the newGuid() -// function would no longer be cross-platform if we parameterized the android -// version. Instead, construction of the GuidGenerator may be different on -// each platform, but the use of newGuid is uniform. -class GuidGenerator final { -public: -#ifdef GUID_ANDROID - GuidGenerator(JNIEnv *env); -#else - GuidGenerator() { } -#endif - - Guid newGuid(); - -#ifdef GUID_ANDROID -private: - JNIEnv *_env; - jclass _uuidClass; - jmethodID _newGuidMethod; - jmethodID _mostSignificantBitsMethod; - jmethodID _leastSignificantBitsMethod; -#endif -}; - -} diff --git a/runtime/Cpp/runtime/src/support/StringUtils.cpp b/runtime/Cpp/runtime/src/support/StringUtils.cpp index 15e7b83683..9ee274c8de 100644 --- a/runtime/Cpp/runtime/src/support/StringUtils.cpp +++ b/runtime/Cpp/runtime/src/support/StringUtils.cpp @@ -7,40 +7,32 @@ namespace antlrcpp { -void replaceAll(std::string& str, std::string const& from, std::string const& to) -{ - if (from.empty()) - return; - - size_t start_pos = 0; - while ((start_pos = str.find(from, start_pos)) != std::string::npos) { - str.replace(start_pos, from.length(), to); - start_pos += to.length(); // In case 'to' contains 'from', like replacing 'x' with 'yx'. + std::string escapeWhitespace(std::string_view in) { + std::string out; + escapeWhitespace(out, in); + out.shrink_to_fit(); + return out; } -} - -std::string ws2s(std::wstring const& wstr) { -#ifndef USE_UTF8_INSTEAD_OF_CODECVT - std::wstring_convert> converter; - std::string narrow = converter.to_bytes(wstr); -#else - std::string narrow; - utf8::utf32to8(wstr.begin(), wstr.end(), std::back_inserter(narrow)); -#endif - - return narrow; -} -std::wstring s2ws(const std::string &str) { -#ifndef USE_UTF8_INSTEAD_OF_CODECVT - std::wstring_convert> converter; - std::wstring wide = converter.from_bytes(str); -#else - std::wstring wide; - utf8::utf8to32(str.begin(), str.end(), std::back_inserter(wide)); -#endif - - return wide; -} + std::string& escapeWhitespace(std::string& out, std::string_view in) { + out.reserve(in.size()); // Best case, no escaping. + for (const auto &c : in) { + switch (c) { + case '\t': + out.append("\\t"); + break; + case '\r': + out.append("\\r"); + break; + case '\n': + out.append("\\n"); + break; + default: + out.push_back(c); + break; + } + } + return out; + } } // namespace antrlcpp diff --git a/runtime/Cpp/runtime/src/support/StringUtils.h b/runtime/Cpp/runtime/src/support/StringUtils.h index d00cc52d9c..aee0d46d6e 100644 --- a/runtime/Cpp/runtime/src/support/StringUtils.h +++ b/runtime/Cpp/runtime/src/support/StringUtils.h @@ -7,70 +7,10 @@ #include "antlr4-common.h" -#ifdef USE_UTF8_INSTEAD_OF_CODECVT -#include "utf8.h" -#endif - namespace antlrcpp { - // For all conversions utf8 <-> utf32. - // I wouldn't prefer wstring_convert because: according to - // https://en.cppreference.com/w/cpp/locale/wstring_convert, - // wstring_convert is deprecated in C++17. - // utfcpp (https://github.com/nemtrif/utfcpp) is a substitution. -#ifndef USE_UTF8_INSTEAD_OF_CODECVT - // VS 2015 and VS 2017 have different bugs in std::codecvt_utf8 (VS 2013 works fine). - #if defined(_MSC_VER) && _MSC_VER >= 1900 && _MSC_VER < 2000 - typedef std::wstring_convert, __int32> UTF32Converter; - #else - typedef std::wstring_convert, char32_t> UTF32Converter; - #endif -#endif - - // The conversion functions fails in VS2017, so we explicitly use a workaround. - template - inline std::string utf32_to_utf8(T const& data) - { - #ifndef USE_UTF8_INSTEAD_OF_CODECVT - // Don't make the converter static or we have to serialize access to it. - thread_local UTF32Converter converter; - - #if defined(_MSC_VER) && _MSC_VER >= 1900 && _MSC_VER < 2000 - const auto p = reinterpret_cast(data.data()); - return converter.to_bytes(p, p + data.size()); - #else - return converter.to_bytes(data); - #endif - #else - std::string narrow; - utf8::utf32to8(data.begin(), data.end(), std::back_inserter(narrow)); - return narrow; - #endif - } - - inline UTF32String utf8_to_utf32(const char* first, const char* last) - { - #ifndef USE_UTF8_INSTEAD_OF_CODECVT - thread_local UTF32Converter converter; - - #if defined(_MSC_VER) && _MSC_VER >= 1900 && _MSC_VER < 2000 - auto r = converter.from_bytes(first, last); - i32string s = reinterpret_cast(r.data()); - return s; - #else - std::u32string s = converter.from_bytes(first, last); - return s; - #endif - #else - UTF32String wide; - utf8::utf8to32(first, last, std::back_inserter(wide)); - return wide; - #endif - } + ANTLR4CPP_PUBLIC std::string escapeWhitespace(std::string_view in); - void replaceAll(std::string &str, std::string const& from, std::string const& to); + ANTLR4CPP_PUBLIC std::string& escapeWhitespace(std::string& out, std::string_view in); - // string <-> wstring conversion (UTF-16), e.g. for use with Window's wide APIs. - ANTLR4CPP_PUBLIC std::string ws2s(std::wstring const& wstr); - ANTLR4CPP_PUBLIC std::wstring s2ws(std::string const& str); } diff --git a/runtime/Cpp/runtime/src/support/Unicode.h b/runtime/Cpp/runtime/src/support/Unicode.h new file mode 100644 index 0000000000..f0f84375ad --- /dev/null +++ b/runtime/Cpp/runtime/src/support/Unicode.h @@ -0,0 +1,28 @@ +/* Copyright (c) 2021 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +#pragma once + +#include "antlr4-common.h" + +namespace antlrcpp { + + class ANTLR4CPP_PUBLIC Unicode final { + public: + static constexpr char32_t REPLACEMENT_CHARACTER = 0xfffd; + + static constexpr bool isValid(char32_t codePoint) { + return codePoint < 0xd800 || (codePoint > 0xdfff && codePoint <= 0x10ffff); + } + + private: + Unicode() = delete; + Unicode(const Unicode&) = delete; + Unicode(Unicode&&) = delete; + Unicode& operator=(const Unicode&) = delete; + Unicode& operator=(Unicode&&) = delete; + }; + +} diff --git a/runtime/Cpp/runtime/src/support/Utf8.cpp b/runtime/Cpp/runtime/src/support/Utf8.cpp new file mode 100644 index 0000000000..294e9f1b21 --- /dev/null +++ b/runtime/Cpp/runtime/src/support/Utf8.cpp @@ -0,0 +1,242 @@ +/* Copyright (c) 2021 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +#include +#include + +#include "support/Utf8.h" +#include "support/Unicode.h" + +// The below implementation is based off of https://github.com/google/cel-cpp/internal/utf8.cc, +// which is itself based off of https://go.googlesource.com/go/+/refs/heads/master/src/unicode/utf8/utf8.go. +// If for some reason you feel the need to copy this implementation, please retain a comment +// referencing the two source files and giving credit, as well as maintaining any and all +// obligations required by the BSD 3-clause license that governs this file. + +namespace antlrcpp { + +namespace { + +#undef SELF + constexpr uint8_t SELF = 0x80; + +#undef LOW + constexpr uint8_t LOW = 0x80; +#undef HIGH + constexpr uint8_t HIGH = 0xbf; + +#undef MASKX + constexpr uint8_t MASKX = 0x3f; +#undef MASK2 + constexpr uint8_t MASK2 = 0x1f; +#undef MASK3 + constexpr uint8_t MASK3 = 0xf; +#undef MASK4 + constexpr uint8_t MASK4 = 0x7; + +#undef TX + constexpr uint8_t TX = 0x80; +#undef T2 + constexpr uint8_t T2 = 0xc0; +#undef T3 + constexpr uint8_t T3 = 0xe0; +#undef T4 + constexpr uint8_t T4 = 0xf0; + +#undef XX + constexpr uint8_t XX = 0xf1; +#undef AS + constexpr uint8_t AS = 0xf0; +#undef S1 + constexpr uint8_t S1 = 0x02; +#undef S2 + constexpr uint8_t S2 = 0x13; +#undef S3 + constexpr uint8_t S3 = 0x03; +#undef S4 + constexpr uint8_t S4 = 0x23; +#undef S5 + constexpr uint8_t S5 = 0x34; +#undef S6 + constexpr uint8_t S6 = 0x04; +#undef S7 + constexpr uint8_t S7 = 0x44; + + // NOLINTBEGIN + // clang-format off +#undef LEADING + constexpr uint8_t LEADING[256] = { + // 1 2 3 4 5 6 7 8 9 A B C D E F + AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x00-0x0F + AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x10-0x1F + AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x20-0x2F + AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x30-0x3F + AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x40-0x4F + AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x50-0x5F + AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x60-0x6F + AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, AS, // 0x70-0x7F + // 1 2 3 4 5 6 7 8 9 A B C D E F + XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, // 0x80-0x8F + XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, // 0x90-0x9F + XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, // 0xA0-0xAF + XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, // 0xB0-0xBF + XX, XX, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, // 0xC0-0xCF + S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, S1, // 0xD0-0xDF + S2, S3, S3, S3, S3, S3, S3, S3, S3, S3, S3, S3, S3, S4, S3, S3, // 0xE0-0xEF + S5, S6, S6, S6, S7, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, // 0xF0-0xFF + }; + // clang-format on + // NOLINTEND + +#undef ACCEPT + constexpr std::pair ACCEPT[16] = { + {LOW, HIGH}, {0xa0, HIGH}, {LOW, 0x9f}, {0x90, HIGH}, + {LOW, 0x8f}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, + {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, + {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, + }; + +} // namespace + + std::pair Utf8::decode(std::string_view input) { + assert(!input.empty()); + const auto b = static_cast(input.front()); + input.remove_prefix(1); + if (b < SELF) { + return {static_cast(b), 1}; + } + const auto leading = LEADING[b]; + if (leading == XX) { + return {Unicode::REPLACEMENT_CHARACTER, 1}; + } + auto size = static_cast(leading & 7) - 1; + if (size > input.size()) { + return {Unicode::REPLACEMENT_CHARACTER, 1}; + } + const auto& accept = ACCEPT[leading >> 4]; + const auto b1 = static_cast(input.front()); + input.remove_prefix(1); + if (b1 < accept.first || b1 > accept.second) { + return {Unicode::REPLACEMENT_CHARACTER, 1}; + } + if (size <= 1) { + return {(static_cast(b & MASK2) << 6) | + static_cast(b1 & MASKX), + 2}; + } + const auto b2 = static_cast(input.front()); + input.remove_prefix(1); + if (b2 < LOW || b2 > HIGH) { + return {Unicode::REPLACEMENT_CHARACTER, 1}; + } + if (size <= 2) { + return {(static_cast(b & MASK3) << 12) | + (static_cast(b1 & MASKX) << 6) | + static_cast(b2 & MASKX), + 3}; + } + const auto b3 = static_cast(input.front()); + input.remove_prefix(1); + if (b3 < LOW || b3 > HIGH) { + return {Unicode::REPLACEMENT_CHARACTER, 1}; + } + return {(static_cast(b & MASK4) << 18) | + (static_cast(b1 & MASKX) << 12) | + (static_cast(b2 & MASKX) << 6) | + static_cast(b3 & MASKX), + 4}; + } + + std::optional Utf8::strictDecode(std::string_view input) { + std::u32string output; + char32_t codePoint; + size_t codeUnits; + output.reserve(input.size()); // Worst case is each byte is a single Unicode code point. + for (size_t index = 0; index < input.size(); index += codeUnits) { + std::tie(codePoint, codeUnits) = Utf8::decode(input.substr(index)); + if (codePoint == Unicode::REPLACEMENT_CHARACTER && codeUnits == 1) { + // Condition is only met when an illegal byte sequence is encountered. See Utf8::decode. + return std::nullopt; + } + output.push_back(codePoint); + } + output.shrink_to_fit(); + return output; + } + + std::u32string Utf8::lenientDecode(std::string_view input) { + std::u32string output; + char32_t codePoint; + size_t codeUnits; + output.reserve(input.size()); // Worst case is each byte is a single Unicode code point. + for (size_t index = 0; index < input.size(); index += codeUnits) { + std::tie(codePoint, codeUnits) = Utf8::decode(input.substr(index)); + output.push_back(codePoint); + } + output.shrink_to_fit(); + return output; + } + + std::string& Utf8::encode(std::string* buffer, char32_t codePoint) { + assert(buffer != nullptr); + if (!Unicode::isValid(codePoint)) { + codePoint = Unicode::REPLACEMENT_CHARACTER; + } + if (codePoint <= 0x7f) { + buffer->push_back(static_cast(static_cast(codePoint))); + } else if (codePoint <= 0x7ff) { + buffer->push_back( + static_cast(T2 | static_cast(codePoint >> 6))); + buffer->push_back( + static_cast(TX | (static_cast(codePoint) & MASKX))); + } else if (codePoint <= 0xffff) { + buffer->push_back( + static_cast(T3 | static_cast(codePoint >> 12))); + buffer->push_back(static_cast( + TX | (static_cast(codePoint >> 6) & MASKX))); + buffer->push_back( + static_cast(TX | (static_cast(codePoint) & MASKX))); + } else { + buffer->push_back( + static_cast(T4 | static_cast(codePoint >> 18))); + buffer->push_back(static_cast( + TX | (static_cast(codePoint >> 12) & MASKX))); + buffer->push_back(static_cast( + TX | (static_cast(codePoint >> 6) & MASKX))); + buffer->push_back( + static_cast(TX | (static_cast(codePoint) & MASKX))); + } + return *buffer; + } + + std::optional Utf8::strictEncode(std::u32string_view input) { + std::string output; + output.reserve(input.size() * 4); // Worst case is each Unicode code point encodes to 4 bytes. + for (size_t index = 0; index < input.size(); index++) { + char32_t codePoint = input[index]; + if (!Unicode::isValid(codePoint)) { + return std::nullopt; + } + Utf8::encode(&output, codePoint); + } + output.shrink_to_fit(); + return output; + } + + std::string Utf8::lenientEncode(std::u32string_view input) { + std::string output; + output.reserve(input.size() * 4); // Worst case is each Unicode code point encodes to 4 bytes. + for (size_t index = 0; index < input.size(); index++) { + char32_t codePoint = input[index]; + if (!Unicode::isValid(codePoint)) { + codePoint = Unicode::REPLACEMENT_CHARACTER; + } + Utf8::encode(&output, codePoint); + } + output.shrink_to_fit(); + return output; + } + +} diff --git a/runtime/Cpp/runtime/src/support/Utf8.h b/runtime/Cpp/runtime/src/support/Utf8.h new file mode 100644 index 0000000000..e4828441cd --- /dev/null +++ b/runtime/Cpp/runtime/src/support/Utf8.h @@ -0,0 +1,54 @@ +/* Copyright (c) 2021 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +#pragma once + +#include +#include +#include +#include + +#include "antlr4-common.h" + +namespace antlrcpp { + + class ANTLR4CPP_PUBLIC Utf8 final { + public: + // Decodes the next code point, returning the decoded code point and the number + // of code units (a.k.a. bytes) consumed. In the event that an invalid code unit + // sequence is returned the replacement character, U+FFFD, is returned with a + // code unit count of 1. As U+FFFD requires 3 code units when encoded, this can + // be used to differentiate valid input from malformed input. + static std::pair decode(std::string_view input); + + // Decodes the given UTF-8 encoded input into a string of code points. + static std::optional strictDecode(std::string_view input); + + // Decodes the given UTF-8 encoded input into a string of code points. Unlike strictDecode(), + // each byte in an illegal byte sequence is replaced with the Unicode replacement character, + // U+FFFD. + static std::u32string lenientDecode(std::string_view input); + + // Encodes the given code point and appends it to the buffer. If the code point + // is an unpaired surrogate or outside of the valid Unicode range it is replaced + // with the replacement character, U+FFFD. + static std::string& encode(std::string *buffer, char32_t codePoint); + + // Encodes the given Unicode code point string as UTF-8. + static std::optional strictEncode(std::u32string_view input); + + // Encodes the given Unicode code point string as UTF-8. Unlike strictEncode(), + // each invalid Unicode code point is replaced with the Unicode replacement character, U+FFFD. + static std::string lenientEncode(std::u32string_view input); + + private: + Utf8() = delete; + Utf8(const Utf8&) = delete; + Utf8(Utf8&&) = delete; + Utf8& operator=(const Utf8&) = delete; + Utf8& operator=(Utf8&&) = delete; + }; + +} diff --git a/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h b/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h index d21795b20c..37b80b3fbe 100755 --- a/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h +++ b/runtime/Cpp/runtime/src/tree/AbstractParseTreeVisitor.h @@ -5,6 +5,7 @@ #pragma once +#include "tree/ParseTree.h" #include "tree/ParseTreeVisitor.h" namespace antlr4 { @@ -14,7 +15,7 @@ namespace tree { public: /// The default implementation calls on the /// specified tree. - virtual antlrcpp::Any visit(ParseTree *tree) override { + virtual std::any visit(ParseTree *tree) override { return tree->accept(this); } @@ -31,16 +32,16 @@ namespace tree { * the tree structure. Visitors that modify the tree should override this * method to behave properly in respect to the specific algorithm in use.

*/ - virtual antlrcpp::Any visitChildren(ParseTree *node) override { - antlrcpp::Any result = defaultResult(); + virtual std::any visitChildren(ParseTree *node) override { + std::any result = defaultResult(); size_t n = node->children.size(); for (size_t i = 0; i < n; i++) { if (!shouldVisitNextChild(node, result)) { break; } - antlrcpp::Any childResult = node->children[i]->accept(this); - result = aggregateResult(result, childResult); + std::any childResult = node->children[i]->accept(this); + result = aggregateResult(std::move(result), std::move(childResult)); } return result; @@ -48,13 +49,13 @@ namespace tree { /// The default implementation returns the result of /// . - virtual antlrcpp::Any visitTerminal(TerminalNode * /*node*/) override { + virtual std::any visitTerminal(TerminalNode * /*node*/) override { return defaultResult(); } /// The default implementation returns the result of /// . - virtual antlrcpp::Any visitErrorNode(ErrorNode * /*node*/) override { + virtual std::any visitErrorNode(ErrorNode * /*node*/) override { return defaultResult(); } @@ -66,11 +67,11 @@ namespace tree { /// The default implementation of /// initializes its aggregate result to this value. ///

- /// The base implementation returns {@code null}. + /// The base implementation returns {@code std::any()}. ///

/// The default value returned by visitor methods. - virtual antlrcpp::Any defaultResult() { - return nullptr; // support isNotNull + virtual std::any defaultResult() { + return std::any(); } /// @@ -91,7 +92,7 @@ namespace tree { /// a child node. /// /// The updated aggregate result. - virtual antlrcpp::Any aggregateResult(antlrcpp::Any /*aggregate*/, const antlrcpp::Any &nextResult) { + virtual std::any aggregateResult(std::any /*aggregate*/, std::any nextResult) { return nextResult; } @@ -118,7 +119,7 @@ namespace tree { /// {@code true} to continue visiting children. Otherwise return /// {@code false} to stop visiting children and immediately return the /// current aggregate result from . - virtual bool shouldVisitNextChild(ParseTree * /*node*/, const antlrcpp::Any &/*currentResult*/) { + virtual bool shouldVisitNextChild(ParseTree * /*node*/, const std::any &/*currentResult*/) { return true; } diff --git a/runtime/Cpp/runtime/src/tree/ErrorNode.cpp b/runtime/Cpp/runtime/src/tree/ErrorNode.cpp deleted file mode 100644 index ade2539afd..0000000000 --- a/runtime/Cpp/runtime/src/tree/ErrorNode.cpp +++ /dev/null @@ -1,9 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "tree/ErrorNode.h" - -antlr4::tree::ErrorNode::~ErrorNode() { -} diff --git a/runtime/Cpp/runtime/src/tree/ErrorNode.h b/runtime/Cpp/runtime/src/tree/ErrorNode.h index 619f44ddc2..c77a5a246a 100755 --- a/runtime/Cpp/runtime/src/tree/ErrorNode.h +++ b/runtime/Cpp/runtime/src/tree/ErrorNode.h @@ -10,9 +10,14 @@ namespace antlr4 { namespace tree { - class ANTLR4CPP_PUBLIC ErrorNode : public virtual TerminalNode { + class ANTLR4CPP_PUBLIC ErrorNode : public TerminalNode { public: - ~ErrorNode() override; + static bool is(const tree::ParseTree &parseTree) { return parseTree.getTreeType() == tree::ParseTreeType::ERROR; } + + static bool is(const tree::ParseTree *parseTree) { return parseTree != nullptr && is(*parseTree); } + + protected: + using TerminalNode::TerminalNode; }; } // namespace tree diff --git a/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp b/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp index fde942d354..f13833fa5c 100755 --- a/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp +++ b/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp @@ -3,21 +3,52 @@ * can be found in the LICENSE.txt file in the project root. */ -#include "Exceptions.h" +#include "misc/Interval.h" +#include "Token.h" +#include "RuleContext.h" #include "tree/ParseTreeVisitor.h" #include "tree/ErrorNodeImpl.h" using namespace antlr4; -using namespace antlr4::misc; using namespace antlr4::tree; -ErrorNodeImpl::ErrorNodeImpl(Token *token) : TerminalNodeImpl(token) { +Token* ErrorNodeImpl::getSymbol() const { + return symbol; } -ErrorNodeImpl::~ErrorNodeImpl() { +void ErrorNodeImpl::setParent(RuleContext *parent_) { + this->parent = parent_; } -antlrcpp::Any ErrorNodeImpl::accept(ParseTreeVisitor *visitor) { +misc::Interval ErrorNodeImpl::getSourceInterval() { + if (symbol == nullptr) { + return misc::Interval::INVALID; + } + + size_t tokenIndex = symbol->getTokenIndex(); + return misc::Interval(tokenIndex, tokenIndex); +} + +std::any ErrorNodeImpl::accept(ParseTreeVisitor *visitor) { return visitor->visitErrorNode(this); } + +std::string ErrorNodeImpl::getText() { + return symbol->getText(); +} + +std::string ErrorNodeImpl::toStringTree(Parser * /*parser*/, bool /*pretty*/) { + return toString(); +} + +std::string ErrorNodeImpl::toString() { + if (symbol->getType() == Token::EOF) { + return ""; + } + return symbol->getText(); +} + +std::string ErrorNodeImpl::toStringTree(bool /*pretty*/) { + return toString(); +} diff --git a/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h b/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h index b64b6f979c..dc9bd10587 100755 --- a/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h +++ b/runtime/Cpp/runtime/src/tree/ErrorNodeImpl.h @@ -21,12 +21,22 @@ namespace tree { /// and deletion as well as during "consume until error recovery set" /// upon no viable alternative exceptions. /// - class ANTLR4CPP_PUBLIC ErrorNodeImpl : public virtual TerminalNodeImpl, public virtual ErrorNode { + class ANTLR4CPP_PUBLIC ErrorNodeImpl : public ErrorNode { public: - ErrorNodeImpl(Token *token); - ~ErrorNodeImpl() override; + Token *symbol; - virtual antlrcpp::Any accept(ParseTreeVisitor *visitor) override; + explicit ErrorNodeImpl(Token *symbol) : ErrorNode(ParseTreeType::ERROR), symbol(symbol) {} + + virtual Token* getSymbol() const override; + virtual void setParent(RuleContext *parent) override; + virtual misc::Interval getSourceInterval() override; + + virtual std::any accept(ParseTreeVisitor *visitor) override; + + virtual std::string getText() override; + virtual std::string toStringTree(Parser *parser, bool pretty = false) override; + virtual std::string toString() override; + virtual std::string toStringTree(bool pretty = false) override; }; } // namespace tree diff --git a/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp b/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp index a4b3efd73d..83e6339518 100644 --- a/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp +++ b/runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp @@ -4,6 +4,7 @@ */ #include "support/CPPUtils.h" +#include "support/Casts.h" #include "tree/ParseTreeListener.h" #include "tree/ParseTree.h" @@ -12,29 +13,26 @@ #include "IterativeParseTreeWalker.h" using namespace antlr4::tree; +using namespace antlrcpp; void IterativeParseTreeWalker::walk(ParseTreeListener *listener, ParseTree *t) const { - - std::vector nodeStack; - std::vector indexStack; - + std::vector> stack; ParseTree *currentNode = t; size_t currentIndex = 0; while (currentNode != nullptr) { // pre-order visit - if (antlrcpp::is(currentNode)) { - listener->visitErrorNode(dynamic_cast(currentNode)); - } else if (antlrcpp::is(currentNode)) { - listener->visitTerminal((TerminalNode *)currentNode); + if (ErrorNode::is(*currentNode)) { + listener->visitErrorNode(downCast(currentNode)); + } else if (TerminalNode::is(*currentNode)) { + listener->visitTerminal(downCast(currentNode)); } else { enterRule(listener, currentNode); } // Move down to first child, if it exists. if (!currentNode->children.empty()) { - nodeStack.push_back(currentNode); - indexStack.push_back(currentIndex); + stack.push_back(std::make_pair(currentNode, currentIndex)); currentIndex = 0; currentNode = currentNode->children[0]; continue; @@ -43,29 +41,26 @@ void IterativeParseTreeWalker::walk(ParseTreeListener *listener, ParseTree *t) c // No child nodes, so walk tree. do { // post-order visit - if (!antlrcpp::is(currentNode)) { + if (!TerminalNode::is(*currentNode)) { exitRule(listener, currentNode); } // No parent, so no siblings. - if (nodeStack.empty()) { + if (stack.empty()) { currentNode = nullptr; currentIndex = 0; break; } // Move to next sibling if possible. - if (nodeStack.back()->children.size() > ++currentIndex) { - currentNode = nodeStack.back()->children[currentIndex]; + if (stack.back().first->children.size() > ++currentIndex) { + currentNode = stack.back().first->children[currentIndex]; break; } // No next sibling, so move up. - currentNode = nodeStack.back(); - nodeStack.pop_back(); - currentIndex = indexStack.back(); - indexStack.pop_back(); - + std::tie(currentNode, currentIndex) = stack.back(); + stack.pop_back(); } while (currentNode != nullptr); } } diff --git a/runtime/Cpp/runtime/src/tree/ParseTree.cpp b/runtime/Cpp/runtime/src/tree/ParseTree.cpp index b975a4064d..2d529cb011 100755 --- a/runtime/Cpp/runtime/src/tree/ParseTree.cpp +++ b/runtime/Cpp/runtime/src/tree/ParseTree.cpp @@ -7,9 +7,6 @@ using namespace antlr4::tree; -ParseTree::ParseTree() : parent(nullptr) { -} - bool ParseTree::operator == (const ParseTree &other) const { return &other == this; } diff --git a/runtime/Cpp/runtime/src/tree/ParseTree.h b/runtime/Cpp/runtime/src/tree/ParseTree.h index 3b91be80e4..25df4890cd 100755 --- a/runtime/Cpp/runtime/src/tree/ParseTree.h +++ b/runtime/Cpp/runtime/src/tree/ParseTree.h @@ -6,6 +6,7 @@ #pragma once #include "support/Any.h" +#include "tree/ParseTreeType.h" namespace antlr4 { namespace tree { @@ -19,15 +20,15 @@ namespace tree { // ml: This class unites 4 Java classes: RuleNode, ParseTree, SyntaxTree and Tree. class ANTLR4CPP_PUBLIC ParseTree { public: - ParseTree(); ParseTree(ParseTree const&) = delete; - virtual ~ParseTree() {} + + virtual ~ParseTree() = default; ParseTree& operator=(ParseTree const&) = delete; /// The parent of this node. If the return value is null, then this /// node is the root of the tree. - ParseTree *parent; + ParseTree *parent = nullptr; /// If we are debugging or building a parse tree for a visitor, /// we need to track all of the tokens and rule invocations associated @@ -50,7 +51,7 @@ namespace tree { /// The needs a double dispatch method. // ml: This has been changed to use Any instead of a template parameter, to avoid the need of a virtual template function. - virtual antlrcpp::Any accept(ParseTreeVisitor *visitor) = 0; + virtual std::any accept(ParseTreeVisitor *visitor) = 0; /// Return the combined text of all leaf nodes. Does not get any /// off-channel tokens (if any) so won't return whitespace and @@ -74,6 +75,14 @@ namespace tree { * EOF is unspecified.

*/ virtual misc::Interval getSourceInterval() = 0; + + ParseTreeType getTreeType() const { return _treeType; } + + protected: + explicit ParseTree(ParseTreeType treeType) : _treeType(treeType) {} + + private: + const ParseTreeType _treeType; }; // A class to help managing ParseTree instances without the need of a shared_ptr. diff --git a/runtime/Cpp/runtime/src/tree/ParseTreeType.h b/runtime/Cpp/runtime/src/tree/ParseTreeType.h new file mode 100644 index 0000000000..17e0512b00 --- /dev/null +++ b/runtime/Cpp/runtime/src/tree/ParseTreeType.h @@ -0,0 +1,22 @@ +/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +#pragma once + +#include + +#include "antlr4-common.h" + +namespace antlr4 { +namespace tree { + + enum class ParseTreeType : size_t { + TERMINAL = 1, + ERROR = 2, + RULE = 3, + }; + +} // namespace tree +} // namespace antlr4 diff --git a/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h b/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h index 5a08599246..d68311ba34 100755 --- a/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h +++ b/runtime/Cpp/runtime/src/tree/ParseTreeVisitor.h @@ -27,7 +27,7 @@ namespace tree { /// /// The to visit. /// The result of visiting the parse tree. - virtual antlrcpp::Any visit(ParseTree *tree) = 0; + virtual std::any visit(ParseTree *tree) = 0; /// /// Visit the children of a node, and return a user-defined result of the @@ -35,21 +35,21 @@ namespace tree { /// /// The whose children should be visited. /// The result of visiting the children of the node. - virtual antlrcpp::Any visitChildren(ParseTree *node) = 0; + virtual std::any visitChildren(ParseTree *node) = 0; /// /// Visit a terminal node, and return a user-defined result of the operation. /// /// The to visit. /// The result of visiting the node. - virtual antlrcpp::Any visitTerminal(TerminalNode *node) = 0; + virtual std::any visitTerminal(TerminalNode *node) = 0; /// /// Visit an error node, and return a user-defined result of the operation. /// /// The to visit. /// The result of visiting the node. - virtual antlrcpp::Any visitErrorNode(ErrorNode *node) = 0; + virtual std::any visitErrorNode(ErrorNode *node) = 0; }; diff --git a/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp b/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp index 998c9ed55d..1eeabff883 100755 --- a/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp +++ b/runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp @@ -7,6 +7,7 @@ #include "ParserRuleContext.h" #include "tree/ParseTreeListener.h" #include "support/CPPUtils.h" +#include "support/Casts.h" #include "tree/IterativeParseTreeWalker.h" #include "tree/ParseTreeWalker.h" @@ -17,15 +18,13 @@ using namespace antlrcpp; static IterativeParseTreeWalker defaultWalker; ParseTreeWalker &ParseTreeWalker::DEFAULT = defaultWalker; -ParseTreeWalker::~ParseTreeWalker() { -} - void ParseTreeWalker::walk(ParseTreeListener *listener, ParseTree *t) const { - if (is(t)) { - listener->visitErrorNode(dynamic_cast(t)); + if (ErrorNode::is(*t)) { + listener->visitErrorNode(downCast(t)); return; - } else if (is(t)) { - listener->visitTerminal(dynamic_cast(t)); + } + if (TerminalNode::is(*t)) { + listener->visitTerminal(downCast(t)); return; } @@ -37,13 +36,13 @@ void ParseTreeWalker::walk(ParseTreeListener *listener, ParseTree *t) const { } void ParseTreeWalker::enterRule(ParseTreeListener *listener, ParseTree *r) const { - ParserRuleContext *ctx = dynamic_cast(r); + auto *ctx = downCast(r); listener->enterEveryRule(ctx); ctx->enterRule(listener); } void ParseTreeWalker::exitRule(ParseTreeListener *listener, ParseTree *r) const { - ParserRuleContext *ctx = dynamic_cast(r); + auto *ctx = downCast(r); ctx->exitRule(listener); listener->exitEveryRule(ctx); } diff --git a/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h b/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h index 166ad806b4..375e659785 100755 --- a/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h +++ b/runtime/Cpp/runtime/src/tree/ParseTreeWalker.h @@ -14,8 +14,8 @@ namespace tree { public: static ParseTreeWalker &DEFAULT; - virtual ~ParseTreeWalker(); - + virtual ~ParseTreeWalker() = default; + /** * * Performs a walk on the given parse tree starting at the root and going down recursively @@ -29,7 +29,7 @@ namespace tree { virtual void walk(ParseTreeListener *listener, ParseTree *t) const; protected: - + /** * * Enters a grammar rule by first triggering the generic event @@ -39,7 +39,7 @@ namespace tree { * The grammar rule containing the rule context */ virtual void enterRule(ParseTreeListener *listener, ParseTree *r) const; - + /** * * Exits a grammar rule by first triggering the event specific to the given parse tree node diff --git a/runtime/Cpp/runtime/src/tree/TerminalNode.cpp b/runtime/Cpp/runtime/src/tree/TerminalNode.cpp deleted file mode 100644 index d630469c70..0000000000 --- a/runtime/Cpp/runtime/src/tree/TerminalNode.cpp +++ /dev/null @@ -1,9 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -#include "tree/TerminalNode.h" - -antlr4::tree::TerminalNode::~TerminalNode() { -} diff --git a/runtime/Cpp/runtime/src/tree/TerminalNode.h b/runtime/Cpp/runtime/src/tree/TerminalNode.h index 7108f70de0..421e7ad795 100755 --- a/runtime/Cpp/runtime/src/tree/TerminalNode.h +++ b/runtime/Cpp/runtime/src/tree/TerminalNode.h @@ -12,9 +12,14 @@ namespace tree { class ANTLR4CPP_PUBLIC TerminalNode : public ParseTree { public: - ~TerminalNode() override; + static bool is(const tree::ParseTree &parseTree) { + const auto treeType = parseTree.getTreeType(); + return treeType == ParseTreeType::TERMINAL || treeType == ParseTreeType::ERROR; + } - virtual Token* getSymbol() = 0; + static bool is(const tree::ParseTree *parseTree) { return parseTree != nullptr && is(*parseTree); } + + virtual Token* getSymbol() const = 0; /** Set the parent for this leaf node. * @@ -26,6 +31,9 @@ namespace tree { * @since 4.7 */ virtual void setParent(RuleContext *parent) = 0; + + protected: + using ParseTree::ParseTree; }; } // namespace tree diff --git a/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp b/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp index 7ab121b732..573b1faf23 100755 --- a/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp +++ b/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp @@ -13,10 +13,7 @@ using namespace antlr4; using namespace antlr4::tree; -TerminalNodeImpl::TerminalNodeImpl(Token *symbol_) : symbol(symbol_) { -} - -Token* TerminalNodeImpl::getSymbol() { +Token* TerminalNodeImpl::getSymbol() const { return symbol; } @@ -33,7 +30,7 @@ misc::Interval TerminalNodeImpl::getSourceInterval() { return misc::Interval(tokenIndex, tokenIndex); } -antlrcpp::Any TerminalNodeImpl::accept(ParseTreeVisitor *visitor) { +std::any TerminalNodeImpl::accept(ParseTreeVisitor *visitor) { return visitor->visitTerminal(this); } diff --git a/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h b/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h index 6f65d82047..ddd8f12881 100755 --- a/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h +++ b/runtime/Cpp/runtime/src/tree/TerminalNodeImpl.h @@ -10,23 +10,22 @@ namespace antlr4 { namespace tree { - class ANTLR4CPP_PUBLIC TerminalNodeImpl : public virtual TerminalNode { + class ANTLR4CPP_PUBLIC TerminalNodeImpl : public TerminalNode { public: Token *symbol; - TerminalNodeImpl(Token *symbol); + explicit TerminalNodeImpl(Token *symbol) : TerminalNode(ParseTreeType::TERMINAL), symbol(symbol) {} - virtual Token* getSymbol() override; + virtual Token* getSymbol() const override; virtual void setParent(RuleContext *parent) override; virtual misc::Interval getSourceInterval() override; - virtual antlrcpp::Any accept(ParseTreeVisitor *visitor) override; + virtual std::any accept(ParseTreeVisitor *visitor) override; virtual std::string getText() override; virtual std::string toStringTree(Parser *parser, bool pretty = false) override; virtual std::string toString() override; virtual std::string toStringTree(bool pretty = false) override; - }; } // namespace tree diff --git a/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp b/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp index 2e58a96259..cbc4076bae 100755 --- a/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp +++ b/runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp @@ -21,7 +21,6 @@ #include "ANTLRInputStream.h" #include "support/Arrays.h" #include "Exceptions.h" -#include "support/StringUtils.h" #include "support/CPPUtils.h" #include "tree/pattern/ParseTreePatternMatcher.h" @@ -109,7 +108,7 @@ ParseTreePattern ParseTreePatternMatcher::compile(const std::string &pattern, in throw e; #else } catch (std::exception & /*e*/) { - std::throw_with_nested((const char*)"Cannot invoke start rule"); // Wrap any other exception. We should however probably use one of the ANTLR exceptions here. + std::throw_with_nested(RuntimeException("Cannot invoke start rule")); // Wrap any other exception. #endif } diff --git a/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp b/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp index fb18788938..48318f9a28 100644 --- a/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp +++ b/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp @@ -1,11 +1,125 @@ + +// Generated from XPathLexer.g4 by ANTLR 4.9.3 + + #include "XPathLexer.h" using namespace antlr4; +namespace { + +struct XPathLexerStaticData final { + XPathLexerStaticData(std::vector ruleNames, + std::vector channelNames, + std::vector modeNames, + std::vector literalNames, + std::vector symbolicNames) + : ruleNames(std::move(ruleNames)), channelNames(std::move(channelNames)), + modeNames(std::move(modeNames)), literalNames(std::move(literalNames)), + symbolicNames(std::move(symbolicNames)), + vocabulary(this->literalNames, this->symbolicNames) {} + + XPathLexerStaticData(const XPathLexerStaticData&) = delete; + XPathLexerStaticData(XPathLexerStaticData&&) = delete; + XPathLexerStaticData& operator=(const XPathLexerStaticData&) = delete; + XPathLexerStaticData& operator=(XPathLexerStaticData&&) = delete; + + std::vector decisionToDFA; + antlr4::atn::PredictionContextCache sharedContextCache; + const std::vector ruleNames; + const std::vector channelNames; + const std::vector modeNames; + const std::vector literalNames; + const std::vector symbolicNames; + const antlr4::dfa::Vocabulary vocabulary; + antlr4::atn::SerializedATNView serializedATN; + std::unique_ptr atn; +}; + +std::once_flag xpathLexerOnceFlag; +XPathLexerStaticData *xpathLexerStaticData = nullptr; + +void xpathLexerInitialize() { + assert(xpathLexerStaticData == nullptr); + auto staticData = std::make_unique( + std::vector{ + "ANYWHERE", "ROOT", "WILDCARD", "BANG", "ID", "NameChar", "NameStartChar", + "STRING" + }, + std::vector{ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }, + std::vector{ + "DEFAULT_MODE" + }, + std::vector{ + "", "", "", "'//'", "'/'", "'*'", "'!'" + }, + std::vector{ + "", "TOKEN_REF", "RULE_REF", "ANYWHERE", "ROOT", "WILDCARD", "BANG", "ID", + "STRING" + } + ); + static const int32_t serializedATNSegment[] = { + 0x4, 0x0, 0x8, 0x32, 0x6, -1, 0x2, 0x0, 0x7, 0x0, 0x2, 0x1, 0x7, + 0x1, 0x2, 0x2, 0x7, 0x2, 0x2, 0x3, 0x7, 0x3, 0x2, 0x4, 0x7, 0x4, + 0x2, 0x5, 0x7, 0x5, 0x2, 0x6, 0x7, 0x6, 0x2, 0x7, 0x7, 0x7, 0x1, + 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x1, 0x2, + 0x1, 0x3, 0x1, 0x3, 0x1, 0x4, 0x1, 0x4, 0x5, 0x4, 0x1d, 0x8, 0x4, + 0xa, 0x4, 0xc, 0x4, 0x20, 0x9, 0x4, 0x1, 0x4, 0x1, 0x4, 0x1, 0x5, + 0x1, 0x5, 0x3, 0x5, 0x26, 0x8, 0x5, 0x1, 0x6, 0x1, 0x6, 0x1, 0x7, + 0x1, 0x7, 0x5, 0x7, 0x2c, 0x8, 0x7, 0xa, 0x7, 0xc, 0x7, 0x2f, 0x9, + 0x7, 0x1, 0x7, 0x1, 0x7, 0x1, 0x2d, 0x0, 0x8, 0x1, 0x3, 0x3, 0x4, + 0x5, 0x5, 0x7, 0x6, 0x9, 0x7, 0xb, 0x0, 0xd, 0x0, 0xf, 0x8, 0x1, + 0x0, 0x2, 0x5, 0x0, 0x30, 0x39, 0x5f, 0x5f, 0xb7, 0xb7, 0x300, 0x36f, + 0x203f, 0x2040, 0xd, 0x0, 0x41, 0x5a, 0x61, 0x7a, 0xc0, 0xd6, 0xd8, + 0xf6, 0xf8, 0x2ff, 0x370, 0x37d, 0x37f, 0x1fff, 0x200c, 0x200d, 0x2070, + 0x218f, 0x2c00, 0x2fef, 0x3001, 0xd7ff, 0xf900, 0xfdcf, 0xfdf0, -1, + 0x0, 0x32, 0x0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x3, 0x1, 0x0, 0x0, + 0x0, 0x0, 0x5, 0x1, 0x0, 0x0, 0x0, 0x0, 0x7, 0x1, 0x0, 0x0, 0x0, + 0x0, 0x9, 0x1, 0x0, 0x0, 0x0, 0x0, 0xf, 0x1, 0x0, 0x0, 0x0, 0x1, + 0x11, 0x1, 0x0, 0x0, 0x0, 0x3, 0x14, 0x1, 0x0, 0x0, 0x0, 0x5, 0x16, + 0x1, 0x0, 0x0, 0x0, 0x7, 0x18, 0x1, 0x0, 0x0, 0x0, 0x9, 0x1a, 0x1, + 0x0, 0x0, 0x0, 0xb, 0x25, 0x1, 0x0, 0x0, 0x0, 0xd, 0x27, 0x1, 0x0, + 0x0, 0x0, 0xf, 0x29, 0x1, 0x0, 0x0, 0x0, 0x11, 0x12, 0x5, 0x2f, 0x0, + 0x0, 0x12, 0x13, 0x5, 0x2f, 0x0, 0x0, 0x13, 0x2, 0x1, 0x0, 0x0, 0x0, + 0x14, 0x15, 0x5, 0x2f, 0x0, 0x0, 0x15, 0x4, 0x1, 0x0, 0x0, 0x0, 0x16, + 0x17, 0x5, 0x2a, 0x0, 0x0, 0x17, 0x6, 0x1, 0x0, 0x0, 0x0, 0x18, 0x19, + 0x5, 0x21, 0x0, 0x0, 0x19, 0x8, 0x1, 0x0, 0x0, 0x0, 0x1a, 0x1e, 0x3, + 0xd, 0x6, 0x0, 0x1b, 0x1d, 0x3, 0xb, 0x5, 0x0, 0x1c, 0x1b, 0x1, 0x0, + 0x0, 0x0, 0x1d, 0x20, 0x1, 0x0, 0x0, 0x0, 0x1e, 0x1c, 0x1, 0x0, 0x0, + 0x0, 0x1e, 0x1f, 0x1, 0x0, 0x0, 0x0, 0x1f, 0x21, 0x1, 0x0, 0x0, 0x0, + 0x20, 0x1e, 0x1, 0x0, 0x0, 0x0, 0x21, 0x22, 0x6, 0x4, 0x0, 0x0, 0x22, + 0xa, 0x1, 0x0, 0x0, 0x0, 0x23, 0x26, 0x3, 0xd, 0x6, 0x0, 0x24, 0x26, + 0x7, 0x0, 0x0, 0x0, 0x25, 0x23, 0x1, 0x0, 0x0, 0x0, 0x25, 0x24, 0x1, + 0x0, 0x0, 0x0, 0x26, 0xc, 0x1, 0x0, 0x0, 0x0, 0x27, 0x28, 0x7, 0x1, + 0x0, 0x0, 0x28, 0xe, 0x1, 0x0, 0x0, 0x0, 0x29, 0x2d, 0x5, 0x27, 0x0, + 0x0, 0x2a, 0x2c, 0x9, 0x0, 0x0, 0x0, 0x2b, 0x2a, 0x1, 0x0, 0x0, 0x0, + 0x2c, 0x2f, 0x1, 0x0, 0x0, 0x0, 0x2d, 0x2e, 0x1, 0x0, 0x0, 0x0, 0x2d, + 0x2b, 0x1, 0x0, 0x0, 0x0, 0x2e, 0x30, 0x1, 0x0, 0x0, 0x0, 0x2f, 0x2d, + 0x1, 0x0, 0x0, 0x0, 0x30, 0x31, 0x5, 0x27, 0x0, 0x0, 0x31, 0x10, + 0x1, 0x0, 0x0, 0x0, 0x4, 0x0, 0x1e, 0x25, 0x2d, 0x1, 0x1, 0x4, 0x0, + }; + + staticData->serializedATN = antlr4::atn::SerializedATNView(serializedATNSegment, sizeof(serializedATNSegment) / sizeof(serializedATNSegment[0])); + + atn::ATNDeserializer deserializer; + staticData->atn = deserializer.deserialize(staticData->serializedATN); + + size_t count = staticData->atn->getNumberOfDecisions(); + staticData->decisionToDFA.reserve(count); + for (size_t i = 0; i < count; i++) { + staticData->decisionToDFA.emplace_back(staticData->atn->getDecisionState(i), i); + } + xpathLexerStaticData = staticData.release(); +} + +} XPathLexer::XPathLexer(CharStream *input) : Lexer(input) { - _interpreter = new atn::LexerATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache); + XPathLexer::initialize(); + _interpreter = new atn::LexerATNSimulator(this, *xpathLexerStaticData->atn, xpathLexerStaticData->decisionToDFA, xpathLexerStaticData->sharedContextCache); } XPathLexer::~XPathLexer() { @@ -17,46 +131,41 @@ std::string XPathLexer::getGrammarFileName() const { } const std::vector& XPathLexer::getRuleNames() const { - return _ruleNames; + return xpathLexerStaticData->ruleNames; } const std::vector& XPathLexer::getChannelNames() const { - return _channelNames; + return xpathLexerStaticData->channelNames; } const std::vector& XPathLexer::getModeNames() const { - return _modeNames; -} - -const std::vector& XPathLexer::getTokenNames() const { - return _tokenNames; + return xpathLexerStaticData->modeNames; } -dfa::Vocabulary& XPathLexer::getVocabulary() const { - return _vocabulary; +const dfa::Vocabulary& XPathLexer::getVocabulary() const { + return xpathLexerStaticData->vocabulary; } -const std::vector XPathLexer::getSerializedATN() const { - return _serializedATN; +antlr4::atn::SerializedATNView XPathLexer::getSerializedATN() const { + return xpathLexerStaticData->serializedATN; } const atn::ATN& XPathLexer::getATN() const { - return _atn; + return *xpathLexerStaticData->atn; } - void XPathLexer::action(RuleContext *context, size_t ruleIndex, size_t actionIndex) { switch (ruleIndex) { - case 4: IDAction(dynamic_cast(context), actionIndex); break; + case 4: IDAction(antlrcpp::downCast(context), actionIndex); break; default: break; } } -void XPathLexer::IDAction(antlr4::RuleContext * /*context*/, size_t actionIndex) { +void XPathLexer::IDAction(antlr4::RuleContext *context, size_t actionIndex) { switch (actionIndex) { - case 0: + case 0: if (isupper(getText()[0])) setType(TOKEN_REF); else @@ -68,106 +177,6 @@ void XPathLexer::IDAction(antlr4::RuleContext * /*context*/, size_t actionIndex) } } - - -// Static vars and initialization. -std::vector XPathLexer::_decisionToDFA; -atn::PredictionContextCache XPathLexer::_sharedContextCache; - -// We own the ATN which in turn owns the ATN states. -atn::ATN XPathLexer::_atn; -std::vector XPathLexer::_serializedATN; - -std::vector XPathLexer::_ruleNames = { - "ANYWHERE", "ROOT", "WILDCARD", "BANG", "ID", "NameChar", "NameStartChar", - "STRING" -}; - -std::vector XPathLexer::_channelNames = { - "DEFAULT_TOKEN_CHANNEL", "HIDDEN" -}; - -std::vector XPathLexer::_modeNames = { - "DEFAULT_MODE" -}; - -std::vector XPathLexer::_literalNames = { - "", "", "", "'//'", "'/'", "'*'", "'!'" -}; - -std::vector XPathLexer::_symbolicNames = { - "", "TOKEN_REF", "RULE_REF", "ANYWHERE", "ROOT", "WILDCARD", "BANG", "ID", - "STRING" -}; - -dfa::Vocabulary XPathLexer::_vocabulary(_literalNames, _symbolicNames); - -std::vector XPathLexer::_tokenNames; - -XPathLexer::Initializer::Initializer() { - // This code could be in a static initializer lambda, but VS doesn't allow access to private class members from there. - for (size_t i = 0; i < _symbolicNames.size(); ++i) { - std::string name = _vocabulary.getLiteralName(i); - if (name.empty()) { - name = _vocabulary.getSymbolicName(i); - } - - if (name.empty()) { - _tokenNames.push_back(""); - } else { - _tokenNames.push_back(name); - } - } - - _serializedATN = { - 0x3, 0x430, 0xd6d1, 0x8206, 0xad2d, 0x4417, 0xaef1, 0x8d80, 0xaadd, - 0x2, 0xa, 0x34, 0x8, 0x1, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4, - 0x4, 0x9, 0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9, - 0x7, 0x4, 0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x3, 0x2, 0x3, 0x2, 0x3, - 0x2, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x4, 0x3, 0x5, 0x3, 0x5, 0x3, - 0x6, 0x3, 0x6, 0x7, 0x6, 0x1f, 0xa, 0x6, 0xc, 0x6, 0xe, 0x6, 0x22, 0xb, - 0x6, 0x3, 0x6, 0x3, 0x6, 0x3, 0x7, 0x3, 0x7, 0x5, 0x7, 0x28, 0xa, 0x7, - 0x3, 0x8, 0x3, 0x8, 0x3, 0x9, 0x3, 0x9, 0x7, 0x9, 0x2e, 0xa, 0x9, 0xc, - 0x9, 0xe, 0x9, 0x31, 0xb, 0x9, 0x3, 0x9, 0x3, 0x9, 0x3, 0x2f, 0x2, 0xa, - 0x3, 0x5, 0x5, 0x6, 0x7, 0x7, 0x9, 0x8, 0xb, 0x9, 0xd, 0x2, 0xf, 0x2, - 0x11, 0xa, 0x3, 0x2, 0x4, 0x7, 0x2, 0x32, 0x3b, 0x61, 0x61, 0xb9, 0xb9, - 0x302, 0x371, 0x2041, 0x2042, 0xf, 0x2, 0x43, 0x5c, 0x63, 0x7c, 0xc2, - 0xd8, 0xda, 0xf8, 0xfa, 0x301, 0x372, 0x37f, 0x381, 0x2001, 0x200e, - 0x200f, 0x2072, 0x2191, 0x2c02, 0x2ff1, 0x3003, 0xd801, 0xf902, 0xfdd1, - 0xfdf2, 0x1, 0x34, 0x2, 0x3, 0x3, 0x2, 0x2, 0x2, 0x2, 0x5, 0x3, 0x2, - 0x2, 0x2, 0x2, 0x7, 0x3, 0x2, 0x2, 0x2, 0x2, 0x9, 0x3, 0x2, 0x2, 0x2, - 0x2, 0xb, 0x3, 0x2, 0x2, 0x2, 0x2, 0x11, 0x3, 0x2, 0x2, 0x2, 0x3, 0x13, - 0x3, 0x2, 0x2, 0x2, 0x5, 0x16, 0x3, 0x2, 0x2, 0x2, 0x7, 0x18, 0x3, 0x2, - 0x2, 0x2, 0x9, 0x1a, 0x3, 0x2, 0x2, 0x2, 0xb, 0x1c, 0x3, 0x2, 0x2, 0x2, - 0xd, 0x27, 0x3, 0x2, 0x2, 0x2, 0xf, 0x29, 0x3, 0x2, 0x2, 0x2, 0x11, - 0x2b, 0x3, 0x2, 0x2, 0x2, 0x13, 0x14, 0x7, 0x31, 0x2, 0x2, 0x14, 0x15, - 0x7, 0x31, 0x2, 0x2, 0x15, 0x4, 0x3, 0x2, 0x2, 0x2, 0x16, 0x17, 0x7, - 0x31, 0x2, 0x2, 0x17, 0x6, 0x3, 0x2, 0x2, 0x2, 0x18, 0x19, 0x7, 0x2c, - 0x2, 0x2, 0x19, 0x8, 0x3, 0x2, 0x2, 0x2, 0x1a, 0x1b, 0x7, 0x23, 0x2, - 0x2, 0x1b, 0xa, 0x3, 0x2, 0x2, 0x2, 0x1c, 0x20, 0x5, 0xf, 0x8, 0x2, - 0x1d, 0x1f, 0x5, 0xd, 0x7, 0x2, 0x1e, 0x1d, 0x3, 0x2, 0x2, 0x2, 0x1f, - 0x22, 0x3, 0x2, 0x2, 0x2, 0x20, 0x1e, 0x3, 0x2, 0x2, 0x2, 0x20, 0x21, - 0x3, 0x2, 0x2, 0x2, 0x21, 0x23, 0x3, 0x2, 0x2, 0x2, 0x22, 0x20, 0x3, - 0x2, 0x2, 0x2, 0x23, 0x24, 0x8, 0x6, 0x2, 0x2, 0x24, 0xc, 0x3, 0x2, - 0x2, 0x2, 0x25, 0x28, 0x5, 0xf, 0x8, 0x2, 0x26, 0x28, 0x9, 0x2, 0x2, - 0x2, 0x27, 0x25, 0x3, 0x2, 0x2, 0x2, 0x27, 0x26, 0x3, 0x2, 0x2, 0x2, - 0x28, 0xe, 0x3, 0x2, 0x2, 0x2, 0x29, 0x2a, 0x9, 0x3, 0x2, 0x2, 0x2a, - 0x10, 0x3, 0x2, 0x2, 0x2, 0x2b, 0x2f, 0x7, 0x29, 0x2, 0x2, 0x2c, 0x2e, - 0xb, 0x2, 0x2, 0x2, 0x2d, 0x2c, 0x3, 0x2, 0x2, 0x2, 0x2e, 0x31, 0x3, - 0x2, 0x2, 0x2, 0x2f, 0x30, 0x3, 0x2, 0x2, 0x2, 0x2f, 0x2d, 0x3, 0x2, - 0x2, 0x2, 0x30, 0x32, 0x3, 0x2, 0x2, 0x2, 0x31, 0x2f, 0x3, 0x2, 0x2, - 0x2, 0x32, 0x33, 0x7, 0x29, 0x2, 0x2, 0x33, 0x12, 0x3, 0x2, 0x2, 0x2, - 0x6, 0x2, 0x20, 0x27, 0x2f, 0x3, 0x3, 0x6, 0x2, - }; - - atn::ATNDeserializer deserializer; - _atn = deserializer.deserialize(_serializedATN); - - size_t count = _atn.getNumberOfDecisions(); - _decisionToDFA.reserve(count); - for (size_t i = 0; i < count; i++) { - _decisionToDFA.emplace_back(_atn.getDecisionState(i), i); - } +void XPathLexer::initialize() { + std::call_once(xpathLexerOnceFlag, xpathLexerInitialize); } - -XPathLexer::Initializer XPathLexer::_init; diff --git a/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h b/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h index ca471c9102..6926d2161e 100644 --- a/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h +++ b/runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h @@ -1,56 +1,47 @@ -#pragma once +// Generated from XPathLexer.g4 by ANTLR 4.9.3 -#include "antlr4-runtime.h" +#pragma once +#include "antlr4-runtime.h" class XPathLexer : public antlr4::Lexer { public: enum { - TOKEN_REF = 1, RULE_REF = 2, ANYWHERE = 3, ROOT = 4, WILDCARD = 5, BANG = 6, + TOKEN_REF = 1, RULE_REF = 2, ANYWHERE = 3, ROOT = 4, WILDCARD = 5, BANG = 6, ID = 7, STRING = 8 }; - XPathLexer(antlr4::CharStream *input); - ~XPathLexer(); + explicit XPathLexer(antlr4::CharStream *input); + + ~XPathLexer() override; virtual std::string getGrammarFileName() const override; + virtual const std::vector& getRuleNames() const override; virtual const std::vector& getChannelNames() const override; + virtual const std::vector& getModeNames() const override; - virtual const std::vector& getTokenNames() const override; // deprecated, use vocabulary instead - virtual antlr4::dfa::Vocabulary& getVocabulary() const override; - virtual const std::vector getSerializedATN() const override; - virtual const antlr4::atn::ATN& getATN() const override; + virtual const antlr4::dfa::Vocabulary& getVocabulary() const override; - virtual void action(antlr4::RuleContext *context, size_t ruleIndex, size_t actionIndex) override; -private: - static std::vector _decisionToDFA; - static antlr4::atn::PredictionContextCache _sharedContextCache; - static std::vector _ruleNames; - static std::vector _tokenNames; - static std::vector _channelNames; - static std::vector _modeNames; + virtual antlr4::atn::SerializedATNView getSerializedATN() const override; - static std::vector _literalNames; - static std::vector _symbolicNames; - static antlr4::dfa::Vocabulary _vocabulary; - static antlr4::atn::ATN _atn; - static std::vector _serializedATN; + virtual const antlr4::atn::ATN& getATN() const override; + virtual void action(antlr4::RuleContext *context, size_t ruleIndex, size_t actionIndex) override; + // By default the static state used to implement the lexer is lazily initialized during the first + // call to the constructor. You can call this function if you wish to initialize the static state + // ahead of time. + static void initialize(); +private: // Individual action functions triggered by action() above. void IDAction(antlr4::RuleContext *context, size_t actionIndex); // Individual semantic predicate functions triggered by sempred() above. - - struct Initializer { - Initializer(); - }; - static Initializer _init; }; diff --git a/runtime/Cpp/runtime/tests/Utf8Test.cpp b/runtime/Cpp/runtime/tests/Utf8Test.cpp new file mode 100644 index 0000000000..e7e415a53f --- /dev/null +++ b/runtime/Cpp/runtime/tests/Utf8Test.cpp @@ -0,0 +1,110 @@ +#include +#include + +#include "gtest/gtest.h" +#include "support/Utf8.h" + +namespace antlrcpp { +namespace { + + struct Utf8EncodeTestCase final { + char32_t code_point; + std::string_view code_units; + }; + + using Utf8EncodeTest = testing::TestWithParam; + + TEST_P(Utf8EncodeTest, Compliance) { + const Utf8EncodeTestCase& test_case = GetParam(); + std::string result; + EXPECT_EQ(Utf8::encode(&result, test_case.code_point), test_case.code_units); + } + + INSTANTIATE_TEST_SUITE_P(Utf8EncodeTest, Utf8EncodeTest, + testing::ValuesIn({ + {0x0000, std::string_view("\x00", 1)}, + {0x0001, "\x01"}, + {0x007e, "\x7e"}, + {0x007f, "\x7f"}, + {0x0080, "\xc2\x80"}, + {0x0081, "\xc2\x81"}, + {0x00bf, "\xc2\xbf"}, + {0x00c0, "\xc3\x80"}, + {0x00c1, "\xc3\x81"}, + {0x00c8, "\xc3\x88"}, + {0x00d0, "\xc3\x90"}, + {0x00e0, "\xc3\xa0"}, + {0x00f0, "\xc3\xb0"}, + {0x00f8, "\xc3\xb8"}, + {0x00ff, "\xc3\xbf"}, + {0x0100, "\xc4\x80"}, + {0x07ff, "\xdf\xbf"}, + {0x0400, "\xd0\x80"}, + {0x0800, "\xe0\xa0\x80"}, + {0x0801, "\xe0\xa0\x81"}, + {0x1000, "\xe1\x80\x80"}, + {0xd000, "\xed\x80\x80"}, + {0xd7ff, "\xed\x9f\xbf"}, + {0xe000, "\xee\x80\x80"}, + {0xfffe, "\xef\xbf\xbe"}, + {0xffff, "\xef\xbf\xbf"}, + {0x10000, "\xf0\x90\x80\x80"}, + {0x10001, "\xf0\x90\x80\x81"}, + {0x40000, "\xf1\x80\x80\x80"}, + {0x10fffe, "\xf4\x8f\xbf\xbe"}, + {0x10ffff, "\xf4\x8f\xbf\xbf"}, + {0xFFFD, "\xef\xbf\xbd"}, + })); + + struct Utf8DecodeTestCase final { + char32_t code_point; + std::string_view code_units; + }; + + using Utf8DecodeTest = testing::TestWithParam; + + TEST_P(Utf8DecodeTest, Compliance) { + const Utf8DecodeTestCase& test_case = GetParam(); + auto [code_point, code_units] = Utf8::decode(test_case.code_units); + EXPECT_EQ(code_units, test_case.code_units.size()); + EXPECT_EQ(code_point, test_case.code_point); + } + + INSTANTIATE_TEST_SUITE_P(Utf8DecodeTest, Utf8DecodeTest, + testing::ValuesIn({ + {0x0000, std::string_view("\x00", 1)}, + {0x0001, "\x01"}, + {0x007e, "\x7e"}, + {0x007f, "\x7f"}, + {0x0080, "\xc2\x80"}, + {0x0081, "\xc2\x81"}, + {0x00bf, "\xc2\xbf"}, + {0x00c0, "\xc3\x80"}, + {0x00c1, "\xc3\x81"}, + {0x00c8, "\xc3\x88"}, + {0x00d0, "\xc3\x90"}, + {0x00e0, "\xc3\xa0"}, + {0x00f0, "\xc3\xb0"}, + {0x00f8, "\xc3\xb8"}, + {0x00ff, "\xc3\xbf"}, + {0x0100, "\xc4\x80"}, + {0x07ff, "\xdf\xbf"}, + {0x0400, "\xd0\x80"}, + {0x0800, "\xe0\xa0\x80"}, + {0x0801, "\xe0\xa0\x81"}, + {0x1000, "\xe1\x80\x80"}, + {0xd000, "\xed\x80\x80"}, + {0xd7ff, "\xed\x9f\xbf"}, + {0xe000, "\xee\x80\x80"}, + {0xfffe, "\xef\xbf\xbe"}, + {0xffff, "\xef\xbf\xbf"}, + {0x10000, "\xf0\x90\x80\x80"}, + {0x10001, "\xf0\x90\x80\x81"}, + {0x40000, "\xf1\x80\x80\x80"}, + {0x10fffe, "\xf4\x8f\xbf\xbe"}, + {0x10ffff, "\xf4\x8f\xbf\xbf"}, + {0xFFFD, "\xef\xbf\xbd"}, + })); + +} +} diff --git a/runtime/Dart/CHANGELOG.md b/runtime/Dart/CHANGELOG.md deleted file mode 100644 index 1ba1db8d3f..0000000000 --- a/runtime/Dart/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ - -## 4.9.0 - -* Initial release - -## 4.9.3 - -* Support web platform. - diff --git a/runtime/Dart/lib/src/atn/atn.dart b/runtime/Dart/lib/src/atn/atn.dart index a0400f41d1..3e7af84763 100644 --- a/runtime/Dart/lib/src/atn/atn.dart +++ b/runtime/Dart/lib/src/atn/atn.dart @@ -15,4 +15,5 @@ export 'src/lexer_action_executor.dart'; export 'src/lexer_atn_simulator.dart'; export 'src/parser_atn_simulator.dart'; export 'src/profiling_atn_simulator.dart'; +export 'src/semantic_context.dart'; export 'src/transition.dart'; diff --git a/runtime/Dart/lib/src/atn/src/atn_deserializer.dart b/runtime/Dart/lib/src/atn/src/atn_deserializer.dart index 4e53609cb2..ee6928be10 100644 --- a/runtime/Dart/lib/src/atn/src/atn_deserializer.dart +++ b/runtime/Dart/lib/src/atn/src/atn_deserializer.dart @@ -66,90 +66,27 @@ class ATNDeserializationOptions { } class ATNDeserializer { - /// This value should never change. Updates following this version are - /// reflected as change in the unique ID SERIALIZED_UUID. - static final SERIALIZED_VERSION = 3; - - /** WARNING: DO NOT MERGE THESE LINES. If UUIDs differ during a merge, - * resolve the conflict by generating a new ID! - */ - - /// This is the earliest supported serialized UUID. - static final BASE_SERIALIZED_UUID = '33761B2D-78BB-4A43-8B0B-4F5BEE8AACF3'; - - /// This UUID indicates an extension of {@link BASE_SERIALIZED_UUID} for the - /// addition of precedence predicates. - static final ADDED_PRECEDENCE_TRANSITIONS = - '1DA0C57D-6C06-438A-9B27-10BCB3CE0F61'; - - /// This UUID indicates an extension of {@link #ADDED_PRECEDENCE_TRANSITIONS} - /// for the addition of lexer actions encoded as a sequence of - /// [LexerAction] instances. - static final ADDED_LEXER_ACTIONS = 'AADB8D7E-AEEF-4415-AD2B-8204D6CF042E'; - - /// This UUID indicates the serialized ATN contains two sets of - /// IntervalSets, where the second set's values are encoded as - /// 32-bit integers to support the full Unicode SMP range up to U+10FFFF. - static final ADDED_UNICODE_SMP = '59627784-3BE5-417A-B9EB-8131A7286089'; - - /// This list contains all of the currently supported UUIDs, ordered by when - /// the feature first appeared in this branch. - static final SUPPORTED_UUIDS = [ - BASE_SERIALIZED_UUID, - ADDED_PRECEDENCE_TRANSITIONS, - ADDED_LEXER_ACTIONS, - ADDED_UNICODE_SMP - ]; - - /// This is the current serialized UUID. - static final SERIALIZED_UUID = ADDED_UNICODE_SMP; + static final SERIALIZED_VERSION = 4; late final ATNDeserializationOptions deserializationOptions; late List data; int pos = 0; - late String uuid; ATNDeserializer([ATNDeserializationOptions? options]) { deserializationOptions = options ?? ATNDeserializationOptions.defaultOptions; } - /// Determines if a particular serialized representation of an ATN supports - /// a particular feature, identified by the [UUID] used for serializing - /// the ATN at the time the feature was first introduced. - /// - /// @param feature The [UUID] marking the first time the feature was - /// supported in the serialized ATN. - /// @param actualUuid The [UUID] of the actual serialized ATN which is - /// currently being deserialized. - /// @return [true] if the [actualUuid] value represents a - /// serialized ATN at or after the feature identified by [feature] was - /// introduced; otherwise, [false]. - bool isFeatureSupported(feature, actualUuid) { - final idx1 = SUPPORTED_UUIDS.indexOf(feature); - if (idx1 < 0) { - return false; - } - final idx2 = SUPPORTED_UUIDS.indexOf(actualUuid); - return idx2 >= idx1; - } - ATN deserialize(List data) { - reset(data); + this.data = data; + this.pos = 0; checkVersion(); - checkUUID(); final atn = readATN(); readStates(atn); readRules(atn); readModes(atn); final sets = []; - // First, deserialize sets with 16-bit arguments <= U+FFFF. - readSets(atn, sets, () => readInt()); - // Next, if the ATN was serialized with the Unicode SMP feature, - // deserialize sets with 32-bit arguments <= U+10FFFF. - if (isFeatureSupported(ADDED_UNICODE_SMP, uuid)) { - readSets(atn, sets, () => readInt32()); - } + readSets(atn, sets); readEdges(atn, sets); readDecisions(atn); readLexerActions(atn); @@ -164,33 +101,6 @@ class ATNDeserializer { return atn; } - /// Each char value in data is shifted by +2 at the entry to this method. - /// This is an encoding optimization targeting the serialized values 0 - /// and -1 (serialized to 0xFFFF), each of which are very common in the - /// serialized form of the ATN. In the modified UTF-8 that Java uses for - /// compiled string literals, these two character values have multi-byte - /// forms. By shifting each value by +2, they become characters 2 and 1 - /// prior to writing the string, each of which have single-byte - /// representations. Since the shift occurs in the tool during ATN - /// serialization, each target is responsible for adjusting the values - /// during deserialization. - /// - /// As a special case, note that the first element of data is not - /// adjusted because it contains the major version number of the - /// serialized ATN, which was fixed at 3 at the time the value shifting - /// was implemented. - void reset(List data) { - final adjust = (int c) { - final v = c; - return v > 1 ? v - 2 : v + 65534; - }; - final temp = data.map(adjust).toList(); - // don't adjust the first value since that's the version number - temp[0] = data[0]; - this.data = temp; - pos = 0; - } - void checkVersion() { final version = readInt(); if (version != SERIALIZED_VERSION) { @@ -198,14 +108,6 @@ class ATNDeserializer { } } - void checkUUID() { - final uuid = readUUID(); - if (!SUPPORTED_UUIDS.contains(uuid)) { - throw ('Could not deserialize ATN with UUID: $uuid (expected $SERIALIZED_UUID or a legacy UUID).'); - } - this.uuid = uuid; - } - ATN readATN() { final grammarType = readInt(); final maxTokenType = readInt(); @@ -225,9 +127,6 @@ class ATNDeserializer { } var ruleIndex = readInt(); - if (ruleIndex == 0xFFFF) { - ruleIndex = -1; - } final s = stateFactory(stype, ruleIndex); if (s is LoopEndState) { @@ -255,12 +154,11 @@ class ATNDeserializer { final stateNumber = readInt(); (atn.states[stateNumber] as DecisionState).nonGreedy = true; } - if (isFeatureSupported(ADDED_PRECEDENCE_TRANSITIONS, uuid)) { - final numPrecedenceStates = readInt(); - for (var i = 0; i < numPrecedenceStates; i++) { - final stateNumber = readInt(); - (atn.states[stateNumber] as RuleStartState).isLeftRecursiveRule = true; - } + + final numPrecedenceStates = readInt(); + for (var i = 0; i < numPrecedenceStates; i++) { + final stateNumber = readInt(); + (atn.states[stateNumber] as RuleStartState).isLeftRecursiveRule = true; } } @@ -276,17 +174,8 @@ class ATNDeserializer { atn.ruleToStartState.add(startState); if (atn.grammarType == ATNType.LEXER) { var tokenType = readInt(); - if (tokenType == 0xFFFF) { - tokenType = Token.EOF; - } atn.ruleToTokenType.add(tokenType); - - if (!isFeatureSupported(ADDED_LEXER_ACTIONS, uuid)) { - // this piece of unused metadata was serialized prior to the - // addition of LexerAction - readInt(); - } } } @@ -310,7 +199,7 @@ class ATNDeserializer { } } - void readSets(ATN atn, List sets, readUnicode) { + void readSets(ATN atn, List sets) { final nsets = readInt(); for (var i = 0; i < nsets; i++) { final nintervals = readInt(); @@ -323,8 +212,8 @@ class ATNDeserializer { } for (var j = 0; j < nintervals; j++) { - int a = readUnicode(); - int b = readUnicode(); + int a = readInt(); + int b = readInt(); set.addRange(a, b); } } @@ -420,48 +309,14 @@ class ATNDeserializer { void readLexerActions(ATN atn) { if (atn.grammarType == ATNType.LEXER) { - if (isFeatureSupported(ADDED_LEXER_ACTIONS, uuid)) { - atn.lexerActions = List.generate(readInt(), (index) { - final actionType = LexerActionType.values[readInt()]; - var data1 = readInt(); - if (data1 == 0xFFFF) { - data1 = -1; - } + atn.lexerActions = List.generate(readInt(), (index) { + final actionType = LexerActionType.values[readInt()]; + var data1 = readInt(); + var data2 = readInt(); + final lexerAction = lexerActionFactory(actionType, data1, data2); - var data2 = readInt(); - if (data2 == 0xFFFF) { - data2 = -1; - } - final lexerAction = lexerActionFactory(actionType, data1, data2); - - return lexerAction; - }); - } else { - // for compatibility with older serialized ATNs, convert the old - // serialized action index for action transitions to the new - // form, which is the index of a LexerCustomAction - final legacyLexerActions = []; - for (var state in atn.states) { - if (state == null) { - continue; - } - for (var i = 0; i < state.numberOfTransitions; i++) { - final transition = state.transition(i); - if (transition is ActionTransition) { - final ruleIndex = transition.ruleIndex; - final actionIndex = transition.actionIndex; - final lexerAction = LexerCustomAction(ruleIndex, actionIndex); - state.setTransition( - i, - ActionTransition(transition.target, ruleIndex, - legacyLexerActions.length, false)); - legacyLexerActions.add(lexerAction); - } - } - } - - atn.lexerActions = legacyLexerActions; - } + return lexerAction; + }); } } @@ -666,51 +521,6 @@ class ATNDeserializer { return data[pos++]; } - int readInt32() { - final low = readInt(); - final high = readInt(); - return low | (high << 16); - } - - int readLong() { - final low = readInt32(); - final high = readInt32(); - return (low & 0x00000000FFFFFFFF) | (high << 32); - } - - static final byteToHex = List.generate( - 256, (i) => i.toRadixString(16).padLeft(2, '0').toUpperCase()); - - String readUUID() { - final bb = List.filled(16, 0); - - for (var i = 7; i >= 0; i--) { - final int = readInt(); - bb[(2 * i) + 1] = int & 0xFF; - bb[2 * i] = (int >> 8) & 0xFF; - } - return byteToHex[bb[0]] + - byteToHex[bb[1]] + - byteToHex[bb[2]] + - byteToHex[bb[3]] + - '-' + - byteToHex[bb[4]] + - byteToHex[bb[5]] + - '-' + - byteToHex[bb[6]] + - byteToHex[bb[7]] + - '-' + - byteToHex[bb[8]] + - byteToHex[bb[9]] + - '-' + - byteToHex[bb[10]] + - byteToHex[bb[11]] + - byteToHex[bb[12]] + - byteToHex[bb[13]] + - byteToHex[bb[14]] + - byteToHex[bb[15]]; - } - Transition edgeFactory( ATN atn, TransitionType type, diff --git a/runtime/Dart/lib/src/atn/src/atn_state.dart b/runtime/Dart/lib/src/atn/src/atn_state.dart index 4d2a40611a..372901d343 100644 --- a/runtime/Dart/lib/src/atn/src/atn_state.dart +++ b/runtime/Dart/lib/src/atn/src/atn_state.dart @@ -196,8 +196,8 @@ class BasicState extends ATNState { } class RuleStartState extends ATNState { - var stopState; - var isLeftRecursiveRule = false; + RuleStopState? stopState; + bool isLeftRecursiveRule = false; RuleStartState(int ruleIndex) : super(ruleIndex); diff --git a/runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart b/runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart index 280a4dc7b8..6f14f1cb36 100644 --- a/runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart +++ b/runtime/Dart/lib/src/atn/src/parser_atn_simulator.dart @@ -1264,7 +1264,7 @@ class ParserATNSimulator extends ATNSimulator { assert(pred != null); if (ambigAlts != null && ambigAlts[i]) { - pairs.add(PredPrediction(pred, i)); + pairs.add(PredPrediction(pred!, i)); } if (pred != SemanticContext.NONE) containsPredicate = true; } @@ -1417,7 +1417,7 @@ class ParserATNSimulator extends ATNSimulator { } if (predicateEvaluationResult) { - if (debug || dfa_debug) log('PREDICT ' + pair.alt); + if (debug || dfa_debug) log('PREDICT ' + pair.alt.toString()); predictions.set(pair.alt); if (!complete) { break; diff --git a/runtime/Dart/lib/src/atn/src/profiling_atn_simulator.dart b/runtime/Dart/lib/src/atn/src/profiling_atn_simulator.dart index e2d6778139..2cb6281b97 100644 --- a/runtime/Dart/lib/src/atn/src/profiling_atn_simulator.dart +++ b/runtime/Dart/lib/src/atn/src/profiling_atn_simulator.dart @@ -202,7 +202,7 @@ class ProfilingATNSimulator extends ParserATNSimulator { alt, fullCtx, ); - if (!(pred is PrecedencePredicate)) { + if (pred is! PrecedencePredicate) { final fullContext = _llStopIndex >= 0; final stopIndex = fullContext ? _llStopIndex : _sllStopIndex; decisions[currentDecision].predicateEvals.add(PredicateEvalInfo( diff --git a/runtime/Dart/lib/src/dfa/src/dfa_state.dart b/runtime/Dart/lib/src/dfa/src/dfa_state.dart index 6628c8faa4..b8a6512b1c 100644 --- a/runtime/Dart/lib/src/dfa/src/dfa_state.dart +++ b/runtime/Dart/lib/src/dfa/src/dfa_state.dart @@ -10,8 +10,8 @@ import '../../util/utils.dart'; /// Map a predicate to a predicted alternative. */ class PredPrediction { - final alt; - final pred; + final SemanticContext pred; + final int alt; PredPrediction(this.pred, this.alt); diff --git a/runtime/Dart/lib/src/interval_set.dart b/runtime/Dart/lib/src/interval_set.dart index 6cb9340eff..c9b7629db3 100644 --- a/runtime/Dart/lib/src/interval_set.dart +++ b/runtime/Dart/lib/src/interval_set.dart @@ -287,18 +287,12 @@ class IntervalSet { return this; } - if (set is IntervalSet) { - final other = set; - // walk set and add each interval - final n = other.intervals.length; - for (var i = 0; i < n; i++) { - final I = other.intervals[i]; - addRange(I.a, I.b); - } - } else { - for (final value in set.toList()) { - addOne(value); - } + final other = set; + // walk set and add each interval + final n = other.intervals.length; + for (var i = 0; i < n; i++) { + final I = other.intervals[i]; + addRange(I.a, I.b); } return this; @@ -313,29 +307,14 @@ class IntervalSet { if (vocabulary == null || vocabulary.isNil) { return null; // nothing in common with null set } - IntervalSet vocabularyIS; - if (vocabulary is IntervalSet) { - vocabularyIS = vocabulary; - } else { - vocabularyIS = IntervalSet(); - vocabularyIS.addAll(vocabulary); - } - - return vocabularyIS - this; + return vocabulary - this; } IntervalSet operator -(IntervalSet a) { if (a.isNil) { return IntervalSet.ofSet(this); } - - if (a is IntervalSet) { - return subtract(this, a); - } - - final other = IntervalSet(); - other.addAll(a); - return subtract(this, other); + return subtract(this, a); } /// Compute the set difference between two interval sets. The specific diff --git a/runtime/Dart/lib/src/parser.dart b/runtime/Dart/lib/src/parser.dart index 255bf08acb..de002e377f 100644 --- a/runtime/Dart/lib/src/parser.dart +++ b/runtime/Dart/lib/src/parser.dart @@ -27,7 +27,7 @@ abstract class Parser extends Recognizer { /// bypass alternatives. /// /// @see ATNDeserializationOptions#isGenerateRuleBypassTransitions() - static final Map bypassAltsAtnCache = {}; + ATN? bypassAltsAtnCache; /// The error handling strategy for the parser. The default value is a new /// instance of [DefaultErrorStrategy]. @@ -51,10 +51,7 @@ abstract class Parser extends Recognizer { /// Specifies whether or not the parser should construct a parse tree during /// the parsing process. The default value is [true]. - /// - /// @see #getBuildParseTree - /// @see #setBuildParseTree - bool _buildParseTrees = true; + bool buildParseTree = true; /// When {@link #setTrace}{@code (true)} is called, a reference to the /// [TraceListener] is stored here so it can be easily removed in a @@ -120,7 +117,7 @@ abstract class Parser extends Recognizer { consume(); } else { t = errorHandler.recoverInline(this); - if (_buildParseTrees && t.tokenIndex == -1) { + if (buildParseTree && t.tokenIndex == -1) { // we must have conjured up a new token during single token insertion // if it's not the current symbol context!.addErrorNode(createErrorNode(context!, t)); @@ -152,7 +149,7 @@ abstract class Parser extends Recognizer { consume(); } else { t = errorHandler.recoverInline(this); - if (_buildParseTrees && t.tokenIndex == -1) { + if (buildParseTree && t.tokenIndex == -1) { // we must have conjured up a new token during single token insertion // if it's not the current symbol context!.addErrorNode(createErrorNode(context!, t)); @@ -162,32 +159,6 @@ abstract class Parser extends Recognizer { return t; } - /// Track the [ParserRuleContext] objects during the parse and hook - /// them up using the {@link ParserRuleContext#children} list so that it - /// forms a parse tree. The [ParserRuleContext] returned from the start - /// rule represents the root of the parse tree. - /// - ///

Note that if we are not building parse trees, rule contexts only point - /// upwards. When a rule exits, it returns the context but that gets garbage - /// collected if nobody holds a reference. It points upwards but nobody - /// points at it.

- /// - ///

When we build parse trees, we are adding all of these contexts to - /// {@link ParserRuleContext#children} list. Contexts are then not candidates - /// for garbage collection.

- set buildParseTree(bool buildParseTrees) { - _buildParseTrees = buildParseTrees; - } - - /// Gets whether or not a complete parse tree will be constructed while - /// parsing. This property is [true] for a newly constructed parser. - /// - /// @return [true] if a complete parse tree will be constructed while - /// parsing, otherwise [false] - bool get buildParseTree { - return _buildParseTrees; - } - /// Trim the internal lists of the parse tree during parsing to conserve memory. /// This property is set to [false] by default for a newly constructed parser. /// @@ -324,16 +295,13 @@ abstract class Parser extends Recognizer { 'The current parser does not support an ATN with bypass alternatives.'); } - var result = bypassAltsAtnCache[serializedATN]; - if (result == null) { + if (bypassAltsAtnCache == null) { final deserializationOptions = ATNDeserializationOptions(false); deserializationOptions.setGenerateRuleBypassTransitions(true); - result = ATNDeserializer(deserializationOptions) - .deserialize(serializedATN!.codeUnits); - bypassAltsAtnCache[serializedATN!] = result; + bypassAltsAtnCache = ATNDeserializer(deserializationOptions).deserialize(serializedATN); } - return result; + return bypassAltsAtnCache!; } /// The preferred method of getting a tree pattern. For example, here's a @@ -433,7 +401,7 @@ abstract class Parser extends Recognizer { inputStream.consume(); } final hasListener = _parseListeners != null && _parseListeners!.isNotEmpty; - if (_buildParseTrees || hasListener) { + if (buildParseTree || hasListener) { if (errorHandler.inErrorRecoveryMode(this)) { final node = context!.addErrorNode(createErrorNode(context!, o)); if (_parseListeners != null) { @@ -483,7 +451,7 @@ abstract class Parser extends Recognizer { this.state = state; context = localctx; context!.start = _input.LT(1)!; - if (_buildParseTrees) addContextToParseTree(); + if (buildParseTree) addContextToParseTree(); if (_parseListeners != null) triggerEnterRuleEvent(); } @@ -506,7 +474,7 @@ abstract class Parser extends Recognizer { localctx.altNumber = altNum; // if we have new localctx, make sure we replace existing ctx // that is previous child of parse tree - if (_buildParseTrees && context != localctx) { + if (buildParseTree && context != localctx) { final parent = context!.parent; if (parent != null) { parent.removeLastChild(); @@ -554,7 +522,7 @@ abstract class Parser extends Recognizer { context = localctx; context!.start = previous.start; - if (_buildParseTrees) { + if (buildParseTree) { context!.addAnyChild(previous); } @@ -582,7 +550,7 @@ abstract class Parser extends Recognizer { // hook into tree retctx.parent = _parentctx; - if (_buildParseTrees && _parentctx != null) { + if (buildParseTree && _parentctx != null) { // add return ctx into invoking rule's tree _parentctx.addAnyChild(retctx); } @@ -749,7 +717,7 @@ abstract class Parser extends Recognizer { final interp = interpreter!; final saveMode = interp.predictionMode; if (profile) { - if (!(interp is ProfilingATNSimulator)) { + if (interp is! ProfilingATNSimulator) { interpreter = ProfilingATNSimulator(this); } } else if (interp is ProfilingATNSimulator) { diff --git a/runtime/Dart/lib/src/recognizer.dart b/runtime/Dart/lib/src/recognizer.dart index e40063f0ce..a46edbe3bd 100644 --- a/runtime/Dart/lib/src/recognizer.dart +++ b/runtime/Dart/lib/src/recognizer.dart @@ -22,7 +22,7 @@ abstract class Recognizer { /// The ATN interpreter used by the recognizer for prediction. ATNInterpreter? interpreter; - int _stateNumber = -1; + int state = -1; List get ruleNames; @@ -85,7 +85,7 @@ abstract class Recognizer { /// ///

For interpreters, we don't know their serialized ATN despite having /// created the interpreter from it.

- String? get serializedATN { + List get serializedATN { throw UnsupportedError('there is no serialized ATN'); } @@ -147,22 +147,6 @@ abstract class Recognizer { void action(RuleContext? _localctx, int ruleIndex, int actionIndex) {} - int get state { - return _stateNumber; - } - - /// Indicate that the recognizer has changed internal state that is - /// consistent with the ATN state passed in. This way we always know - /// where we are in the ATN as the parser goes along. The rule - /// context objects form a stack that lets us see the stack of - /// invoking rules. Combine this and we have complete ATN - /// configuration information. - set state(int atnState) { -// System.err.println("setState "+atnState); - _stateNumber = atnState; -// if ( traceATNStates ) _ctx.trace(atnState); - } - IntStream get inputStream; set inputStream(covariant IntStream input); diff --git a/runtime/Dart/lib/src/runtime_meta_data.dart b/runtime/Dart/lib/src/runtime_meta_data.dart index 8008b7d374..f0af12f3dc 100644 --- a/runtime/Dart/lib/src/runtime_meta_data.dart +++ b/runtime/Dart/lib/src/runtime_meta_data.dart @@ -66,7 +66,7 @@ class RuntimeMetaData { /// omitted, the {@code -} (hyphen-minus) appearing before it is also /// omitted. /// - static final String VERSION = '4.9.3'; + static final String VERSION = '4.10'; /// Gets the currently executing version of the ANTLR 4 runtime library. /// diff --git a/runtime/Dart/lib/src/tree/src/trees.dart b/runtime/Dart/lib/src/tree/src/trees.dart index 7c452b508b..cd8950d2f3 100644 --- a/runtime/Dart/lib/src/tree/src/trees.dart +++ b/runtime/Dart/lib/src/tree/src/trees.dart @@ -224,8 +224,8 @@ class Trees { /// Return first node satisfying the pred /// /// @since 4.5.1 - static Tree? findNodeSuchThat(Tree? t, Predicate pred) { - if (pred.test(t)) return t; + static Tree? findNodeSuchThat(Tree? t, bool Function(Tree?) pred) { + if (pred(t)) return t; if (t == null) return null; @@ -237,7 +237,3 @@ class Trees { return null; } } - -abstract class Predicate { - bool test(T? t); -} diff --git a/runtime/Dart/pubspec.yaml b/runtime/Dart/pubspec.yaml index 39ebadb8b0..f59fd1f8ef 100644 --- a/runtime/Dart/pubspec.yaml +++ b/runtime/Dart/pubspec.yaml @@ -1,5 +1,5 @@ name: "antlr4" -version: "4.9.3" +version: "4.10.0" description: "New Dart runtime for ANTLR4." homepage: "https://github.com/antlr/antlr4" license: "BSD-3-Clause" diff --git a/runtime/Go/antlr/atn.go b/runtime/Go/antlr/atn.go index 1592212e14..a4e2079e65 100644 --- a/runtime/Go/antlr/atn.go +++ b/runtime/Go/antlr/atn.go @@ -4,6 +4,8 @@ package antlr +import "sync" + var ATNInvalidAltNumber int type ATN struct { @@ -37,6 +39,10 @@ type ATN struct { ruleToTokenType []int states []ATNState + + mu sync.Mutex + stateMu sync.RWMutex + edgeMu sync.RWMutex } func NewATN(grammarType int, maxTokenType int) *ATN { @@ -59,14 +65,15 @@ func (a *ATN) NextTokensInContext(s ATNState, ctx RuleContext) *IntervalSet { // in s and staying in same rule. Token.EPSILON is in set if we reach end of // rule. func (a *ATN) NextTokensNoContext(s ATNState) *IntervalSet { - if s.GetNextTokenWithinRule() != nil { - return s.GetNextTokenWithinRule() + a.mu.Lock() + defer a.mu.Unlock() + iset := s.GetNextTokenWithinRule() + if iset == nil { + iset = a.NextTokensInContext(s, nil) + iset.readOnly = true + s.SetNextTokenWithinRule(iset) } - - s.SetNextTokenWithinRule(a.NextTokensInContext(s, nil)) - s.GetNextTokenWithinRule().readOnly = true - - return s.GetNextTokenWithinRule() + return iset } func (a *ATN) NextTokens(s ATNState, ctx RuleContext) *IntervalSet { diff --git a/runtime/Go/antlr/atn_config_set.go b/runtime/Go/antlr/atn_config_set.go index 51d6ab82ae..49ad4a7197 100644 --- a/runtime/Go/antlr/atn_config_set.go +++ b/runtime/Go/antlr/atn_config_set.go @@ -104,7 +104,7 @@ func (b *BaseATNConfigSet) Alts() *BitSet { func NewBaseATNConfigSet(fullCtx bool) *BaseATNConfigSet { return &BaseATNConfigSet{ cachedHash: -1, - configLookup: NewArray2DHashSetWithCap(hashATNConfig, equalATNConfigs, 16, 2), + configLookup: newArray2DHashSetWithCap(hashATNConfig, equalATNConfigs, 16, 2), fullCtx: fullCtx, } } @@ -155,7 +155,7 @@ func (b *BaseATNConfigSet) Add(config ATNConfig, mergeCache *DoubleDict) bool { } func (b *BaseATNConfigSet) GetStates() Set { - states := NewArray2DHashSet(nil, nil) + states := newArray2DHashSet(nil, nil) for i := 0; i < len(b.configs); i++ { states.Add(b.configs[i].GetState()) @@ -283,7 +283,7 @@ func (b *BaseATNConfigSet) Clear() { b.configs = make([]ATNConfig, 0) b.cachedHash = -1 - b.configLookup = NewArray2DHashSet(nil, equalATNConfigs) + b.configLookup = newArray2DHashSet(nil, equalATNConfigs) } func (b *BaseATNConfigSet) FullContext() bool { @@ -365,7 +365,7 @@ type OrderedATNConfigSet struct { func NewOrderedATNConfigSet() *OrderedATNConfigSet { b := NewBaseATNConfigSet(false) - b.configLookup = NewArray2DHashSet(nil, nil) + b.configLookup = newArray2DHashSet(nil, nil) return &OrderedATNConfigSet{BaseATNConfigSet: b} } diff --git a/runtime/Go/antlr/atn_deserialization_options.go b/runtime/Go/antlr/atn_deserialization_options.go index 18b89efafb..cb8eafb0b2 100644 --- a/runtime/Go/antlr/atn_deserialization_options.go +++ b/runtime/Go/antlr/atn_deserialization_options.go @@ -4,7 +4,9 @@ package antlr -var ATNDeserializationOptionsdefaultOptions = &ATNDeserializationOptions{true, false, false} +import "errors" + +var defaultATNDeserializationOptions = ATNDeserializationOptions{true, true, false} type ATNDeserializationOptions struct { readOnly bool @@ -12,14 +14,48 @@ type ATNDeserializationOptions struct { generateRuleBypassTransitions bool } -func NewATNDeserializationOptions(CopyFrom *ATNDeserializationOptions) *ATNDeserializationOptions { - o := new(ATNDeserializationOptions) +func (opts *ATNDeserializationOptions) ReadOnly() bool { + return opts.readOnly +} + +func (opts *ATNDeserializationOptions) SetReadOnly(readOnly bool) { + if opts.readOnly { + panic(errors.New("Cannot mutate read only ATNDeserializationOptions")) + } + opts.readOnly = readOnly +} + +func (opts *ATNDeserializationOptions) VerifyATN() bool { + return opts.verifyATN +} + +func (opts *ATNDeserializationOptions) SetVerifyATN(verifyATN bool) { + if opts.readOnly { + panic(errors.New("Cannot mutate read only ATNDeserializationOptions")) + } + opts.verifyATN = verifyATN +} - if CopyFrom != nil { - o.readOnly = CopyFrom.readOnly - o.verifyATN = CopyFrom.verifyATN - o.generateRuleBypassTransitions = CopyFrom.generateRuleBypassTransitions +func (opts *ATNDeserializationOptions) GenerateRuleBypassTransitions() bool { + return opts.generateRuleBypassTransitions +} + +func (opts *ATNDeserializationOptions) SetGenerateRuleBypassTransitions(generateRuleBypassTransitions bool) { + if opts.readOnly { + panic(errors.New("Cannot mutate read only ATNDeserializationOptions")) } + opts.generateRuleBypassTransitions = generateRuleBypassTransitions +} +func DefaultATNDeserializationOptions() *ATNDeserializationOptions { + return NewATNDeserializationOptions(&defaultATNDeserializationOptions) +} + +func NewATNDeserializationOptions(other *ATNDeserializationOptions) *ATNDeserializationOptions { + o := new(ATNDeserializationOptions) + if other != nil { + *o = *other + o.readOnly = false + } return o } diff --git a/runtime/Go/antlr/atn_deserializer.go b/runtime/Go/antlr/atn_deserializer.go index 884d39cf7c..aea9bbfa93 100644 --- a/runtime/Go/antlr/atn_deserializer.go +++ b/runtime/Go/antlr/atn_deserializer.go @@ -5,50 +5,34 @@ package antlr import ( - "encoding/hex" "fmt" "strconv" - "strings" - "unicode/utf16" ) -// This is the earliest supported serialized UUID. -// stick to serialized version for now, we don't need a UUID instance -var BaseSerializedUUID = "AADB8D7E-AEEF-4415-AD2B-8204D6CF042E" -var AddedUnicodeSMP = "59627784-3BE5-417A-B9EB-8131A7286089" +const serializedVersion = 4 -// This list contains all of the currently supported UUIDs, ordered by when -// the feature first appeared in this branch. -var SupportedUUIDs = []string{BaseSerializedUUID, AddedUnicodeSMP} - -var SerializedVersion = 3 - -// This is the current serialized UUID. -var SerializedUUID = AddedUnicodeSMP - -type LoopEndStateIntPair struct { +type loopEndStateIntPair struct { item0 *LoopEndState item1 int } -type BlockStartStateIntPair struct { +type blockStartStateIntPair struct { item0 BlockStartState item1 int } type ATNDeserializer struct { - deserializationOptions *ATNDeserializationOptions - data []rune - pos int - uuid string + options *ATNDeserializationOptions + data []int32 + pos int } func NewATNDeserializer(options *ATNDeserializationOptions) *ATNDeserializer { if options == nil { - options = ATNDeserializationOptionsdefaultOptions + options = &defaultATNDeserializationOptions } - return &ATNDeserializer{deserializationOptions: options} + return &ATNDeserializer{options: options} } func stringInSlice(a string, list []string) int { @@ -61,30 +45,10 @@ func stringInSlice(a string, list []string) int { return -1 } -// isFeatureSupported determines if a particular serialized representation of an -// ATN supports a particular feature, identified by the UUID used for -// serializing the ATN at the time the feature was first introduced. Feature is -// the UUID marking the first time the feature was supported in the serialized -// ATN. ActualUuid is the UUID of the actual serialized ATN which is currently -// being deserialized. It returns true if actualUuid represents a serialized ATN -// at or after the feature identified by feature was introduced, and otherwise -// false. -func (a *ATNDeserializer) isFeatureSupported(feature, actualUUID string) bool { - idx1 := stringInSlice(feature, SupportedUUIDs) - - if idx1 < 0 { - return false - } - - idx2 := stringInSlice(actualUUID, SupportedUUIDs) - - return idx2 >= idx1 -} - -func (a *ATNDeserializer) DeserializeFromUInt16(data []uint16) *ATN { - a.reset(utf16.Decode(data)) +func (a *ATNDeserializer) Deserialize(data []int32) *ATN { + a.data = data + a.pos = 0 a.checkVersion() - a.checkUUID() atn := a.readATN() @@ -92,15 +56,7 @@ func (a *ATNDeserializer) DeserializeFromUInt16(data []uint16) *ATN { a.readRules(atn) a.readModes(atn) - sets := make([]*IntervalSet, 0) - - // First, deserialize sets with 16-bit arguments <= U+FFFF. - sets = a.readSets(atn, sets, a.readInt) - // Next, if the ATN was serialized with the Unicode SMP feature, - // deserialize sets with 32-bit arguments <= U+10FFFF. - if (a.isFeatureSupported(AddedUnicodeSMP, a.uuid)) { - sets = a.readSets(atn, sets, a.readInt32) - } + sets := a.readSets(atn, nil) a.readEdges(atn, sets) a.readDecisions(atn) @@ -108,7 +64,7 @@ func (a *ATNDeserializer) DeserializeFromUInt16(data []uint16) *ATN { a.markPrecedenceDecisions(atn) a.verifyATN(atn) - if a.deserializationOptions.generateRuleBypassTransitions && atn.grammarType == ATNTypeParser { + if a.options.GenerateRuleBypassTransitions() && atn.grammarType == ATNTypeParser { a.generateRuleBypassTransitions(atn) // Re-verify after modification a.verifyATN(atn) @@ -118,42 +74,14 @@ func (a *ATNDeserializer) DeserializeFromUInt16(data []uint16) *ATN { } -func (a *ATNDeserializer) reset(data []rune) { - temp := make([]rune, len(data)) - - for i, c := range data { - // Don't adjust the first value since that's the version number - if i == 0 { - temp[i] = c - } else if c > 1 { - temp[i] = c - 2 - } else { - temp[i] = c + 65533 - } - } - - a.data = temp - a.pos = 0 -} - func (a *ATNDeserializer) checkVersion() { version := a.readInt() - if version != SerializedVersion { - panic("Could not deserialize ATN with version " + strconv.Itoa(version) + " (expected " + strconv.Itoa(SerializedVersion) + ").") + if version != serializedVersion { + panic("Could not deserialize ATN with version " + strconv.Itoa(version) + " (expected " + strconv.Itoa(serializedVersion) + ").") } } -func (a *ATNDeserializer) checkUUID() { - uuid := a.readUUID() - - if stringInSlice(uuid, SupportedUUIDs) < 0 { - panic("Could not deserialize ATN with UUID: " + uuid + " (expected " + SerializedUUID + " or a legacy UUID).") - } - - a.uuid = uuid -} - func (a *ATNDeserializer) readATN() *ATN { grammarType := a.readInt() maxTokenType := a.readInt() @@ -162,37 +90,36 @@ func (a *ATNDeserializer) readATN() *ATN { } func (a *ATNDeserializer) readStates(atn *ATN) { - loopBackStateNumbers := make([]LoopEndStateIntPair, 0) - endStateNumbers := make([]BlockStartStateIntPair, 0) - nstates := a.readInt() + // Allocate worst case size. + loopBackStateNumbers := make([]loopEndStateIntPair, 0, nstates) + endStateNumbers := make([]blockStartStateIntPair, 0, nstates) + + // Preallocate states slice. + atn.states = make([]ATNState, 0, nstates) + for i := 0; i < nstates; i++ { stype := a.readInt() // Ignore bad types of states if stype == ATNStateInvalidType { atn.addState(nil) - continue } ruleIndex := a.readInt() - if ruleIndex == 0xFFFF { - ruleIndex = -1 - } - s := a.stateFactory(stype, ruleIndex) if stype == ATNStateLoopEnd { loopBackStateNumber := a.readInt() - loopBackStateNumbers = append(loopBackStateNumbers, LoopEndStateIntPair{s.(*LoopEndState), loopBackStateNumber}) + loopBackStateNumbers = append(loopBackStateNumbers, loopEndStateIntPair{s.(*LoopEndState), loopBackStateNumber}) } else if s2, ok := s.(BlockStartState); ok { endStateNumber := a.readInt() - endStateNumbers = append(endStateNumbers, BlockStartStateIntPair{s2, endStateNumber}) + endStateNumbers = append(endStateNumbers, blockStartStateIntPair{s2, endStateNumber}) } atn.addState(s) @@ -200,20 +127,15 @@ func (a *ATNDeserializer) readStates(atn *ATN) { // Delay the assignment of loop back and end states until we know all the state // instances have been initialized - for j := 0; j < len(loopBackStateNumbers); j++ { - pair := loopBackStateNumbers[j] - + for _, pair := range loopBackStateNumbers { pair.item0.loopBackState = atn.states[pair.item1] } - for j := 0; j < len(endStateNumbers); j++ { - pair := endStateNumbers[j] - + for _, pair := range endStateNumbers { pair.item0.setEndState(atn.states[pair.item1].(*BlockEndState)) } numNonGreedyStates := a.readInt() - for j := 0; j < numNonGreedyStates; j++ { stateNumber := a.readInt() @@ -221,7 +143,6 @@ func (a *ATNDeserializer) readStates(atn *ATN) { } numPrecedenceStates := a.readInt() - for j := 0; j < numPrecedenceStates; j++ { stateNumber := a.readInt() @@ -233,12 +154,12 @@ func (a *ATNDeserializer) readRules(atn *ATN) { nrules := a.readInt() if atn.grammarType == ATNTypeLexer { - atn.ruleToTokenType = make([]int, nrules) // TODO: initIntArray(nrules, 0) + atn.ruleToTokenType = make([]int, nrules) } - atn.ruleToStartState = make([]*RuleStartState, nrules) // TODO: initIntArray(nrules, 0) + atn.ruleToStartState = make([]*RuleStartState, nrules) - for i := 0; i < nrules; i++ { + for i := range atn.ruleToStartState { s := a.readInt() startState := atn.states[s].(*RuleStartState) @@ -247,19 +168,13 @@ func (a *ATNDeserializer) readRules(atn *ATN) { if atn.grammarType == ATNTypeLexer { tokenType := a.readInt() - if tokenType == 0xFFFF { - tokenType = TokenEOF - } - atn.ruleToTokenType[i] = tokenType } } - atn.ruleToStopState = make([]*RuleStopState, nrules) //initIntArray(nrules, 0) - - for i := 0; i < len(atn.states); i++ { - state := atn.states[i] + atn.ruleToStopState = make([]*RuleStopState, nrules) + for _, state := range atn.states { if s2, ok := state.(*RuleStopState); ok { atn.ruleToStopState[s2.ruleIndex] = s2 atn.ruleToStartState[s2.ruleIndex].stopState = s2 @@ -269,17 +184,25 @@ func (a *ATNDeserializer) readRules(atn *ATN) { func (a *ATNDeserializer) readModes(atn *ATN) { nmodes := a.readInt() + atn.modeToStartState = make([]*TokensStartState, nmodes) - for i := 0; i < nmodes; i++ { + for i := range atn.modeToStartState { s := a.readInt() - atn.modeToStartState = append(atn.modeToStartState, atn.states[s].(*TokensStartState)) + atn.modeToStartState[i] = atn.states[s].(*TokensStartState) } } -func (a *ATNDeserializer) readSets(atn *ATN, sets []*IntervalSet, readUnicode func() int) []*IntervalSet { +func (a *ATNDeserializer) readSets(atn *ATN, sets []*IntervalSet) []*IntervalSet { m := a.readInt() + // Preallocate the needed capacity. + if cap(sets)-len(sets) < m { + isets := make([]*IntervalSet, len(sets), len(sets)+m) + copy(isets, sets) + sets = isets + } + for i := 0; i < m; i++ { iset := NewIntervalSet() @@ -293,8 +216,8 @@ func (a *ATNDeserializer) readSets(atn *ATN, sets []*IntervalSet, readUnicode fu } for j := 0; j < n; j++ { - i1 := readUnicode() - i2 := readUnicode() + i1 := a.readInt() + i2 := a.readInt() iset.addRange(i1, i2) } @@ -322,11 +245,9 @@ func (a *ATNDeserializer) readEdges(atn *ATN, sets []*IntervalSet) { } // Edges for rule stop states can be derived, so they are not serialized - for i := 0; i < len(atn.states); i++ { - state := atn.states[i] - - for j := 0; j < len(state.GetTransitions()); j++ { - var t, ok = state.GetTransitions()[j].(*RuleTransition) + for _, state := range atn.states { + for _, t := range state.GetTransitions() { + var rt, ok = t.(*RuleTransition) if !ok { continue @@ -334,48 +255,42 @@ func (a *ATNDeserializer) readEdges(atn *ATN, sets []*IntervalSet) { outermostPrecedenceReturn := -1 - if atn.ruleToStartState[t.getTarget().GetRuleIndex()].isPrecedenceRule { - if t.precedence == 0 { - outermostPrecedenceReturn = t.getTarget().GetRuleIndex() + if atn.ruleToStartState[rt.getTarget().GetRuleIndex()].isPrecedenceRule { + if rt.precedence == 0 { + outermostPrecedenceReturn = rt.getTarget().GetRuleIndex() } } - trans := NewEpsilonTransition(t.followState, outermostPrecedenceReturn) + trans := NewEpsilonTransition(rt.followState, outermostPrecedenceReturn) - atn.ruleToStopState[t.getTarget().GetRuleIndex()].AddTransition(trans, -1) + atn.ruleToStopState[rt.getTarget().GetRuleIndex()].AddTransition(trans, -1) } } - for i := 0; i < len(atn.states); i++ { - state := atn.states[i] - - if s2, ok := state.(*BaseBlockStartState); ok { + for _, state := range atn.states { + if s2, ok := state.(BlockStartState); ok { // We need to know the end state to set its start state - if s2.endState == nil { + if s2.getEndState() == nil { panic("IllegalState") } // Block end states can only be associated to a single block start state - if s2.endState.startState != nil { + if s2.getEndState().startState != nil { panic("IllegalState") } - s2.endState.startState = state + s2.getEndState().startState = state } if s2, ok := state.(*PlusLoopbackState); ok { - for j := 0; j < len(s2.GetTransitions()); j++ { - target := s2.GetTransitions()[j].getTarget() - - if t2, ok := target.(*PlusBlockStartState); ok { + for _, t := range s2.GetTransitions() { + if t2, ok := t.getTarget().(*PlusBlockStartState); ok { t2.loopBackState = state } } } else if s2, ok := state.(*StarLoopbackState); ok { - for j := 0; j < len(s2.GetTransitions()); j++ { - target := s2.GetTransitions()[j].getTarget() - - if t2, ok := target.(*StarLoopEntryState); ok { + for _, t := range s2.GetTransitions() { + if t2, ok := t.getTarget().(*StarLoopEntryState); ok { t2.loopBackState = state } } @@ -399,25 +314,13 @@ func (a *ATNDeserializer) readLexerActions(atn *ATN) { if atn.grammarType == ATNTypeLexer { count := a.readInt() - atn.lexerActions = make([]LexerAction, count) // initIntArray(count, nil) + atn.lexerActions = make([]LexerAction, count) - for i := 0; i < count; i++ { + for i := range atn.lexerActions { actionType := a.readInt() data1 := a.readInt() - - if data1 == 0xFFFF { - data1 = -1 - } - data2 := a.readInt() - - if data2 == 0xFFFF { - data2 = -1 - } - - lexerAction := a.lexerActionFactory(actionType, data1, data2) - - atn.lexerActions[i] = lexerAction + atn.lexerActions[i] = a.lexerActionFactory(actionType, data1, data2) } } } @@ -565,14 +468,12 @@ func (a *ATNDeserializer) markPrecedenceDecisions(atn *ATN) { } func (a *ATNDeserializer) verifyATN(atn *ATN) { - if !a.deserializationOptions.verifyATN { + if !a.options.VerifyATN() { return } // Verify assumptions - for i := 0; i < len(atn.states); i++ { - state := atn.states[i] - + for _, state := range atn.states { if state == nil { continue } @@ -587,18 +488,18 @@ func (a *ATNDeserializer) verifyATN(atn *ATN) { a.checkCondition(s2.loopBackState != nil, "") a.checkCondition(len(s2.GetTransitions()) == 2, "") - switch s2 := state.(type) { + switch s2.transitions[0].getTarget().(type) { case *StarBlockStartState: - var _, ok2 = s2.GetTransitions()[1].getTarget().(*LoopEndState) + _, ok := s2.transitions[1].getTarget().(*LoopEndState) - a.checkCondition(ok2, "") + a.checkCondition(ok, "") a.checkCondition(!s2.nonGreedy, "") case *LoopEndState: - var s3, ok2 = s2.GetTransitions()[1].getTarget().(*StarBlockStartState) + var _, ok = s2.transitions[1].getTarget().(*StarBlockStartState) - a.checkCondition(ok2, "") - a.checkCondition(s3.nonGreedy, "") + a.checkCondition(ok, "") + a.checkCondition(s2.nonGreedy, "") default: panic("IllegalState") @@ -607,9 +508,9 @@ func (a *ATNDeserializer) verifyATN(atn *ATN) { case *StarLoopbackState: a.checkCondition(len(state.GetTransitions()) == 1, "") - var _, ok2 = state.GetTransitions()[0].getTarget().(*StarLoopEntryState) + var _, ok = state.GetTransitions()[0].getTarget().(*StarLoopEntryState) - a.checkCondition(ok2, "") + a.checkCondition(ok, "") case *LoopEndState: a.checkCondition(s2.loopBackState != nil, "") @@ -617,8 +518,8 @@ func (a *ATNDeserializer) verifyATN(atn *ATN) { case *RuleStartState: a.checkCondition(s2.stopState != nil, "") - case *BaseBlockStartState: - a.checkCondition(s2.endState != nil, "") + case BlockStartState: + a.checkCondition(s2.getEndState() != nil, "") case *BlockEndState: a.checkCondition(s2.startState != nil, "") @@ -649,53 +550,7 @@ func (a *ATNDeserializer) readInt() int { a.pos++ - return int(v) -} - -func (a *ATNDeserializer) readInt32() int { - var low = a.readInt() - var high = a.readInt() - return low | (high << 16) -} - -//TODO -//func (a *ATNDeserializer) readLong() int64 { -// panic("Not implemented") -// var low = a.readInt32() -// var high = a.readInt32() -// return (low & 0x00000000FFFFFFFF) | (high << int32) -//} - -func createByteToHex() []string { - bth := make([]string, 256) - - for i := 0; i < 256; i++ { - bth[i] = strings.ToUpper(hex.EncodeToString([]byte{byte(i)})) - } - - return bth -} - -var byteToHex = createByteToHex() - -func (a *ATNDeserializer) readUUID() string { - bb := make([]int, 16) - - for i := 7; i >= 0; i-- { - integer := a.readInt() - - bb[(2*i)+1] = integer & 0xFF - bb[2*i] = (integer >> 8) & 0xFF - } - - return byteToHex[bb[0]] + byteToHex[bb[1]] + - byteToHex[bb[2]] + byteToHex[bb[3]] + "-" + - byteToHex[bb[4]] + byteToHex[bb[5]] + "-" + - byteToHex[bb[6]] + byteToHex[bb[7]] + "-" + - byteToHex[bb[8]] + byteToHex[bb[9]] + "-" + - byteToHex[bb[10]] + byteToHex[bb[11]] + - byteToHex[bb[12]] + byteToHex[bb[13]] + - byteToHex[bb[14]] + byteToHex[bb[15]] + return int(v) // data is 32 bits but int is at least that big } func (a *ATNDeserializer) edgeFactory(atn *ATN, typeIndex, src, trg, arg1, arg2, arg3 int, sets []*IntervalSet) Transition { diff --git a/runtime/Go/antlr/atn_state.go b/runtime/Go/antlr/atn_state.go index 563d5db38d..3835bb2e93 100644 --- a/runtime/Go/antlr/atn_state.go +++ b/runtime/Go/antlr/atn_state.go @@ -243,6 +243,8 @@ func NewBasicBlockStartState() *BasicBlockStartState { return &BasicBlockStartState{BaseBlockStartState: b} } +var _ BlockStartState = &BasicBlockStartState{} + // BlockEndState is a terminal node of a simple (a|b|c) block. type BlockEndState struct { *BaseATNState @@ -318,6 +320,8 @@ func NewPlusBlockStartState() *PlusBlockStartState { return &PlusBlockStartState{BaseBlockStartState: b} } +var _ BlockStartState = &PlusBlockStartState{} + // StarBlockStartState is the block that begins a closure loop. type StarBlockStartState struct { *BaseBlockStartState @@ -331,6 +335,8 @@ func NewStarBlockStartState() *StarBlockStartState { return &StarBlockStartState{BaseBlockStartState: b} } +var _ BlockStartState = &StarBlockStartState{} + type StarLoopbackState struct { *BaseATNState } diff --git a/runtime/Go/antlr/dfa.go b/runtime/Go/antlr/dfa.go index 770c32a6bb..d55a2a87d5 100644 --- a/runtime/Go/antlr/dfa.go +++ b/runtime/Go/antlr/dfa.go @@ -6,7 +6,6 @@ package antlr import ( "sort" - "sync" ) type DFA struct { @@ -18,23 +17,27 @@ type DFA struct { // states is all the DFA states. Use Map to get the old state back; Set can only // indicate whether it is there. states map[int]*DFAState - statesMu sync.RWMutex s0 *DFAState - s0Mu sync.RWMutex // precedenceDfa is the backing field for isPrecedenceDfa and setPrecedenceDfa. // True if the DFA is for a precedence decision and false otherwise. precedenceDfa bool - precedenceDfaMu sync.RWMutex } func NewDFA(atnStartState DecisionState, decision int) *DFA { - return &DFA{ + dfa := &DFA{ atnStartState: atnStartState, decision: decision, states: make(map[int]*DFAState), } + if s, ok := atnStartState.(*StarLoopEntryState); ok && s.precedenceRuleDecision { + dfa.precedenceDfa = true + dfa.s0 = NewDFAState(-1, NewBaseATNConfigSet(false)) + dfa.s0.isAcceptState = false + dfa.s0.requiresFullContext = false + } + return dfa } // getPrecedenceStartState gets the start state for the current precedence and @@ -79,8 +82,6 @@ func (d *DFA) setPrecedenceStartState(precedence int, startState *DFAState) { } func (d *DFA) getPrecedenceDfa() bool { - d.precedenceDfaMu.RLock() - defer d.precedenceDfaMu.RUnlock() return d.precedenceDfa } @@ -104,46 +105,32 @@ func (d *DFA) setPrecedenceDfa(precedenceDfa bool) { d.setS0(nil) } - d.precedenceDfaMu.Lock() - defer d.precedenceDfaMu.Unlock() d.precedenceDfa = precedenceDfa } } func (d *DFA) getS0() *DFAState { - d.s0Mu.RLock() - defer d.s0Mu.RUnlock() return d.s0 } func (d *DFA) setS0(s *DFAState) { - d.s0Mu.Lock() - defer d.s0Mu.Unlock() d.s0 = s } func (d *DFA) getState(hash int) (*DFAState, bool) { - d.statesMu.RLock() - defer d.statesMu.RUnlock() s, ok := d.states[hash] return s, ok } func (d *DFA) setStates(states map[int]*DFAState) { - d.statesMu.Lock() - defer d.statesMu.Unlock() d.states = states } func (d *DFA) setState(hash int, state *DFAState) { - d.statesMu.Lock() - defer d.statesMu.Unlock() d.states[hash] = state } func (d *DFA) numStates() int { - d.statesMu.RLock() - defer d.statesMu.RUnlock() return len(d.states) } diff --git a/runtime/Go/antlr/dfa_state.go b/runtime/Go/antlr/dfa_state.go index 3a81706adf..970ed19865 100644 --- a/runtime/Go/antlr/dfa_state.go +++ b/runtime/Go/antlr/dfa_state.go @@ -6,7 +6,6 @@ package antlr import ( "fmt" - "sync" ) // PredPrediction maps a predicate to a predicted alternative. @@ -50,8 +49,7 @@ type DFAState struct { // edges elements point to the target of the symbol. Shift up by 1 so (-1) // Token.EOF maps to the first element. - edges []*DFAState - edgesMu sync.RWMutex + edges []*DFAState isAcceptState bool @@ -93,7 +91,7 @@ func NewDFAState(stateNumber int, configs ATNConfigSet) *DFAState { // GetAltSet gets the set of all alts mentioned by all ATN configurations in d. func (d *DFAState) GetAltSet() Set { - alts := NewArray2DHashSet(nil, nil) + alts := newArray2DHashSet(nil, nil) if d.configs != nil { for _, c := range d.configs.GetItems() { @@ -109,32 +107,22 @@ func (d *DFAState) GetAltSet() Set { } func (d *DFAState) getEdges() []*DFAState { - d.edgesMu.RLock() - defer d.edgesMu.RUnlock() return d.edges } func (d *DFAState) numEdges() int { - d.edgesMu.RLock() - defer d.edgesMu.RUnlock() return len(d.edges) } func (d *DFAState) getIthEdge(i int) *DFAState { - d.edgesMu.RLock() - defer d.edgesMu.RUnlock() return d.edges[i] } func (d *DFAState) setEdges(newEdges []*DFAState) { - d.edgesMu.Lock() - defer d.edgesMu.Unlock() d.edges = newEdges } func (d *DFAState) setIthEdge(i int, edge *DFAState) { - d.edgesMu.Lock() - defer d.edgesMu.Unlock() d.edges[i] = edge } diff --git a/runtime/Go/antlr/error_strategy.go b/runtime/Go/antlr/error_strategy.go index 977a6e4549..c4080dbfd1 100644 --- a/runtime/Go/antlr/error_strategy.go +++ b/runtime/Go/antlr/error_strategy.go @@ -16,7 +16,7 @@ type ErrorStrategy interface { RecoverInline(Parser) Token Recover(Parser, RecognitionException) Sync(Parser) - inErrorRecoveryMode(Parser) bool + InErrorRecoveryMode(Parser) bool ReportError(Parser, RecognitionException) ReportMatch(Parser) } @@ -40,7 +40,7 @@ func NewDefaultErrorStrategy() *DefaultErrorStrategy { // error". This is used to suppress Reporting multiple error messages while // attempting to recover from a detected syntax error. // - // @see //inErrorRecoveryMode + // @see //InErrorRecoveryMode // d.errorRecoveryMode = false @@ -71,7 +71,7 @@ func (d *DefaultErrorStrategy) beginErrorCondition(recognizer Parser) { d.errorRecoveryMode = true } -func (d *DefaultErrorStrategy) inErrorRecoveryMode(recognizer Parser) bool { +func (d *DefaultErrorStrategy) InErrorRecoveryMode(recognizer Parser) bool { return d.errorRecoveryMode } @@ -118,7 +118,7 @@ func (d *DefaultErrorStrategy) ReportMatch(recognizer Parser) { func (d *DefaultErrorStrategy) ReportError(recognizer Parser, e RecognitionException) { // if we've already Reported an error and have not Matched a token // yet successfully, don't Report any errors. - if d.inErrorRecoveryMode(recognizer) { + if d.InErrorRecoveryMode(recognizer) { return // don't Report spurious errors } d.beginErrorCondition(recognizer) @@ -209,7 +209,7 @@ func (d *DefaultErrorStrategy) Recover(recognizer Parser, e RecognitionException // func (d *DefaultErrorStrategy) Sync(recognizer Parser) { // If already recovering, don't try to Sync - if d.inErrorRecoveryMode(recognizer) { + if d.InErrorRecoveryMode(recognizer) { return } @@ -312,7 +312,7 @@ func (d *DefaultErrorStrategy) ReportFailedPredicate(recognizer Parser, e *Faile // @param recognizer the parser instance // func (d *DefaultErrorStrategy) ReportUnwantedToken(recognizer Parser) { - if d.inErrorRecoveryMode(recognizer) { + if d.InErrorRecoveryMode(recognizer) { return } d.beginErrorCondition(recognizer) @@ -341,7 +341,7 @@ func (d *DefaultErrorStrategy) ReportUnwantedToken(recognizer Parser) { // @param recognizer the parser instance // func (d *DefaultErrorStrategy) ReportMissingToken(recognizer Parser) { - if d.inErrorRecoveryMode(recognizer) { + if d.InErrorRecoveryMode(recognizer) { return } d.beginErrorCondition(recognizer) @@ -738,7 +738,11 @@ func (b *BailErrorStrategy) Recover(recognizer Parser, e RecognitionException) { context := recognizer.GetParserRuleContext() for context != nil { context.SetException(e) - context = context.GetParent().(ParserRuleContext) + if parent, ok := context.GetParent().(ParserRuleContext); ok { + context = parent + } else { + context = nil + } } panic(NewParseCancellationException()) // TODO we don't emit e properly } diff --git a/runtime/Go/antlr/lexer_atn_simulator.go b/runtime/Go/antlr/lexer_atn_simulator.go index 730bea47aa..dc05153ea4 100644 --- a/runtime/Go/antlr/lexer_atn_simulator.go +++ b/runtime/Go/antlr/lexer_atn_simulator.go @@ -91,11 +91,16 @@ func (l *LexerATNSimulator) Match(input CharStream, mode int) int { dfa := l.decisionToDFA[mode] - if dfa.getS0() == nil { + var s0 *DFAState + l.atn.stateMu.RLock() + s0 = dfa.getS0() + l.atn.stateMu.RUnlock() + + if s0 == nil { return l.MatchATN(input) } - return l.execATN(input, dfa.getS0()) + return l.execATN(input, s0) } func (l *LexerATNSimulator) reset() { @@ -117,11 +122,7 @@ func (l *LexerATNSimulator) MatchATN(input CharStream) int { suppressEdge := s0Closure.hasSemanticContext s0Closure.hasSemanticContext = false - next := l.addDFAState(s0Closure) - - if !suppressEdge { - l.decisionToDFA[l.mode].setS0(next) - } + next := l.addDFAState(s0Closure, suppressEdge) predict := l.execATN(input, next) @@ -203,10 +204,15 @@ func (l *LexerATNSimulator) execATN(input CharStream, ds0 *DFAState) int { // {@code t}, or {@code nil} if the target state for l edge is not // already cached func (l *LexerATNSimulator) getExistingTargetState(s *DFAState, t int) *DFAState { - if s.getEdges() == nil || t < LexerATNSimulatorMinDFAEdge || t > LexerATNSimulatorMaxDFAEdge { + if t < LexerATNSimulatorMinDFAEdge || t > LexerATNSimulatorMaxDFAEdge { return nil } + l.atn.edgeMu.RLock() + defer l.atn.edgeMu.RUnlock() + if s.getEdges() == nil { + return nil + } target := s.getIthEdge(t - LexerATNSimulatorMinDFAEdge) if LexerATNSimulatorDebug && target != nil { fmt.Println("reuse state " + strconv.Itoa(s.stateNumber) + " edge to " + strconv.Itoa(target.stateNumber)) @@ -537,7 +543,7 @@ func (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfg suppressEdge := cfgs.HasSemanticContext() cfgs.SetHasSemanticContext(false) - to = l.addDFAState(cfgs) + to = l.addDFAState(cfgs, true) if suppressEdge { return to @@ -551,6 +557,8 @@ func (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfg if LexerATNSimulatorDebug { fmt.Println("EDGE " + from.String() + " -> " + to.String() + " upon " + strconv.Itoa(tk)) } + l.atn.edgeMu.Lock() + defer l.atn.edgeMu.Unlock() if from.getEdges() == nil { // make room for tokens 1..n and -1 masquerading as index 0 from.setEdges(make([]*DFAState, LexerATNSimulatorMaxDFAEdge-LexerATNSimulatorMinDFAEdge+1)) @@ -564,7 +572,7 @@ func (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfg // configurations already. This method also detects the first // configuration containing an ATN rule stop state. Later, when // traversing the DFA, we will know which rule to accept. -func (l *LexerATNSimulator) addDFAState(configs ATNConfigSet) *DFAState { +func (l *LexerATNSimulator) addDFAState(configs ATNConfigSet, suppressEdge bool) *DFAState { proposed := NewDFAState(-1, configs) var firstConfigWithRuleStopState ATNConfig @@ -585,16 +593,22 @@ func (l *LexerATNSimulator) addDFAState(configs ATNConfigSet) *DFAState { } hash := proposed.hash() dfa := l.decisionToDFA[l.mode] + + l.atn.stateMu.Lock() + defer l.atn.stateMu.Unlock() existing, ok := dfa.getState(hash) if ok { - return existing - } - newState := proposed - newState.stateNumber = dfa.numStates() - configs.SetReadOnly(true) - newState.configs = configs - dfa.setState(hash, newState) - return newState + proposed = existing + } else { + proposed.stateNumber = dfa.numStates() + configs.SetReadOnly(true) + proposed.configs = configs + dfa.setState(hash, proposed) + } + if !suppressEdge { + dfa.setS0(proposed) + } + return proposed } func (l *LexerATNSimulator) getDFA(mode int) *DFA { diff --git a/runtime/Go/antlr/ll1_analyzer.go b/runtime/Go/antlr/ll1_analyzer.go index ebd43e456a..6ffb37de69 100644 --- a/runtime/Go/antlr/ll1_analyzer.go +++ b/runtime/Go/antlr/ll1_analyzer.go @@ -38,7 +38,7 @@ func (la *LL1Analyzer) getDecisionLookahead(s ATNState) []*IntervalSet { look := make([]*IntervalSet, count) for alt := 0; alt < count; alt++ { look[alt] = NewIntervalSet() - lookBusy := NewArray2DHashSet(nil, nil) + lookBusy := newArray2DHashSet(nil, nil) seeThruPreds := false // fail to get lookahead upon pred la.look1(s.GetTransitions()[alt].getTarget(), nil, BasePredictionContextEMPTY, look[alt], lookBusy, NewBitSet(), seeThruPreds, false) // Wipe out lookahead for la alternative if we found nothing @@ -75,7 +75,7 @@ func (la *LL1Analyzer) Look(s, stopState ATNState, ctx RuleContext) *IntervalSet if ctx != nil { lookContext = predictionContextFromRuleContext(s.GetATN(), ctx) } - la.look1(s, stopState, lookContext, r, NewArray2DHashSet(nil, nil), NewBitSet(), seeThruPreds, true) + la.look1(s, stopState, lookContext, r, newArray2DHashSet(nil, nil), NewBitSet(), seeThruPreds, true) return r } diff --git a/runtime/Go/antlr/parser.go b/runtime/Go/antlr/parser.go index fb60258e33..2ab2f56052 100644 --- a/runtime/Go/antlr/parser.go +++ b/runtime/Go/antlr/parser.go @@ -425,7 +425,7 @@ func (p *BaseParser) Consume() Token { } hasListener := p.parseListeners != nil && len(p.parseListeners) > 0 if p.BuildParseTrees || hasListener { - if p.errHandler.inErrorRecoveryMode(p) { + if p.errHandler.InErrorRecoveryMode(p) { node := p.ctx.AddErrorNode(o) if p.parseListeners != nil { for _, l := range p.parseListeners { diff --git a/runtime/Go/antlr/parser_atn_simulator.go b/runtime/Go/antlr/parser_atn_simulator.go index d7a3665bec..888d512975 100644 --- a/runtime/Go/antlr/parser_atn_simulator.go +++ b/runtime/Go/antlr/parser_atn_simulator.go @@ -96,14 +96,18 @@ func (p *ParserATNSimulator) AdaptivePredict(input TokenStream, decision int, ou // Now we are certain to have a specific decision's DFA // But, do we still need an initial state? var s0 *DFAState + p.atn.stateMu.RLock() if dfa.getPrecedenceDfa() { + p.atn.edgeMu.RLock() // the start state for a precedence DFA depends on the current // parser precedence, and is provided by a DFA method. s0 = dfa.getPrecedenceStartState(p.parser.GetPrecedence()) + p.atn.edgeMu.RUnlock() } else { // the start state for a "regular" DFA is just s0 s0 = dfa.getS0() } + p.atn.stateMu.RUnlock() if s0 == nil { if outerContext == nil { @@ -114,21 +118,10 @@ func (p *ParserATNSimulator) AdaptivePredict(input TokenStream, decision int, ou " exec LA(1)==" + p.getLookaheadName(input) + ", outerContext=" + outerContext.String(p.parser.GetRuleNames(), nil)) } - // If p is not a precedence DFA, we check the ATN start state - // to determine if p ATN start state is the decision for the - // closure block that determines whether a precedence rule - // should continue or complete. - - t2 := dfa.atnStartState - t, ok := t2.(*StarLoopEntryState) - if !dfa.getPrecedenceDfa() && ok { - if t.precedenceRuleDecision { - dfa.setPrecedenceDfa(true) - } - } fullCtx := false s0Closure := p.computeStartState(dfa.atnStartState, RuleContextEmpty, fullCtx) + p.atn.stateMu.Lock() if dfa.getPrecedenceDfa() { // If p is a precedence DFA, we use applyPrecedenceFilter // to convert the computed start state to a precedence start @@ -139,12 +132,16 @@ func (p *ParserATNSimulator) AdaptivePredict(input TokenStream, decision int, ou dfa.s0.configs = s0Closure s0Closure = p.applyPrecedenceFilter(s0Closure) s0 = p.addDFAState(dfa, NewDFAState(-1, s0Closure)) + p.atn.edgeMu.Lock() dfa.setPrecedenceStartState(p.parser.GetPrecedence(), s0) + p.atn.edgeMu.Unlock() } else { s0 = p.addDFAState(dfa, NewDFAState(-1, s0Closure)) dfa.setS0(s0) } + p.atn.stateMu.Unlock() } + alt := p.execATN(dfa, s0, input, index, outerContext) if ParserATNSimulatorDebug { fmt.Println("DFA after predictATN: " + dfa.String(p.parser.GetLiteralNames(), nil)) @@ -295,11 +292,16 @@ func (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream, // already cached func (p *ParserATNSimulator) getExistingTargetState(previousD *DFAState, t int) *DFAState { - edges := previousD.getEdges() - if edges == nil || t+1 < 0 || t+1 >= len(edges) { + if t+1 < 0 { return nil } + p.atn.edgeMu.RLock() + defer p.atn.edgeMu.RUnlock() + edges := previousD.getEdges() + if edges == nil || t+1 >= len(edges) { + return nil + } return previousD.getIthEdge(t + 1) } @@ -568,7 +570,7 @@ func (p *ParserATNSimulator) computeReachSet(closure ATNConfigSet, t int, fullCt // if reach == nil { reach = NewBaseATNConfigSet(fullCtx) - closureBusy := NewArray2DHashSet(nil, nil) + closureBusy := newArray2DHashSet(nil, nil) treatEOFAsEpsilon := t == TokenEOF amount := len(intermediate.configs) for k := 0; k < amount; k++ { @@ -663,7 +665,7 @@ func (p *ParserATNSimulator) computeStartState(a ATNState, ctx RuleContext, full for i := 0; i < len(a.GetTransitions()); i++ { target := a.GetTransitions()[i].getTarget() c := NewBaseATNConfig6(target, i+1, initialContext) - closureBusy := NewArray2DHashSet(nil, nil) + closureBusy := newArray2DHashSet(nil, nil) p.closure(c, configs, closureBusy, true, fullCtx, false) } return configs @@ -1446,14 +1448,18 @@ func (p *ParserATNSimulator) addDFAEdge(dfa *DFA, from *DFAState, t int, to *DFA if to == nil { return nil } + p.atn.stateMu.Lock() to = p.addDFAState(dfa, to) // used existing if possible not incoming + p.atn.stateMu.Unlock() if from == nil || t < -1 || t > p.atn.maxTokenType { return to } + p.atn.edgeMu.Lock() if from.getEdges() == nil { from.setEdges(make([]*DFAState, p.atn.maxTokenType+1+1)) } from.setIthEdge(t+1, to) // connect + p.atn.edgeMu.Unlock() if ParserATNSimulatorDebug { var names []string diff --git a/runtime/Go/antlr/recognizer.go b/runtime/Go/antlr/recognizer.go index 12578cfb37..d7c1079b1e 100644 --- a/runtime/Go/antlr/recognizer.go +++ b/runtime/Go/antlr/recognizer.go @@ -49,7 +49,7 @@ var tokenTypeMapCache = make(map[string]int) var ruleIndexMapCache = make(map[string]int) func (b *BaseRecognizer) checkVersion(toolVersion string) { - runtimeVersion := "4.9.3" + runtimeVersion := "4.10" if runtimeVersion != toolVersion { fmt.Println("ANTLR runtime and generated code versions disagree: " + runtimeVersion + "!=" + toolVersion) } diff --git a/runtime/Go/antlr/semantic_context.go b/runtime/Go/antlr/semantic_context.go index bdbaabdc24..9ada430779 100644 --- a/runtime/Go/antlr/semantic_context.go +++ b/runtime/Go/antlr/semantic_context.go @@ -193,7 +193,7 @@ type AND struct { func NewAND(a, b SemanticContext) *AND { - operands := NewArray2DHashSet(nil, nil) + operands := newArray2DHashSet(nil, nil) if aa, ok := a.(*AND); ok { for _, o := range aa.opnds { operands.Add(o) @@ -345,7 +345,7 @@ type OR struct { func NewOR(a, b SemanticContext) *OR { - operands := NewArray2DHashSet(nil, nil) + operands := newArray2DHashSet(nil, nil) if aa, ok := a.(*OR); ok { for _, o := range aa.opnds { operands.Add(o) diff --git a/runtime/Go/antlr/testing_lexer_b_test.go b/runtime/Go/antlr/testing_lexer_b_test.go index 4ab9b340d3..d07782b17f 100644 --- a/runtime/Go/antlr/testing_lexer_b_test.go +++ b/runtime/Go/antlr/testing_lexer_b_test.go @@ -20,28 +20,27 @@ MULT : '*'; WS : ' '+; */ -var lexerB_serializedLexerAtn = []uint16{ - 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 9, 40, 8, - 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, - 7, 4, 8, 9, 8, 3, 2, 6, 2, 19, 10, 2, 13, 2, 14, 2, 20, 3, 3, 6, 3, 24, - 10, 3, 13, 3, 14, 3, 25, 3, 4, 3, 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, - 3, 8, 6, 8, 37, 10, 8, 13, 8, 14, 8, 38, 2, 2, 9, 3, 3, 5, 4, 7, 5, 9, - 6, 11, 7, 13, 8, 15, 9, 3, 2, 2, 2, 42, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, - 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, - 2, 2, 2, 15, 3, 2, 2, 2, 3, 18, 3, 2, 2, 2, 5, 23, 3, 2, 2, 2, 7, 27, 3, - 2, 2, 2, 9, 29, 3, 2, 2, 2, 11, 31, 3, 2, 2, 2, 13, 33, 3, 2, 2, 2, 15, - 36, 3, 2, 2, 2, 17, 19, 4, 99, 124, 2, 18, 17, 3, 2, 2, 2, 19, 20, 3, 2, - 2, 2, 20, 18, 3, 2, 2, 2, 20, 21, 3, 2, 2, 2, 21, 4, 3, 2, 2, 2, 22, 24, - 4, 50, 59, 2, 23, 22, 3, 2, 2, 2, 24, 25, 3, 2, 2, 2, 25, 23, 3, 2, 2, - 2, 25, 26, 3, 2, 2, 2, 26, 6, 3, 2, 2, 2, 27, 28, 7, 61, 2, 2, 28, 8, 3, - 2, 2, 2, 29, 30, 7, 63, 2, 2, 30, 10, 3, 2, 2, 2, 31, 32, 7, 45, 2, 2, - 32, 12, 3, 2, 2, 2, 33, 34, 7, 44, 2, 2, 34, 14, 3, 2, 2, 2, 35, 37, 7, - 34, 2, 2, 36, 35, 3, 2, 2, 2, 37, 38, 3, 2, 2, 2, 38, 36, 3, 2, 2, 2, 38, - 39, 3, 2, 2, 2, 39, 16, 3, 2, 2, 2, 6, 2, 20, 25, 38, 2, +var lexerB_serializedLexerAtn = []int32{ + 4, 0, 7, 38, 6, 65535, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, + 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 1, 0, 4, 0, 17, 8, 0, 11, 0, 12, 0, + 18, 1, 1, 4, 1, 22, 8, 1, 11, 1, 12, 1, 23, 1, 2, 1, 2, 1, 3, 1, 3, 1, + 4, 1, 4, 1, 5, 1, 5, 1, 6, 4, 6, 35, 8, 6, 11, 6, 12, 6, 36, 0, 0, 7, 1, + 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 1, 0, 0, 0, 40, 0, 1, 1, 0, 0, + 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, + 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 1, 16, 1, 0, 0, 0, 3, 21, 1, 0, + 0, 0, 5, 25, 1, 0, 0, 0, 7, 27, 1, 0, 0, 0, 9, 29, 1, 0, 0, 0, 11, 31, + 1, 0, 0, 0, 13, 34, 1, 0, 0, 0, 15, 17, 2, 97, 122, 0, 16, 15, 1, 0, 0, + 0, 17, 18, 1, 0, 0, 0, 18, 16, 1, 0, 0, 0, 18, 19, 1, 0, 0, 0, 19, 2, 1, + 0, 0, 0, 20, 22, 2, 48, 57, 0, 21, 20, 1, 0, 0, 0, 22, 23, 1, 0, 0, 0, + 23, 21, 1, 0, 0, 0, 23, 24, 1, 0, 0, 0, 24, 4, 1, 0, 0, 0, 25, 26, 5, 59, + 0, 0, 26, 6, 1, 0, 0, 0, 27, 28, 5, 61, 0, 0, 28, 8, 1, 0, 0, 0, 29, 30, + 5, 43, 0, 0, 30, 10, 1, 0, 0, 0, 31, 32, 5, 42, 0, 0, 32, 12, 1, 0, 0, + 0, 33, 35, 5, 32, 0, 0, 34, 33, 1, 0, 0, 0, 35, 36, 1, 0, 0, 0, 36, 34, + 1, 0, 0, 0, 36, 37, 1, 0, 0, 0, 37, 14, 1, 0, 0, 0, 4, 0, 18, 23, 36, 0, } var lexerB_lexerDeserializer = NewATNDeserializer(nil) -var lexerB_lexerAtn = lexerB_lexerDeserializer.DeserializeFromUInt16(lexerB_serializedLexerAtn) +var lexerB_lexerAtn = lexerB_lexerDeserializer.Deserialize(lexerB_serializedLexerAtn) var lexerB_lexerChannelNames = []string{ "DEFAULT_TOKEN_CHANNEL", "HIDDEN", diff --git a/runtime/Go/antlr/tokenstream_rewriter_test.go b/runtime/Go/antlr/tokenstream_rewriter_test.go index 8d61d35123..b3647ed318 100644 --- a/runtime/Go/antlr/tokenstream_rewriter_test.go +++ b/runtime/Go/antlr/tokenstream_rewriter_test.go @@ -10,6 +10,16 @@ import ( "strings" ) + +/* Assume the following grammar for this test. + +lexer grammar LexerA; +A : 'a'; +B : 'b'; +C : 'c'; + +*/ + func TestInsertBeforeIndex0(t *testing.T){ input := NewInputStream("abc") lexer := NewLexerA(input) @@ -318,17 +328,17 @@ func TestLexerA(t *testing.T){ var _ = fmt.Printf var _ = unicode.IsLetter -var serializedLexerAtn = []uint16{ - 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 5, 15, 8, - 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, - 4, 2, 2, 5, 3, 3, 5, 4, 7, 5, 3, 2, 2, 2, 14, 2, 3, 3, 2, 2, 2, 2, 5, 3, - 2, 2, 2, 2, 7, 3, 2, 2, 2, 3, 9, 3, 2, 2, 2, 5, 11, 3, 2, 2, 2, 7, 13, - 3, 2, 2, 2, 9, 10, 7, 99, 2, 2, 10, 4, 3, 2, 2, 2, 11, 12, 7, 100, 2, 2, - 12, 6, 3, 2, 2, 2, 13, 14, 7, 101, 2, 2, 14, 8, 3, 2, 2, 2, 3, 2, 2, +var serializedLexerAtn = []int32{ + 4, 0, 3, 13, 6, 65535, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 1, 0, 1, 0, + 1, 1, 1, 1, 1, 2, 1, 2, 0, 0, 3, 1, 1, 3, 2, 5, 3, 1, 0, 0, 0, 12, 0, 1, + 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 1, 7, 1, 0, 0, 0, 3, 9, + 1, 0, 0, 0, 5, 11, 1, 0, 0, 0, 7, 8, 5, 97, 0, 0, 8, 2, 1, 0, 0, 0, 9, + 10, 5, 98, 0, 0, 10, 4, 1, 0, 0, 0, 11, 12, 5, 99, 0, 0, 12, 6, 1, 0, 0, + 0, 1, 0, 0, } var lexerDeserializer = NewATNDeserializer(nil) -var lexerAtn = lexerDeserializer.DeserializeFromUInt16(serializedLexerAtn) +var lexerAtn = lexerDeserializer.Deserialize(serializedLexerAtn) var lexerChannelNames = []string{ "DEFAULT_TOKEN_CHANNEL", "HIDDEN", diff --git a/runtime/Go/antlr/tree.go b/runtime/Go/antlr/tree.go index bdeb6d7881..08ce22bba3 100644 --- a/runtime/Go/antlr/tree.go +++ b/runtime/Go/antlr/tree.go @@ -64,7 +64,7 @@ type BaseParseTreeVisitor struct{} var _ ParseTreeVisitor = &BaseParseTreeVisitor{} -func (v *BaseParseTreeVisitor) Visit(tree ParseTree) interface{} { return nil } +func (v *BaseParseTreeVisitor) Visit(tree ParseTree) interface{} { return tree.Accept(v) } func (v *BaseParseTreeVisitor) VisitChildren(node RuleNode) interface{} { return nil } func (v *BaseParseTreeVisitor) VisitTerminal(node TerminalNode) interface{} { return nil } func (v *BaseParseTreeVisitor) VisitErrorNode(node ErrorNode) interface{} { return nil } diff --git a/runtime/Go/antlr/utils.go b/runtime/Go/antlr/utils.go index 9c7d0a6cda..ec219df983 100644 --- a/runtime/Go/antlr/utils.go +++ b/runtime/Go/antlr/utils.go @@ -8,7 +8,7 @@ import ( "bytes" "errors" "fmt" - "sort" + "math/bits" "strconv" "strings" ) @@ -71,59 +71,92 @@ type hasher interface { hash() int } +const bitsPerWord = 64 + +func indexForBit(bit int) int { + return bit / bitsPerWord +} + +func wordForBit(data []uint64, bit int) uint64 { + idx := indexForBit(bit) + if idx >= len(data) { + return 0 + } + return data[idx] +} + +func maskForBit(bit int) uint64 { + return uint64(1) << (bit % bitsPerWord) +} + +func wordsNeeded(bit int) int { + return indexForBit(bit) + 1 +} + type BitSet struct { - data map[int]bool + data []uint64 } func NewBitSet() *BitSet { - b := new(BitSet) - b.data = make(map[int]bool) - return b + return &BitSet{} } func (b *BitSet) add(value int) { - b.data[value] = true + idx := indexForBit(value) + if idx >= len(b.data) { + size := wordsNeeded(value) + data := make([]uint64, size) + copy(data, b.data) + b.data = data + } + b.data[idx] |= maskForBit(value) } func (b *BitSet) clear(index int) { - delete(b.data, index) + idx := indexForBit(index) + if idx >= len(b.data) { + return + } + b.data[idx] &= ^maskForBit(index) } func (b *BitSet) or(set *BitSet) { - for k := range set.data { - b.add(k) + // Get min size necessary to represent the bits in both sets. + bLen := b.minLen() + setLen := set.minLen() + maxLen := intMax(bLen, setLen) + if maxLen > len(b.data) { + // Increase the size of len(b.data) to repesent the bits in both sets. + data := make([]uint64, maxLen) + copy(data, b.data) + b.data = data + } + // len(b.data) is at least setLen. + for i := 0; i < setLen; i++ { + b.data[i] |= set.data[i] } } func (b *BitSet) remove(value int) { - delete(b.data, value) + b.clear(value) } func (b *BitSet) contains(value int) bool { - return b.data[value] -} - -func (b *BitSet) values() []int { - ks := make([]int, len(b.data)) - i := 0 - for k := range b.data { - ks[i] = k - i++ + idx := indexForBit(value) + if idx >= len(b.data) { + return false } - sort.Ints(ks) - return ks + return (b.data[idx] & maskForBit(value)) != 0 } func (b *BitSet) minValue() int { - min := 2147483647 - - for k := range b.data { - if k < min { - min = k + for i, v := range b.data { + if v == 0 { + continue } + return i*bitsPerWord + bits.TrailingZeros64(v) } - - return min + return 2147483647 } func (b *BitSet) equals(other interface{}) bool { @@ -132,12 +165,22 @@ func (b *BitSet) equals(other interface{}) bool { return false } - if len(b.data) != len(otherBitSet.data) { + if b == otherBitSet { + return true + } + + // We only compare set bits, so we cannot rely on the two slices having the same size. Its + // possible for two BitSets to have different slice lengths but the same set bits. So we only + // compare the relavent words and ignore the trailing zeros. + bLen := b.minLen() + otherLen := otherBitSet.minLen() + + if bLen != otherLen { return false } - for k, v := range b.data { - if otherBitSet.data[k] != v { + for i := 0; i < bLen; i++ { + if b.data[i] != otherBitSet.data[i] { return false } } @@ -145,18 +188,35 @@ func (b *BitSet) equals(other interface{}) bool { return true } +func (b *BitSet) minLen() int { + for i := len(b.data); i > 0; i-- { + if b.data[i-1] != 0 { + return i + } + } + return 0 +} + func (b *BitSet) length() int { - return len(b.data) + cnt := 0 + for _, val := range b.data { + cnt += bits.OnesCount64(val) + } + return cnt } func (b *BitSet) String() string { - vals := b.values() - valsS := make([]string, len(vals)) + vals := make([]string, 0, b.length()) - for i, val := range vals { - valsS[i] = strconv.Itoa(val) + for i, v := range b.data { + for v != 0 { + n := bits.TrailingZeros64(v) + vals = append(vals, strconv.Itoa(i*bitsPerWord+n)) + v &= ^(uint64(1) << n) + } } - return "{" + strings.Join(valsS, ", ") + "}" + + return "{" + strings.Join(vals, ", ") + "}" } type AltDict struct { diff --git a/runtime/Go/antlr/utils_set.go b/runtime/Go/antlr/utils_set.go index 9caa78b8cd..0d4eac698d 100644 --- a/runtime/Go/antlr/utils_set.go +++ b/runtime/Go/antlr/utils_set.go @@ -8,7 +8,7 @@ const ( _loadFactor = 0.75 ) -var _ Set = (*Array2DHashSet)(nil) +var _ Set = (*array2DHashSet)(nil) type Set interface { Add(value interface{}) (added interface{}) @@ -19,7 +19,7 @@ type Set interface { Each(f func(interface{}) bool) } -type Array2DHashSet struct { +type array2DHashSet struct { buckets [][]interface{} hashcodeFunction func(interface{}) int equalsFunction func(interface{}, interface{}) bool @@ -31,7 +31,7 @@ type Array2DHashSet struct { initialBucketCapacity int } -func (as *Array2DHashSet) Each(f func(interface{}) bool) { +func (as *array2DHashSet) Each(f func(interface{}) bool) { if as.Len() < 1 { return } @@ -48,7 +48,7 @@ func (as *Array2DHashSet) Each(f func(interface{}) bool) { } } -func (as *Array2DHashSet) Values() []interface{} { +func (as *array2DHashSet) Values() []interface{} { if as.Len() < 1 { return nil } @@ -61,18 +61,18 @@ func (as *Array2DHashSet) Values() []interface{} { return values } -func (as *Array2DHashSet) Contains(value interface{}) bool { +func (as *array2DHashSet) Contains(value interface{}) bool { return as.Get(value) != nil } -func (as *Array2DHashSet) Add(value interface{}) interface{} { +func (as *array2DHashSet) Add(value interface{}) interface{} { if as.n > as.threshold { as.expand() } return as.innerAdd(value) } -func (as *Array2DHashSet) expand() { +func (as *array2DHashSet) expand() { old := as.buckets as.currentPrime += 4 @@ -120,11 +120,11 @@ func (as *Array2DHashSet) expand() { } } -func (as *Array2DHashSet) Len() int { +func (as *array2DHashSet) Len() int { return as.n } -func (as *Array2DHashSet) Get(o interface{}) interface{} { +func (as *array2DHashSet) Get(o interface{}) interface{} { if o == nil { return nil } @@ -147,7 +147,7 @@ func (as *Array2DHashSet) Get(o interface{}) interface{} { return nil } -func (as *Array2DHashSet) innerAdd(o interface{}) interface{} { +func (as *array2DHashSet) innerAdd(o interface{}) interface{} { b := as.getBuckets(o) bucket := as.buckets[b] @@ -187,25 +187,25 @@ func (as *Array2DHashSet) innerAdd(o interface{}) interface{} { return o } -func (as *Array2DHashSet) getBuckets(value interface{}) int { +func (as *array2DHashSet) getBuckets(value interface{}) int { hash := as.hashcodeFunction(value) return hash & (len(as.buckets) - 1) } -func (as *Array2DHashSet) createBuckets(cap int) [][]interface{} { +func (as *array2DHashSet) createBuckets(cap int) [][]interface{} { return make([][]interface{}, cap) } -func (as *Array2DHashSet) createBucket(cap int) []interface{} { +func (as *array2DHashSet) createBucket(cap int) []interface{} { return make([]interface{}, cap) } -func NewArray2DHashSetWithCap( +func newArray2DHashSetWithCap( hashcodeFunction func(interface{}) int, equalsFunction func(interface{}, interface{}) bool, initCap int, initBucketCap int, -) *Array2DHashSet { +) *array2DHashSet { if hashcodeFunction == nil { hashcodeFunction = standardHashFunction } @@ -214,7 +214,7 @@ func NewArray2DHashSetWithCap( equalsFunction = standardEqualsFunction } - ret := &Array2DHashSet{ + ret := &array2DHashSet{ hashcodeFunction: hashcodeFunction, equalsFunction: equalsFunction, @@ -229,9 +229,9 @@ func NewArray2DHashSetWithCap( return ret } -func NewArray2DHashSet( +func newArray2DHashSet( hashcodeFunction func(interface{}) int, equalsFunction func(interface{}, interface{}) bool, -) *Array2DHashSet { - return NewArray2DHashSetWithCap(hashcodeFunction, equalsFunction, _initalCapacity, _initalBucketCapacity) +) *array2DHashSet { + return newArray2DHashSetWithCap(hashcodeFunction, equalsFunction, _initalCapacity, _initalBucketCapacity) } diff --git a/runtime/Go/antlr/utils_test.go b/runtime/Go/antlr/utils_test.go new file mode 100644 index 0000000000..ed274ef339 --- /dev/null +++ b/runtime/Go/antlr/utils_test.go @@ -0,0 +1,62 @@ +package antlr + +import "testing" + +func testBitSet(t *testing.T, bs *BitSet, str string, length int, contains []int, minValue int, minLen int) { + t.Helper() + if got, want := bs.String(), str; got != want { + t.Errorf("%+v.String() = %q, want %q", bs, got, want) + } + if got, want := bs.length(), length; got != want { + t.Errorf("%+v.length() = %q, want %q", bs, got, want) + } + for i := 0; i < len(bs.data)*bitsPerWord; i++ { + var want bool + for _, val := range contains { + if i == val { + want = true + break + } + } + if got := bs.contains(i); got != want { + t.Errorf("%+v.contains(%v) = %v, want %v", bs, i, got, want) + } + } + if got, want := bs.minValue(), minValue; got != want { + t.Errorf("%+v.minValue() = %v, want %v", bs, got, want) + } + if got, want := bs.minLen(), minLen; got != want { + t.Errorf("%+v.minLen() = %v, want %v", bs, got, want) + } +} + +func TestBitSet(t *testing.T) { + bs1 := NewBitSet() + testBitSet(t, bs1, "{}", 0, []int{}, 2147483647, 0) + bs1.add(0) + testBitSet(t, bs1, "{0}", 1, []int{0}, 0, 1) + bs1.add(63) + testBitSet(t, bs1, "{0, 63}", 2, []int{0, 63}, 0, 1) + bs1.remove(0) + testBitSet(t, bs1, "{63}", 1, []int{63}, 63, 1) + bs1.add(20) + testBitSet(t, bs1, "{20, 63}", 2, []int{20, 63}, 20, 1) + bs1.clear(63) + testBitSet(t, bs1, "{20}", 1, []int{20}, 20, 1) + bs2 := NewBitSet() + bs2.add(64) + bs1.or(bs2) + testBitSet(t, bs1, "{20, 64}", 2, []int{20, 64}, 20, 2) + bs1.remove(20) + testBitSet(t, bs1, "{64}", 1, []int{64}, 64, 2) + bs3 := NewBitSet() + bs3.add(63) + bs1.or(bs3) + testBitSet(t, bs1, "{63, 64}", 2, []int{63, 64}, 63, 2) + bs1.clear(64) + bs4 := NewBitSet() + bs4.or(bs1) + if got, want := bs4.equals(bs1), true; got != want { + t.Errorf("%+v.equals(%+v) = %v, want %v", bs4, bs1, got, want) + } +} diff --git a/runtime/Java/pom.xml b/runtime/Java/pom.xml index 0fb2024a05..e4b0538ca9 100644 --- a/runtime/Java/pom.xml +++ b/runtime/Java/pom.xml @@ -9,13 +9,17 @@ org.antlr antlr4-master - 4.9.4-SNAPSHOT + 4.10-SNAPSHOT ../../pom.xml antlr4-runtime ANTLR 4 Runtime The ANTLR 4 Runtime + + 3.8 + + dot @@ -27,7 +31,7 @@ org.apache.maven.plugins maven-source-plugin - 3.0.1 + 3.2.1 @@ -42,7 +46,6 @@ 1.0 - deploy dot @@ -57,9 +60,9 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.4 + 3.3.1 - 1.7 + 1.8 false @@ -70,26 +73,10 @@ - - org.antlr - antlr4-maven-plugin - 4.5.3 - - - antlr - - src - - - antlr4 - - - - org.apache.felix maven-bundle-plugin - 2.5.4 + 5.1.2 bundle-manifest @@ -108,7 +95,7 @@ maven-jar-plugin - 3.0.0 + 3.2.0 @@ -118,6 +105,15 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + diff --git a/runtime/Java/src/org/antlr/v4/runtime/ANTLRFileStream.java b/runtime/Java/src/org/antlr/v4/runtime/ANTLRFileStream.java index ede83eb263..18a7c8e427 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/ANTLRFileStream.java +++ b/runtime/Java/src/org/antlr/v4/runtime/ANTLRFileStream.java @@ -15,6 +15,7 @@ * * @deprecated as of 4.7 Please use {@link CharStreams} interface. */ +@Deprecated public class ANTLRFileStream extends ANTLRInputStream { protected String fileName; diff --git a/runtime/Java/src/org/antlr/v4/runtime/ANTLRInputStream.java b/runtime/Java/src/org/antlr/v4/runtime/ANTLRInputStream.java index f71a62de36..0fbca01032 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/ANTLRInputStream.java +++ b/runtime/Java/src/org/antlr/v4/runtime/ANTLRInputStream.java @@ -22,6 +22,7 @@ * * @deprecated as of 4.7 Please use {@link CharStreams} interface. */ +@Deprecated public class ANTLRInputStream implements CharStream { public static final int READ_BUFFER_SIZE = 1024; public static final int INITIAL_BUFFER_SIZE = 1024; diff --git a/runtime/Java/src/org/antlr/v4/runtime/CommonToken.java b/runtime/Java/src/org/antlr/v4/runtime/CommonToken.java index a34020f160..42ff55aa99 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/CommonToken.java +++ b/runtime/Java/src/org/antlr/v4/runtime/CommonToken.java @@ -261,8 +261,7 @@ public String toString() { return toString(null); } - public String toString(Recognizer r) { - + public String toString(Recognizer r) { String channelStr = ""; if ( channel>0 ) { channelStr=",channel="+channel; diff --git a/runtime/Java/src/org/antlr/v4/runtime/LexerInterpreter.java b/runtime/Java/src/org/antlr/v4/runtime/LexerInterpreter.java index 8a8dfb4360..d6581631ce 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/LexerInterpreter.java +++ b/runtime/Java/src/org/antlr/v4/runtime/LexerInterpreter.java @@ -34,7 +34,7 @@ public class LexerInterpreter extends Lexer { @Deprecated public LexerInterpreter(String grammarFileName, Collection tokenNames, Collection ruleNames, Collection modeNames, ATN atn, CharStream input) { - this(grammarFileName, VocabularyImpl.fromTokenNames(tokenNames.toArray(new String[tokenNames.size()])), ruleNames, new ArrayList(), modeNames, atn, input); + this(grammarFileName, VocabularyImpl.fromTokenNames(tokenNames.toArray(new String[0])), ruleNames, new ArrayList(), modeNames, atn, input); } @Deprecated @@ -56,9 +56,9 @@ public LexerInterpreter(String grammarFileName, Vocabulary vocabulary, Collectio tokenNames[i] = vocabulary.getDisplayName(i); } - this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]); - this.channelNames = channelNames.toArray(new String[channelNames.size()]); - this.modeNames = modeNames.toArray(new String[modeNames.size()]); + this.ruleNames = ruleNames.toArray(new String[0]); + this.channelNames = channelNames.toArray(new String[0]); + this.modeNames = modeNames.toArray(new String[0]); this.vocabulary = vocabulary; this._decisionToDFA = new DFA[atn.getNumberOfDecisions()]; diff --git a/runtime/Java/src/org/antlr/v4/runtime/Parser.java b/runtime/Java/src/org/antlr/v4/runtime/Parser.java index 566aea0ecf..5b52fa786c 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/Parser.java +++ b/runtime/Java/src/org/antlr/v4/runtime/Parser.java @@ -80,13 +80,14 @@ public void exitEveryRule(ParserRuleContext ctx) { } /** - * This field maps from the serialized ATN string to the deserialized {@link ATN} with - * bypass alternatives. + * This field holds the deserialized {@link ATN} with bypass alternatives, created + * lazily upon first demand. In 4.10 I changed from map + * since we only need one per parser object and also it complicates other targets + * that don't use ATN strings. * * @see ATNDeserializationOptions#isGenerateRuleBypassTransitions() */ - private static final Map bypassAltsAtnCache = - new WeakHashMap(); + private ATN bypassAltsAtnCache; /** * The error handling strategy for the parser. The default value is a new @@ -445,16 +446,14 @@ public ATN getATNWithBypassAlts() { throw new UnsupportedOperationException("The current parser does not support an ATN with bypass alternatives."); } - synchronized (bypassAltsAtnCache) { - ATN result = bypassAltsAtnCache.get(serializedAtn); - if (result == null) { - ATNDeserializationOptions deserializationOptions = new ATNDeserializationOptions(); - deserializationOptions.setGenerateRuleBypassTransitions(true); - result = new ATNDeserializer(deserializationOptions).deserialize(serializedAtn.toCharArray()); - bypassAltsAtnCache.put(serializedAtn, result); + synchronized (this) { + if ( bypassAltsAtnCache!=null ) { + return bypassAltsAtnCache; } - - return result; + ATNDeserializationOptions deserializationOptions = new ATNDeserializationOptions(); + deserializationOptions.setGenerateRuleBypassTransitions(true); + bypassAltsAtnCache = new ATNDeserializer(deserializationOptions).deserialize(serializedAtn.toCharArray()); + return bypassAltsAtnCache; } } diff --git a/runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java b/runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java index 6045b270e2..a4aaba595e 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java +++ b/runtime/Java/src/org/antlr/v4/runtime/ParserInterpreter.java @@ -92,7 +92,7 @@ public class ParserInterpreter extends Parser { @Deprecated public ParserInterpreter(String grammarFileName, Collection tokenNames, Collection ruleNames, ATN atn, TokenStream input) { - this(grammarFileName, VocabularyImpl.fromTokenNames(tokenNames.toArray(new String[tokenNames.size()])), ruleNames, atn, input); + this(grammarFileName, VocabularyImpl.fromTokenNames(tokenNames.toArray(new String[0])), ruleNames, atn, input); } public ParserInterpreter(String grammarFileName, Vocabulary vocabulary, @@ -106,7 +106,7 @@ public ParserInterpreter(String grammarFileName, Vocabulary vocabulary, tokenNames[i] = vocabulary.getDisplayName(i); } - this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]); + this.ruleNames = ruleNames.toArray(new String[0]); this.vocabulary = vocabulary; // init decision DFA diff --git a/runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java b/runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java index b634a35072..3b18a98de7 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java +++ b/runtime/Java/src/org/antlr/v4/runtime/RuntimeMetaData.java @@ -67,7 +67,7 @@ public class RuntimeMetaData { * omitted. * */ - public static final String VERSION = "4.9.3"; + public static final String VERSION = "4.10"; /** * Gets the currently executing version of the ANTLR 4 runtime library. diff --git a/runtime/Java/src/org/antlr/v4/runtime/VocabularyImpl.java b/runtime/Java/src/org/antlr/v4/runtime/VocabularyImpl.java index 00593e388a..aad75a76ec 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/VocabularyImpl.java +++ b/runtime/Java/src/org/antlr/v4/runtime/VocabularyImpl.java @@ -173,4 +173,18 @@ public String getDisplayName(int tokenType) { return Integer.toString(tokenType); } + + // Because this is an actual implementation object, we can provide access methods for vocabulary symbols + + public String[] getLiteralNames() { + return literalNames; + } + + public String[] getSymbolicNames() { + return symbolicNames; + } + + public String[] getDisplayNames() { + return displayNames; + } } diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java index 0ebcdeb31e..0ec2a9359e 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNDeserializer.java @@ -7,118 +7,27 @@ package org.antlr.v4.runtime.atn; import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.misc.IntegerList; import org.antlr.v4.runtime.misc.IntervalSet; import org.antlr.v4.runtime.misc.Pair; import java.io.InvalidClassException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Locale; -import java.util.UUID; -/** +/** Deserialize ATNs for JavaTarget; it's complicated by the fact that java requires + * that we serialize the list of integers as 16 bit characters in a string. Other + * targets will have an array of ints generated and can simply decode the ints + * back into an ATN. * * @author Sam Harwell */ public class ATNDeserializer { public static final int SERIALIZED_VERSION; static { - /* This value should never change. Updates following this version are - * reflected as change in the unique ID SERIALIZED_UUID. - */ - SERIALIZED_VERSION = 3; - } - - /** - * This is the earliest supported serialized UUID. - */ - private static final UUID BASE_SERIALIZED_UUID; - /** - * This UUID indicates an extension of {@link BASE_SERIALIZED_UUID} for the - * addition of precedence predicates. - */ - private static final UUID ADDED_PRECEDENCE_TRANSITIONS; - /** - * This UUID indicates an extension of {@link #ADDED_PRECEDENCE_TRANSITIONS} - * for the addition of lexer actions encoded as a sequence of - * {@link LexerAction} instances. - */ - private static final UUID ADDED_LEXER_ACTIONS; - /** - * This UUID indicates the serialized ATN contains two sets of - * IntervalSets, where the second set's values are encoded as - * 32-bit integers to support the full Unicode SMP range up to U+10FFFF. - */ - private static final UUID ADDED_UNICODE_SMP; - /** - * This list contains all of the currently supported UUIDs, ordered by when - * the feature first appeared in this branch. - */ - private static final List SUPPORTED_UUIDS; - - /** - * This is the current serialized UUID. - */ - public static final UUID SERIALIZED_UUID; - static { - /* WARNING: DO NOT MERGE THESE LINES. If UUIDs differ during a merge, - * resolve the conflict by generating a new ID! - */ - BASE_SERIALIZED_UUID = UUID.fromString("33761B2D-78BB-4A43-8B0B-4F5BEE8AACF3"); - ADDED_PRECEDENCE_TRANSITIONS = UUID.fromString("1DA0C57D-6C06-438A-9B27-10BCB3CE0F61"); - ADDED_LEXER_ACTIONS = UUID.fromString("AADB8D7E-AEEF-4415-AD2B-8204D6CF042E"); - ADDED_UNICODE_SMP = UUID.fromString("59627784-3BE5-417A-B9EB-8131A7286089"); - - SUPPORTED_UUIDS = new ArrayList(); - SUPPORTED_UUIDS.add(BASE_SERIALIZED_UUID); - SUPPORTED_UUIDS.add(ADDED_PRECEDENCE_TRANSITIONS); - SUPPORTED_UUIDS.add(ADDED_LEXER_ACTIONS); - SUPPORTED_UUIDS.add(ADDED_UNICODE_SMP); - - SERIALIZED_UUID = ADDED_UNICODE_SMP; - } - - interface UnicodeDeserializer { - // Wrapper for readInt() or readInt32() - int readUnicode(char[] data, int p); - - // Work around Java not allowing mutation of captured variables - // by returning amount by which to increment p after each read - int size(); - } - - enum UnicodeDeserializingMode { - UNICODE_BMP, - UNICODE_SMP - } - - static UnicodeDeserializer getUnicodeDeserializer(UnicodeDeserializingMode mode) { - if (mode == UnicodeDeserializingMode.UNICODE_BMP) { - return new UnicodeDeserializer() { - @Override - public int readUnicode(char[] data, int p) { - return toInt(data[p]); - } - - @Override - public int size() { - return 1; - } - }; - } - else { - return new UnicodeDeserializer() { - @Override - public int readUnicode(char[] data, int p) { - return toInt32(data, p); - } - - @Override - public int size() { - return 2; - } - }; - } + SERIALIZED_VERSION = 4; } private final ATNDeserializationOptions deserializationOptions; @@ -135,70 +44,20 @@ public ATNDeserializer(ATNDeserializationOptions deserializationOptions) { this.deserializationOptions = deserializationOptions; } - /** - * Determines if a particular serialized representation of an ATN supports - * a particular feature, identified by the {@link UUID} used for serializing - * the ATN at the time the feature was first introduced. - * - * @param feature The {@link UUID} marking the first time the feature was - * supported in the serialized ATN. - * @param actualUuid The {@link UUID} of the actual serialized ATN which is - * currently being deserialized. - * @return {@code true} if the {@code actualUuid} value represents a - * serialized ATN at or after the feature identified by {@code feature} was - * introduced; otherwise, {@code false}. - */ - static protected boolean isFeatureSupported(UUID feature, UUID actualUuid) { - int featureIndex = SUPPORTED_UUIDS.indexOf(feature); - if (featureIndex < 0) { - return false; - } - - return SUPPORTED_UUIDS.indexOf(actualUuid) >= featureIndex; - } - - @SuppressWarnings("deprecation") public ATN deserialize(char[] data) { - data = data.clone(); - - // Each char value in data is shifted by +2 at the entry to this method. - // This is an encoding optimization targeting the serialized values 0 - // and -1 (serialized to 0xFFFF), each of which are very common in the - // serialized form of the ATN. In the modified UTF-8 that Java uses for - // compiled string literals, these two character values have multi-byte - // forms. By shifting each value by +2, they become characters 2 and 1 - // prior to writing the string, each of which have single-byte - // representations. Since the shift occurs in the tool during ATN - // serialization, each target is responsible for adjusting the values - // during deserialization. - // - // As a special case, note that the first element of data is not - // adjusted because it contains the major version number of the - // serialized ATN, which was fixed at 3 at the time the value shifting - // was implemented. - for (int i = 1; i < data.length; i++) { - data[i] = (char)(data[i] - 2); - } + return deserialize(decodeIntsEncodedAs16BitWords(data)); + } + public ATN deserialize(int[] data) { int p = 0; - int version = toInt(data[p++]); + int version = data[p++]; if (version != SERIALIZED_VERSION) { String reason = String.format(Locale.getDefault(), "Could not deserialize ATN with version %d (expected %d).", version, SERIALIZED_VERSION); throw new UnsupportedOperationException(new InvalidClassException(ATN.class.getName(), reason)); } - UUID uuid = toUUID(data, p); - p += 8; - if (!SUPPORTED_UUIDS.contains(uuid)) { - String reason = String.format(Locale.getDefault(), "Could not deserialize ATN with UUID %s (expected %s or a legacy UUID).", uuid, SERIALIZED_UUID); - throw new UnsupportedOperationException(new InvalidClassException(ATN.class.getName(), reason)); - } - - boolean supportsPrecedencePredicates = isFeatureSupported(ADDED_PRECEDENCE_TRANSITIONS, uuid); - boolean supportsLexerActions = isFeatureSupported(ADDED_LEXER_ACTIONS, uuid); - - ATNType grammarType = ATNType.values()[toInt(data[p++])]; - int maxTokenType = toInt(data[p++]); + ATNType grammarType = ATNType.values()[data[p++]]; + int maxTokenType = data[p++]; ATN atn = new ATN(grammarType, maxTokenType); // @@ -206,27 +65,23 @@ public ATN deserialize(char[] data) { // List> loopBackStateNumbers = new ArrayList>(); List> endStateNumbers = new ArrayList>(); - int nstates = toInt(data[p++]); + int nstates = data[p++]; for (int i=0; i((LoopEndState)s, loopBackStateNumber)); } else if (s instanceof BlockStartState) { - int endStateNumber = toInt(data[p++]); + int endStateNumber = data[p++]; endStateNumbers.add(new Pair((BlockStartState)s, endStateNumber)); } atn.addState(s); @@ -241,46 +96,34 @@ else if (s instanceof BlockStartState) { pair.a.endState = (BlockEndState)atn.states.get(pair.b); } - int numNonGreedyStates = toInt(data[p++]); + int numNonGreedyStates = data[p++]; for (int i = 0; i < numNonGreedyStates; i++) { - int stateNumber = toInt(data[p++]); + int stateNumber = data[p++]; ((DecisionState)atn.states.get(stateNumber)).nonGreedy = true; } - if (supportsPrecedencePredicates) { - int numPrecedenceStates = toInt(data[p++]); - for (int i = 0; i < numPrecedenceStates; i++) { - int stateNumber = toInt(data[p++]); - ((RuleStartState)atn.states.get(stateNumber)).isLeftRecursiveRule = true; - } + int numPrecedenceStates = data[p++]; + for (int i = 0; i < numPrecedenceStates; i++) { + int stateNumber = data[p++]; + ((RuleStartState)atn.states.get(stateNumber)).isLeftRecursiveRule = true; } // // RULES // - int nrules = toInt(data[p++]); + int nrules = data[p++]; if ( atn.grammarType == ATNType.LEXER ) { atn.ruleToTokenType = new int[nrules]; } atn.ruleToStartState = new RuleStartState[nrules]; for (int i=0; i sets = new ArrayList(); - - // First, read all sets with 16-bit Unicode code points <= U+FFFF. - p = deserializeSets(data, p, sets, getUnicodeDeserializer(UnicodeDeserializingMode.UNICODE_BMP)); - - // Next, if the ATN was serialized with the Unicode SMP feature, - // deserialize sets with 32-bit arguments <= U+10FFFF. - if (isFeatureSupported(ADDED_UNICODE_SMP, uuid)) { - p = deserializeSets(data, p, sets, getUnicodeDeserializer(UnicodeDeserializingMode.UNICODE_SMP)); - } + p = deserializeSets(data, p, sets); // // EDGES // - int nedges = toInt(data[p++]); + int nedges = data[p++]; for (int i=0; i"+trg+ @@ -398,9 +233,9 @@ else if (state instanceof StarLoopbackState) { // // DECISIONS // - int ndecisions = toInt(data[p++]); + int ndecisions = data[p++]; for (int i=1; i<=ndecisions; i++) { - int s = toInt(data[p++]); + int s = data[p++]; DecisionState decState = (DecisionState)atn.states.get(s); atn.decisionToState.add(decState); decState.decision = i-1; @@ -410,46 +245,15 @@ else if (state instanceof StarLoopbackState) { // LEXER ACTIONS // if (atn.grammarType == ATNType.LEXER) { - if (supportsLexerActions) { - atn.lexerActions = new LexerAction[toInt(data[p++])]; - for (int i = 0; i < atn.lexerActions.length; i++) { - LexerActionType actionType = LexerActionType.values()[toInt(data[p++])]; - int data1 = toInt(data[p++]); - if (data1 == 0xFFFF) { - data1 = -1; - } - - int data2 = toInt(data[p++]); - if (data2 == 0xFFFF) { - data2 = -1; - } + atn.lexerActions = new LexerAction[data[p++]]; + for (int i = 0; i < atn.lexerActions.length; i++) { + LexerActionType actionType = LexerActionType.values()[data[p++]]; + int data1 = data[p++]; + int data2 = data[p++]; - LexerAction lexerAction = lexerActionFactory(actionType, data1, data2); + LexerAction lexerAction = lexerActionFactory(actionType, data1, data2); - atn.lexerActions[i] = lexerAction; - } - } - else { - // for compatibility with older serialized ATNs, convert the old - // serialized action index for action transitions to the new - // form, which is the index of a LexerCustomAction - List legacyLexerActions = new ArrayList(); - for (ATNState state : atn.states) { - for (int i = 0; i < state.getNumberOfTransitions(); i++) { - Transition transition = state.transition(i); - if (!(transition instanceof ActionTransition)) { - continue; - } - - int ruleIndex = ((ActionTransition)transition).ruleIndex; - int actionIndex = ((ActionTransition)transition).actionIndex; - LexerCustomAction lexerAction = new LexerCustomAction(ruleIndex, actionIndex); - state.setTransition(i, new ActionTransition(transition.target, ruleIndex, legacyLexerActions.size(), false)); - legacyLexerActions.add(lexerAction); - } - } - - atn.lexerActions = legacyLexerActions.toArray(new LexerAction[legacyLexerActions.size()]); + atn.lexerActions[i] = lexerAction; } } @@ -552,24 +356,22 @@ else if (state instanceof StarLoopbackState) { return atn; } - private int deserializeSets(char[] data, int p, List sets, UnicodeDeserializer unicodeDeserializer) { - int nsets = toInt(data[p++]); + private int deserializeSets(int[] data, int p, List sets) { + int nsets = data[p++]; for (int i=0; i 0x7FFF + if ( v>=0x7FFF_FFFF ) { // too big to fit in 15 bits + 16 bits? (+1 would be 8000_0000 which is bad encoding) + throw new UnsupportedOperationException("Serialized ATN data element["+i+"] = "+v+" doesn't fit in 31 bits"); + } + v = v & 0x7FFF_FFFF; // strip high bit (sentinel) if set + data16.add((v >> 16) | 0x8000); // store high 15-bit word first and set high bit to say word follows + data16.add((v & 0xFFFF)); // then store lower 16-bit word + } + } + return data16; + } + + public static int[] decodeIntsEncodedAs16BitWords(char[] data16) { + return decodeIntsEncodedAs16BitWords(data16, false); + } + + /** Convert a list of chars (16 uint) that represent a serialized and compressed list of ints for an ATN. + * This method pairs with {@link #encodeIntsWith16BitWords(IntegerList)} above. Used only for Java Target. + */ + public static int[] decodeIntsEncodedAs16BitWords(char[] data16, boolean trimToSize) { + // will be strictly smaller but we waste bit of space to avoid copying during initialization of parsers + int[] data = new int[data16.length]; + int i = 0; + int i2 = 0; + while ( i < data16.length ) { + char v = data16[i++]; + if ( (v & 0x8000) == 0 ) { // hi bit not set? Implies 1-word value + data[i2++] = v; // 7 bit int + } + else { // hi bit set. Implies 2-word value + char vnext = data16[i++]; + if ( v==0xFFFF && vnext == 0xFFFF ) { // is it -1? + data[i2++] = -1; + } + else { // 31-bit int + data[i2++] = (v & 0x7FFF) << 16 | (vnext & 0xFFFF); + } + } + } + if ( trimToSize ) { + return Arrays.copyOf(data, i2); } + return data; } } diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSerializer.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSerializer.java index e8f7bbdd3a..6a9515eb5d 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSerializer.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSerializer.java @@ -10,40 +10,40 @@ import org.antlr.v4.runtime.misc.IntegerList; import org.antlr.v4.runtime.misc.Interval; import org.antlr.v4.runtime.misc.IntervalSet; -import org.antlr.v4.runtime.misc.Utils; -import java.io.InvalidClassException; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.LinkedHashMap; -import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.UUID; +/** This class represents a target neutral serializer for ATNs. An ATN is converted to a list of integers + * that can be converted back to and ATN. We compute the list of integers and then generate an array + * into the target language for a particular lexer or parser. Java is a special case where we must + * generate strings instead of arrays, but that is handled outside of this class. + * See {@link ATNDeserializer#encodeIntsWith16BitWords(IntegerList)} and + * {@link org.antlr.v4.codegen.model.SerializedJavaATN}. + */ public class ATNSerializer { public ATN atn; - private List tokenNames; - private interface CodePointSerializer { - void serializeCodePoint(IntegerList data, int cp); - } + private final IntegerList data = new IntegerList(); + /** Note that we use a LinkedHashMap as a set to mainintain insertion order while deduplicating + entries with the same key. */ + private final Map sets = new LinkedHashMap<>(); + private final IntegerList nonGreedyStates = new IntegerList(); + private final IntegerList precedenceStates = new IntegerList(); public ATNSerializer(ATN atn) { assert atn.grammarType != null; this.atn = atn; } - public ATNSerializer(ATN atn, List tokenNames) { - assert atn.grammarType != null; - this.atn = atn; - this.tokenNames = tokenNames; - } - /** Serialize state descriptors, edge descriptors, and decision→state map - * into list of ints: + * into list of ints. Likely out of date, but keeping as it could be helpful: * + * SERIALIZED_VERSION + * UUID (2 longs) * grammar-type, (ANTLRParser.LEXER, ...) * max token type, * num states, @@ -65,141 +65,98 @@ public ATNSerializer(ATN atn, List tokenNames) { * Convenient to pack into unsigned shorts to make as Java string. */ public IntegerList serialize() { - IntegerList data = new IntegerList(); + addPreamble(); + int nedges = addEdges(); + addNonGreedyStates(); + addPrecedenceStates(); + addRuleStatesAndLexerTokenTypes(); + addModeStartStates(); + Map setIndices = null; + setIndices = addSets(); + addEdges(nedges, setIndices); + addDecisionStartStates(); + addLexerActions(); + + return data; + } + + private void addPreamble() { data.add(ATNDeserializer.SERIALIZED_VERSION); - serializeUUID(data, ATNDeserializer.SERIALIZED_UUID); // convert grammar type to ATN const to avoid dependence on ANTLRParser data.add(atn.grammarType.ordinal()); data.add(atn.maxTokenType); - int nedges = 0; - - // Note that we use a LinkedHashMap as a set to - // maintain insertion order while deduplicating - // entries with the same key. - Map sets = new LinkedHashMap<>(); - - // dump states, count edges and collect sets while doing so - IntegerList nonGreedyStates = new IntegerList(); - IntegerList precedenceStates = new IntegerList(); - data.add(atn.states.size()); - for (ATNState s : atn.states) { - if ( s==null ) { // might be optimized away - data.add(ATNState.INVALID_TYPE); - continue; - } - - int stateType = s.getStateType(); - if (s instanceof DecisionState && ((DecisionState)s).nonGreedy) { - nonGreedyStates.add(s.stateNumber); - } + } - if (s instanceof RuleStartState && ((RuleStartState)s).isLeftRecursiveRule) { - precedenceStates.add(s.stateNumber); - } + private void addLexerActions() { + if (atn.grammarType == ATNType.LEXER) { + data.add(atn.lexerActions.length); + for (LexerAction action : atn.lexerActions) { + data.add(action.getActionType().ordinal()); + switch (action.getActionType()) { + case CHANNEL: + int channel = ((LexerChannelAction)action).getChannel(); + data.add(channel); + data.add(0); + break; - data.add(stateType); + case CUSTOM: + int ruleIndex = ((LexerCustomAction)action).getRuleIndex(); + int actionIndex = ((LexerCustomAction)action).getActionIndex(); + data.add(ruleIndex); + data.add(actionIndex); + break; - if (s.ruleIndex == -1) { - data.add(Character.MAX_VALUE); - } - else { - data.add(s.ruleIndex); - } + case MODE: + int mode = ((LexerModeAction)action).getMode(); + data.add(mode); + data.add(0); + break; - if ( s.getStateType() == ATNState.LOOP_END ) { - data.add(((LoopEndState)s).loopBackState.stateNumber); - } - else if ( s instanceof BlockStartState ) { - data.add(((BlockStartState)s).endState.stateNumber); - } + case MORE: + data.add(0); + data.add(0); + break; - if (s.getStateType() != ATNState.RULE_STOP) { - // the deserializer can trivially derive these edges, so there's no need to serialize them - nedges += s.getNumberOfTransitions(); - } + case POP_MODE: + data.add(0); + data.add(0); + break; - for (int i=0; i0 ) { - for (ATNState modeStartState : atn.modeToStartState) { - data.add(modeStartState.stateNumber); - } - } - List bmpSets = new ArrayList<>(); - List smpSets = new ArrayList<>(); - for (IntervalSet set : sets.keySet()) { - if (!set.isNil() && set.getMaxElement() <= Character.MAX_VALUE) { - bmpSets.add(set); - } - else { - smpSets.add(set); - } - } - serializeSets( - data, - bmpSets, - new CodePointSerializer() { - @Override - public void serializeCodePoint(IntegerList data, int cp) { - data.add(cp); - } - }); - serializeSets( - data, - smpSets, - new CodePointSerializer() { - @Override - public void serializeCodePoint(IntegerList data, int cp) { - serializeInt(data, cp); - } - }); - Map setIndices = new HashMap<>(); - int setIndex = 0; - for (IntervalSet bmpSet : bmpSets) { - setIndices.put(bmpSet, setIndex++); - } - for (IntervalSet smpSet : smpSets) { - setIndices.put(smpSet, setIndex++); + private void addDecisionStartStates() { + int ndecisions = atn.decisionToState.size(); + data.add(ndecisions); + for (DecisionState decStartState : atn.decisionToState) { + data.add(decStartState.stateNumber); } + } + private void addEdges(int nedges, Map setIndices) { data.add(nedges); for (ATNState s : atn.states) { if ( s==null ) { @@ -248,7 +205,6 @@ public void serializeCodePoint(IntegerList data, int cp) { arg1 = 0; arg3 = 1; } - break; case Transition.ATOM : arg1 = ((AtomTransition)t).label; @@ -256,16 +212,11 @@ public void serializeCodePoint(IntegerList data, int cp) { arg1 = 0; arg3 = 1; } - break; case Transition.ACTION : ActionTransition at = (ActionTransition)t; arg1 = at.ruleIndex; arg2 = at.actionIndex; - if (arg2 == -1) { - arg2 = 0xFFFF; - } - arg3 = at.isCtxDependent ? 1 : 0 ; break; case Transition.SET : @@ -286,98 +237,102 @@ public void serializeCodePoint(IntegerList data, int cp) { data.add(arg3); } } + } - int ndecisions = atn.decisionToState.size(); - data.add(ndecisions); - for (DecisionState decStartState : atn.decisionToState) { - data.add(decStartState.stateNumber); + private Map addSets() { + serializeSets(data, sets.keySet()); + Map setIndices = new HashMap<>(); + int setIndex = 0; + for (IntervalSet s : sets.keySet()) { + setIndices.put(s, setIndex++); } + return setIndices; + } - // - // LEXER ACTIONS - // - if (atn.grammarType == ATNType.LEXER) { - data.add(atn.lexerActions.length); - for (LexerAction action : atn.lexerActions) { - data.add(action.getActionType().ordinal()); - switch (action.getActionType()) { - case CHANNEL: - int channel = ((LexerChannelAction)action).getChannel(); - data.add(channel != -1 ? channel : 0xFFFF); - data.add(0); - break; + private void addModeStartStates() { + int nmodes = atn.modeToStartState.size(); + data.add(nmodes); + if ( nmodes>0 ) { + for (ATNState modeStartState : atn.modeToStartState) { + data.add(modeStartState.stateNumber); + } + } + } - case CUSTOM: - int ruleIndex = ((LexerCustomAction)action).getRuleIndex(); - int actionIndex = ((LexerCustomAction)action).getActionIndex(); - data.add(ruleIndex != -1 ? ruleIndex : 0xFFFF); - data.add(actionIndex != -1 ? actionIndex : 0xFFFF); - break; + private void addRuleStatesAndLexerTokenTypes() { + int nrules = atn.ruleToStartState.length; + data.add(nrules); + for (int r=0; r=0; // 0 implies fragment rule, other token types > 0 + data.add(atn.ruleToTokenType[r]); + } + } + } - case MODE: - int mode = ((LexerModeAction)action).getMode(); - data.add(mode != -1 ? mode : 0xFFFF); - data.add(0); - break; + private void addPrecedenceStates() { + data.add(precedenceStates.size()); + for (int i = 0; i < precedenceStates.size(); i++) { + data.add(precedenceStates.get(i)); + } + } - case MORE: - data.add(0); - data.add(0); - break; + private void addNonGreedyStates() { + data.add(nonGreedyStates.size()); + for (int i = 0; i < nonGreedyStates.size(); i++) { + data.add(nonGreedyStates.get(i)); + } + } - case POP_MODE: - data.add(0); - data.add(0); - break; + private int addEdges() { + int nedges = 0; + data.add(atn.states.size()); + for (ATNState s : atn.states) { + if ( s==null ) { // might be optimized away + data.add(ATNState.INVALID_TYPE); + continue; + } - case PUSH_MODE: - mode = ((LexerPushModeAction)action).getMode(); - data.add(mode != -1 ? mode : 0xFFFF); - data.add(0); - break; + int stateType = s.getStateType(); + if (s instanceof DecisionState && ((DecisionState)s).nonGreedy) { + nonGreedyStates.add(s.stateNumber); + } - case SKIP: - data.add(0); - data.add(0); - break; + if (s instanceof RuleStartState && ((RuleStartState)s).isLeftRecursiveRule) { + precedenceStates.add(s.stateNumber); + } - case TYPE: - int type = ((LexerTypeAction)action).getType(); - data.add(type != -1 ? type : 0xFFFF); - data.add(0); - break; + data.add(stateType); - default: - String message = String.format(Locale.getDefault(), "The specified lexer action type %s is not valid.", action.getActionType()); - throw new IllegalArgumentException(message); - } + data.add(s.ruleIndex); + + if ( s.getStateType() == ATNState.LOOP_END ) { + data.add(((LoopEndState)s).loopBackState.stateNumber); + } + else if ( s instanceof BlockStartState ) { + data.add(((BlockStartState)s).endState.stateNumber); } - } - // Note: This value shifting loop is documented in ATNDeserializer. - // don't adjust the first value since that's the version number - for (int i = 1; i < data.size(); i++) { - if (data.get(i) < Character.MIN_VALUE || data.get(i) > Character.MAX_VALUE) { - throw new UnsupportedOperationException("Serialized ATN data element "+ - data.get(i)+ - " element "+i+" out of range "+ - (int)Character.MIN_VALUE+ - ".."+ - (int)Character.MAX_VALUE); + if (s.getStateType() != ATNState.RULE_STOP) { + // the deserializer can trivially derive these edges, so there's no need to serialize them + nedges += s.getNumberOfTransitions(); } - int value = (data.get(i) + 2) & 0xFFFF; - data.set(i, value); + for (int i=0; i sets, - CodePointSerializer codePointSerializer) - { + private static void serializeSets(IntegerList data, Collection sets) { int nSets = sets.size(); data.add(nSets); @@ -397,232 +352,18 @@ private static void serializeSets( continue; } else { - codePointSerializer.serializeCodePoint(data, 0); + data.add(0); } } else { - codePointSerializer.serializeCodePoint(data, I.a); + data.add(I.a); } - - codePointSerializer.serializeCodePoint(data, I.b); + data.add(I.b); } } } - public String decode(char[] data) { - data = data.clone(); - // don't adjust the first value since that's the version number - for (int i = 1; i < data.length; i++) { - data[i] = (char)(data[i] - 2); - } - - StringBuilder buf = new StringBuilder(); - int p = 0; - int version = ATNDeserializer.toInt(data[p++]); - if (version != ATNDeserializer.SERIALIZED_VERSION) { - String reason = String.format("Could not deserialize ATN with version %d (expected %d).", version, ATNDeserializer.SERIALIZED_VERSION); - throw new UnsupportedOperationException(new InvalidClassException(ATN.class.getName(), reason)); - } - - UUID uuid = ATNDeserializer.toUUID(data, p); - p += 8; - if (!uuid.equals(ATNDeserializer.SERIALIZED_UUID)) { - String reason = String.format(Locale.getDefault(), "Could not deserialize ATN with UUID %s (expected %s).", uuid, ATNDeserializer.SERIALIZED_UUID); - throw new UnsupportedOperationException(new InvalidClassException(ATN.class.getName(), reason)); - } - - p++; // skip grammarType - int maxType = ATNDeserializer.toInt(data[p++]); - buf.append("max type ").append(maxType).append("\n"); - int nstates = ATNDeserializer.toInt(data[p++]); - for (int i=0; i").append(trg) - .append(" ").append(Transition.serializationNames.get(ttype)) - .append(" ").append(arg1).append(",").append(arg2).append(",").append(arg3) - .append("\n"); - p += 6; - } - int ndecisions = ATNDeserializer.toInt(data[p++]); - for (int i=0; i0 ) { - buf.append(", "); - } - - int a = unicodeDeserializer.readUnicode(data, p); - p += unicodeDeserializer.size(); - int b = unicodeDeserializer.readUnicode(data, p); - p += unicodeDeserializer.size(); - buf.append(getTokenName(a)).append("..").append(getTokenName(b)); - } - buf.append("\n"); - } - return p; - } - - public String getTokenName(int t) { - if ( t==-1 ) return "EOF"; - - if ( atn.grammarType == ATNType.LEXER && - t >= Character.MIN_VALUE && t <= Character.MAX_VALUE ) - { - switch (t) { - case '\n': - return "'\\n'"; - case '\r': - return "'\\r'"; - case '\t': - return "'\\t'"; - case '\b': - return "'\\b'"; - case '\f': - return "'\\f'"; - case '\\': - return "'\\\\'"; - case '\'': - return "'\\''"; - default: - if ( Character.UnicodeBlock.of((char)t)==Character.UnicodeBlock.BASIC_LATIN && - !Character.isISOControl((char)t) ) { - return '\''+Character.toString((char)t)+'\''; - } - // turn on the bit above max "\uFFFF" value so that we pad with zeros - // then only take last 4 digits - String hex = Integer.toHexString(t|0x10000).toUpperCase().substring(1,5); - String unicodeStr = "'\\u"+hex+"'"; - return unicodeStr; - } - } - - if (tokenNames != null && t >= 0 && t < tokenNames.size()) { - return tokenNames.get(t); - } - - return String.valueOf(t); - } - - /** Used by Java target to encode short/int array as chars in string. */ - public static String getSerializedAsString(ATN atn) { - return new String(getSerializedAsChars(atn)); - } - public static IntegerList getSerialized(ATN atn) { return new ATNSerializer(atn).serialize(); } - - public static char[] getSerializedAsChars(ATN atn) { - return Utils.toCharArray(getSerialized(atn)); - } - - public static String getDecoded(ATN atn, List tokenNames) { - IntegerList serialized = getSerialized(atn); - char[] data = Utils.toCharArray(serialized); - return new ATNSerializer(atn, tokenNames).decode(data); - } - - private void serializeUUID(IntegerList data, UUID uuid) { - serializeLong(data, uuid.getLeastSignificantBits()); - serializeLong(data, uuid.getMostSignificantBits()); - } - - private void serializeLong(IntegerList data, long value) { - serializeInt(data, (int)value); - serializeInt(data, (int)(value >> 32)); - } - - private void serializeInt(IntegerList data, int value) { - data.add((char)value); - data.add((char)(value >> 16)); - } } diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java index 752a9a707d..b7670abc77 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNSimulator.java @@ -11,28 +11,8 @@ import java.util.IdentityHashMap; import java.util.List; -import java.util.UUID; public abstract class ATNSimulator { - /** - * @deprecated Use {@link ATNDeserializer#SERIALIZED_VERSION} instead. - */ - @Deprecated - public static final int SERIALIZED_VERSION; - static { - SERIALIZED_VERSION = ATNDeserializer.SERIALIZED_VERSION; - } - - /** - * This is the current serialized UUID. - * @deprecated Use {@link ATNDeserializer#checkCondition(boolean)} instead. - */ - @Deprecated - public static final UUID SERIALIZED_UUID; - static { - SERIALIZED_UUID = ATNDeserializer.SERIALIZED_UUID; - } - /** Must distinguish between missing edge and edge we know leads nowhere */ public static final DFAState ERROR; @@ -105,82 +85,4 @@ public PredictionContext getCachedContext(PredictionContext context) { visited); } } - - /** - * @deprecated Use {@link ATNDeserializer#deserialize} instead. - */ - @Deprecated - public static ATN deserialize(char[] data) { - return new ATNDeserializer().deserialize(data); - } - - /** - * @deprecated Use {@link ATNDeserializer#checkCondition(boolean)} instead. - */ - @Deprecated - public static void checkCondition(boolean condition) { - new ATNDeserializer().checkCondition(condition); - } - - /** - * @deprecated Use {@link ATNDeserializer#checkCondition(boolean, String)} instead. - */ - @Deprecated - public static void checkCondition(boolean condition, String message) { - new ATNDeserializer().checkCondition(condition, message); - } - - /** - * @deprecated Use {@link ATNDeserializer#toInt} instead. - */ - @Deprecated - public static int toInt(char c) { - return ATNDeserializer.toInt(c); - } - - /** - * @deprecated Use {@link ATNDeserializer#toInt32} instead. - */ - @Deprecated - public static int toInt32(char[] data, int offset) { - return ATNDeserializer.toInt32(data, offset); - } - - /** - * @deprecated Use {@link ATNDeserializer#toLong} instead. - */ - @Deprecated - public static long toLong(char[] data, int offset) { - return ATNDeserializer.toLong(data, offset); - } - - /** - * @deprecated Use {@link ATNDeserializer#toUUID} instead. - */ - @Deprecated - public static UUID toUUID(char[] data, int offset) { - return ATNDeserializer.toUUID(data, offset); - } - - /** - * @deprecated Use {@link ATNDeserializer#edgeFactory} instead. - */ - @Deprecated - - public static Transition edgeFactory(ATN atn, - int type, int src, int trg, - int arg1, int arg2, int arg3, - List sets) - { - return new ATNDeserializer().edgeFactory(atn, type, src, trg, arg1, arg2, arg3, sets); - } - - /** - * @deprecated Use {@link ATNDeserializer#stateFactory} instead. - */ - @Deprecated - public static ATNState stateFactory(int type, int ruleIndex) { - return new ATNDeserializer().stateFactory(type, ruleIndex); - } - } diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNState.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNState.java index 955a25df4c..df0869bad8 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ATNState.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ATNState.java @@ -147,7 +147,7 @@ public String toString() { } public Transition[] getTransitions() { - return transitions.toArray(new Transition[transitions.size()]); + return transitions.toArray(new Transition[0]); } public int getNumberOfTransitions() { diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/CodePointTransitions.java b/runtime/Java/src/org/antlr/v4/runtime/atn/CodePointTransitions.java index 7aedfc44a6..ce0bf8e4c3 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/CodePointTransitions.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/CodePointTransitions.java @@ -6,47 +6,25 @@ package org.antlr.v4.runtime.atn; -import org.antlr.v4.runtime.misc.IntervalSet; - /** * Utility class to create {@link AtomTransition}, {@link RangeTransition}, * and {@link SetTransition} appropriately based on the range of the input. * - * To keep the serialized ATN size small, we only inline atom and - * range transitions for Unicode code points <= U+FFFF. - * - * Whenever we encounter a Unicode code point > U+FFFF, we represent that - * as a set transition (even if it is logically an atom or a range). + * Previously, we distinguished between atom and range transitions for + * Unicode code points <= U+FFFF and those above. We used a set + * transition for a Unicode code point > U+FFFF. Now that we can serialize + * 32-bit int/chars in the ATN serialization, this is no longer necessary. */ public abstract class CodePointTransitions { - /** - * If {@code codePoint} is <= U+FFFF, returns a new {@link AtomTransition}. - * Otherwise, returns a new {@link SetTransition}. - */ + /** Return new {@link AtomTransition} */ public static Transition createWithCodePoint(ATNState target, int codePoint) { - if (Character.isSupplementaryCodePoint(codePoint)) { - return new SetTransition(target, IntervalSet.of(codePoint)); - } - else { - return new AtomTransition(target, codePoint); - } + return createWithCodePointRange(target, codePoint, codePoint); } - /** - * If {@code codePointFrom} and {@code codePointTo} are both - * <= U+FFFF, returns a new {@link RangeTransition}. - * Otherwise, returns a new {@link SetTransition}. - */ - public static Transition createWithCodePointRange( - ATNState target, - int codePointFrom, - int codePointTo) { - if (Character.isSupplementaryCodePoint(codePointFrom) || - Character.isSupplementaryCodePoint(codePointTo)) { - return new SetTransition(target, IntervalSet.of(codePointFrom, codePointTo)); - } - else { - return new RangeTransition(target, codePointFrom, codePointTo); - } + /** Return new {@link AtomTransition} if range represents one atom else {@link SetTransition}. */ + public static Transition createWithCodePointRange(ATNState target, int codePointFrom, int codePointTo) { + return codePointFrom == codePointTo + ? new AtomTransition(target, codePointFrom) + : new RangeTransition(target, codePointFrom, codePointTo); } } diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java b/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java index 76524ebd82..2fcb834310 100755 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/ParserATNSimulator.java @@ -1245,7 +1245,7 @@ protected DFAState.PredPrediction[] getPredicatePredictions(BitSet ambigAlts, } // System.out.println(Arrays.toString(altToPred)+"->"+pairs); - return pairs.toArray(new DFAState.PredPrediction[pairs.size()]); + return pairs.toArray(new DFAState.PredPrediction[0]); } /** diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java b/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java index 25d8bc49b5..e2a90bf373 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/PredictionContext.java @@ -715,6 +715,6 @@ else if ( p.getReturnState(index)!= EMPTY_RETURN_STATE) { } } - return result.toArray(new String[result.size()]); + return result.toArray(new String[0]); } } diff --git a/runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java b/runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java index 3b888e7cf7..299ec99965 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java +++ b/runtime/Java/src/org/antlr/v4/runtime/atn/SemanticContext.java @@ -219,7 +219,7 @@ public AND(SemanticContext a, SemanticContext b) { operands.add(reduced); } - opnds = operands.toArray(new SemanticContext[operands.size()]); + opnds = operands.toArray(new SemanticContext[0]); } @Override @@ -316,7 +316,7 @@ public OR(SemanticContext a, SemanticContext b) { operands.add(reduced); } - this.opnds = operands.toArray(new SemanticContext[operands.size()]); + this.opnds = operands.toArray(new SemanticContext[0]); } @Override diff --git a/runtime/Java/src/org/antlr/v4/runtime/misc/IntegerList.java b/runtime/Java/src/org/antlr/v4/runtime/misc/IntegerList.java index d6af911835..d6c700d8f6 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/misc/IntegerList.java +++ b/runtime/Java/src/org/antlr/v4/runtime/misc/IntegerList.java @@ -5,9 +5,11 @@ */ package org.antlr.v4.runtime.misc; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.*; /** * @@ -274,8 +276,9 @@ private void ensureCapacity(int capacity) { _data = Arrays.copyOf(_data, newLength); } - /** Convert the list to a UTF-16 encoded char array. If all values are less - * than the 0xFFFF 16-bit code point limit then this is just a char array + /** Convert the int list to a char array where values > 0x7FFFF take 2 bytes. TODO????? + * If all values are less + * than the 0x7FFF 16-bit code point limit (1 bit taken to indicatethen this is just a char array * of 16-bit char as usual. For values in the supplementary range, encode * them as two UTF-16 code units. */ diff --git a/runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java b/runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java index 221fa55d3e..94980e1532 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java +++ b/runtime/Java/src/org/antlr/v4/runtime/misc/InterpreterDataReader.java @@ -20,7 +20,7 @@ // A class to read plain text interpreter data produced by ANTLR. public class InterpreterDataReader { - + public static class InterpreterData { ATN atn; Vocabulary vocabulary; @@ -28,39 +28,39 @@ public static class InterpreterData { List channels; // Only valid for lexer grammars. List modes; // ditto }; - + /** * The structure of the data file is very simple. Everything is line based with empty lines * separating the different parts. For lexers the layout is: * token literal names: * ... - * + * * token symbolic names: * ... - * + * * rule names: * ... - * + * * channel names: * ... - * + * * mode names: * ... - * + * * atn: * enclosed in a pair of squared brackets. - * + * * Data for a parser does not contain channel and mode names. */ public static InterpreterData parseFile(String fileName) { InterpreterData result = new InterpreterData(); result.ruleNames = new ArrayList(); - + try (BufferedReader br = new BufferedReader(new FileReader(fileName))) { String line; List literalNames = new ArrayList(); List symbolicNames = new ArrayList(); - + line = br.readLine(); if ( !line.equals("token literal names:") ) throw new RuntimeException("Unexpected data entry"); @@ -69,7 +69,7 @@ public static InterpreterData parseFile(String fileName) { break; literalNames.add(line.equals("null") ? "" : line); } - + line = br.readLine(); if ( !line.equals("token symbolic names:") ) throw new RuntimeException("Unexpected data entry"); @@ -89,7 +89,8 @@ public static InterpreterData parseFile(String fileName) { break; result.ruleNames.add(line); } - + + line = br.readLine(); if ( line.equals("channel names:") ) { // Additional lexer data. result.channels = new ArrayList(); while ((line = br.readLine()) != null) { @@ -113,19 +114,11 @@ public static InterpreterData parseFile(String fileName) { if ( !line.equals("atn:") ) throw new RuntimeException("Unexpected data entry"); line = br.readLine(); - String[] elements = line.split(","); - char[] serializedATN = new char[elements.length]; - - for (int i = 0; i < elements.length; ++i) { - int value; - String element = elements[i]; - if ( element.startsWith("[") ) - value = Integer.parseInt(element.substring(1).trim()); - else if ( element.endsWith("]") ) - value = Integer.parseInt(element.substring(0, element.length() - 1).trim()); - else - value = Integer.parseInt(element.trim()); - serializedATN[i] = (char)value; + String[] elements = line.substring(1,line.length()-1).split(","); + int[] serializedATN = new int[elements.length]; + + for (int i = 0; i < elements.length; ++i) { // ignore [...] on ends + serializedATN[i] = Integer.parseInt(elements[i].trim()); } ATNDeserializer deserializer = new ATNDeserializer(); @@ -134,8 +127,8 @@ else if ( element.endsWith("]") ) catch (java.io.IOException e) { // We just swallow the error and return empty objects instead. } - + return result; } - + } diff --git a/runtime/Java/src/org/antlr/v4/runtime/misc/NotNull.java b/runtime/Java/src/org/antlr/v4/runtime/misc/NotNull.java index 78052918af..216c938578 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/misc/NotNull.java +++ b/runtime/Java/src/org/antlr/v4/runtime/misc/NotNull.java @@ -17,5 +17,6 @@ @Documented @Retention(RetentionPolicy.CLASS) @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE}) +@Deprecated public @interface NotNull { } diff --git a/runtime/Java/src/org/antlr/v4/runtime/misc/TestRig.java b/runtime/Java/src/org/antlr/v4/runtime/misc/TestRig.java index 2be97840a2..3f91539b43 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/misc/TestRig.java +++ b/runtime/Java/src/org/antlr/v4/runtime/misc/TestRig.java @@ -14,6 +14,7 @@ * @deprecated * @since 4.5.1 */ +@Deprecated public class TestRig { public static void main(String[] args) { try { diff --git a/runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java b/runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java index 406d2afbec..bf6531b7aa 100644 --- a/runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java +++ b/runtime/Java/src/org/antlr/v4/runtime/tree/Trees.java @@ -185,6 +185,7 @@ public static List getDescendants(ParseTree t) { } /** @deprecated */ + @Deprecated public static List descendants(ParseTree t) { return getDescendants(t); } diff --git a/runtime/JavaScript/.eslintignore b/runtime/JavaScript/.eslintignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/runtime/JavaScript/.eslintrc.yml b/runtime/JavaScript/.eslintrc.yml new file mode 100644 index 0000000000..75de9268ac --- /dev/null +++ b/runtime/JavaScript/.eslintrc.yml @@ -0,0 +1,18 @@ +env: + browser: true + node: true + es2016: true + amd: true + jasmine: true +extends: 'eslint:recommended' +globals: + Atomics: readonly + SharedArrayBuffer: readonly + Set: readonly +# parser: babel-eslint +parserOptions: + sourceType: module +rules: + no-unused-vars: ["error", {vars: "all", args: "none"}] + no-prototype-builtins: [ "off" ] + no-fallthrough: ["error", { "commentPattern": "no-break" }] diff --git a/runtime/JavaScript/package-lock.json b/runtime/JavaScript/package-lock.json index fef3f02bec..d97248f90e 100644 --- a/runtime/JavaScript/package-lock.json +++ b/runtime/JavaScript/package-lock.json @@ -1,77 +1,85 @@ { "name": "antlr4", - "version": "4.9.3", + "version": "4.10.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "antlr4", - "version": "4.9.3", + "version": "4.10", "license": "BSD-3-Clause", "devDependencies": { - "@babel/core": "^7.13.10", - "@babel/preset-env": "^7.13.10", - "ansi-regex": "^5.0.1", - "babel-loader": "^8.2.2", - "browserslist": ">=4.16.5", - "hosted-git-info": ">=2.8.9", - "ini": "1.3.6", - "jest": "^26.6.3", - "path-parse": ">=1.0.7", - "set-value": ">=4.0.1", - "ssri": ">=6.0.2", - "tmpl": "^1.0.5", - "webpack": "^4.46.0", - "webpack-cli": "^3.3.12", - "ws": ">=7.4.6", - "y18n": ">=4.0.1" + "@babel/preset-env": "^7.16.11", + "babel-loader": "^8.2.4", + "eslint-plugin-es5": "^1.5.0", + "eslint-webpack-plugin": "^3.1.1", + "glob-parent": "^6.0.2", + "jasmine": "^4.0.2", + "jasmine-spec-reporter": "^7.0.0", + "minimist": "^1.2.6", + "webpack": "^5.66.0", + "webpack-cli": "^4.9.1" }, "engines": { "node": ">=14" } }, + "node_modules/@ampproject/remapping": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.1.2.tgz", + "integrity": "sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/code-frame": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", - "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.0" + "@babel/highlight": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.0.tgz", - "integrity": "sha512-DGjt2QZse5SGd9nfOSqO4WLJ8NN/oHkijbXbPrxuoJO3oIPJL3TciZs9FX+cOHNiY9E9l0opL8g7BmLe3T+9ew==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", + "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.0.tgz", - "integrity": "sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helpers": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz", + "integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==", + "dev": true, + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.7", + "@babel/helper-compilation-targets": "^7.17.7", + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helpers": "^7.17.8", + "@babel/parser": "^7.17.8", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.1.2", - "semver": "^6.3.0", - "source-map": "^0.5.0" + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" @@ -82,12 +90,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.0.tgz", - "integrity": "sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0", + "@babel/types": "^7.17.0", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -96,39 +104,39 @@ } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz", - "integrity": "sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", + "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.0.tgz", - "integrity": "sha512-9KuleLT0e77wFUku6TUkqZzCEymBdtuQQ27MhEKzf9UOOJu3cYj98kyaDAzxpC7lV6DGiZFuC8XqDsq8/Kl6aQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz", + "integrity": "sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA==", "dev": true, "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-explode-assignable-expression": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.0.tgz", - "integrity": "sha512-S7iaOT1SYlqK0sQaCi21RX4+13hmdmnxIEAnQUB/eh7GeAnRjOUgTYpLkUOiRXzD+yog1JxP0qyAQZ7ZxVxLVg==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", + "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-validator-option": "^7.14.5", - "browserslist": "^4.16.6", + "@babel/compat-data": "^7.17.7", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.17.5", "semver": "^6.3.0" }, "engines": { @@ -139,17 +147,18 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.0.tgz", - "integrity": "sha512-XLwWvqEaq19zFlF5PTgOod4bUA+XbkR4WLQBct1bkzmxJGB0ZEJaoKF4c8cgH9oBtCDuYJ8BP5NB9uFiEgO5QA==", + "version": "7.17.6", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.6.tgz", + "integrity": "sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-member-expression-to-functions": "^7.16.0", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/helper-replace-supers": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -159,13 +168,13 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.0.tgz", - "integrity": "sha512-3DyG0zAFAZKcOp7aVr33ddwkxJ0Z0Jr5V99y3I690eYLpukJsJvAbzTy1ewoCqsML8SbIrjH14Jc/nSQ4TvNPA==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.17.0.tgz", + "integrity": "sha512-awO2So99wG6KnlE+TPs6rn83gCz5WlEePJDTnLEqbchMVrBeAujURVphRdigsk094VhvZehFoNOihSlcBjwsXA==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "regexpu-core": "^4.7.1" + "@babel/helper-annotate-as-pure": "^7.16.7", + "regexpu-core": "^5.0.1" }, "engines": { "node": ">=6.9.0" @@ -175,9 +184,9 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.4.tgz", - "integrity": "sha512-OrpPZ97s+aPi6h2n1OXzdhVis1SGSsMU2aMHgLcOKfsp4/v1NWpx3CWT3lBj5eeBq9cDkPkh+YCfdF7O12uNDQ==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz", + "integrity": "sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==", "dev": true, "dependencies": { "@babel/helper-compilation-targets": "^7.13.0", @@ -193,156 +202,169 @@ "@babel/core": "^7.4.0-0" } }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "dev": true, + "dependencies": { + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-explode-assignable-expression": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.0.tgz", - "integrity": "sha512-Hk2SLxC9ZbcOhLpg/yMznzJ11W++lg5GMbxt1ev6TXUiJB0N42KPC+7w8a+eWGuqDnUYuwStJoZHM7RgmIOaGQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz", + "integrity": "sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz", - "integrity": "sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-get-function-arity": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz", - "integrity": "sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz", - "integrity": "sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz", - "integrity": "sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.17.7.tgz", + "integrity": "sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz", - "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz", - "integrity": "sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", + "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-replace-supers": "^7.16.0", - "@babel/helper-simple-access": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/helper-validator-identifier": "^7.15.7", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz", - "integrity": "sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz", + "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz", - "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.0.tgz", - "integrity": "sha512-MLM1IOMe9aQBqMWxcRw8dcb9jlM86NIw7KA0Wri91Xkfied+dE0QuBFSBjMNvqzmS0OSIDsMNC24dBEkPUi7ew==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz", + "integrity": "sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-wrap-function": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-wrap-function": "^7.16.8", + "@babel/types": "^7.16.8" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz", - "integrity": "sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz", + "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==", "dev": true, "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.16.0", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz", - "integrity": "sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", + "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" @@ -361,71 +383,72 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz", - "integrity": "sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", - "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.0.tgz", - "integrity": "sha512-VVMGzYY3vkWgCJML+qVLvGIam902mJW0FvT7Avj1zEe0Gn7D93aWdLblYARTxEw+6DhZmtzhBM2zv0ekE5zg1g==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz", + "integrity": "sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/helper-function-name": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.8", + "@babel/types": "^7.16.8" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.0.tgz", - "integrity": "sha512-dVRM0StFMdKlkt7cVcGgwD8UMaBfWJHl3A83Yfs8GQ3MO0LHIIIMvK7Fa0RGOGUQ10qikLaX6D7o5htcQWgTMQ==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.8.tgz", + "integrity": "sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==", "dev": true, + "peer": true, "dependencies": { - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", - "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -434,9 +457,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.16.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.2.tgz", - "integrity": "sha512-RUVpT0G2h6rOZwqLDTrKk7ksNv7YpAilTnYe1/Q+eDjxEceRMKVWbCsX7t8h6C1qCFi/1Y8WZjcEPBAFG27GPw==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", + "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -446,12 +469,12 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.16.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz", - "integrity": "sha512-h37CvpLSf8gb2lIJ2CgC3t+EjFbi0t8qS7LCS1xcJIlEXE4czlofwaW7W1HA8zpgOCzI9C1nmoqNR1zWkk0pQg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz", + "integrity": "sha512-anv/DObl7waiGEnC24O9zqL0pSuI9hljihqiDuFHC8d7/bjr/4RLGPWuc8rYOff/QPzbEPSkzG8wGG9aDuhHRg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -461,14 +484,14 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.0.tgz", - "integrity": "sha512-4tcFwwicpWTrpl9qjf7UsoosaArgImF85AxqCRZlgc3IQDvkUHjJpruXAL58Wmj+T6fypWTC/BakfEkwIL/pwA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.7.tgz", + "integrity": "sha512-di8vUHRdf+4aJ7ltXhaDbPoszdkh59AQtJM5soLsuHpQJdFQZOA4uGj0V2u/CZ8bJ/u8ULDL5yq6FO/bCXnKHw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", - "@babel/plugin-proposal-optional-chaining": "^7.16.0" + "@babel/plugin-proposal-optional-chaining": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -478,13 +501,13 @@ } }, "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.0.tgz", - "integrity": "sha512-nyYmIo7ZqKsY6P4lnVmBlxp9B3a96CscbLotlsNuktMHahkDwoPYEjXrZHU0Tj844Z9f1IthVxQln57mhkcExw==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz", + "integrity": "sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.16.0", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-remap-async-to-generator": "^7.16.8", "@babel/plugin-syntax-async-generators": "^7.8.4" }, "engines": { @@ -495,13 +518,13 @@ } }, "node_modules/@babel/plugin-proposal-class-properties": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.0.tgz", - "integrity": "sha512-mCF3HcuZSY9Fcx56Lbn+CGdT44ioBMMvjNVldpKtj8tpniETdLjnxdHI1+sDWXIM1nNt+EanJOZ3IG9lzVjs7A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz", + "integrity": "sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-class-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -511,13 +534,13 @@ } }, "node_modules/@babel/plugin-proposal-class-static-block": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.0.tgz", - "integrity": "sha512-mAy3sdcY9sKAkf3lQbDiv3olOfiLqI51c9DR9b19uMoR2Z6r5pmGl7dfNFqEvqOyqbf1ta4lknK4gc5PJn3mfA==", + "version": "7.17.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.17.6.tgz", + "integrity": "sha512-X/tididvL2zbs7jZCeeRJ8167U/+Ac135AM6jCAx6gYXDUviZV5Ku9UDvWS2NCuWlFjIRXklYhwo6HhAC7ETnA==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-create-class-features-plugin": "^7.17.6", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-class-static-block": "^7.14.5" }, "engines": { @@ -528,12 +551,12 @@ } }, "node_modules/@babel/plugin-proposal-dynamic-import": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.0.tgz", - "integrity": "sha512-QGSA6ExWk95jFQgwz5GQ2Dr95cf7eI7TKutIXXTb7B1gCLTCz5hTjFTQGfLFBBiC5WSNi7udNwWsqbbMh1c4yQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz", + "integrity": "sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-dynamic-import": "^7.8.3" }, "engines": { @@ -544,12 +567,12 @@ } }, "node_modules/@babel/plugin-proposal-export-namespace-from": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.0.tgz", - "integrity": "sha512-CjI4nxM/D+5wCnhD11MHB1AwRSAYeDT+h8gCdcVJZ/OK7+wRzFsf7PFPWVpVpNRkHMmMkQWAHpTq+15IXQ1diA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.7.tgz", + "integrity": "sha512-ZxdtqDXLRGBL64ocZcs7ovt71L3jhC1RGSyR996svrCi3PYqHNkb3SwPJCs8RIzD86s+WPpt2S73+EHCGO+NUA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-export-namespace-from": "^7.8.3" }, "engines": { @@ -560,12 +583,12 @@ } }, "node_modules/@babel/plugin-proposal-json-strings": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.0.tgz", - "integrity": "sha512-kouIPuiv8mSi5JkEhzApg5Gn6hFyKPnlkO0a9YSzqRurH8wYzSlf6RJdzluAsbqecdW5pBvDJDfyDIUR/vLxvg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz", + "integrity": "sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-json-strings": "^7.8.3" }, "engines": { @@ -576,12 +599,12 @@ } }, "node_modules/@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.0.tgz", - "integrity": "sha512-pbW0fE30sVTYXXm9lpVQQ/Vc+iTeQKiXlaNRZPPN2A2VdlWyAtsUrsQ3xydSlDW00TFMK7a8m3cDTkBF5WnV3Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.7.tgz", + "integrity": "sha512-K3XzyZJGQCr00+EtYtrDjmwX7o7PLK6U9bi1nCwkQioRFVUv6dJoxbQjtWVtP+bCPy82bONBKG8NPyQ4+i6yjg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" }, "engines": { @@ -592,12 +615,12 @@ } }, "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.0.tgz", - "integrity": "sha512-3bnHA8CAFm7cG93v8loghDYyQ8r97Qydf63BeYiGgYbjKKB/XP53W15wfRC7dvKfoiJ34f6Rbyyx2btExc8XsQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz", + "integrity": "sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" }, "engines": { @@ -608,12 +631,12 @@ } }, "node_modules/@babel/plugin-proposal-numeric-separator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.0.tgz", - "integrity": "sha512-FAhE2I6mjispy+vwwd6xWPyEx3NYFS13pikDBWUAFGZvq6POGs5eNchw8+1CYoEgBl9n11I3NkzD7ghn25PQ9Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz", + "integrity": "sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-numeric-separator": "^7.10.4" }, "engines": { @@ -624,16 +647,16 @@ } }, "node_modules/@babel/plugin-proposal-object-rest-spread": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.0.tgz", - "integrity": "sha512-LU/+jp89efe5HuWJLmMmFG0+xbz+I2rSI7iLc1AlaeSMDMOGzWlc5yJrMN1d04osXN4sSfpo4O+azkBNBes0jg==", + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.17.3.tgz", + "integrity": "sha512-yuL5iQA/TbZn+RGAfxQXfi7CNLmKi1f8zInn4IgobuCWcAb7i+zj4TYzQ9l8cEzVyJ89PDGuqxK1xZpUDISesw==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/compat-data": "^7.17.0", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.16.0" + "@babel/plugin-transform-parameters": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -643,12 +666,12 @@ } }, "node_modules/@babel/plugin-proposal-optional-catch-binding": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.0.tgz", - "integrity": "sha512-kicDo0A/5J0nrsCPbn89mTG3Bm4XgYi0CZtvex9Oyw7gGZE3HXGD0zpQNH+mo+tEfbo8wbmMvJftOwpmPy7aVw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz", + "integrity": "sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" }, "engines": { @@ -659,12 +682,12 @@ } }, "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.0.tgz", - "integrity": "sha512-Y4rFpkZODfHrVo70Uaj6cC1JJOt3Pp0MdWSwIKtb8z1/lsjl9AmnB7ErRFV+QNGIfcY1Eruc2UMx5KaRnXjMyg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.7.tgz", + "integrity": "sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, @@ -676,13 +699,13 @@ } }, "node_modules/@babel/plugin-proposal-private-methods": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.0.tgz", - "integrity": "sha512-IvHmcTHDFztQGnn6aWq4t12QaBXTKr1whF/dgp9kz84X6GUcwq9utj7z2wFCUfeOup/QKnOlt2k0zxkGFx9ubg==", + "version": "7.16.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz", + "integrity": "sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-class-features-plugin": "^7.16.10", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -692,14 +715,14 @@ } }, "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.0.tgz", - "integrity": "sha512-3jQUr/HBbMVZmi72LpjQwlZ55i1queL8KcDTQEkAHihttJnAPrcvG9ZNXIfsd2ugpizZo595egYV6xy+pv4Ofw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.7.tgz", + "integrity": "sha512-rMQkjcOFbm+ufe3bTZLyOfsOUOxyvLXZJCTARhJr+8UMSoZmqTe1K1BgkFcrW37rAchWg57yI69ORxiWvUINuQ==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-create-class-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-create-class-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-private-property-in-object": "^7.14.5" }, "engines": { @@ -710,13 +733,13 @@ } }, "node_modules/@babel/plugin-proposal-unicode-property-regex": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.0.tgz", - "integrity": "sha512-ti7IdM54NXv29cA4+bNNKEMS4jLMCbJgl+Drv+FgYy0erJLAxNAIXcNjNjrRZEcWq0xJHsNVwQezskMFpF8N9g==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz", + "integrity": "sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=4" @@ -737,18 +760,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", - "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-class-properties": { "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", @@ -800,18 +811,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.10.4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-json-strings": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", @@ -927,12 +926,12 @@ } }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.0.tgz", - "integrity": "sha512-vIFb5250Rbh7roWARvCLvIJ/PtAU5Lhv7BtZ1u24COwpI9Ypjsh+bZcKk6rlIyalK+r0jOc1XQ8I4ovNxNrWrA==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz", + "integrity": "sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -942,14 +941,14 @@ } }, "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.0.tgz", - "integrity": "sha512-PbIr7G9kR8tdH6g8Wouir5uVjklETk91GMVSUq+VaOgiinbCkBP6Q7NN/suM/QutZkMJMvcyAriogcYAdhg8Gw==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz", + "integrity": "sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.16.0" + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-remap-async-to-generator": "^7.16.8" }, "engines": { "node": ">=6.9.0" @@ -959,12 +958,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.0.tgz", - "integrity": "sha512-V14As3haUOP4ZWrLJ3VVx5rCnrYhMSHN/jX7z6FAt5hjRkLsb0snPCmJwSOML5oxkKO4FNoNv7V5hw/y2bjuvg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz", + "integrity": "sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -974,12 +973,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.0.tgz", - "integrity": "sha512-27n3l67/R3UrXfizlvHGuTwsRIFyce3D/6a37GRxn28iyTPvNXaW4XvznexRh1zUNLPjbLL22Id0XQElV94ruw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz", + "integrity": "sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -989,17 +988,18 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.0.tgz", - "integrity": "sha512-HUxMvy6GtAdd+GKBNYDWCIA776byUQH8zjnfjxwT1P1ARv/wFu8eBDpmXQcLS/IwRtrxIReGiplOwMeyO7nsDQ==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-replace-supers": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz", + "integrity": "sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", "globals": "^11.1.0" }, "engines": { @@ -1010,12 +1010,12 @@ } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.0.tgz", - "integrity": "sha512-63l1dRXday6S8V3WFY5mXJwcRAnPYxvFfTlt67bwV1rTyVTM5zrp0DBBb13Kl7+ehkCVwIZPumPpFP/4u70+Tw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz", + "integrity": "sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1025,12 +1025,12 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.0.tgz", - "integrity": "sha512-Q7tBUwjxLTsHEoqktemHBMtb3NYwyJPTJdM+wDwb0g8PZ3kQUIzNvwD5lPaqW/p54TXBc/MXZu9Jr7tbUEUM8Q==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.17.7.tgz", + "integrity": "sha512-XVh0r5yq9sLR4vZ6eVZe8FKfIcSgaTBxVBRSYokRj2qksf6QerYnTxz9/GTuKTH/n/HwLP7t6gtlybHetJ/6hQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1040,13 +1040,13 @@ } }, "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.0.tgz", - "integrity": "sha512-FXlDZfQeLILfJlC6I1qyEwcHK5UpRCFkaoVyA1nk9A1L1Yu583YO4un2KsLBsu3IJb4CUbctZks8tD9xPQubLw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz", + "integrity": "sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1056,12 +1056,12 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.0.tgz", - "integrity": "sha512-LIe2kcHKAZOJDNxujvmp6z3mfN6V9lJxubU4fJIGoQCkKe3Ec2OcbdlYP+vW++4MpxwG0d1wSDOJtQW5kLnkZQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz", + "integrity": "sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1071,13 +1071,13 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.0.tgz", - "integrity": "sha512-OwYEvzFI38hXklsrbNivzpO3fh87skzx8Pnqi4LoSYeav0xHlueSoCJrSgTPfnbyzopo5b3YVAJkFIcUpK2wsw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz", + "integrity": "sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA==", "dev": true, "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1087,12 +1087,12 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.0.tgz", - "integrity": "sha512-5QKUw2kO+GVmKr2wMYSATCTTnHyscl6sxFRAY+rvN7h7WB0lcG0o4NoV6ZQU32OZGVsYUsfLGgPQpDFdkfjlJQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz", + "integrity": "sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1102,13 +1102,14 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.0.tgz", - "integrity": "sha512-lBzMle9jcOXtSOXUpc7tvvTpENu/NuekNJVova5lCCWCV9/U1ho2HH2y0p6mBg8fPm/syEAbfaaemYGOHCY3mg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz", + "integrity": "sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1118,12 +1119,12 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.0.tgz", - "integrity": "sha512-gQDlsSF1iv9RU04clgXqRjrPyyoJMTclFt3K1cjLmTKikc0s/6vE3hlDeEVC71wLTRu72Fq7650kABrdTc2wMQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz", + "integrity": "sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1133,12 +1134,12 @@ } }, "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.0.tgz", - "integrity": "sha512-WRpw5HL4Jhnxw8QARzRvwojp9MIE7Tdk3ez6vRyUk1MwgjJN0aNpRoXainLR5SgxmoXx/vsXGZ6OthP6t/RbUg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz", + "integrity": "sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1148,13 +1149,13 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.0.tgz", - "integrity": "sha512-rWFhWbCJ9Wdmzln1NmSCqn7P0RAD+ogXG/bd9Kg5c7PKWkJtkiXmYsMBeXjDlzHpVTJ4I/hnjs45zX4dEv81xw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz", + "integrity": "sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", "babel-plugin-dynamic-import-node": "^2.3.3" }, "engines": { @@ -1165,14 +1166,14 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.0.tgz", - "integrity": "sha512-Dzi+NWqyEotgzk/sb7kgQPJQf7AJkQBWsVp1N6JWc1lBVo0vkElUnGdr1PzUBmfsCCN5OOFya3RtpeHk15oLKQ==", + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.17.7.tgz", + "integrity": "sha512-ITPmR2V7MqioMJyrxUo2onHNC3e+MvfFiFIR0RP21d3PtlVb6sfzoxNKiphSZUOM9hEIdzCcZe83ieX3yoqjUA==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-simple-access": "^7.16.0", + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", "babel-plugin-dynamic-import-node": "^2.3.3" }, "engines": { @@ -1183,15 +1184,15 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.0.tgz", - "integrity": "sha512-yuGBaHS3lF1m/5R+6fjIke64ii5luRUg97N2wr+z1sF0V+sNSXPxXDdEEL/iYLszsN5VKxVB1IPfEqhzVpiqvg==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.17.8.tgz", + "integrity": "sha512-39reIkMTUVagzgA5x88zDYXPCMT6lcaRKs1+S9K6NKBPErbgO/w/kP8GlNQTC87b412ZTlmNgr3k2JrWgHH+Bw==", "dev": true, "dependencies": { - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", "babel-plugin-dynamic-import-node": "^2.3.3" }, "engines": { @@ -1202,13 +1203,13 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.0.tgz", - "integrity": "sha512-nx4f6no57himWiHhxDM5pjwhae5vLpTK2zCnDH8+wNLJy0TVER/LJRHl2bkt6w9Aad2sPD5iNNoUpY3X9sTGDg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz", + "integrity": "sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1218,12 +1219,12 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.0.tgz", - "integrity": "sha512-LogN88uO+7EhxWc8WZuQ8vxdSyVGxhkh8WTC3tzlT8LccMuQdA81e9SGV6zY7kY2LjDhhDOFdQVxdGwPyBCnvg==", + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz", + "integrity": "sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.16.0" + "@babel/helper-create-regexp-features-plugin": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1233,12 +1234,12 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.0.tgz", - "integrity": "sha512-fhjrDEYv2DBsGN/P6rlqakwRwIp7rBGLPbrKxwh7oVt5NNkIhZVOY2GRV+ULLsQri1bDqwDWnU3vhlmx5B2aCw==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz", + "integrity": "sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1248,13 +1249,13 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.0.tgz", - "integrity": "sha512-fds+puedQHn4cPLshoHcR1DTMN0q1V9ou0mUjm8whx9pGcNvDrVVrgw+KJzzCaiTdaYhldtrUps8DWVMgrSEyg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz", + "integrity": "sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-replace-supers": "^7.16.0" + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1264,12 +1265,12 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.0.tgz", - "integrity": "sha512-XgnQEm1CevKROPx+udOi/8f8TiGhrUWiHiaUCIp47tE0tpFDjzXNTZc9E5CmCwxNjXTWEVqvRfWZYOTFvMa/ZQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz", + "integrity": "sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1279,12 +1280,12 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.0.tgz", - "integrity": "sha512-XLldD4V8+pOqX2hwfWhgwXzGdnDOThxaNTgqagOcpBgIxbUvpgU2FMvo5E1RyHbk756WYgdbS0T8y0Cj9FKkWQ==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz", + "integrity": "sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1294,9 +1295,9 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.0.tgz", - "integrity": "sha512-JAvGxgKuwS2PihiSFaDrp94XOzzTUeDeOQlcKzVAyaPap7BnZXK/lvMDiubkPTdotPKOIZq9xWXWnggUMYiExg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.7.tgz", + "integrity": "sha512-mF7jOgGYCkSJagJ6XCujSQg+6xC1M77/03K2oBmVJWoFGNUtnVJO4WHKJk3dnPC8HCcj4xBQP1Egm8DWh3Pb3Q==", "dev": true, "dependencies": { "regenerator-transform": "^0.14.2" @@ -1309,12 +1310,12 @@ } }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.0.tgz", - "integrity": "sha512-Dgs8NNCehHSvXdhEhln8u/TtJxfVwGYCgP2OOr5Z3Ar+B+zXicEOKNTyc+eca2cuEOMtjW6m9P9ijOt8QdqWkg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.7.tgz", + "integrity": "sha512-KQzzDnZ9hWQBjwi5lpY5v9shmm6IVG0U9pB18zvMu2i4H90xpT4gmqwPYsn8rObiadYe2M0gmgsiOIF5A/2rtg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1324,12 +1325,12 @@ } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.0.tgz", - "integrity": "sha512-iVb1mTcD8fuhSv3k99+5tlXu5N0v8/DPm2mO3WACLG6al1CGZH7v09HJyUb1TtYl/Z+KrM6pHSIJdZxP5A+xow==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz", + "integrity": "sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1339,12 +1340,12 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.0.tgz", - "integrity": "sha512-Ao4MSYRaLAQczZVp9/7E7QHsCuK92yHRrmVNRe/SlEJjhzivq0BSn8mEraimL8wizHZ3fuaHxKH0iwzI13GyGg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz", + "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" }, "engines": { @@ -1355,12 +1356,12 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.0.tgz", - "integrity": "sha512-/ntT2NljR9foobKk4E/YyOSwcGUXtYWv5tinMK/3RkypyNBNdhHUaq6Orw5DWq9ZcNlS03BIlEALFeQgeVAo4Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz", + "integrity": "sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1370,12 +1371,12 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.0.tgz", - "integrity": "sha512-Rd4Ic89hA/f7xUSJQk5PnC+4so50vBoBfxjdQAdvngwidM8jYIBVxBZ/sARxD4e0yMXRbJVDrYf7dyRtIIKT6Q==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz", + "integrity": "sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1385,12 +1386,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.0.tgz", - "integrity": "sha512-++V2L8Bdf4vcaHi2raILnptTBjGEFxn5315YU+e8+EqXIucA+q349qWngCLpUYqqv233suJ6NOienIVUpS9cqg==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz", + "integrity": "sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1400,12 +1401,12 @@ } }, "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.0.tgz", - "integrity": "sha512-VFi4dhgJM7Bpk8lRc5CMaRGlKZ29W9C3geZjt9beuzSUrlJxsNwX7ReLwaL6WEvsOf2EQkyIJEPtF8EXjB/g2A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz", + "integrity": "sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1415,13 +1416,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.0.tgz", - "integrity": "sha512-jHLK4LxhHjvCeZDWyA9c+P9XH1sOxRd1RO9xMtDVRAOND/PczPqizEtVdx4TQF/wyPaewqpT+tgQFYMnN/P94A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz", + "integrity": "sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -1431,32 +1432,32 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.0.tgz", - "integrity": "sha512-cdTu/W0IrviamtnZiTfixPfIncr2M1VqRrkjzZWlr1B4TVYimCFK5jkyOdP4qw2MrlKHi+b3ORj6x8GoCew8Dg==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-validator-option": "^7.14.5", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.0", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.0", - "@babel/plugin-proposal-async-generator-functions": "^7.16.0", - "@babel/plugin-proposal-class-properties": "^7.16.0", - "@babel/plugin-proposal-class-static-block": "^7.16.0", - "@babel/plugin-proposal-dynamic-import": "^7.16.0", - "@babel/plugin-proposal-export-namespace-from": "^7.16.0", - "@babel/plugin-proposal-json-strings": "^7.16.0", - "@babel/plugin-proposal-logical-assignment-operators": "^7.16.0", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0", - "@babel/plugin-proposal-numeric-separator": "^7.16.0", - "@babel/plugin-proposal-object-rest-spread": "^7.16.0", - "@babel/plugin-proposal-optional-catch-binding": "^7.16.0", - "@babel/plugin-proposal-optional-chaining": "^7.16.0", - "@babel/plugin-proposal-private-methods": "^7.16.0", - "@babel/plugin-proposal-private-property-in-object": "^7.16.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.16.0", + "version": "7.16.11", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.11.tgz", + "integrity": "sha512-qcmWG8R7ZW6WBRPZK//y+E3Cli151B20W1Rv7ln27vuPaXU/8TKms6jFdiJtF7UDTxcrb7mZd88tAeK9LjdT8g==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.16.8", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-validator-option": "^7.16.7", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.7", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.7", + "@babel/plugin-proposal-async-generator-functions": "^7.16.8", + "@babel/plugin-proposal-class-properties": "^7.16.7", + "@babel/plugin-proposal-class-static-block": "^7.16.7", + "@babel/plugin-proposal-dynamic-import": "^7.16.7", + "@babel/plugin-proposal-export-namespace-from": "^7.16.7", + "@babel/plugin-proposal-json-strings": "^7.16.7", + "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7", + "@babel/plugin-proposal-numeric-separator": "^7.16.7", + "@babel/plugin-proposal-object-rest-spread": "^7.16.7", + "@babel/plugin-proposal-optional-catch-binding": "^7.16.7", + "@babel/plugin-proposal-optional-chaining": "^7.16.7", + "@babel/plugin-proposal-private-methods": "^7.16.11", + "@babel/plugin-proposal-private-property-in-object": "^7.16.7", + "@babel/plugin-proposal-unicode-property-regex": "^7.16.7", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", "@babel/plugin-syntax-class-static-block": "^7.14.5", @@ -1471,44 +1472,44 @@ "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-syntax-private-property-in-object": "^7.14.5", "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-transform-arrow-functions": "^7.16.0", - "@babel/plugin-transform-async-to-generator": "^7.16.0", - "@babel/plugin-transform-block-scoped-functions": "^7.16.0", - "@babel/plugin-transform-block-scoping": "^7.16.0", - "@babel/plugin-transform-classes": "^7.16.0", - "@babel/plugin-transform-computed-properties": "^7.16.0", - "@babel/plugin-transform-destructuring": "^7.16.0", - "@babel/plugin-transform-dotall-regex": "^7.16.0", - "@babel/plugin-transform-duplicate-keys": "^7.16.0", - "@babel/plugin-transform-exponentiation-operator": "^7.16.0", - "@babel/plugin-transform-for-of": "^7.16.0", - "@babel/plugin-transform-function-name": "^7.16.0", - "@babel/plugin-transform-literals": "^7.16.0", - "@babel/plugin-transform-member-expression-literals": "^7.16.0", - "@babel/plugin-transform-modules-amd": "^7.16.0", - "@babel/plugin-transform-modules-commonjs": "^7.16.0", - "@babel/plugin-transform-modules-systemjs": "^7.16.0", - "@babel/plugin-transform-modules-umd": "^7.16.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.0", - "@babel/plugin-transform-new-target": "^7.16.0", - "@babel/plugin-transform-object-super": "^7.16.0", - "@babel/plugin-transform-parameters": "^7.16.0", - "@babel/plugin-transform-property-literals": "^7.16.0", - "@babel/plugin-transform-regenerator": "^7.16.0", - "@babel/plugin-transform-reserved-words": "^7.16.0", - "@babel/plugin-transform-shorthand-properties": "^7.16.0", - "@babel/plugin-transform-spread": "^7.16.0", - "@babel/plugin-transform-sticky-regex": "^7.16.0", - "@babel/plugin-transform-template-literals": "^7.16.0", - "@babel/plugin-transform-typeof-symbol": "^7.16.0", - "@babel/plugin-transform-unicode-escapes": "^7.16.0", - "@babel/plugin-transform-unicode-regex": "^7.16.0", + "@babel/plugin-transform-arrow-functions": "^7.16.7", + "@babel/plugin-transform-async-to-generator": "^7.16.8", + "@babel/plugin-transform-block-scoped-functions": "^7.16.7", + "@babel/plugin-transform-block-scoping": "^7.16.7", + "@babel/plugin-transform-classes": "^7.16.7", + "@babel/plugin-transform-computed-properties": "^7.16.7", + "@babel/plugin-transform-destructuring": "^7.16.7", + "@babel/plugin-transform-dotall-regex": "^7.16.7", + "@babel/plugin-transform-duplicate-keys": "^7.16.7", + "@babel/plugin-transform-exponentiation-operator": "^7.16.7", + "@babel/plugin-transform-for-of": "^7.16.7", + "@babel/plugin-transform-function-name": "^7.16.7", + "@babel/plugin-transform-literals": "^7.16.7", + "@babel/plugin-transform-member-expression-literals": "^7.16.7", + "@babel/plugin-transform-modules-amd": "^7.16.7", + "@babel/plugin-transform-modules-commonjs": "^7.16.8", + "@babel/plugin-transform-modules-systemjs": "^7.16.7", + "@babel/plugin-transform-modules-umd": "^7.16.7", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.8", + "@babel/plugin-transform-new-target": "^7.16.7", + "@babel/plugin-transform-object-super": "^7.16.7", + "@babel/plugin-transform-parameters": "^7.16.7", + "@babel/plugin-transform-property-literals": "^7.16.7", + "@babel/plugin-transform-regenerator": "^7.16.7", + "@babel/plugin-transform-reserved-words": "^7.16.7", + "@babel/plugin-transform-shorthand-properties": "^7.16.7", + "@babel/plugin-transform-spread": "^7.16.7", + "@babel/plugin-transform-sticky-regex": "^7.16.7", + "@babel/plugin-transform-template-literals": "^7.16.7", + "@babel/plugin-transform-typeof-symbol": "^7.16.7", + "@babel/plugin-transform-unicode-escapes": "^7.16.7", + "@babel/plugin-transform-unicode-regex": "^7.16.7", "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.16.0", - "babel-plugin-polyfill-corejs2": "^0.2.3", - "babel-plugin-polyfill-corejs3": "^0.3.0", - "babel-plugin-polyfill-regenerator": "^0.2.3", - "core-js-compat": "^3.19.0", + "@babel/types": "^7.16.8", + "babel-plugin-polyfill-corejs2": "^0.3.0", + "babel-plugin-polyfill-corejs3": "^0.5.0", + "babel-plugin-polyfill-regenerator": "^0.3.0", + "core-js-compat": "^3.20.2", "semver": "^6.3.0" }, "engines": { @@ -1535,9 +1536,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.0.tgz", - "integrity": "sha512-Nht8L0O8YCktmsDV6FqFue7vQLRx3Hb0B37lS5y0jDRqRxlBG4wIJHnf9/bgSE2UyipKFA01YtS+npRdTWBUyw==", + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", + "integrity": "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==", "dev": true, "dependencies": { "regenerator-runtime": "^0.13.4" @@ -1547,32 +1548,33 @@ } }, "node_modules/@babel/template": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz", - "integrity": "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==", + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.0.tgz", - "integrity": "sha512-qQ84jIs1aRQxaGaxSysII9TuDaguZ5yVrEuC0BN2vcPlalwfLovVmCjbFDPECPXcYM/wLvNFfp8uDOliLxIoUQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.0", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0", + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", + "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.3", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.17.3", + "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1581,1104 +1583,1117 @@ } }, "node_modules/@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.15.7", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true - }, - "node_modules/@cnakazawa/watch": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", - "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", - "dev": true, - "dependencies": { - "exec-sh": "^0.3.2", - "minimist": "^1.2.0" - }, - "bin": { - "watch": "cli.js" - }, - "engines": { - "node": ">=0.1.95" - } - }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", - "dev": true, - "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", + "integrity": "sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==", "dev": true, "engines": { - "node": ">=8" + "node": ">=10.0.0" } }, - "node_modules/@jest/console": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", - "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", + "node_modules/@eslint/eslintrc": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", + "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", "dev": true, + "peer": true, "dependencies": { - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^26.6.2", - "jest-util": "^26.6.2", - "slash": "^3.0.0" + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.3.1", + "globals": "^13.9.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": ">= 10.14.2" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@jest/console/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", + "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", "dev": true, + "peer": true, "dependencies": { - "color-convert": "^2.0.1" + "type-fest": "^0.20.2" }, "engines": { "node": ">=8" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@jest/console/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", + "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", "dev": true, + "peer": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=10.10.0" } }, - "node_modules/@jest/console/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/console/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "peer": true }, - "node_modules/@jest/console/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/@jridgewell/resolve-uri": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", + "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", "dev": true, + "peer": true, "engines": { - "node": ">=8" + "node": ">=6.0.0" } }, - "node_modules/@jest/console/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", + "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "dev": true, + "peer": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", + "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", "dev": true, + "peer": true, "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/@jest/core": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", - "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", + "node_modules/@types/eslint": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.2.2.tgz", + "integrity": "sha512-nQxgB8/Sg+QKhnV8e0WzPpxjIGT3tuJDDzybkDi8ItE/IgTlHo07U0shaIjzhcvQxlq9SDRE42lsJ23uvEgJ2A==", "dev": true, "dependencies": { - "@jest/console": "^26.6.2", - "@jest/reporters": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.6.2", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-resolve-dependencies": "^26.6.3", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "jest-watcher": "^26.6.2", - "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "rimraf": "^3.0.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">= 10.14.2" + "@types/estree": "*", + "@types/json-schema": "*" } }, - "node_modules/@jest/core/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@types/eslint-scope": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", + "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "@types/eslint": "*", + "@types/estree": "*" } }, - "node_modules/@jest/core/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/@types/estree": { + "version": "0.0.50", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", + "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "16.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", + "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", + "dev": true + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" } }, - "node_modules/@jest/core/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", + "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", "dev": true, "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@xtuc/long": "4.2.2" } }, - "node_modules/@jest/core/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", "dev": true }, - "node_modules/@jest/core/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", + "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1" } }, - "node_modules/@jest/core/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/@webassemblyjs/ieee754": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", + "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "@xtuc/ieee754": "^1.2.0" } }, - "node_modules/@jest/environment": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", - "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", + "node_modules/@webassemblyjs/leb128": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", + "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", "dev": true, "dependencies": { - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" + "@xtuc/long": "4.2.2" } }, - "node_modules/@jest/fake-timers": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", - "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", + "node_modules/@webassemblyjs/utf8": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", + "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", + "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", "dev": true, "dependencies": { - "@jest/types": "^26.6.2", - "@sinonjs/fake-timers": "^6.0.1", - "@types/node": "*", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/helper-wasm-section": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-opt": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "@webassemblyjs/wast-printer": "1.11.1" } }, - "node_modules/@jest/globals": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", - "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", + "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", "dev": true, "dependencies": { - "@jest/environment": "^26.6.2", - "@jest/types": "^26.6.2", - "expect": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, - "node_modules/@jest/reporters": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", - "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", + "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", "dev": true, "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.2", - "graceful-fs": "^4.2.4", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^4.0.3", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "slash": "^3.0.0", - "source-map": "^0.6.0", - "string-length": "^4.0.1", - "terminal-link": "^2.0.0", - "v8-to-istanbul": "^7.0.0" - }, - "engines": { - "node": ">= 10.14.2" - }, - "optionalDependencies": { - "node-notifier": "^8.0.0" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1" } }, - "node_modules/@jest/reporters/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", + "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, - "node_modules/@jest/reporters/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", + "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "@webassemblyjs/ast": "1.11.1", + "@xtuc/long": "4.2.2" } }, - "node_modules/@jest/reporters/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/@webpack-cli/configtest": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.0.tgz", + "integrity": "sha512-ttOkEkoalEHa7RaFYpM0ErK1xc4twg3Am9hfHhL7MVqlHebnkYd2wuI/ZqTDj0cVzZho6PdinY0phFZV3O0Mzg==", + "dev": true, + "peerDependencies": { + "webpack": "4.x.x || 5.x.x", + "webpack-cli": "4.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.0.tgz", + "integrity": "sha512-F6b+Man0rwE4n0409FyAJHStYA5OIZERxmnUfLVwv0mc0V1wLad3V7jqRlMkgKBeAq07jUvglacNaa6g9lOpuw==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "envinfo": "^7.7.3" }, - "engines": { - "node": ">=7.0.0" + "peerDependencies": { + "webpack-cli": "4.x.x" } }, - "node_modules/@jest/reporters/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/@webpack-cli/serve": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.0.tgz", + "integrity": "sha512-ZkVeqEmRpBV2GHvjjUZqEai2PpUbuq8Bqd//vEYsp63J8WyexI8ppCqVS3Zs0QADf6aWuPdU+0XsPI647PVlQA==", + "dev": true, + "peerDependencies": { + "webpack-cli": "4.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", "dev": true }, - "node_modules/@jest/reporters/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true, + "bin": { + "acorn": "bin/acorn" + }, "engines": { - "node": ">=8" + "node": ">=0.4.0" } }, - "node_modules/@jest/reporters/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/acorn-import-assertions": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "dev": true, - "engines": { - "node": ">=0.10.0" + "peerDependencies": { + "acorn": "^8" } }, - "node_modules/@jest/reporters/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "peer": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/@jest/source-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", - "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "dependencies": { - "callsites": "^3.0.0", - "graceful-fs": "^4.2.4", - "source-map": "^0.6.0" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, - "engines": { - "node": ">= 10.14.2" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@jest/source-map/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", "dev": true, - "engines": { - "node": ">=0.10.0" + "peerDependencies": { + "ajv": "^6.9.1" } }, - "node_modules/@jest/test-result": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", - "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "dependencies": { - "@jest/console": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" - }, + "peer": true, "engines": { - "node": ">= 10.14.2" + "node": ">=8" } }, - "node_modules/@jest/test-sequencer": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", - "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "dependencies": { - "@jest/test-result": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3" + "color-convert": "^1.9.0" }, "engines": { - "node": ">= 10.14.2" + "node": ">=4" } }, - "node_modules/@jest/transform": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", - "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "dependencies": { - "@babel/core": "^7.1.0", - "@jest/types": "^26.6.2", - "babel-plugin-istanbul": "^6.0.0", - "chalk": "^4.0.0", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-util": "^26.6.2", - "micromatch": "^4.0.2", - "pirates": "^4.0.1", - "slash": "^3.0.0", - "source-map": "^0.6.1", - "write-file-atomic": "^3.0.0" - }, - "engines": { - "node": ">= 10.14.2" - } + "peer": true }, - "node_modules/@jest/transform/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/babel-loader": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.4.tgz", + "integrity": "sha512-8dytA3gcvPPPv4Grjhnt8b5IIiTcq/zeXOPk4iTYI0SVXcsmuGg7JtBRDp8S9X+gJfhQ8ektjXZlDu1Bb33U8A==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "find-cache-dir": "^3.3.1", + "loader-utils": "^2.0.0", + "make-dir": "^3.1.0", + "schema-utils": "^2.6.5" }, "engines": { - "node": ">=8" + "node": ">= 8.9" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@babel/core": "^7.0.0", + "webpack": ">=2" } }, - "node_modules/@jest/transform/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "object.assign": "^4.1.0" } }, - "node_modules/@jest/transform/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz", + "integrity": "sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "@babel/compat-data": "^7.13.11", + "@babel/helper-define-polyfill-provider": "^0.3.1", + "semver": "^6.1.1" }, - "engines": { - "node": ">=7.0.0" + "peerDependencies": { + "@babel/core": "^7.0.0-0" } }, - "node_modules/@jest/transform/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz", + "integrity": "sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==", + "dev": true, + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.3.1", + "core-js-compat": "^3.21.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz", + "integrity": "sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==", + "dev": true, + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/@jest/transform/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true, "engines": { - "node": ">=8" + "node": "*" } }, - "node_modules/@jest/transform/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "engines": { - "node": ">=0.10.0" + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/@jest/transform/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "fill-range": "^7.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "node_modules/browserslist": { + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", + "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0" + "caniuse-lite": "^1.0.30001317", + "electron-to-chromium": "^1.4.84", + "escalade": "^3.1.1", + "node-releases": "^2.0.2", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist": "cli.js" }, "engines": { - "node": ">= 10.14.2" + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/@jest/types/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@jest/types/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, + "peer": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=6" } }, - "node_modules/@jest/types/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/caniuse-lite": { + "version": "1.0.30001324", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001324.tgz", + "integrity": "sha512-/eYp1J6zYh1alySQB4uzYFkLmxxI8tk0kxldbNHXp8+v+rdMKdUBNjRLz7T7fz6Iox+1lIdYpc7rq6ZcXfTukg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ] + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=4" } }, - "node_modules/@jest/types/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@jest/types/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", "dev": true, "engines": { - "node": ">=8" + "node": ">=6.0" } }, - "node_modules/@jest/types/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "dependencies": { - "type-detect": "4.0.8" + "color-name": "1.1.3" } }, - "node_modules/@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0" - } + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true }, - "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "node_modules/colorette": { + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", + "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", + "dev": true + }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "dev": true, "engines": { - "node": ">= 6" + "node": ">=0.1.90" } }, - "node_modules/@types/babel__core": { - "version": "7.1.16", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz", - "integrity": "sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ==", + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, + "peer": true, "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" + "safe-buffer": "~5.1.1" } }, - "node_modules/@types/babel__generator": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.3.tgz", - "integrity": "sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA==", + "node_modules/core-js-compat": { + "version": "3.21.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.21.1.tgz", + "integrity": "sha512-gbgX5AUvMb8gwxC7FLVWYT7Kkgu/y7+h/h1X43yJkNqhlK2fuYyQimqvKGNZFAY6CKii/GFKJ2cp/1/42TN36g==", "dev": true, "dependencies": { - "@babel/types": "^7.0.0" + "browserslist": "^4.19.1", + "semver": "7.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" } }, - "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "node_modules/core-js-compat/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", "dev": true, - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/@types/babel__traverse": { - "version": "7.14.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", - "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "dependencies": { - "@babel/types": "^7.3.0" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" } }, - "node_modules/@types/graceful-fs": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", - "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "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": { - "@types/node": "*" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", - "dev": true + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "peer": true }, - "node_modules/@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "dependencies": { - "@types/istanbul-lib-coverage": "*" + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, + "peer": true, "dependencies": { - "@types/istanbul-lib-report": "*" + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" } }, - "node_modules/@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "node_modules/electron-to-chromium": { + "version": "1.4.103", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.103.tgz", + "integrity": "sha512-c/uKWR1Z/W30Wy/sx3dkZoj4BijbXX85QKWu9jJfjho3LBAXNEGAEW3oWiGb+dotA6C6BzCTxL2/aLes7jlUeg==", "dev": true }, - "node_modules/@types/node": { - "version": "16.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", - "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", - "dev": true - }, - "node_modules/@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", - "dev": true - }, - "node_modules/@types/prettier": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz", - "integrity": "sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw==", - "dev": true - }, - "node_modules/@types/stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", - "dev": true - }, - "node_modules/@types/yargs": { - "version": "15.0.14", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.14.tgz", - "integrity": "sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ==", + "node_modules/emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true, - "dependencies": { - "@types/yargs-parser": "*" + "engines": { + "node": ">= 4" } }, - "node_modules/@types/yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", - "dev": true - }, - "node_modules/@webassemblyjs/ast": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", - "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "node_modules/enhanced-resolve": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz", + "integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==", "dev": true, "dependencies": { - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0" + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" } }, - "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", - "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", - "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", - "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-code-frame": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", - "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", + "node_modules/envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", "dev": true, - "dependencies": { - "@webassemblyjs/wast-printer": "1.9.0" + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@webassemblyjs/helper-fsm": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", - "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "node_modules/es-module-lexer": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", "dev": true }, - "node_modules/@webassemblyjs/helper-module-context": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", - "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0" + "engines": { + "node": ">=6" } }, - "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", - "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", - "dev": true - }, - "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", - "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0" + "engines": { + "node": ">=0.8.0" } }, - "node_modules/@webassemblyjs/ieee754": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", - "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "node_modules/eslint": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", + "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", "dev": true, + "peer": true, "dependencies": { - "@xtuc/ieee754": "^1.2.0" + "@eslint/eslintrc": "^1.2.1", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@webassemblyjs/leb128": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", - "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "node_modules/eslint-plugin-es5": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es5/-/eslint-plugin-es5-1.5.0.tgz", + "integrity": "sha512-Qxmfo7v2B7SGAEURJo0dpBweFf+JU15kSyALfiB2rXWcBuJ96r6X9kFHXFnhdopPHCaHjoQs1xQPUJVbGMb1AA==", "dev": true, - "dependencies": { - "@xtuc/long": "4.2.2" + "peerDependencies": { + "eslint": ">= 3.0.0" } }, - "node_modules/@webassemblyjs/utf8": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", - "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", - "dev": true - }, - "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", - "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/helper-wasm-section": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-opt": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "@webassemblyjs/wast-printer": "1.9.0" + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" } }, - "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", - "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", + "node_modules/eslint-scope/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" + "engines": { + "node": ">=4.0" } }, - "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", - "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, + "peer": true, "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0" + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" } }, - "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", - "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" + "peer": true, + "engines": { + "node": ">=10" } }, - "node_modules/@webassemblyjs/wast-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", - "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/floating-point-hex-parser": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-code-frame": "1.9.0", - "@webassemblyjs/helper-fsm": "1.9.0", - "@xtuc/long": "4.2.2" + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@webassemblyjs/wast-printer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", - "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", + "node_modules/eslint-webpack-plugin": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/eslint-webpack-plugin/-/eslint-webpack-plugin-3.1.1.tgz", + "integrity": "sha512-xSucskTN9tOkfW7so4EaiFIkulWLXwCB/15H917lR6pTv0Zot6/fetFucmENRb7J5whVSFKIvwnrnsa78SG2yg==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "node_modules/@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "node_modules/@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "node_modules/abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", - "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", - "dev": true, - "bin": { - "acorn": "bin/acorn" + "@types/eslint": "^7.28.2", + "jest-worker": "^27.3.1", + "micromatch": "^4.0.4", + "normalize-path": "^3.0.0", + "schema-utils": "^3.1.1" }, "engines": { - "node": ">=0.4.0" + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0", + "webpack": "^5.0.0" } }, - "node_modules/acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "node_modules/eslint-webpack-plugin/node_modules/@types/eslint": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz", + "integrity": "sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==", "dev": true, "dependencies": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" + "@types/estree": "*", + "@types/json-schema": "*" } }, - "node_modules/acorn-globals/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "node_modules/eslint-webpack-plugin/node_modules/schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, - "bin": { - "acorn": "bin/acorn" + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" }, "engines": { - "node": ">=0.4.0" + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { - "node": ">=0.4.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "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==", + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "peer": true, "dependencies": { - "debug": "4" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">= 6.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "peer": true, "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "color-name": "~1.1.4" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "engines": { + "node": ">=7.0.0" } }, - "node_modules/ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "peerDependencies": { - "ajv": ">=5.0.0" + "peer": true + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", "dev": true, - "peerDependencies": { - "ajv": "^6.9.1" + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "node_modules/eslint/node_modules/globals": { + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", + "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", "dev": true, + "peer": true, "dependencies": { - "type-fest": "^0.21.3" + "type-fest": "^0.20.2" }, "engines": { "node": ">=8" @@ -2687,1832 +2702,1679 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "peer": true, "engines": { "node": ">=8" } }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "peer": true, "dependencies": { - "color-convert": "^1.9.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "node_modules/espree": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", + "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", "dev": true, + "peer": true, "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": ">= 8" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, + "peer": true, "dependencies": { - "sprintf-js": "~1.0.2" + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" } }, - "node_modules/arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=4.0" } }, - "node_modules/arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=4.0" } }, - "node_modules/arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" + "node": ">=0.8.x" } }, - "node_modules/asn1.js/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "node_modules/assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "dependencies": { - "object-assign": "^4.1.1", - "util": "0.10.3" - } - }, - "node_modules/assert/node_modules/inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "node_modules/assert/node_modules/util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "dependencies": { - "inherits": "2.0.1" - } - }, - "node_modules/assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true, - "optional": true + "peer": true }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "node_modules/fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", "dev": true }, - "node_modules/atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, - "bin": { - "atob": "bin/atob.js" + "peer": true, + "dependencies": { + "flat-cache": "^3.0.4" }, "engines": { - "node": ">= 4.5.0" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/babel-jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", - "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "dependencies": { - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/babel__core": "^7.1.7", - "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.6.2", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "slash": "^3.0.0" + "to-regex-range": "^5.0.1" }, "engines": { - "node": ">= 10.14.2" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "node": ">=8" } }, - "node_modules/babel-jest/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" }, "engines": { "node": ">=8" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, - "node_modules/babel-jest/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=8" } }, - "node_modules/babel-jest/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, + "peer": true, "dependencies": { - "color-name": "~1.1.4" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" }, "engines": { - "node": ">=7.0.0" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/babel-jest/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/flatted": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true, + "peer": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "node_modules/babel-jest/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true, + "peer": true + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, + "peer": true, "engines": { - "node": ">=8" + "node": ">=6.9.0" } }, - "node_modules/babel-jest/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/babel-loader": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.3.tgz", - "integrity": "sha512-n4Zeta8NC3QAsuyiizu0GkmRcQ6clkV9WFUnUf1iXP//IeSKbWjofW3UHyZVwlOB4y039YQKefawyTn64Zwbuw==", + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "dependencies": { - "find-cache-dir": "^3.3.1", - "loader-utils": "^1.4.0", - "make-dir": "^3.1.0", - "schema-utils": "^2.6.5" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">= 8.9" + "node": "*" }, - "peerDependencies": { - "@babel/core": "^7.0.0", - "webpack": ">=2" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "dependencies": { - "object.assign": "^4.1.0" + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" } }, - "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz", - "integrity": "sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q==", + "node_modules/graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" + "function-bind": "^1.1.1" }, "engines": { - "node": ">=8" + "node": ">= 0.4.0" } }, - "node_modules/babel-plugin-jest-hoist": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", - "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true, - "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.0.0", - "@types/babel__traverse": "^7.0.6" - }, "engines": { - "node": ">= 10.14.2" + "node": ">=4" } }, - "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz", - "integrity": "sha512-NDZ0auNRzmAfE1oDDPW2JhzIMXUk+FFe2ICejmt5T4ocKgiQx3e0VCRx9NCAidcMtL2RUZaWtXnmjTCkx0tcbA==", + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, - "dependencies": { - "@babel/compat-data": "^7.13.11", - "@babel/helper-define-polyfill-provider": "^0.2.4", - "semver": "^6.1.1" + "engines": { + "node": ">= 0.4" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.3.0.tgz", - "integrity": "sha512-JLwi9vloVdXLjzACL80j24bG6/T1gYxwowG44dg6HN/7aTPdyPbJJidf6ajoA3RPHHtW0j9KMrSOLpIZpAnPpg==", + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true, - "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.2.4", - "core-js-compat": "^3.18.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "peer": true, + "engines": { + "node": ">= 4" } }, - "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.3.tgz", - "integrity": "sha512-JVE78oRZPKFIeUqFGrSORNzQnrDwZR16oiWeGM8ZyjBn2XAT5OjP+wXx5ESuo33nUsFUEJYjtklnsKbxW5L+7g==", + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, + "peer": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.2.4" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "dependencies": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "peer": true, + "engines": { + "node": ">=4" } }, - "node_modules/babel-preset-jest": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", - "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", + "node_modules/import-local": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", + "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", "dev": true, "dependencies": { - "babel-plugin-jest-hoist": "^26.6.2", - "babel-preset-current-node-syntax": "^1.0.0" - }, - "engines": { - "node": ">= 10.14.2" + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "dependencies": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" + "bin": { + "import-local-fixture": "fixtures/cli.js" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/base/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, + "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.8.19" } }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, - "engines": { - "node": "*" + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" } }, - "node_modules/binary-extensions": { + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/interpret": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true, - "optional": true, "engines": { - "node": ">=8" + "node": ">= 0.10" } }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "node_modules/is-core-module": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", + "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", "dev": true, - "optional": true, "dependencies": { - "file-uri-to-path": "1.0.0" + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "node_modules/browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" + "engines": { + "node": ">=0.12.0" } }, - "node_modules/browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "dependencies": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/browserify-rsa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true, - "dependencies": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", - "dev": true, - "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - } - }, - "node_modules/browserify-sign/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "node_modules/jasmine": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-4.0.2.tgz", + "integrity": "sha512-YsrgxJQEggxzByYe4j68eQLOiQeSrPDYGv4sHhGBp3c6HHdq+uPXeAQ73kOAQpdLZ3/0zN7x/TZTloqeE1/qIA==", "dev": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "glob": "^7.1.6", + "jasmine-core": "^4.0.0" }, - "engines": { - "node": ">= 6" + "bin": { + "jasmine": "bin/jasmine.js" } }, - "node_modules/browserify-sign/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "node_modules/jasmine-core": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-4.0.0.tgz", + "integrity": "sha512-tq24OCqHElgU9KDpb/8O21r1IfotgjIzalfW9eCmRR40LZpvwXT68iariIyayMwi0m98RDt16aljdbwK0sBMmQ==", + "dev": true }, - "node_modules/browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "node_modules/jasmine-spec-reporter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-7.0.0.tgz", + "integrity": "sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==", "dev": true, "dependencies": { - "pako": "~1.0.5" + "colors": "1.4.0" } }, - "node_modules/browserslist": { - "version": "4.17.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.6.tgz", - "integrity": "sha512-uPgz3vyRTlEiCv4ee9KlsKgo2V6qPk7Jsn0KAn2OBqbqKo3iNcPEC1Ti6J4dwnz+aIRfEEEuOzC9IBk8tXUomw==", + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, "dependencies": { - "caniuse-lite": "^1.0.30001274", - "electron-to-chromium": "^1.3.886", - "escalade": "^3.1.1", - "node-releases": "^2.0.1", - "picocolors": "^1.0.0" - }, - "bin": { - "browserslist": "cli.js" + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" }, "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" + "node": ">= 10.13.0" } }, - "node_modules/bser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "node-int64": "^0.4.0" + "engines": { + "node": ">=8" } }, - "node_modules/buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "node_modules/builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, - "node_modules/cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "dev": true, - "dependencies": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - } - }, - "node_modules/cacache/node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/cacache/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "peer": true, "dependencies": { - "glob": "^7.1.3" + "argparse": "^2.0.1" }, "bin": { - "rimraf": "bin.js" + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/cacache/node_modules/ssri": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", - "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, - "dependencies": { - "figgy-pudding": "^3.5.1" + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" } }, - "node_modules/cacache/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "node_modules/cacache/node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, - "node_modules/cache-base": { + "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true, - "dependencies": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } + "peer": true }, - "node_modules/cache-base/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "node_modules/json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" + "bin": { + "json5": "lib/cli.js" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/cache-base/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/cache-base/node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "peer": true, "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.8.0" } }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "node_modules/loader-runner": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", + "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=6.11.5" } }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "node_modules/loader-utils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", + "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, "engines": { - "node": ">=6" + "node": ">=8.9.0" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/caniuse-lite": { - "version": "1.0.30001278", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001278.tgz", - "integrity": "sha512-mpF9KeH8u5cMoEmIic/cr7PNS+F5LWBk0t2ekGT60lFf0Wq+n9LspAj0g3P+o7DQhD3sUdlMln4YFAWhFYn9jg==", + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - } + "peer": true }, - "node_modules/capture-exit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", - "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "dependencies": { - "rsvp": "^4.8.4" + "semver": "^6.0.0" }, "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { - "node": ">=4" + "node": ">=8.6" } }, - "node_modules/char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "node_modules/mime-db": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", + "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==", "dev": true, "engines": { - "node": ">=10" + "node": ">= 0.6" } }, - "node_modules/chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "node_modules/mime-types": { + "version": "2.1.33", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", + "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", "dev": true, - "optional": true, "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "mime-db": "1.50.0" }, "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "node": ">= 0.6" } }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } }, - "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, "engines": { - "node": ">=6.0" + "node": "*" } }, - "node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "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/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } + "peer": true }, - "node_modules/cjs-module-lexer": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", - "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", + "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==", "dev": true }, - "node_modules/class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, "engines": { "node": ">=0.10.0" } }, - "node_modules/class-utils/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, "dependencies": { - "is-descriptor": "^0.1.0" + "path-key": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/class-utils/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" } }, - "node_modules/class-utils/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/class-utils/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" + "wrappy": "1" } }, - "node_modules/class-utils/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, "dependencies": { - "is-buffer": "^1.1.5" + "mimic-fn": "^2.1.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/class-utils/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, + "peer": true, "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.8.0" } }, - "node_modules/class-utils/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" + "node": ">=6" } }, - "node_modules/collect-v8-coverage": { + "node_modules/parent-module": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", - "dev": true - }, - "node_modules/collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "peer": true, "dependencies": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" + "callsites": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, - "dependencies": { - "color-name": "1.1.3" + "engines": { + "node": ">=8" } }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, "engines": { - "node": ">= 0.8" + "node": ">=8" } }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, - "node_modules/component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", "dev": true }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, - "engines": [ - "node >= 0.8" - ], "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "node_modules/constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } }, - "node_modules/convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" + "engines": { + "node": ">=6" } }, - "node_modules/copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "dependencies": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" + "safe-buffer": "^5.1.0" } }, - "node_modules/copy-concurrently/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "node_modules/rechoir": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", "dev": true, "dependencies": { - "glob": "^7.1.3" + "resolve": "^1.9.0" }, - "bin": { - "rimraf": "bin.js" + "engines": { + "node": ">= 0.10" } }, - "node_modules/copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz", + "integrity": "sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw==", "dev": true, + "dependencies": { + "regenerate": "^1.4.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/core-js-compat": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.19.1.tgz", - "integrity": "sha512-Q/VJ7jAF/y68+aUsQJ/afPOewdsGkDtcMb40J8MbuWKlK3Y+wtHq8bTHKPj2WKWLIqmS5JhHs4CzHtz6pT2W6g==", + "node_modules/regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "dev": true + }, + "node_modules/regenerator-transform": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", "dev": true, "dependencies": { - "browserslist": "^4.17.6", - "semver": "7.0.0" + "@babel/runtime": "^7.8.4" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" + "url": "https://github.com/sponsors/mysticatea" } }, - "node_modules/core-js-compat/node_modules/semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "node_modules/regexpu-core": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.0.1.tgz", + "integrity": "sha512-CriEZlrKK9VJw/xQGJpQM5rY88BtuL8DM+AEwvcThHilbxiTAy8vq4iJnd2tqq8wLmjbGZzP7ZcKFjbGkmEFrw==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.0.1", + "regjsgen": "^0.6.0", + "regjsparser": "^0.8.2", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "node_modules/regjsgen": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.6.0.tgz", + "integrity": "sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA==", "dev": true }, - "node_modules/create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "node_modules/regjsparser": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.8.4.tgz", + "integrity": "sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA==", "dev": true, "dependencies": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" } }, - "node_modules/create-ecdh/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "dev": true, - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" + "bin": { + "jsesc": "bin/jsesc" } }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "resolve-from": "^5.0.0" }, "engines": { - "node": ">= 8" + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" } }, - "node_modules/crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, + "peer": true, "dependencies": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" + "glob": "^7.1.3" }, - "engines": { - "node": "*" + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "node_modules/schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", "dev": true, "dependencies": { - "cssom": "~0.3.6" + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" }, "engines": { - "node": ">=8" + "node": ">= 8.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } }, - "node_modules/cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } }, - "node_modules/data-urls": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", - "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", "dev": true, "dependencies": { - "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0" + "kind-of": "^6.0.2" }, "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "dependencies": { - "ms": "2.1.2" + "shebang-regex": "^3.0.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=8" } }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", + "node_modules/signal-exit": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", + "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", "dev": true }, - "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "node_modules/source-map-support": { + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", + "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", "dev": true, "dependencies": { - "object-keys": "^1.0.12" - }, - "engines": { - "node": ">= 0.4" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "node_modules/define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "dependencies": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, "engines": { "node": ">=0.10.0" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "peer": true, "dependencies": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "node_modules/detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true, + "ansi-regex": "^5.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/detect-newline": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/diff-sequences": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", - "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "peer": true, "engines": { - "node": ">= 10.14.2" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/diffie-hellman/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true, "engines": { - "node": ">=0.4", - "npm": ">=1.2" + "node": ">=6" } }, - "node_modules/domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "node_modules/terser": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", + "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", "dev": true, "dependencies": { - "webidl-conversions": "^5.0.0" + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" }, "engines": { - "node": ">=8" - } - }, - "node_modules/domexception/node_modules/webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true, - "engines": { - "node": ">=8" + "node": ">=10" + }, + "peerDependencies": { + "acorn": "^8.5.0" + }, + "peerDependenciesMeta": { + "acorn": { + "optional": true + } } }, - "node_modules/duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "node_modules/terser-webpack-plugin": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.0.tgz", + "integrity": "sha512-LPIisi3Ol4chwAaPP8toUJ3L4qCM1G0wao7L3qNv57Drezxj6+VEyySpPw4B1HSO2Eg/hDY/MNF5XihCAoqnsQ==", "dev": true, "dependencies": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" + "jest-worker": "^27.4.1", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.0", + "source-map": "^0.6.1", + "terser": "^5.7.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } } }, - "node_modules/electron-to-chromium": { - "version": "1.3.890", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.890.tgz", - "integrity": "sha512-VWlVXSkv0cA/OOehrEyqjUTHwV8YXCPTfPvbtoeU2aHR21vI4Ejh5aC4AxUwOmbLbBgb6Gd3URZahoCxtBqCYQ==", - "dev": true - }, - "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "node_modules/terser-webpack-plugin/node_modules/schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/emittery": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", - "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==", - "dev": true, + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, "engines": { - "node": ">=10" + "node": ">= 10.13.0" }, "funding": { - "url": "https://github.com/sindresorhus/emittery?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "node_modules/terser-webpack-plugin/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "engines": { - "node": ">= 4" + "node": ">=0.10.0" } }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "node_modules/terser/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true, - "dependencies": { - "once": "^1.4.0" + "engines": { + "node": ">= 8" } }, - "node_modules/enhanced-resolve": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", - "integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==", + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" - }, - "engines": { - "node": ">=6.9.0" - } + "peer": true }, - "node_modules/enhanced-resolve/node_modules/memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true, - "dependencies": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - }, "engines": { - "node": ">=4.3.0 <5.0.0 || >=5.10" + "node": ">=4" } }, - "node_modules/errno": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", - "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "dependencies": { - "prr": "~1.0.1" + "is-number": "^7.0.0" }, - "bin": { - "errno": "cli.js" + "engines": { + "node": ">=8.0" } }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "peer": true, "dependencies": { - "is-arrayish": "^0.2.1" + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" } }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, + "peer": true, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", "dev": true, "engines": { - "node": ">=0.8.0" + "node": ">=4" } }, - "node_modules/escodegen": { + "node_modules/unicode-match-property-ecmascript": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", "dev": true, "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" }, "engines": { - "node": ">=6.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" + "node": ">=4" } }, - "node_modules/escodegen/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", + "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", "dev": true, - "optional": true, "engines": { - "node": ">=0.10.0" + "node": ">=4" } }, - "node_modules/eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", + "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", "dev": true, - "dependencies": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - }, "engines": { - "node": ">=4.0.0" + "node": ">=4" } }, - "node_modules/eslint-scope/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, - "engines": { - "node": ">=4.0" + "dependencies": { + "punycode": "^2.1.0" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "peer": true + }, + "node_modules/watchpack": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", + "integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==", + "dev": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" }, "engines": { - "node": ">=4" + "node": ">=10.13.0" } }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" + "node_modules/webpack": { + "version": "5.66.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.66.0.tgz", + "integrity": "sha512-NJNtGT7IKpGzdW7Iwpn/09OXz9inIkeIQ/ibY6B+MdV1x6+uReqz/5z1L89ezWnpPDWpXF0TY5PCYKQdWVn8Vg==", + "dev": true, + "dependencies": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.50", + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/wasm-edit": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "acorn": "^8.4.1", + "acorn-import-assertions": "^1.7.6", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.8.3", + "es-module-lexer": "^0.9.0", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.1.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.3", + "watchpack": "^2.3.1", + "webpack-sources": "^3.2.2" + }, + "bin": { + "webpack": "bin/webpack.js" }, "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } } }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, + "node_modules/webpack-cli": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.1.tgz", + "integrity": "sha512-JYRFVuyFpzDxMDB+v/nanUdQYcZtqFPGzmlW4s+UkPMFhSpfRNmf1z4AwYcHJVdvEFAM7FFCQdNTpsBYhDLusQ==", + "dev": true, + "dependencies": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^1.1.0", + "@webpack-cli/info": "^1.4.0", + "@webpack-cli/serve": "^1.6.0", + "colorette": "^2.0.14", + "commander": "^7.0.0", + "execa": "^5.0.0", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "rechoir": "^0.7.0", + "webpack-merge": "^5.7.3" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10.13.0" + }, + "peerDependencies": { + "webpack": "4.x.x || 5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "@webpack-cli/migrate": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } } }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "node_modules/webpack-cli/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true, "engines": { - "node": ">=0.8.x" - } - }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" + "node": ">= 10" } }, - "node_modules/exec-sh": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.6.tgz", - "integrity": "sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w==", - "dev": true - }, - "node_modules/execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "node_modules/webpack-cli/node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" }, "engines": { @@ -4522,16880 +4384,3051 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "node_modules/webpack-cli/node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", "dev": true, "engines": { - "node": ">= 0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "node_modules/webpack-cli/node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true, - "dependencies": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, "engines": { - "node": ">=0.10.0" + "node": ">=10.17.0" } }, - "node_modules/expand-brackets/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/webpack-merge": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", + "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", "dev": true, "dependencies": { - "ms": "2.0.0" + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" } }, - "node_modules/expand-brackets/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, "engines": { - "node": ">=0.10.0" + "node": ">=10.13.0" } }, - "node_modules/expand-brackets/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "node_modules/webpack/node_modules/schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "dependencies": { - "is-extendable": "^0.1.0" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" }, "engines": { - "node": ">=0.10.0" + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/expand-brackets/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "dependencies": { - "kind-of": "^3.0.2" + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" }, "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, - "node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "node_modules/wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, + "peer": true, "engines": { "node": ">=0.10.0" } }, - "node_modules/expand-brackets/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + }, + "dependencies": { + "@ampproject/remapping": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.1.2.tgz", + "integrity": "sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==", "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" + "peer": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.0" } }, - "node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "@babel/code-frame": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/highlight": "^7.16.7" + } + }, + "@babel/compat-data": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", + "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", + "dev": true + }, + "@babel/core": { + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz", + "integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==", + "dev": true, + "peer": true, + "requires": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.7", + "@babel/helper-compilation-targets": "^7.17.7", + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helpers": "^7.17.8", + "@babel/parser": "^7.17.8", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0" } }, - "node_modules/expand-brackets/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "@babel/generator": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" } }, - "node_modules/expand-brackets/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "@babel/helper-annotate-as-pure": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", + "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.16.7" } }, - "node_modules/expand-brackets/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz", + "integrity": "sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-explode-assignable-expression": "^7.16.7", + "@babel/types": "^7.16.7" } }, - "node_modules/expand-brackets/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "@babel/helper-compilation-targets": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", + "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.17.7", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.17.5", + "semver": "^6.3.0" + } }, - "node_modules/expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "@babel/helper-create-class-features-plugin": { + "version": "7.17.6", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.6.tgz", + "integrity": "sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg==", "dev": true, - "dependencies": { - "homedir-polyfill": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7" } }, - "node_modules/expect": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", - "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", + "@babel/helper-create-regexp-features-plugin": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.17.0.tgz", + "integrity": "sha512-awO2So99wG6KnlE+TPs6rn83gCz5WlEePJDTnLEqbchMVrBeAujURVphRdigsk094VhvZehFoNOihSlcBjwsXA==", "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "ansi-styles": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.7", + "regexpu-core": "^5.0.1" } }, - "node_modules/expect/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "@babel/helper-define-polyfill-provider": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz", + "integrity": "sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "@babel/helper-compilation-targets": "^7.13.0", + "@babel/helper-module-imports": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/traverse": "^7.13.0", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2", + "semver": "^6.1.2" } }, - "node_modules/expect/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "@babel/helper-environment-visitor": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "requires": { + "@babel/types": "^7.16.7" } }, - "node_modules/expect/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "@babel/helper-explode-assignable-expression": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz", + "integrity": "sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ==", + "dev": true, + "requires": { + "@babel/types": "^7.16.7" + } }, - "node_modules/extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "@babel/helper-function-name": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", "dev": true, - "dependencies": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" } }, - "node_modules/extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "@babel/helper-get-function-arity": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", "dev": true, - "dependencies": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.16.7" } }, - "node_modules/extglob/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "@babel/helper-hoist-variables": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.16.7" } }, - "node_modules/extglob/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "@babel/helper-member-expression-to-functions": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.17.7.tgz", + "integrity": "sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw==", "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.17.0" } }, - "node_modules/extglob/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "@babel/helper-module-imports": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.16.7" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "@babel/helper-module-transforms": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", + "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0" + } }, - "node_modules/fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "@babel/helper-optimise-call-expression": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz", + "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==", "dev": true, - "dependencies": { - "bser": "2.1.1" + "requires": { + "@babel/types": "^7.16.7" } }, - "node_modules/figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "@babel/helper-plugin-utils": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", "dev": true }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "@babel/helper-remap-async-to-generator": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz", + "integrity": "sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw==", "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-wrap-function": "^7.16.8", + "@babel/types": "^7.16.8" } }, - "node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "@babel/helper-replace-supers": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz", + "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==", "dev": true, - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + "requires": { + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-member-expression-to-functions": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/traverse": "^7.16.7", + "@babel/types": "^7.16.7" } }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "@babel/helper-simple-access": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", + "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/types": "^7.17.0" } }, - "node_modules/findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", + "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", "dev": true, - "dependencies": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - }, - "engines": { - "node": ">= 0.10" + "requires": { + "@babel/types": "^7.16.0" } }, - "node_modules/findup-sync/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "@babel/helper-split-export-declaration": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", "dev": true, - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/types": "^7.16.7" } }, - "node_modules/findup-sync/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "@babel/helper-validator-identifier": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz", + "integrity": "sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw==", "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-function-name": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.16.8", + "@babel/types": "^7.16.8" } }, - "node_modules/findup-sync/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "@babel/helpers": { + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.8.tgz", + "integrity": "sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==", "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" + "peer": true, + "requires": { + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0" } }, - "node_modules/findup-sync/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "@babel/highlight": { + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" } }, - "node_modules/findup-sync/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "@babel/parser": { + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", + "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==", + "dev": true + }, + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz", + "integrity": "sha512-anv/DObl7waiGEnC24O9zqL0pSuI9hljihqiDuFHC8d7/bjr/4RLGPWuc8rYOff/QPzbEPSkzG8wGG9aDuhHRg==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/findup-sync/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.7.tgz", + "integrity": "sha512-di8vUHRdf+4aJ7ltXhaDbPoszdkh59AQtJM5soLsuHpQJdFQZOA4uGj0V2u/CZ8bJ/u8ULDL5yq6FO/bCXnKHw==", "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", + "@babel/plugin-proposal-optional-chaining": "^7.16.7" } }, - "node_modules/findup-sync/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz", + "integrity": "sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ==", "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-remap-async-to-generator": "^7.16.8", + "@babel/plugin-syntax-async-generators": "^7.8.4" } }, - "node_modules/findup-sync/node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "@babel/plugin-proposal-class-properties": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz", + "integrity": "sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==", "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-create-class-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/findup-sync/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "@babel/plugin-proposal-class-static-block": { + "version": "7.17.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.17.6.tgz", + "integrity": "sha512-X/tididvL2zbs7jZCeeRJ8167U/+Ac135AM6jCAx6gYXDUviZV5Ku9UDvWS2NCuWlFjIRXklYhwo6HhAC7ETnA==", "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-create-class-features-plugin": "^7.17.6", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-class-static-block": "^7.14.5" } }, - "node_modules/flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "@babel/plugin-proposal-dynamic-import": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz", + "integrity": "sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg==", "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" } }, - "node_modules/for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "@babel/plugin-proposal-export-namespace-from": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.7.tgz", + "integrity": "sha512-ZxdtqDXLRGBL64ocZcs7ovt71L3jhC1RGSyR996svrCi3PYqHNkb3SwPJCs8RIzD86s+WPpt2S73+EHCGO+NUA==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" } }, - "node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "@babel/plugin-proposal-json-strings": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz", + "integrity": "sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ==", "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-json-strings": "^7.8.3" } }, - "node_modules/fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "@babel/plugin-proposal-logical-assignment-operators": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.7.tgz", + "integrity": "sha512-K3XzyZJGQCr00+EtYtrDjmwX7o7PLK6U9bi1nCwkQioRFVUv6dJoxbQjtWVtP+bCPy82bONBKG8NPyQ4+i6yjg==", "dev": true, - "dependencies": { - "map-cache": "^0.2.2" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" } }, - "node_modules/from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz", + "integrity": "sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ==", "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" } }, - "node_modules/fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "@babel/plugin-proposal-numeric-separator": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz", + "integrity": "sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw==", "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.17.3.tgz", + "integrity": "sha512-yuL5iQA/TbZn+RGAfxQXfi7CNLmKi1f8zInn4IgobuCWcAb7i+zj4TYzQ9l8cEzVyJ89PDGuqxK1xZpUDISesw==", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "requires": { + "@babel/compat-data": "^7.17.0", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.16.7" } }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz", + "integrity": "sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA==", "dev": true, - "engines": { - "node": ">=6.9.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "@babel/plugin-proposal-optional-chaining": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.7.tgz", + "integrity": "sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA==", "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" } }, - "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "@babel/plugin-proposal-private-methods": { + "version": "7.16.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz", + "integrity": "sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "requires": { + "@babel/helper-create-class-features-plugin": "^7.16.10", + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "@babel/plugin-proposal-private-property-in-object": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.7.tgz", + "integrity": "sha512-rMQkjcOFbm+ufe3bTZLyOfsOUOxyvLXZJCTARhJr+8UMSoZmqTe1K1BgkFcrW37rAchWg57yI69ORxiWvUINuQ==", "dev": true, - "engines": { - "node": ">=8.0.0" + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-create-class-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" } }, - "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz", + "integrity": "sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg==", "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", "dev": true, - "optional": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" } }, - "node_modules/global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", "dev": true, - "dependencies": { - "global-prefix": "^3.0.0" - }, - "engines": { - "node": ">=6" + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, - "node_modules/global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "@babel/plugin-syntax-export-namespace-from": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", "dev": true, - "dependencies": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - }, - "engines": { - "node": ">=6" + "requires": { + "@babel/helper-plugin-utils": "^7.8.3" } }, - "node_modules/global-prefix/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, - "engines": { - "node": ">=4" + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" } }, - "node_modules/graceful-fs": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", - "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", - "dev": true - }, - "node_modules/growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, - "optional": true + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" } }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, - "engines": { - "node": ">=4" + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, - "node_modules/has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, - "node_modules/has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, - "dependencies": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" } }, - "node_modules/has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" } }, - "node_modules/has-values/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" } }, - "node_modules/has-values/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "@babel/plugin-transform-arrow-functions": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz", + "integrity": "sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ==", "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/has-values/node_modules/kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "@babel/plugin-transform-async-to-generator": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz", + "integrity": "sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg==", "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-remap-async-to-generator": "^7.16.8" } }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz", + "integrity": "sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg==", "dev": true, - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/hash-base/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "@babel/plugin-transform-block-scoping": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz", + "integrity": "sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ==", "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/hash-base/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "@babel/plugin-transform-classes": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz", + "integrity": "sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-optimise-call-expression": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "globals": "^11.1.0" + } }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "@babel/plugin-transform-computed-properties": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz", + "integrity": "sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw==", "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "@babel/plugin-transform-destructuring": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.17.7.tgz", + "integrity": "sha512-XVh0r5yq9sLR4vZ6eVZe8FKfIcSgaTBxVBRSYokRj2qksf6QerYnTxz9/GTuKTH/n/HwLP7t6gtlybHetJ/6hQ==", "dev": true, - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "@babel/plugin-transform-dotall-regex": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz", + "integrity": "sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ==", "dev": true, - "dependencies": { - "parse-passwd": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/hosted-git-info": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", - "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", + "@babel/plugin-transform-duplicate-keys": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz", + "integrity": "sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "engines": { - "node": ">=10" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz", + "integrity": "sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA==", "dev": true, - "dependencies": { - "whatwg-encoding": "^1.0.5" - }, - "engines": { - "node": ">=10" + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "@babel/plugin-transform-for-of": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz", + "integrity": "sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg==", "dev": true, - "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "@babel/plugin-transform-function-name": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz", + "integrity": "sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA==", "dev": true, - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" + "requires": { + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "@babel/plugin-transform-literals": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz", + "integrity": "sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ==", "dev": true, - "engines": { - "node": ">=8.12.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "@babel/plugin-transform-member-expression-literals": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz", + "integrity": "sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw==", "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "@babel/plugin-transform-modules-amd": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz", + "integrity": "sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true + "requires": { + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "babel-plugin-dynamic-import-node": "^2.3.3" + } }, - "node_modules/import-local": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", - "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", + "@babel/plugin-transform-modules-commonjs": { + "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.17.7.tgz", + "integrity": "sha512-ITPmR2V7MqioMJyrxUo2onHNC3e+MvfFiFIR0RP21d3PtlVb6sfzoxNKiphSZUOM9hEIdzCcZe83ieX3yoqjUA==", "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "babel-plugin-dynamic-import-node": "^2.3.3" } }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "@babel/plugin-transform-modules-systemjs": { + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.17.8.tgz", + "integrity": "sha512-39reIkMTUVagzgA5x88zDYXPCMT6lcaRKs1+S9K6NKBPErbgO/w/kP8GlNQTC87b412ZTlmNgr3k2JrWgHH+Bw==", "dev": true, - "engines": { - "node": ">=0.8.19" + "requires": { + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "babel-plugin-dynamic-import-node": "^2.3.3" } }, - "node_modules/infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "@babel/plugin-transform-modules-umd": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz", + "integrity": "sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ==", "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "requires": { + "@babel/helper-module-transforms": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/ini": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.6.tgz", - "integrity": "sha512-IZUoxEjNjubzrmvzZU4lKP7OnYmX72XRl3sqkfJhBKweKi5rnGi5+IUdlj/H1M+Ip5JQ1WzaDMOBRY90Ajc5jg==", + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.16.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz", + "integrity": "sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw==", "dev": true, - "engines": { - "node": "*" + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.16.7" } }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "@babel/plugin-transform-new-target": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz", + "integrity": "sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg==", "dev": true, - "engines": { - "node": ">= 0.10" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "@babel/plugin-transform-object-super": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz", + "integrity": "sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw==", "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-replace-supers": "^7.16.7" } }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "@babel/plugin-transform-parameters": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz", + "integrity": "sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw==", "dev": true, - "optional": true, - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "@babel/plugin-transform-property-literals": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz", + "integrity": "sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw==", "dev": true, - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/is-core-module": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", - "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", + "@babel/plugin-transform-regenerator": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.7.tgz", + "integrity": "sha512-mF7jOgGYCkSJagJ6XCujSQg+6xC1M77/03K2oBmVJWoFGNUtnVJO4WHKJk3dnPC8HCcj4xBQP1Egm8DWh3Pb3Q==", "dev": true, - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "requires": { + "regenerator-transform": "^0.14.2" } }, - "node_modules/is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "@babel/plugin-transform-reserved-words": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.7.tgz", + "integrity": "sha512-KQzzDnZ9hWQBjwi5lpY5v9shmm6IVG0U9pB18zvMu2i4H90xpT4gmqwPYsn8rObiadYe2M0gmgsiOIF5A/2rtg==", "dev": true, - "dependencies": { - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "@babel/plugin-transform-shorthand-properties": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz", + "integrity": "sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg==", "dev": true, - "dependencies": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "@babel/plugin-transform-spread": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz", + "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==", "dev": true, - "optional": true, - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" } }, - "node_modules/is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "@babel/plugin-transform-sticky-regex": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz", + "integrity": "sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw==", "dev": true, - "dependencies": { - "is-plain-object": "^2.0.4" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "@babel/plugin-transform-template-literals": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz", + "integrity": "sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "@babel/plugin-transform-typeof-symbol": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz", + "integrity": "sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ==", "dev": true, - "engines": { - "node": ">=8" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "@babel/plugin-transform-unicode-escapes": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz", + "integrity": "sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q==", "dev": true, - "engines": { - "node": ">=6" + "requires": { + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "@babel/plugin-transform-unicode-regex": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz", + "integrity": "sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q==", "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" + "@babel/preset-env": { + "version": "7.16.11", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.11.tgz", + "integrity": "sha512-qcmWG8R7ZW6WBRPZK//y+E3Cli151B20W1Rv7ln27vuPaXU/8TKms6jFdiJtF7UDTxcrb7mZd88tAeK9LjdT8g==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.16.8", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-validator-option": "^7.16.7", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.7", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.7", + "@babel/plugin-proposal-async-generator-functions": "^7.16.8", + "@babel/plugin-proposal-class-properties": "^7.16.7", + "@babel/plugin-proposal-class-static-block": "^7.16.7", + "@babel/plugin-proposal-dynamic-import": "^7.16.7", + "@babel/plugin-proposal-export-namespace-from": "^7.16.7", + "@babel/plugin-proposal-json-strings": "^7.16.7", + "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7", + "@babel/plugin-proposal-numeric-separator": "^7.16.7", + "@babel/plugin-proposal-object-rest-spread": "^7.16.7", + "@babel/plugin-proposal-optional-catch-binding": "^7.16.7", + "@babel/plugin-proposal-optional-chaining": "^7.16.7", + "@babel/plugin-proposal-private-methods": "^7.16.11", + "@babel/plugin-proposal-private-property-in-object": "^7.16.7", + "@babel/plugin-proposal-unicode-property-regex": "^7.16.7", + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5", + "@babel/plugin-transform-arrow-functions": "^7.16.7", + "@babel/plugin-transform-async-to-generator": "^7.16.8", + "@babel/plugin-transform-block-scoped-functions": "^7.16.7", + "@babel/plugin-transform-block-scoping": "^7.16.7", + "@babel/plugin-transform-classes": "^7.16.7", + "@babel/plugin-transform-computed-properties": "^7.16.7", + "@babel/plugin-transform-destructuring": "^7.16.7", + "@babel/plugin-transform-dotall-regex": "^7.16.7", + "@babel/plugin-transform-duplicate-keys": "^7.16.7", + "@babel/plugin-transform-exponentiation-operator": "^7.16.7", + "@babel/plugin-transform-for-of": "^7.16.7", + "@babel/plugin-transform-function-name": "^7.16.7", + "@babel/plugin-transform-literals": "^7.16.7", + "@babel/plugin-transform-member-expression-literals": "^7.16.7", + "@babel/plugin-transform-modules-amd": "^7.16.7", + "@babel/plugin-transform-modules-commonjs": "^7.16.8", + "@babel/plugin-transform-modules-systemjs": "^7.16.7", + "@babel/plugin-transform-modules-umd": "^7.16.7", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.8", + "@babel/plugin-transform-new-target": "^7.16.7", + "@babel/plugin-transform-object-super": "^7.16.7", + "@babel/plugin-transform-parameters": "^7.16.7", + "@babel/plugin-transform-property-literals": "^7.16.7", + "@babel/plugin-transform-regenerator": "^7.16.7", + "@babel/plugin-transform-reserved-words": "^7.16.7", + "@babel/plugin-transform-shorthand-properties": "^7.16.7", + "@babel/plugin-transform-spread": "^7.16.7", + "@babel/plugin-transform-sticky-regex": "^7.16.7", + "@babel/plugin-transform-template-literals": "^7.16.7", + "@babel/plugin-transform-typeof-symbol": "^7.16.7", + "@babel/plugin-transform-unicode-escapes": "^7.16.7", + "@babel/plugin-transform-unicode-regex": "^7.16.7", + "@babel/preset-modules": "^0.1.5", + "@babel/types": "^7.16.8", + "babel-plugin-polyfill-corejs2": "^0.3.0", + "babel-plugin-polyfill-corejs3": "^0.5.0", + "babel-plugin-polyfill-regenerator": "^0.3.0", + "core-js-compat": "^3.20.2", + "semver": "^6.3.0" } }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "@babel/preset-modules": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", + "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" } }, - "node_modules/is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true - }, - "node_modules/is-primitive": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-3.0.1.tgz", - "integrity": "sha512-GljRxhWvlCNRfZyORiH77FwdFwGcMO620o37EOYC0ORWdq+WYNVqW0w2Juzew4M+L81l6/QS3t5gkkihyRqv9w==", + "@babel/runtime": { + "version": "7.17.8", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.8.tgz", + "integrity": "sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "regenerator-runtime": "^0.13.4" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "@babel/template": { + "version": "7.16.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true + "@babel/traverse": { + "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", + "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.3", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.17.3", + "@babel/types": "^7.17.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + } }, - "node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "@babel/types": { + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" } }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "@discoveryjs/json-ext": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz", + "integrity": "sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==", + "dev": true + }, + "@eslint/eslintrc": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", + "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", "dev": true, - "optional": true, - "dependencies": { - "is-docker": "^2.0.0" + "peer": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.3.1", + "globals": "^13.9.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" }, - "engines": { - "node": ">=8" + "dependencies": { + "globals": { + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", + "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "dev": true, + "peer": true, + "requires": { + "type-fest": "^0.20.2" + } + } } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "@humanwhocodes/config-array": { + "version": "0.9.5", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", + "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", "dev": true, - "engines": { - "node": ">=0.10.0" + "peer": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" } }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true, - "engines": { - "node": ">=8" - } + "peer": true }, - "node_modules/istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "@jridgewell/resolve-uri": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", + "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", "dev": true, - "dependencies": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } + "peer": true }, - "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "@jridgewell/sourcemap-codec": { + "version": "1.4.11", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", + "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", "dev": true, - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } + "peer": true }, - "node_modules/istanbul-lib-report/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "@jridgewell/trace-mapping": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", + "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", "dev": true, - "engines": { - "node": ">=8" + "peer": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/istanbul-lib-report/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "@types/eslint": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.2.2.tgz", + "integrity": "sha512-nQxgB8/Sg+QKhnV8e0WzPpxjIGT3tuJDDzybkDi8ItE/IgTlHo07U0shaIjzhcvQxlq9SDRE42lsJ23uvEgJ2A==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "@types/eslint-scope": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", + "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", "dev": true, - "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, - "engines": { - "node": ">=10" + "requires": { + "@types/eslint": "*", + "@types/estree": "*" } }, - "node_modules/istanbul-lib-source-maps/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "@types/estree": { + "version": "0.0.50", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz", + "integrity": "sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw==", + "dev": true }, - "node_modules/istanbul-reports": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.5.tgz", - "integrity": "sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ==", - "dev": true, - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, - "engines": { - "node": ">=8" - } + "@types/json-schema": { + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", + "dev": true }, - "node_modules/jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", - "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", - "dev": true, - "dependencies": { - "@jest/core": "^26.6.3", - "import-local": "^3.0.2", - "jest-cli": "^26.6.3" - }, - "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": ">= 10.14.2" - } + "@types/node": { + "version": "16.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", + "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", + "dev": true }, - "node_modules/jest-changed-files": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", - "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", + "@webassemblyjs/ast": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", + "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "execa": "^4.0.0", - "throat": "^5.0.0" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "@webassemblyjs/helper-numbers": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1" } }, - "node_modules/jest-cli": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", - "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", + "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", + "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", + "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "dev": true + }, + "@webassemblyjs/helper-numbers": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", + "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", "dev": true, - "dependencies": { - "@jest/core": "^26.6.3", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "import-local": "^3.0.2", - "is-ci": "^2.0.0", - "jest-config": "^26.6.3", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "prompts": "^2.0.1", - "yargs": "^15.4.1" - }, - "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "@webassemblyjs/floating-point-hex-parser": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@xtuc/long": "4.2.2" } }, - "node_modules/jest-cli/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", + "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", + "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1" } }, - "node_modules/jest-cli/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "@webassemblyjs/ieee754": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", + "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "requires": { + "@xtuc/ieee754": "^1.2.0" } }, - "node_modules/jest-cli/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "@webassemblyjs/leb128": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", + "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "requires": { + "@xtuc/long": "4.2.2" } }, - "node_modules/jest-cli/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "@webassemblyjs/utf8": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", + "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", "dev": true }, - "node_modules/jest-cli/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "@webassemblyjs/wasm-edit": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", + "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", "dev": true, - "engines": { - "node": ">=8" + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/helper-wasm-section": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-opt": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "@webassemblyjs/wast-printer": "1.11.1" } }, - "node_modules/jest-cli/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "@webassemblyjs/wasm-gen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", + "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, - "node_modules/jest-config": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", - "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", + "@webassemblyjs/wasm-opt": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", + "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", "dev": true, - "dependencies": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.6.3", - "@jest/types": "^26.6.2", - "babel-jest": "^26.6.3", - "chalk": "^4.0.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.1", - "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.6.2", - "jest-environment-node": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.6.3", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" - }, - "peerDependencies": { - "ts-node": ">=9.0.0" - }, - "peerDependenciesMeta": { - "ts-node": { - "optional": true - } + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-buffer": "1.11.1", + "@webassemblyjs/wasm-gen": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1" } }, - "node_modules/jest-config/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "@webassemblyjs/wasm-parser": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", + "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.1", + "@webassemblyjs/ieee754": "1.11.1", + "@webassemblyjs/leb128": "1.11.1", + "@webassemblyjs/utf8": "1.11.1" } }, - "node_modules/jest-config/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "@webassemblyjs/wast-printer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", + "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "requires": { + "@webassemblyjs/ast": "1.11.1", + "@xtuc/long": "4.2.2" } }, - "node_modules/jest-config/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "@webpack-cli/configtest": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.0.tgz", + "integrity": "sha512-ttOkEkoalEHa7RaFYpM0ErK1xc4twg3Am9hfHhL7MVqlHebnkYd2wuI/ZqTDj0cVzZho6PdinY0phFZV3O0Mzg==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-config/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "requires": {} }, - "node_modules/jest-config/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "@webpack-cli/info": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.0.tgz", + "integrity": "sha512-F6b+Man0rwE4n0409FyAJHStYA5OIZERxmnUfLVwv0mc0V1wLad3V7jqRlMkgKBeAq07jUvglacNaa6g9lOpuw==", "dev": true, - "engines": { - "node": ">=8" + "requires": { + "envinfo": "^7.7.3" } }, - "node_modules/jest-config/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "@webpack-cli/serve": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.0.tgz", + "integrity": "sha512-ZkVeqEmRpBV2GHvjjUZqEai2PpUbuq8Bqd//vEYsp63J8WyexI8ppCqVS3Zs0QADf6aWuPdU+0XsPI647PVlQA==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } + "requires": {} }, - "node_modules/jest-diff": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", - "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", - "dev": true, - "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" - } + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true }, - "node_modules/jest-diff/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "dev": true + }, + "acorn-import-assertions": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", + "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } + "requires": {} }, - "node_modules/jest-diff/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } + "peer": true, + "requires": {} }, - "node_modules/jest-diff/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "node_modules/jest-diff/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "requires": {} }, - "node_modules/jest-diff/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "engines": { - "node": ">=8" - } + "peer": true }, - "node_modules/jest-diff/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "color-convert": "^1.9.0" } }, - "node_modules/jest-docblock": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz", - "integrity": "sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w==", + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "dependencies": { - "detect-newline": "^3.0.0" - }, - "engines": { - "node": ">= 10.14.2" + "peer": true + }, + "babel-loader": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.4.tgz", + "integrity": "sha512-8dytA3gcvPPPv4Grjhnt8b5IIiTcq/zeXOPk4iTYI0SVXcsmuGg7JtBRDp8S9X+gJfhQ8ektjXZlDu1Bb33U8A==", + "dev": true, + "requires": { + "find-cache-dir": "^3.3.1", + "loader-utils": "^2.0.0", + "make-dir": "^3.1.0", + "schema-utils": "^2.6.5" } }, - "node_modules/jest-each": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", - "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", + "babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "object.assign": "^4.1.0" } }, - "node_modules/jest-each/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "babel-plugin-polyfill-corejs2": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz", + "integrity": "sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "@babel/compat-data": "^7.13.11", + "@babel/helper-define-polyfill-provider": "^0.3.1", + "semver": "^6.1.1" } }, - "node_modules/jest-each/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "babel-plugin-polyfill-corejs3": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz", + "integrity": "sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "requires": { + "@babel/helper-define-polyfill-provider": "^0.3.1", + "core-js-compat": "^3.21.0" } }, - "node_modules/jest-each/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "babel-plugin-polyfill-regenerator": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz", + "integrity": "sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "requires": { + "@babel/helper-define-polyfill-provider": "^0.3.1" } }, - "node_modules/jest-each/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/jest-each/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true }, - "node_modules/jest-each/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/jest-environment-jsdom": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", - "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, - "dependencies": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2", - "jsdom": "^16.4.0" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "fill-range": "^7.0.1" } }, - "node_modules/jest-environment-node": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", - "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", + "browserslist": { + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", + "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==", "dev": true, - "dependencies": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "caniuse-lite": "^1.0.30001317", + "electron-to-chromium": "^1.4.84", + "escalade": "^3.1.1", + "node-releases": "^2.0.2", + "picocolors": "^1.0.0" } }, - "node_modules/jest-get-type": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", - "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==", + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "dev": true, - "engines": { - "node": ">= 10.14.2" + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" } }, - "node_modules/jest-haste-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", - "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "@types/graceful-fs": "^4.1.2", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.4", - "jest-regex-util": "^26.0.0", - "jest-serializer": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "micromatch": "^4.0.2", - "sane": "^4.0.3", - "walker": "^1.0.7" - }, - "engines": { - "node": ">= 10.14.2" - }, - "optionalDependencies": { - "fsevents": "^2.1.2" - } + "peer": true + }, + "caniuse-lite": { + "version": "1.0.30001324", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001324.tgz", + "integrity": "sha512-/eYp1J6zYh1alySQB4uzYFkLmxxI8tk0kxldbNHXp8+v+rdMKdUBNjRLz7T7fz6Iox+1lIdYpc7rq6ZcXfTukg==", + "dev": true }, - "node_modules/jest-jasmine2": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", - "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, - "dependencies": { - "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "expect": "^26.6.2", - "is-generator-fn": "^2.0.0", - "jest-each": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2", - "throat": "^5.0.0" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, - "node_modules/jest-jasmine2/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } + "chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true }, - "node_modules/jest-jasmine2/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" } }, - "node_modules/jest-jasmine2/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "requires": { + "color-name": "1.1.3" } }, - "node_modules/jest-jasmine2/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "node_modules/jest-jasmine2/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "colorette": { + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", + "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", + "dev": true + }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", "dev": true, - "engines": { - "node": ">=8" + "peer": true, + "requires": { + "safe-buffer": "~5.1.1" } }, - "node_modules/jest-jasmine2/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "core-js-compat": { + "version": "3.21.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.21.1.tgz", + "integrity": "sha512-gbgX5AUvMb8gwxC7FLVWYT7Kkgu/y7+h/h1X43yJkNqhlK2fuYyQimqvKGNZFAY6CKii/GFKJ2cp/1/42TN36g==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" + "requires": { + "browserslist": "^4.19.1", + "semver": "7.0.0" }, - "engines": { - "node": ">=8" + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true + } } }, - "node_modules/jest-leak-detector": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", - "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, - "dependencies": { - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" } }, - "node_modules/jest-matcher-utils": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", - "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, - "dependencies": { - "chalk": "^4.0.0", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "ms": "2.1.2" } }, - "node_modules/jest-matcher-utils/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } + "peer": true }, - "node_modules/jest-matcher-utils/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "requires": { + "object-keys": "^1.0.12" } }, - "node_modules/jest-matcher-utils/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "peer": true, + "requires": { + "esutils": "^2.0.2" } }, - "node_modules/jest-matcher-utils/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "electron-to-chromium": { + "version": "1.4.103", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.103.tgz", + "integrity": "sha512-c/uKWR1Z/W30Wy/sx3dkZoj4BijbXX85QKWu9jJfjho3LBAXNEGAEW3oWiGb+dotA6C6BzCTxL2/aLes7jlUeg==", "dev": true }, - "node_modules/jest-matcher-utils/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-matcher-utils/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true }, - "node_modules/jest-message-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", - "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", + "enhanced-resolve": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz", + "integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==", "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", + "requires": { "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2", - "slash": "^3.0.0", - "stack-utils": "^2.0.2" - }, - "engines": { - "node": ">= 10.14.2" + "tapable": "^2.2.0" } }, - "node_modules/jest-message-util/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } + "envinfo": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz", + "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", + "dev": true }, - "node_modules/jest-message-util/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } + "es-module-lexer": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", + "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "dev": true }, - "node_modules/jest-message-util/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true }, - "node_modules/jest-message-util/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "node_modules/jest-message-util/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "eslint": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", + "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-message-util/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" + "peer": true, + "requires": { + "@eslint/eslintrc": "^1.2.1", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.6.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" }, - "engines": { - "node": ">=8" + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "peer": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "peer": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "peer": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "peer": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "peer": true + }, + "eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "peer": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "globals": { + "version": "13.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", + "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "dev": true, + "peer": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "peer": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "peer": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, - "node_modules/jest-mock": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", - "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", + "eslint-plugin-es5": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es5/-/eslint-plugin-es5-1.5.0.tgz", + "integrity": "sha512-Qxmfo7v2B7SGAEURJo0dpBweFf+JU15kSyALfiB2rXWcBuJ96r6X9kFHXFnhdopPHCaHjoQs1xQPUJVbGMb1AA==", "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "@types/node": "*" - }, - "engines": { - "node": ">= 10.14.2" - } + "requires": {} }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true + "dependencies": { + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true } } }, - "node_modules/jest-regex-util": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz", - "integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==", + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, - "engines": { - "node": ">= 10.14.2" + "peer": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "peer": true + } } }, - "node_modules/jest-resolve": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", - "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", + "eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^26.6.2", - "read-pkg-up": "^7.0.1", - "resolve": "^1.18.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">= 10.14.2" - } + "peer": true }, - "node_modules/jest-resolve-dependencies": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", - "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", + "eslint-webpack-plugin": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/eslint-webpack-plugin/-/eslint-webpack-plugin-3.1.1.tgz", + "integrity": "sha512-xSucskTN9tOkfW7so4EaiFIkulWLXwCB/15H917lR6pTv0Zot6/fetFucmENRb7J5whVSFKIvwnrnsa78SG2yg==", "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.6.2" + "requires": { + "@types/eslint": "^7.28.2", + "jest-worker": "^27.3.1", + "micromatch": "^4.0.4", + "normalize-path": "^3.0.0", + "schema-utils": "^3.1.1" }, - "engines": { - "node": ">= 10.14.2" + "dependencies": { + "@types/eslint": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.29.0.tgz", + "integrity": "sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + } } }, - "node_modules/jest-resolve/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "espree": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", + "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peer": true, + "requires": { + "acorn": "^8.7.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^3.3.0" } }, - "node_modules/jest-resolve/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "peer": true, + "requires": { + "estraverse": "^5.1.0" } }, - "node_modules/jest-resolve/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "requires": { + "estraverse": "^5.2.0" } }, - "node_modules/jest-resolve/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, - "node_modules/jest-resolve/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true, - "engines": { - "node": ">=8" - } + "peer": true }, - "node_modules/jest-resolve/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "fastest-levenshtein": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz", + "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==", + "dev": true + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "peer": true, + "requires": { + "flat-cache": "^3.0.4" } }, - "node_modules/jest-runner": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", - "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, - "dependencies": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.7.1", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.6.2", - "jest-leak-detector": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "source-map-support": "^0.5.6", - "throat": "^5.0.0" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "to-regex-range": "^5.0.1" } }, - "node_modules/jest-runner/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" } }, - "node_modules/jest-runner/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, - "node_modules/jest-runner/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "peer": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" } }, - "node_modules/jest-runner/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "flatted": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true, + "peer": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "node_modules/jest-runner/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, - "node_modules/jest-runner/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } + "peer": true }, - "node_modules/jest-runtime": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", - "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, - "dependencies": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/globals": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0", - "cjs-module-lexer": "^0.6.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "slash": "^3.0.0", - "strip-bom": "^4.0.0", - "yargs": "^15.4.1" - }, - "bin": { - "jest-runtime": "bin/jest-runtime.js" - }, - "engines": { - "node": ">= 10.14.2" - } + "peer": true }, - "node_modules/jest-runtime/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" } }, - "node_modules/jest-runtime/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, - "node_modules/jest-runtime/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "requires": { + "is-glob": "^4.0.3" } }, - "node_modules/jest-runtime/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, - "node_modules/jest-runtime/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true }, - "node_modules/jest-runtime/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "function-bind": "^1.1.1" } }, - "node_modules/jest-serializer": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", - "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true, - "dependencies": { - "@types/node": "*", - "graceful-fs": "^4.2.4" - }, - "engines": { - "node": ">= 10.14.2" - } + "peer": true }, - "node_modules/jest-snapshot": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", - "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, - "dependencies": { - "@babel/types": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/babel__traverse": "^7.0.4", - "@types/prettier": "^2.0.0", - "chalk": "^4.0.0", - "expect": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-haste-map": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "natural-compare": "^1.4.0", - "pretty-format": "^26.6.2", - "semver": "^7.3.2" + "peer": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, - "engines": { - "node": ">= 10.14.2" + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "peer": true + } } }, - "node_modules/jest-snapshot/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "import-local": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", + "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" } }, - "node_modules/jest-snapshot/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } + "peer": true }, - "node_modules/jest-snapshot/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "requires": { + "once": "^1.3.0", + "wrappy": "1" } }, - "node_modules/jest-snapshot/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "node_modules/jest-snapshot/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } + "interpret": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", + "dev": true }, - "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/jest-snapshot/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "is-core-module": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", + "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "has": "^1.0.3" } }, - "node_modules/jest-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", - "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", - "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "micromatch": "^4.0.2" - }, - "engines": { - "node": ">= 10.14.2" - } + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true }, - "node_modules/jest-util/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "is-extglob": "^2.1.1" } }, - "node_modules/jest-util/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "requires": { + "isobject": "^3.0.1" } }, - "node_modules/jest-util/node_modules/color-convert": { + "is-stream": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true }, - "node_modules/jest-util/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "node_modules/jest-util/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true }, - "node_modules/jest-util/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "jasmine": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-4.0.2.tgz", + "integrity": "sha512-YsrgxJQEggxzByYe4j68eQLOiQeSrPDYGv4sHhGBp3c6HHdq+uPXeAQ73kOAQpdLZ3/0zN7x/TZTloqeE1/qIA==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "glob": "^7.1.6", + "jasmine-core": "^4.0.0" } }, - "node_modules/jest-validate": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", - "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", - "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "camelcase": "^6.0.0", - "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "leven": "^3.1.0", - "pretty-format": "^26.6.2" - }, - "engines": { - "node": ">= 10.14.2" - } + "jasmine-core": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-4.0.0.tgz", + "integrity": "sha512-tq24OCqHElgU9KDpb/8O21r1IfotgjIzalfW9eCmRR40LZpvwXT68iariIyayMwi0m98RDt16aljdbwK0sBMmQ==", + "dev": true }, - "node_modules/jest-validate/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "jasmine-spec-reporter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-7.0.0.tgz", + "integrity": "sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==", "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "requires": { + "colors": "1.4.0" } }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, - "engines": { - "node": ">=10" + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, - "node_modules/jest-validate/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "peer": true, + "requires": { + "argparse": "^2.0.1" } }, - "node_modules/jest-validate/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } + "peer": true }, - "node_modules/jest-validate/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", "dev": true }, - "node_modules/jest-validate/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, - "engines": { - "node": ">=8" + "peer": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, - "node_modules/jest-validate/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "loader-runner": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz", + "integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==", + "dev": true + }, + "loader-utils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", + "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" } }, - "node_modules/jest-watcher": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", - "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, - "dependencies": { - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "jest-util": "^26.6.2", - "string-length": "^4.0.1" - }, - "engines": { - "node": ">= 10.14.2" + "requires": { + "p-locate": "^4.1.0" } }, - "node_modules/jest-watcher/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true }, - "node_modules/jest-watcher/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } + "peer": true }, - "node_modules/jest-watcher/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" + "requires": { + "semver": "^6.0.0" } }, - "node_modules/jest-watcher/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, - "node_modules/jest-watcher/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-watcher/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, - "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">= 10.13.0" + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" } }, - "node_modules/jest-worker/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } + "mime-db": { + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", + "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==", + "dev": true }, - "node_modules/jest-worker/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "mime-types": { + "version": "2.1.33", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", + "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "mime-db": "1.50.0" } }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, - "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "requires": { + "brace-expansion": "^1.1.7" } }, - "node_modules/jsdom": { - "version": "16.7.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", - "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", - "dev": true, - "dependencies": { - "abab": "^2.0.5", - "acorn": "^8.2.4", - "acorn-globals": "^6.0.0", - "cssom": "^0.4.4", - "cssstyle": "^2.3.0", - "data-urls": "^2.0.0", - "decimal.js": "^10.2.1", - "domexception": "^2.0.1", - "escodegen": "^2.0.0", - "form-data": "^3.0.0", - "html-encoding-sniffer": "^2.0.1", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.5.0", - "ws": "^7.4.6", - "xml-name-validator": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "canvas": "^2.5.0" - }, - "peerDependenciesMeta": { - "canvas": { - "optional": true - } - } + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true }, - "node_modules/jsdom/node_modules/ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", - "dev": true, - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } + "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/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true, - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } + "peer": true }, - "node_modules/json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "node_modules/json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "node-releases": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", + "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==", "dev": true }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "node_modules/json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" + "requires": { + "path-key": "^3.0.0" } }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", "dev": true, - "engines": { - "node": ">=6" + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" } }, - "node_modules/leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, - "engines": { - "node": ">=6" + "requires": { + "wrappy": "1" } }, - "node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" + "requires": { + "mimic-fn": "^2.1.0" } }, - "node_modules/lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, - "node_modules/loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, - "engines": { - "node": ">=4.3.0 <5.0.0 || >=5.10" + "peer": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" } }, - "node_modules/loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - }, - "engines": { - "node": ">=4.0.0" + "requires": { + "p-try": "^2.0.0" } }, - "node_modules/loader-utils/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" + "requires": { + "p-limit": "^2.2.0" } }, - "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" + "peer": true, + "requires": { + "callsites": "^3.0.0" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, - "node_modules/lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true }, - "node_modules/makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", - "dev": true, - "dependencies": { - "tmpl": "1.0.5" - } + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true }, - "node_modules/map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, - "engines": { - "node": ">=0.10.0" + "requires": { + "find-up": "^4.0.0" } }, - "node_modules/map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, - "dependencies": { - "object-visit": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } + "peer": true }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" + "requires": { + "safe-buffer": "^5.1.0" } }, - "node_modules/memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "rechoir": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", "dev": true, - "dependencies": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" + "requires": { + "resolve": "^1.9.0" } }, - "node_modules/merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", "dev": true }, - "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "regenerate-unicode-properties": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz", + "integrity": "sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw==", "dev": true, - "dependencies": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "bin": { - "miller-rabin": "bin/miller-rabin" + "requires": { + "regenerate": "^1.4.2" } }, - "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "regenerator-runtime": { + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", "dev": true }, - "node_modules/mime-db": { - "version": "1.50.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", - "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==", + "regenerator-transform": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", "dev": true, - "engines": { - "node": ">= 0.6" + "requires": { + "@babel/runtime": "^7.8.4" } }, - "node_modules/mime-types": { - "version": "2.1.33", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", - "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, - "dependencies": { - "mime-db": "1.50.0" - }, - "engines": { - "node": ">= 0.6" - } + "peer": true }, - "node_modules/mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "regexpu-core": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.0.1.tgz", + "integrity": "sha512-CriEZlrKK9VJw/xQGJpQM5rY88BtuL8DM+AEwvcThHilbxiTAy8vq4iJnd2tqq8wLmjbGZzP7ZcKFjbGkmEFrw==", "dev": true, - "engines": { - "node": ">=6" + "requires": { + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^10.0.1", + "regjsgen": "^0.6.0", + "regjsparser": "^0.8.2", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.0.0" } }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "regjsgen": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.6.0.tgz", + "integrity": "sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA==", "dev": true }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "regjsparser": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.8.4.tgz", + "integrity": "sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA==", "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" + "requires": { + "jsesc": "~0.5.0" }, - "engines": { - "node": "*" + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } } }, - "node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "node_modules/minipass": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", - "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" } }, - "node_modules/mississippi": { + "resolve-cwd": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, - "dependencies": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - }, - "engines": { - "node": ">=4.0.0" + "requires": { + "resolve-from": "^5.0.0" } }, - "node_modules/mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "dependencies": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true }, - "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" + "peer": true, + "requires": { + "glob": "^7.1.3" } }, - "node_modules/move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "dependencies": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, - "node_modules/move-concurrently/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "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/nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", - "dev": true, - "optional": true - }, - "node_modules/nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", - "dev": true - }, - "node_modules/node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "dependencies": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - } - }, - "node_modules/node-libs-browser/node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "node_modules/node-modules-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/node-notifier": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.2.tgz", - "integrity": "sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg==", - "dev": true, - "optional": true, - "dependencies": { - "growly": "^1.3.0", - "is-wsl": "^2.2.0", - "semver": "^7.3.2", - "shellwords": "^0.1.1", - "uuid": "^8.3.0", - "which": "^2.0.2" - } - }, - "node_modules/node-notifier/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "optional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/node-releases": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", - "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", - "dev": true - }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/normalize-package-data/node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "dependencies": { - "path-key": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", - "dev": true - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "dependencies": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-copy/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "dependencies": { - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "dependencies": { - "isobject": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/onetime": { + "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "dependencies": { - "mimic-fn": "^2.1.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "node_modules/parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "dependencies": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, - "node_modules/parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "dev": true, - "dependencies": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true - }, - "node_modules/pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "node_modules/path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true, - "optional": true - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dev": true, - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/pirates": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", - "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", - "dev": true, - "dependencies": { - "node-modules-regexp": "^1.0.0" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/pretty-format": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", - "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", - "dev": true, - "dependencies": { - "@jest/types": "^26.6.2", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^17.0.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/pretty-format/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/pretty-format/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/pretty-format/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "node_modules/promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dev": true, - "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "dev": true - }, - "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "dev": true - }, - "node_modules/public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "dependencies": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/public-encrypt/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "dependencies": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - } - }, - "node_modules/pumpify/node_modules/pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true, - "engines": { - "node": ">=0.4.x" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "dependencies": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true - }, - "node_modules/read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "dependencies": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "dev": true, - "dependencies": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-pkg-up/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/read-pkg/node_modules/type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readable-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "optional": true, - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "node_modules/regenerate-unicode-properties": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz", - "integrity": "sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", - "dev": true - }, - "node_modules/regenerator-transform": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", - "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.8.4" - } - }, - "node_modules/regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/regexpu-core": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", - "integrity": "sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==", - "dev": true, - "dependencies": { - "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^9.0.0", - "regjsgen": "^0.5.2", - "regjsparser": "^0.7.0", - "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/regjsgen": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", - "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", - "dev": true - }, - "node_modules/regjsparser": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.7.0.tgz", - "integrity": "sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==", - "dev": true, - "dependencies": { - "jsesc": "~0.5.0" - }, - "bin": { - "regjsparser": "bin/parser" - } - }, - "node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, - "node_modules/remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "node_modules/repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "node_modules/resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "dependencies": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "dependencies": { - "resolve-from": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "dependencies": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-dir/node_modules/global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "dependencies": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-dir/node_modules/global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "dependencies": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resolve-dir/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "deprecated": "https://github.com/lydell/resolve-url#deprecated", - "dev": true - }, - "node_modules/ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/rsvp": { - "version": "4.8.5", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", - "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", - "dev": true, - "engines": { - "node": "6.* || >= 7.*" - } - }, - "node_modules/run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "dependencies": { - "aproba": "^1.1.1" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "dependencies": { - "ret": "~0.1.10" - } - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "node_modules/sane": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", - "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", - "deprecated": "some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added", - "dev": true, - "dependencies": { - "@cnakazawa/watch": "^1.0.3", - "anymatch": "^2.0.0", - "capture-exit": "^2.0.0", - "exec-sh": "^0.3.2", - "execa": "^1.0.0", - "fb-watchman": "^2.0.0", - "micromatch": "^3.1.4", - "minimist": "^1.1.1", - "walker": "~1.0.5" - }, - "bin": { - "sane": "src/cli.js" - }, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/sane/node_modules/anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "dependencies": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "node_modules/sane/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "engines": { - "node": ">=4.8" - } - }, - "node_modules/sane/node_modules/execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "dependencies": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/sane/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/sane/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "dependencies": { - "path-key": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/sane/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/sane/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/sane/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sane/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", - "dev": true, - "dependencies": { - "xmlchars": "^2.2.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/schema-utils": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", - "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.5", - "ajv": "^6.12.4", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 8.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "node_modules/set-value": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-4.1.0.tgz", - "integrity": "sha512-zTEg4HL0RwVrqcWs3ztF+x1vkxfm0lP+MQQFPiMJTKVceBwEV0A569Ou8l9IYQG8jOZdMVI1hGsc0tmeD2o/Lw==", - "dev": true, - "funding": [ - "https://github.com/sponsors/jonschlinkert", - "https://paypal.me/jonathanschlinkert", - "https://jonschlinkert.dev/sponsor" - ], - "dependencies": { - "is-plain-object": "^2.0.4", - "is-primitive": "^3.0.1" - }, - "engines": { - "node": ">=11.0" - } - }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true, - "optional": true - }, - "node_modules/signal-exit": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", - "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", - "dev": true - }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "dependencies": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "dependencies": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-node/node_modules/define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "dependencies": { - "is-descriptor": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "dependencies": { - "kind-of": "^3.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon-util/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/snapdragon/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/snapdragon/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node_modules/source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "dependencies": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.20", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", - "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "dev": true - }, - "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "node_modules/spdx-license-ids": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz", - "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==", - "dev": true - }, - "node_modules/split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "dependencies": { - "extend-shallow": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "node_modules/ssri": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", - "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "dev": true, - "dependencies": { - "minipass": "^3.1.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/stack-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", - "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/stack-utils/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "dependencies": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "dependencies": { - "is-descriptor": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "dependencies": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-extend/node_modules/kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "dependencies": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "node_modules/stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "node_modules/stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "dependencies": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "node_modules/stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/string-length": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", - "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", - "dev": true, - "dependencies": { - "char-regex": "^1.0.2", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/supports-hyperlinks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", - "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, - "node_modules/tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/terminal-link": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", - "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", - "dev": true, - "dependencies": { - "ansi-escapes": "^4.2.1", - "supports-hyperlinks": "^2.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", - "dev": true, - "dependencies": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - }, - "bin": { - "terser": "bin/terser" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/terser-webpack-plugin": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", - "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", - "dev": true, - "dependencies": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^4.0.0", - "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" - }, - "engines": { - "node": ">= 6.9.0" - }, - "peerDependencies": { - "webpack": "^4.0.0" - } - }, - "node_modules/terser-webpack-plugin/node_modules/find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser-webpack-plugin/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser-webpack-plugin/node_modules/is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/terser-webpack-plugin/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser-webpack-plugin/node_modules/make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "dependencies": { - "pify": "^4.0.1", - "semver": "^5.6.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser-webpack-plugin/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser-webpack-plugin/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/terser-webpack-plugin/node_modules/pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "dependencies": { - "find-up": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/terser-webpack-plugin/node_modules/schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "dependencies": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - }, - "engines": { - "node": ">= 4" - } - }, - "node_modules/terser-webpack-plugin/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/terser-webpack-plugin/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/terser/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/throat": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", - "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", - "dev": true - }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "node_modules/timers-browserify": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", - "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", - "dev": true, - "dependencies": { - "setimmediate": "^1.0.4" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true - }, - "node_modules/to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-object-path/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "dependencies": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", - "dev": true, - "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", - "dev": true, - "dependencies": { - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, - "node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/unicode-canonical-property-names-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", - "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", - "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", - "dev": true, - "dependencies": { - "unicode-canonical-property-names-ecmascript": "^2.0.0", - "unicode-property-aliases-ecmascript": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-match-property-value-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", - "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/unicode-property-aliases-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", - "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "dependencies": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/union-value/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/union-value/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/union-value/node_modules/set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "dependencies": { - "unique-slug": "^2.0.0" - } - }, - "node_modules/unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4" - } - }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "dependencies": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "dependencies": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "dependencies": { - "isarray": "1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/unset-value/node_modules/has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=4", - "yarn": "*" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "deprecated": "Please see https://github.com/lydell/urix#deprecated", - "dev": true - }, - "node_modules/url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "dependencies": { - "punycode": "1.3.2", - "querystring": "0.2.0" - } - }, - "node_modules/url/node_modules/punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - }, - "node_modules/use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, - "dependencies": { - "inherits": "2.0.3" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "node_modules/util/node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "optional": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "node_modules/v8-to-istanbul": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz", - "integrity": "sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0", - "source-map": "^0.7.3" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/v8-to-istanbul/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, - "node_modules/w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "dev": true, - "dependencies": { - "browser-process-hrtime": "^1.0.0" - } - }, - "node_modules/w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", - "dev": true, - "dependencies": { - "xml-name-validator": "^3.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", - "dev": true, - "dependencies": { - "makeerror": "1.0.12" - } - }, - "node_modules/watchpack": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", - "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" - }, - "optionalDependencies": { - "chokidar": "^3.4.1", - "watchpack-chokidar2": "^2.0.1" - } - }, - "node_modules/watchpack-chokidar2": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", - "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", - "dev": true, - "optional": true, - "dependencies": { - "chokidar": "^2.1.8" - } - }, - "node_modules/watchpack-chokidar2/node_modules/anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "optional": true, - "dependencies": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "node_modules/watchpack-chokidar2/node_modules/anymatch/node_modules/normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "dependencies": { - "remove-trailing-separator": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "optional": true, - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "deprecated": "Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.", - "dev": true, - "optional": true, - "dependencies": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - }, - "optionalDependencies": { - "fsevents": "^1.2.7" - } - }, - "node_modules/watchpack-chokidar2/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "optional": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "dependencies": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - }, - "engines": { - "node": ">= 4.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "optional": true, - "dependencies": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/glob-parent/node_modules/is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "optional": true, - "dependencies": { - "is-extglob": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "optional": true, - "dependencies": { - "binary-extensions": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "optional": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "optional": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/watchpack-chokidar2/node_modules/readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "optional": true, - "dependencies": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/watchpack-chokidar2/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "optional": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true, - "engines": { - "node": ">=10.4" - } - }, - "node_modules/webpack": { - "version": "4.46.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz", - "integrity": "sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q==", - "dev": true, - "dependencies": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/wasm-edit": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "acorn": "^6.4.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.5.0", - "eslint-scope": "^4.0.3", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.3", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.3", - "watchpack": "^1.7.4", - "webpack-sources": "^1.4.1" - }, - "bin": { - "webpack": "bin/webpack.js" - }, - "engines": { - "node": ">=6.11.5" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - }, - "peerDependenciesMeta": { - "webpack-cli": { - "optional": true - }, - "webpack-command": { - "optional": true - } - } - }, - "node_modules/webpack-cli": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", - "integrity": "sha512-NVWBaz9k839ZH/sinurM+HcDvJOTXwSjYp1ku+5XKeOC03z8v5QitnK/x+lAxGXFyhdayoIf/GOpv85z3/xPag==", - "dev": true, - "dependencies": { - "chalk": "^2.4.2", - "cross-spawn": "^6.0.5", - "enhanced-resolve": "^4.1.1", - "findup-sync": "^3.0.0", - "global-modules": "^2.0.0", - "import-local": "^2.0.0", - "interpret": "^1.4.0", - "loader-utils": "^1.4.0", - "supports-color": "^6.1.0", - "v8-compile-cache": "^2.1.1", - "yargs": "^13.3.2" - }, - "bin": { - "webpack-cli": "bin/cli.js" - }, - "engines": { - "node": ">=6.11.5" - }, - "peerDependencies": { - "webpack": "4.x.x" - } - }, - "node_modules/webpack-cli/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/webpack-cli/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/webpack-cli/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "engines": { - "node": ">=4.8" - } - }, - "node_modules/webpack-cli/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "node_modules/webpack-cli/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/webpack-cli/node_modules/import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", - "dev": true, - "dependencies": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/webpack-cli/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/webpack-cli/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/webpack-cli/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/webpack-cli/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/webpack-cli/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/webpack-cli/node_modules/pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "dependencies": { - "find-up": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/webpack-cli/node_modules/resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "dependencies": { - "resolve-from": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/webpack-cli/node_modules/resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/webpack-cli/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/webpack-cli/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack-cli/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack-cli/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/webpack-cli/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/webpack-cli/node_modules/supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/webpack-cli/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/webpack-cli/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/webpack-cli/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/webpack-cli/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "node_modules/webpack-cli/node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - }, - "node_modules/webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", - "dev": true, - "dependencies": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" - } - }, - "node_modules/webpack-sources/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack/node_modules/acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/webpack/node_modules/braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "dependencies": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack/node_modules/braces/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack/node_modules/fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "dependencies": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack/node_modules/fill-range/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack/node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack/node_modules/is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "dependencies": { - "kind-of": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack/node_modules/is-number/node_modules/kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "dependencies": { - "is-buffer": "^1.1.5" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack/node_modules/micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "dependencies": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/webpack/node_modules/schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "dependencies": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - }, - "engines": { - "node": ">= 4" - } - }, - "node_modules/webpack/node_modules/to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "dependencies": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "dependencies": { - "iconv-lite": "0.4.24" - } - }, - "node_modules/whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true - }, - "node_modules/whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", - "dev": true, - "dependencies": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", - "dev": true, - "dependencies": { - "errno": "~0.1.7" - } - }, - "node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" - } - }, - "node_modules/ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "node_modules/xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", - "dev": true - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - } - }, - "dependencies": { - "@babel/code-frame": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", - "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", - "dev": true, - "requires": { - "@babel/highlight": "^7.16.0" - } - }, - "@babel/compat-data": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.0.tgz", - "integrity": "sha512-DGjt2QZse5SGd9nfOSqO4WLJ8NN/oHkijbXbPrxuoJO3oIPJL3TciZs9FX+cOHNiY9E9l0opL8g7BmLe3T+9ew==", - "dev": true - }, - "@babel/core": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.0.tgz", - "integrity": "sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helpers": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", - "semver": "^6.3.0", - "source-map": "^0.5.0" - } - }, - "@babel/generator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.0.tgz", - "integrity": "sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" - } - }, - "@babel/helper-annotate-as-pure": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz", - "integrity": "sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.0.tgz", - "integrity": "sha512-9KuleLT0e77wFUku6TUkqZzCEymBdtuQQ27MhEKzf9UOOJu3cYj98kyaDAzxpC7lV6DGiZFuC8XqDsq8/Kl6aQ==", - "dev": true, - "requires": { - "@babel/helper-explode-assignable-expression": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-compilation-targets": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.0.tgz", - "integrity": "sha512-S7iaOT1SYlqK0sQaCi21RX4+13hmdmnxIEAnQUB/eh7GeAnRjOUgTYpLkUOiRXzD+yog1JxP0qyAQZ7ZxVxLVg==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-validator-option": "^7.14.5", - "browserslist": "^4.16.6", - "semver": "^6.3.0" - } - }, - "@babel/helper-create-class-features-plugin": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.0.tgz", - "integrity": "sha512-XLwWvqEaq19zFlF5PTgOod4bUA+XbkR4WLQBct1bkzmxJGB0ZEJaoKF4c8cgH9oBtCDuYJ8BP5NB9uFiEgO5QA==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-member-expression-to-functions": "^7.16.0", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/helper-replace-supers": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0" - } - }, - "@babel/helper-create-regexp-features-plugin": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.0.tgz", - "integrity": "sha512-3DyG0zAFAZKcOp7aVr33ddwkxJ0Z0Jr5V99y3I690eYLpukJsJvAbzTy1ewoCqsML8SbIrjH14Jc/nSQ4TvNPA==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "regexpu-core": "^4.7.1" - } - }, - "@babel/helper-define-polyfill-provider": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.4.tgz", - "integrity": "sha512-OrpPZ97s+aPi6h2n1OXzdhVis1SGSsMU2aMHgLcOKfsp4/v1NWpx3CWT3lBj5eeBq9cDkPkh+YCfdF7O12uNDQ==", - "dev": true, - "requires": { - "@babel/helper-compilation-targets": "^7.13.0", - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/traverse": "^7.13.0", - "debug": "^4.1.1", - "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2", - "semver": "^6.1.2" - } - }, - "@babel/helper-explode-assignable-expression": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.0.tgz", - "integrity": "sha512-Hk2SLxC9ZbcOhLpg/yMznzJ11W++lg5GMbxt1ev6TXUiJB0N42KPC+7w8a+eWGuqDnUYuwStJoZHM7RgmIOaGQ==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-function-name": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz", - "integrity": "sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz", - "integrity": "sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-hoist-variables": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz", - "integrity": "sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-member-expression-to-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz", - "integrity": "sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-module-imports": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz", - "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-module-transforms": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz", - "integrity": "sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-replace-supers": "^7.16.0", - "@babel/helper-simple-access": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/helper-validator-identifier": "^7.15.7", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-optimise-call-expression": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz", - "integrity": "sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-plugin-utils": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz", - "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==", - "dev": true - }, - "@babel/helper-remap-async-to-generator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.0.tgz", - "integrity": "sha512-MLM1IOMe9aQBqMWxcRw8dcb9jlM86NIw7KA0Wri91Xkfied+dE0QuBFSBjMNvqzmS0OSIDsMNC24dBEkPUi7ew==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-wrap-function": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-replace-supers": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz", - "integrity": "sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA==", - "dev": true, - "requires": { - "@babel/helper-member-expression-to-functions": "^7.16.0", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-simple-access": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz", - "integrity": "sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", - "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-split-export-declaration": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz", - "integrity": "sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==", - "dev": true, - "requires": { - "@babel/types": "^7.16.0" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", - "dev": true - }, - "@babel/helper-validator-option": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", - "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", - "dev": true - }, - "@babel/helper-wrap-function": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.0.tgz", - "integrity": "sha512-VVMGzYY3vkWgCJML+qVLvGIam902mJW0FvT7Avj1zEe0Gn7D93aWdLblYARTxEw+6DhZmtzhBM2zv0ekE5zg1g==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.16.0", - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, - "@babel/helpers": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.0.tgz", - "integrity": "sha512-dVRM0StFMdKlkt7cVcGgwD8UMaBfWJHl3A83Yfs8GQ3MO0LHIIIMvK7Fa0RGOGUQ10qikLaX6D7o5htcQWgTMQ==", - "dev": true, - "requires": { - "@babel/template": "^7.16.0", - "@babel/traverse": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, - "@babel/highlight": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", - "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.15.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - } - }, - "@babel/parser": { - "version": "7.16.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.2.tgz", - "integrity": "sha512-RUVpT0G2h6rOZwqLDTrKk7ksNv7YpAilTnYe1/Q+eDjxEceRMKVWbCsX7t8h6C1qCFi/1Y8WZjcEPBAFG27GPw==", - "dev": true - }, - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.16.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz", - "integrity": "sha512-h37CvpLSf8gb2lIJ2CgC3t+EjFbi0t8qS7LCS1xcJIlEXE4czlofwaW7W1HA8zpgOCzI9C1nmoqNR1zWkk0pQg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.0.tgz", - "integrity": "sha512-4tcFwwicpWTrpl9qjf7UsoosaArgImF85AxqCRZlgc3IQDvkUHjJpruXAL58Wmj+T6fypWTC/BakfEkwIL/pwA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", - "@babel/plugin-proposal-optional-chaining": "^7.16.0" - } - }, - "@babel/plugin-proposal-async-generator-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.0.tgz", - "integrity": "sha512-nyYmIo7ZqKsY6P4lnVmBlxp9B3a96CscbLotlsNuktMHahkDwoPYEjXrZHU0Tj844Z9f1IthVxQln57mhkcExw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.16.0", - "@babel/plugin-syntax-async-generators": "^7.8.4" - } - }, - "@babel/plugin-proposal-class-properties": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.0.tgz", - "integrity": "sha512-mCF3HcuZSY9Fcx56Lbn+CGdT44ioBMMvjNVldpKtj8tpniETdLjnxdHI1+sDWXIM1nNt+EanJOZ3IG9lzVjs7A==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-proposal-class-static-block": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.0.tgz", - "integrity": "sha512-mAy3sdcY9sKAkf3lQbDiv3olOfiLqI51c9DR9b19uMoR2Z6r5pmGl7dfNFqEvqOyqbf1ta4lknK4gc5PJn3mfA==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-class-static-block": "^7.14.5" - } - }, - "@babel/plugin-proposal-dynamic-import": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.0.tgz", - "integrity": "sha512-QGSA6ExWk95jFQgwz5GQ2Dr95cf7eI7TKutIXXTb7B1gCLTCz5hTjFTQGfLFBBiC5WSNi7udNwWsqbbMh1c4yQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - } - }, - "@babel/plugin-proposal-export-namespace-from": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.0.tgz", - "integrity": "sha512-CjI4nxM/D+5wCnhD11MHB1AwRSAYeDT+h8gCdcVJZ/OK7+wRzFsf7PFPWVpVpNRkHMmMkQWAHpTq+15IXQ1diA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - } - }, - "@babel/plugin-proposal-json-strings": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.0.tgz", - "integrity": "sha512-kouIPuiv8mSi5JkEhzApg5Gn6hFyKPnlkO0a9YSzqRurH8wYzSlf6RJdzluAsbqecdW5pBvDJDfyDIUR/vLxvg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-json-strings": "^7.8.3" - } - }, - "@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.0.tgz", - "integrity": "sha512-pbW0fE30sVTYXXm9lpVQQ/Vc+iTeQKiXlaNRZPPN2A2VdlWyAtsUrsQ3xydSlDW00TFMK7a8m3cDTkBF5WnV3Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - } - }, - "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.0.tgz", - "integrity": "sha512-3bnHA8CAFm7cG93v8loghDYyQ8r97Qydf63BeYiGgYbjKKB/XP53W15wfRC7dvKfoiJ34f6Rbyyx2btExc8XsQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - } - }, - "@babel/plugin-proposal-numeric-separator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.0.tgz", - "integrity": "sha512-FAhE2I6mjispy+vwwd6xWPyEx3NYFS13pikDBWUAFGZvq6POGs5eNchw8+1CYoEgBl9n11I3NkzD7ghn25PQ9Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.0.tgz", - "integrity": "sha512-LU/+jp89efe5HuWJLmMmFG0+xbz+I2rSI7iLc1AlaeSMDMOGzWlc5yJrMN1d04osXN4sSfpo4O+azkBNBes0jg==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.16.0" - } - }, - "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.0.tgz", - "integrity": "sha512-kicDo0A/5J0nrsCPbn89mTG3Bm4XgYi0CZtvex9Oyw7gGZE3HXGD0zpQNH+mo+tEfbo8wbmMvJftOwpmPy7aVw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - } - }, - "@babel/plugin-proposal-optional-chaining": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.0.tgz", - "integrity": "sha512-Y4rFpkZODfHrVo70Uaj6cC1JJOt3Pp0MdWSwIKtb8z1/lsjl9AmnB7ErRFV+QNGIfcY1Eruc2UMx5KaRnXjMyg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - } - }, - "@babel/plugin-proposal-private-methods": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.0.tgz", - "integrity": "sha512-IvHmcTHDFztQGnn6aWq4t12QaBXTKr1whF/dgp9kz84X6GUcwq9utj7z2wFCUfeOup/QKnOlt2k0zxkGFx9ubg==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-proposal-private-property-in-object": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.0.tgz", - "integrity": "sha512-3jQUr/HBbMVZmi72LpjQwlZ55i1queL8KcDTQEkAHihttJnAPrcvG9ZNXIfsd2ugpizZo595egYV6xy+pv4Ofw==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-create-class-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" - } - }, - "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.0.tgz", - "integrity": "sha512-ti7IdM54NXv29cA4+bNNKEMS4jLMCbJgl+Drv+FgYy0erJLAxNAIXcNjNjrRZEcWq0xJHsNVwQezskMFpF8N9g==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-syntax-async-generators": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-bigint": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", - "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", - "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.12.13" - } - }, - "@babel/plugin-syntax-class-static-block": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", - "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-syntax-dynamic-import": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-export-namespace-from": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.3" - } - }, - "@babel/plugin-syntax-import-meta": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", - "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-json-strings": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-nullish-coalescing-operator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-numeric-separator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.10.4" - } - }, - "@babel/plugin-syntax-object-rest-spread": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-catch-binding": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-optional-chaining": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.8.0" - } - }, - "@babel/plugin-syntax-private-property-in-object": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", - "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-syntax-top-level-await": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", - "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-arrow-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.0.tgz", - "integrity": "sha512-vIFb5250Rbh7roWARvCLvIJ/PtAU5Lhv7BtZ1u24COwpI9Ypjsh+bZcKk6rlIyalK+r0jOc1XQ8I4ovNxNrWrA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-async-to-generator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.0.tgz", - "integrity": "sha512-PbIr7G9kR8tdH6g8Wouir5uVjklETk91GMVSUq+VaOgiinbCkBP6Q7NN/suM/QutZkMJMvcyAriogcYAdhg8Gw==", - "dev": true, - "requires": { - "@babel/helper-module-imports": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.16.0" - } - }, - "@babel/plugin-transform-block-scoped-functions": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.0.tgz", - "integrity": "sha512-V14As3haUOP4ZWrLJ3VVx5rCnrYhMSHN/jX7z6FAt5hjRkLsb0snPCmJwSOML5oxkKO4FNoNv7V5hw/y2bjuvg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-block-scoping": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.0.tgz", - "integrity": "sha512-27n3l67/R3UrXfizlvHGuTwsRIFyce3D/6a37GRxn28iyTPvNXaW4XvznexRh1zUNLPjbLL22Id0XQElV94ruw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-classes": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.0.tgz", - "integrity": "sha512-HUxMvy6GtAdd+GKBNYDWCIA776byUQH8zjnfjxwT1P1ARv/wFu8eBDpmXQcLS/IwRtrxIReGiplOwMeyO7nsDQ==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.16.0", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-optimise-call-expression": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-replace-supers": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "globals": "^11.1.0" - } - }, - "@babel/plugin-transform-computed-properties": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.0.tgz", - "integrity": "sha512-63l1dRXday6S8V3WFY5mXJwcRAnPYxvFfTlt67bwV1rTyVTM5zrp0DBBb13Kl7+ehkCVwIZPumPpFP/4u70+Tw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-destructuring": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.0.tgz", - "integrity": "sha512-Q7tBUwjxLTsHEoqktemHBMtb3NYwyJPTJdM+wDwb0g8PZ3kQUIzNvwD5lPaqW/p54TXBc/MXZu9Jr7tbUEUM8Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-dotall-regex": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.0.tgz", - "integrity": "sha512-FXlDZfQeLILfJlC6I1qyEwcHK5UpRCFkaoVyA1nk9A1L1Yu583YO4un2KsLBsu3IJb4CUbctZks8tD9xPQubLw==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-duplicate-keys": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.0.tgz", - "integrity": "sha512-LIe2kcHKAZOJDNxujvmp6z3mfN6V9lJxubU4fJIGoQCkKe3Ec2OcbdlYP+vW++4MpxwG0d1wSDOJtQW5kLnkZQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-exponentiation-operator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.0.tgz", - "integrity": "sha512-OwYEvzFI38hXklsrbNivzpO3fh87skzx8Pnqi4LoSYeav0xHlueSoCJrSgTPfnbyzopo5b3YVAJkFIcUpK2wsw==", - "dev": true, - "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-for-of": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.0.tgz", - "integrity": "sha512-5QKUw2kO+GVmKr2wMYSATCTTnHyscl6sxFRAY+rvN7h7WB0lcG0o4NoV6ZQU32OZGVsYUsfLGgPQpDFdkfjlJQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-function-name": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.0.tgz", - "integrity": "sha512-lBzMle9jcOXtSOXUpc7tvvTpENu/NuekNJVova5lCCWCV9/U1ho2HH2y0p6mBg8fPm/syEAbfaaemYGOHCY3mg==", - "dev": true, - "requires": { - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-literals": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.0.tgz", - "integrity": "sha512-gQDlsSF1iv9RU04clgXqRjrPyyoJMTclFt3K1cjLmTKikc0s/6vE3hlDeEVC71wLTRu72Fq7650kABrdTc2wMQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-member-expression-literals": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.0.tgz", - "integrity": "sha512-WRpw5HL4Jhnxw8QARzRvwojp9MIE7Tdk3ez6vRyUk1MwgjJN0aNpRoXainLR5SgxmoXx/vsXGZ6OthP6t/RbUg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-modules-amd": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.0.tgz", - "integrity": "sha512-rWFhWbCJ9Wdmzln1NmSCqn7P0RAD+ogXG/bd9Kg5c7PKWkJtkiXmYsMBeXjDlzHpVTJ4I/hnjs45zX4dEv81xw==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-commonjs": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.0.tgz", - "integrity": "sha512-Dzi+NWqyEotgzk/sb7kgQPJQf7AJkQBWsVp1N6JWc1lBVo0vkElUnGdr1PzUBmfsCCN5OOFya3RtpeHk15oLKQ==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-simple-access": "^7.16.0", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-systemjs": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.0.tgz", - "integrity": "sha512-yuGBaHS3lF1m/5R+6fjIke64ii5luRUg97N2wr+z1sF0V+sNSXPxXDdEEL/iYLszsN5VKxVB1IPfEqhzVpiqvg==", - "dev": true, - "requires": { - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-validator-identifier": "^7.15.7", - "babel-plugin-dynamic-import-node": "^2.3.3" - } - }, - "@babel/plugin-transform-modules-umd": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.0.tgz", - "integrity": "sha512-nx4f6no57himWiHhxDM5pjwhae5vLpTK2zCnDH8+wNLJy0TVER/LJRHl2bkt6w9Aad2sPD5iNNoUpY3X9sTGDg==", - "dev": true, - "requires": { - "@babel/helper-module-transforms": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.0.tgz", - "integrity": "sha512-LogN88uO+7EhxWc8WZuQ8vxdSyVGxhkh8WTC3tzlT8LccMuQdA81e9SGV6zY7kY2LjDhhDOFdQVxdGwPyBCnvg==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.16.0" - } - }, - "@babel/plugin-transform-new-target": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.0.tgz", - "integrity": "sha512-fhjrDEYv2DBsGN/P6rlqakwRwIp7rBGLPbrKxwh7oVt5NNkIhZVOY2GRV+ULLsQri1bDqwDWnU3vhlmx5B2aCw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-object-super": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.0.tgz", - "integrity": "sha512-fds+puedQHn4cPLshoHcR1DTMN0q1V9ou0mUjm8whx9pGcNvDrVVrgw+KJzzCaiTdaYhldtrUps8DWVMgrSEyg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-replace-supers": "^7.16.0" - } - }, - "@babel/plugin-transform-parameters": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.0.tgz", - "integrity": "sha512-XgnQEm1CevKROPx+udOi/8f8TiGhrUWiHiaUCIp47tE0tpFDjzXNTZc9E5CmCwxNjXTWEVqvRfWZYOTFvMa/ZQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-property-literals": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.0.tgz", - "integrity": "sha512-XLldD4V8+pOqX2hwfWhgwXzGdnDOThxaNTgqagOcpBgIxbUvpgU2FMvo5E1RyHbk756WYgdbS0T8y0Cj9FKkWQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-regenerator": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.0.tgz", - "integrity": "sha512-JAvGxgKuwS2PihiSFaDrp94XOzzTUeDeOQlcKzVAyaPap7BnZXK/lvMDiubkPTdotPKOIZq9xWXWnggUMYiExg==", - "dev": true, - "requires": { - "regenerator-transform": "^0.14.2" - } - }, - "@babel/plugin-transform-reserved-words": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.0.tgz", - "integrity": "sha512-Dgs8NNCehHSvXdhEhln8u/TtJxfVwGYCgP2OOr5Z3Ar+B+zXicEOKNTyc+eca2cuEOMtjW6m9P9ijOt8QdqWkg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-shorthand-properties": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.0.tgz", - "integrity": "sha512-iVb1mTcD8fuhSv3k99+5tlXu5N0v8/DPm2mO3WACLG6al1CGZH7v09HJyUb1TtYl/Z+KrM6pHSIJdZxP5A+xow==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-spread": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.0.tgz", - "integrity": "sha512-Ao4MSYRaLAQczZVp9/7E7QHsCuK92yHRrmVNRe/SlEJjhzivq0BSn8mEraimL8wizHZ3fuaHxKH0iwzI13GyGg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" - } - }, - "@babel/plugin-transform-sticky-regex": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.0.tgz", - "integrity": "sha512-/ntT2NljR9foobKk4E/YyOSwcGUXtYWv5tinMK/3RkypyNBNdhHUaq6Orw5DWq9ZcNlS03BIlEALFeQgeVAo4Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-template-literals": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.0.tgz", - "integrity": "sha512-Rd4Ic89hA/f7xUSJQk5PnC+4so50vBoBfxjdQAdvngwidM8jYIBVxBZ/sARxD4e0yMXRbJVDrYf7dyRtIIKT6Q==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-typeof-symbol": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.0.tgz", - "integrity": "sha512-++V2L8Bdf4vcaHi2raILnptTBjGEFxn5315YU+e8+EqXIucA+q349qWngCLpUYqqv233suJ6NOienIVUpS9cqg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-unicode-escapes": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.0.tgz", - "integrity": "sha512-VFi4dhgJM7Bpk8lRc5CMaRGlKZ29W9C3geZjt9beuzSUrlJxsNwX7ReLwaL6WEvsOf2EQkyIJEPtF8EXjB/g2A==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/plugin-transform-unicode-regex": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.0.tgz", - "integrity": "sha512-jHLK4LxhHjvCeZDWyA9c+P9XH1sOxRd1RO9xMtDVRAOND/PczPqizEtVdx4TQF/wyPaewqpT+tgQFYMnN/P94A==", - "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5" - } - }, - "@babel/preset-env": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.0.tgz", - "integrity": "sha512-cdTu/W0IrviamtnZiTfixPfIncr2M1VqRrkjzZWlr1B4TVYimCFK5jkyOdP4qw2MrlKHi+b3ORj6x8GoCew8Dg==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.16.0", - "@babel/helper-compilation-targets": "^7.16.0", - "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-validator-option": "^7.14.5", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.0", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.0", - "@babel/plugin-proposal-async-generator-functions": "^7.16.0", - "@babel/plugin-proposal-class-properties": "^7.16.0", - "@babel/plugin-proposal-class-static-block": "^7.16.0", - "@babel/plugin-proposal-dynamic-import": "^7.16.0", - "@babel/plugin-proposal-export-namespace-from": "^7.16.0", - "@babel/plugin-proposal-json-strings": "^7.16.0", - "@babel/plugin-proposal-logical-assignment-operators": "^7.16.0", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0", - "@babel/plugin-proposal-numeric-separator": "^7.16.0", - "@babel/plugin-proposal-object-rest-spread": "^7.16.0", - "@babel/plugin-proposal-optional-catch-binding": "^7.16.0", - "@babel/plugin-proposal-optional-chaining": "^7.16.0", - "@babel/plugin-proposal-private-methods": "^7.16.0", - "@babel/plugin-proposal-private-property-in-object": "^7.16.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.16.0", - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-class-static-block": "^7.14.5", - "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5", - "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-transform-arrow-functions": "^7.16.0", - "@babel/plugin-transform-async-to-generator": "^7.16.0", - "@babel/plugin-transform-block-scoped-functions": "^7.16.0", - "@babel/plugin-transform-block-scoping": "^7.16.0", - "@babel/plugin-transform-classes": "^7.16.0", - "@babel/plugin-transform-computed-properties": "^7.16.0", - "@babel/plugin-transform-destructuring": "^7.16.0", - "@babel/plugin-transform-dotall-regex": "^7.16.0", - "@babel/plugin-transform-duplicate-keys": "^7.16.0", - "@babel/plugin-transform-exponentiation-operator": "^7.16.0", - "@babel/plugin-transform-for-of": "^7.16.0", - "@babel/plugin-transform-function-name": "^7.16.0", - "@babel/plugin-transform-literals": "^7.16.0", - "@babel/plugin-transform-member-expression-literals": "^7.16.0", - "@babel/plugin-transform-modules-amd": "^7.16.0", - "@babel/plugin-transform-modules-commonjs": "^7.16.0", - "@babel/plugin-transform-modules-systemjs": "^7.16.0", - "@babel/plugin-transform-modules-umd": "^7.16.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.0", - "@babel/plugin-transform-new-target": "^7.16.0", - "@babel/plugin-transform-object-super": "^7.16.0", - "@babel/plugin-transform-parameters": "^7.16.0", - "@babel/plugin-transform-property-literals": "^7.16.0", - "@babel/plugin-transform-regenerator": "^7.16.0", - "@babel/plugin-transform-reserved-words": "^7.16.0", - "@babel/plugin-transform-shorthand-properties": "^7.16.0", - "@babel/plugin-transform-spread": "^7.16.0", - "@babel/plugin-transform-sticky-regex": "^7.16.0", - "@babel/plugin-transform-template-literals": "^7.16.0", - "@babel/plugin-transform-typeof-symbol": "^7.16.0", - "@babel/plugin-transform-unicode-escapes": "^7.16.0", - "@babel/plugin-transform-unicode-regex": "^7.16.0", - "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.16.0", - "babel-plugin-polyfill-corejs2": "^0.2.3", - "babel-plugin-polyfill-corejs3": "^0.3.0", - "babel-plugin-polyfill-regenerator": "^0.2.3", - "core-js-compat": "^3.19.0", - "semver": "^6.3.0" - } - }, - "@babel/preset-modules": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", - "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", - "@babel/types": "^7.4.4", - "esutils": "^2.0.2" - } - }, - "@babel/runtime": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.0.tgz", - "integrity": "sha512-Nht8L0O8YCktmsDV6FqFue7vQLRx3Hb0B37lS5y0jDRqRxlBG4wIJHnf9/bgSE2UyipKFA01YtS+npRdTWBUyw==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.4" - } - }, - "@babel/template": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz", - "integrity": "sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0" - } - }, - "@babel/traverse": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.0.tgz", - "integrity": "sha512-qQ84jIs1aRQxaGaxSysII9TuDaguZ5yVrEuC0BN2vcPlalwfLovVmCjbFDPECPXcYM/wLvNFfp8uDOliLxIoUQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.0", - "@babel/generator": "^7.16.0", - "@babel/helper-function-name": "^7.16.0", - "@babel/helper-hoist-variables": "^7.16.0", - "@babel/helper-split-export-declaration": "^7.16.0", - "@babel/parser": "^7.16.0", - "@babel/types": "^7.16.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } - }, - "@babel/types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.0.tgz", - "integrity": "sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.15.7", - "to-fast-properties": "^2.0.0" - } - }, - "@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true - }, - "@cnakazawa/watch": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", - "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", - "dev": true, - "requires": { - "exec-sh": "^0.3.2", - "minimist": "^1.2.0" - } - }, - "@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - } - }, - "@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true - }, - "@jest/console": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", - "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^26.6.2", - "jest-util": "^26.6.2", - "slash": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "@jest/core": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", - "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", - "dev": true, - "requires": { - "@jest/console": "^26.6.2", - "@jest/reporters": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-changed-files": "^26.6.2", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-resolve-dependencies": "^26.6.3", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "jest-watcher": "^26.6.2", - "micromatch": "^4.0.2", - "p-each-series": "^2.1.0", - "rimraf": "^3.0.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "@jest/environment": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", - "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", - "dev": true, - "requires": { - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2" - } - }, - "@jest/fake-timers": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", - "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "@sinonjs/fake-timers": "^6.0.1", - "@types/node": "*", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" - } - }, - "@jest/globals": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", - "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", - "dev": true, - "requires": { - "@jest/environment": "^26.6.2", - "@jest/types": "^26.6.2", - "expect": "^26.6.2" - } - }, - "@jest/reporters": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", - "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", - "dev": true, - "requires": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.2", - "graceful-fs": "^4.2.4", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^4.0.3", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "jest-haste-map": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "node-notifier": "^8.0.0", - "slash": "^3.0.0", - "source-map": "^0.6.0", - "string-length": "^4.0.1", - "terminal-link": "^2.0.0", - "v8-to-istanbul": "^7.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "@jest/source-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", - "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", - "dev": true, - "requires": { - "callsites": "^3.0.0", - "graceful-fs": "^4.2.4", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "@jest/test-result": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", - "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", - "dev": true, - "requires": { - "@jest/console": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" - } - }, - "@jest/test-sequencer": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", - "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", - "dev": true, - "requires": { - "@jest/test-result": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-runner": "^26.6.3", - "jest-runtime": "^26.6.3" - } - }, - "@jest/transform": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", - "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", - "dev": true, - "requires": { - "@babel/core": "^7.1.0", - "@jest/types": "^26.6.2", - "babel-plugin-istanbul": "^6.0.0", - "chalk": "^4.0.0", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.2.4", - "jest-haste-map": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-util": "^26.6.2", - "micromatch": "^4.0.2", - "pirates": "^4.0.1", - "slash": "^3.0.0", - "source-map": "^0.6.1", - "write-file-atomic": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", - "dev": true, - "requires": { - "type-detect": "4.0.8" - } - }, - "@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - }, - "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true - }, - "@types/babel__core": { - "version": "7.1.16", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.16.tgz", - "integrity": "sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ==", - "dev": true, - "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "@types/babel__generator": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.3.tgz", - "integrity": "sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0" - } - }, - "@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", - "dev": true, - "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "@types/babel__traverse": { - "version": "7.14.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", - "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", - "dev": true, - "requires": { - "@babel/types": "^7.3.0" - } - }, - "@types/graceful-fs": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", - "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "@types/istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", - "dev": true - }, - "@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*" - } - }, - "@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", - "dev": true, - "requires": { - "@types/istanbul-lib-report": "*" - } - }, - "@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", - "dev": true - }, - "@types/node": { - "version": "16.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", - "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", - "dev": true - }, - "@types/normalize-package-data": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", - "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", - "dev": true - }, - "@types/prettier": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.4.1.tgz", - "integrity": "sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw==", - "dev": true - }, - "@types/stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", - "dev": true - }, - "@types/yargs": { - "version": "15.0.14", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.14.tgz", - "integrity": "sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ==", - "dev": true, - "requires": { - "@types/yargs-parser": "*" - } - }, - "@types/yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", - "dev": true - }, - "@webassemblyjs/ast": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", - "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", - "dev": true, - "requires": { - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0" - } - }, - "@webassemblyjs/floating-point-hex-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", - "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", - "dev": true - }, - "@webassemblyjs/helper-api-error": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", - "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", - "dev": true - }, - "@webassemblyjs/helper-buffer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", - "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", - "dev": true - }, - "@webassemblyjs/helper-code-frame": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", - "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", - "dev": true, - "requires": { - "@webassemblyjs/wast-printer": "1.9.0" - } - }, - "@webassemblyjs/helper-fsm": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", - "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", - "dev": true - }, - "@webassemblyjs/helper-module-context": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", - "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0" - } - }, - "@webassemblyjs/helper-wasm-bytecode": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", - "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", - "dev": true - }, - "@webassemblyjs/helper-wasm-section": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", - "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0" - } - }, - "@webassemblyjs/ieee754": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", - "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", - "dev": true, - "requires": { - "@xtuc/ieee754": "^1.2.0" - } - }, - "@webassemblyjs/leb128": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", - "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", - "dev": true, - "requires": { - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/utf8": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", - "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", - "dev": true - }, - "@webassemblyjs/wasm-edit": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", - "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/helper-wasm-section": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-opt": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "@webassemblyjs/wast-printer": "1.9.0" - } - }, - "@webassemblyjs/wasm-gen": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", - "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } - }, - "@webassemblyjs/wasm-opt": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", - "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-buffer": "1.9.0", - "@webassemblyjs/wasm-gen": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0" - } - }, - "@webassemblyjs/wasm-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", - "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-wasm-bytecode": "1.9.0", - "@webassemblyjs/ieee754": "1.9.0", - "@webassemblyjs/leb128": "1.9.0", - "@webassemblyjs/utf8": "1.9.0" - } - }, - "@webassemblyjs/wast-parser": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", - "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/floating-point-hex-parser": "1.9.0", - "@webassemblyjs/helper-api-error": "1.9.0", - "@webassemblyjs/helper-code-frame": "1.9.0", - "@webassemblyjs/helper-fsm": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "@webassemblyjs/wast-printer": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", - "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/wast-parser": "1.9.0", - "@xtuc/long": "4.2.2" - } - }, - "@xtuc/ieee754": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", - "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", - "dev": true - }, - "@xtuc/long": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", - "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", - "dev": true - }, - "abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", - "dev": true - }, - "acorn": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", - "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==", - "dev": true - }, - "acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", - "dev": true, - "requires": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - }, - "dependencies": { - "acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true - } - } - }, - "acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "dev": true - }, - "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, - "requires": { - "debug": "4" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true, - "requires": {} - }, - "ajv-keywords": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", - "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", - "dev": true, - "requires": {} - }, - "ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", - "dev": true, - "requires": { - "type-fest": "^0.21.3" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "babel-jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", - "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", - "dev": true, - "requires": { - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/babel__core": "^7.1.7", - "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.6.2", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "slash": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "babel-loader": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.3.tgz", - "integrity": "sha512-n4Zeta8NC3QAsuyiizu0GkmRcQ6clkV9WFUnUf1iXP//IeSKbWjofW3UHyZVwlOB4y039YQKefawyTn64Zwbuw==", - "dev": true, - "requires": { - "find-cache-dir": "^3.3.1", - "loader-utils": "^1.4.0", - "make-dir": "^3.1.0", - "schema-utils": "^2.6.5" - } - }, - "babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dev": true, - "requires": { - "object.assign": "^4.1.0" - } - }, - "babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "dependencies": { - "istanbul-lib-instrument": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz", - "integrity": "sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q==", - "dev": true, - "requires": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - } - } - } - }, - "babel-plugin-jest-hoist": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", - "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", - "dev": true, - "requires": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.0.0", - "@types/babel__traverse": "^7.0.6" - } - }, - "babel-plugin-polyfill-corejs2": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz", - "integrity": "sha512-NDZ0auNRzmAfE1oDDPW2JhzIMXUk+FFe2ICejmt5T4ocKgiQx3e0VCRx9NCAidcMtL2RUZaWtXnmjTCkx0tcbA==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.13.11", - "@babel/helper-define-polyfill-provider": "^0.2.4", - "semver": "^6.1.1" - } - }, - "babel-plugin-polyfill-corejs3": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.3.0.tgz", - "integrity": "sha512-JLwi9vloVdXLjzACL80j24bG6/T1gYxwowG44dg6HN/7aTPdyPbJJidf6ajoA3RPHHtW0j9KMrSOLpIZpAnPpg==", - "dev": true, - "requires": { - "@babel/helper-define-polyfill-provider": "^0.2.4", - "core-js-compat": "^3.18.0" - } - }, - "babel-plugin-polyfill-regenerator": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.3.tgz", - "integrity": "sha512-JVE78oRZPKFIeUqFGrSORNzQnrDwZR16oiWeGM8ZyjBn2XAT5OjP+wXx5ESuo33nUsFUEJYjtklnsKbxW5L+7g==", - "dev": true, - "requires": { - "@babel/helper-define-polyfill-provider": "^0.2.4" - } - }, - "babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", - "dev": true, - "requires": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" - } - }, - "babel-preset-jest": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", - "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", - "dev": true, - "requires": { - "babel-plugin-jest-hoist": "^26.6.2", - "babel-preset-current-node-syntax": "^1.0.0" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - } - } - }, - "base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true - }, - "big.js": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", - "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", - "dev": true - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, - "optional": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "dev": true, - "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", - "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", - "dev": true, - "requires": { - "bn.js": "^5.0.0", - "randombytes": "^2.0.1" - } - }, - "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", - "dev": true, - "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, - "browserslist": { - "version": "4.17.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.6.tgz", - "integrity": "sha512-uPgz3vyRTlEiCv4ee9KlsKgo2V6qPk7Jsn0KAn2OBqbqKo3iNcPEC1Ti6J4dwnz+aIRfEEEuOzC9IBk8tXUomw==", - "dev": true, - "requires": { - "caniuse-lite": "^1.0.30001274", - "electron-to-chromium": "^1.3.886", - "escalade": "^3.1.1", - "node-releases": "^2.0.1", - "picocolors": "^1.0.0" - } - }, - "bser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", - "dev": true, - "requires": { - "node-int64": "^0.4.0" - } - }, - "buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" - } - }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, - "cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "ssri": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", - "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - } - } - } - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "caniuse-lite": { - "version": "1.0.30001278", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001278.tgz", - "integrity": "sha512-mpF9KeH8u5cMoEmIic/cr7PNS+F5LWBk0t2ekGT60lFf0Wq+n9LspAj0g3P+o7DQhD3sUdlMln4YFAWhFYn9jg==", - "dev": true - }, - "capture-exit": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", - "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", - "dev": true, - "requires": { - "rsvp": "^4.8.4" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", - "dev": true - }, - "chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, - "chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", - "dev": true - }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "cjs-module-lexer": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", - "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", - "dev": true - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, - "collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", - "dev": true - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - }, - "dependencies": { - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-js-compat": { - "version": "3.19.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.19.1.tgz", - "integrity": "sha512-Q/VJ7jAF/y68+aUsQJ/afPOewdsGkDtcMb40J8MbuWKlK3Y+wtHq8bTHKPj2WKWLIqmS5JhHs4CzHtz6pT2W6g==", - "dev": true, - "requires": { - "browserslist": "^4.17.6", - "semver": "7.0.0" - }, - "dependencies": { - "semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", - "dev": true - } - } - }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", - "dev": true - }, - "cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", - "dev": true, - "requires": { - "cssom": "~0.3.6" - }, - "dependencies": { - "cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - } - } - }, - "cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, - "data-urls": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", - "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", - "dev": true, - "requires": { - "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0" - } - }, - "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, - "detect-newline": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", - "dev": true - }, - "diff-sequences": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", - "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", - "dev": true - }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, - "domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", - "dev": true, - "requires": { - "webidl-conversions": "^5.0.0" - }, - "dependencies": { - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true - } - } - }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, - "electron-to-chromium": { - "version": "1.3.890", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.890.tgz", - "integrity": "sha512-VWlVXSkv0cA/OOehrEyqjUTHwV8YXCPTfPvbtoeU2aHR21vI4Ejh5aC4AxUwOmbLbBgb6Gd3URZahoCxtBqCYQ==", - "dev": true - }, - "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dev": true, - "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "emittery": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", - "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "emojis-list": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", - "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", - "dev": true - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "enhanced-resolve": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", - "integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "memory-fs": "^0.5.0", - "tapable": "^1.0.0" - }, - "dependencies": { - "memory-fs": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", - "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - } - } - }, - "errno": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", - "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", - "dev": true, - "requires": { - "prr": "~1.0.1" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", - "dev": true, - "requires": { - "esprima": "^4.0.1", - "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - }, - "dependencies": { - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - } - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "exec-sh": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.6.tgz", - "integrity": "sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w==", - "dev": true - }, - "execa": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", - "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - } - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "expect": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", - "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "ansi-styles": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-regex-util": "^26.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - } - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", - "dev": true, - "requires": { - "bser": "2.1.1" - } - }, - "figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, - "optional": true - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - }, - "dependencies": { - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } - } - }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "optional": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, - "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - } - }, - "get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "dev": true - }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "optional": true, - "requires": { - "is-glob": "^4.0.1" - } - }, - "global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "dev": true, - "requires": { - "global-prefix": "^3.0.0" - } - }, - "global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, - "requires": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - }, - "dependencies": { - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true - }, - "graceful-fs": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", - "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", - "dev": true - }, - "growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", - "dev": true, - "optional": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "hosted-git-info": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", - "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", - "dev": true, - "requires": { - "whatwg-encoding": "^1.0.5" - } - }, - "html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "dev": true, - "requires": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "dev": true, - "requires": { - "agent-base": "6", - "debug": "4" - } - }, - "human-signals": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", - "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", - "dev": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, - "import-local": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.3.tgz", - "integrity": "sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA==", - "dev": true, - "requires": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true - }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "ini": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.6.tgz", - "integrity": "sha512-IZUoxEjNjubzrmvzZU4lKP7OnYmX72XRl3sqkfJhBKweKi5rnGi5+IUdlj/H1M+Ip5JQ1WzaDMOBRY90Ajc5jg==", - "dev": true - }, - "interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, - "is-core-module": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.0.tgz", - "integrity": "sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==", - "dev": true, - "requires": { - "has": "^1.0.3" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, - "optional": true - }, - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-potential-custom-element-name": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", - "dev": true - }, - "is-primitive": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-3.0.1.tgz", - "integrity": "sha512-GljRxhWvlCNRfZyORiH77FwdFwGcMO620o37EOYC0ORWdq+WYNVqW0w2Juzew4M+L81l6/QS3t5gkkihyRqv9w==", - "dev": true - }, - "is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, - "optional": true, - "requires": { - "is-docker": "^2.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", - "dev": true - }, - "istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", - "dev": true, - "requires": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" - } - }, - "istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "istanbul-reports": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.5.tgz", - "integrity": "sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ==", - "dev": true, - "requires": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - } - }, - "jest": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", - "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", - "dev": true, - "requires": { - "@jest/core": "^26.6.3", - "import-local": "^3.0.2", - "jest-cli": "^26.6.3" - } - }, - "jest-changed-files": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", - "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "execa": "^4.0.0", - "throat": "^5.0.0" - } - }, - "jest-cli": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", - "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", - "dev": true, - "requires": { - "@jest/core": "^26.6.3", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "import-local": "^3.0.2", - "is-ci": "^2.0.0", - "jest-config": "^26.6.3", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "prompts": "^2.0.1", - "yargs": "^15.4.1" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-config": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", - "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", - "dev": true, - "requires": { - "@babel/core": "^7.1.0", - "@jest/test-sequencer": "^26.6.3", - "@jest/types": "^26.6.2", - "babel-jest": "^26.6.3", - "chalk": "^4.0.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.1", - "graceful-fs": "^4.2.4", - "jest-environment-jsdom": "^26.6.2", - "jest-environment-node": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-jasmine2": "^26.6.3", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-diff": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", - "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "diff-sequences": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-docblock": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz", - "integrity": "sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w==", - "dev": true, - "requires": { - "detect-newline": "^3.0.0" - } - }, - "jest-each": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", - "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-environment-jsdom": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", - "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", - "dev": true, - "requires": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2", - "jsdom": "^16.4.0" - } - }, - "jest-environment-node": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", - "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", - "dev": true, - "requires": { - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "jest-mock": "^26.6.2", - "jest-util": "^26.6.2" - } - }, - "jest-get-type": { - "version": "26.3.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", - "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==", - "dev": true - }, - "jest-haste-map": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", - "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "@types/graceful-fs": "^4.1.2", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", - "graceful-fs": "^4.2.4", - "jest-regex-util": "^26.0.0", - "jest-serializer": "^26.6.2", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "micromatch": "^4.0.2", - "sane": "^4.0.3", - "walker": "^1.0.7" - } - }, - "jest-jasmine2": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", - "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", - "dev": true, - "requires": { - "@babel/traverse": "^7.1.0", - "@jest/environment": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "expect": "^26.6.2", - "is-generator-fn": "^2.0.0", - "jest-each": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "pretty-format": "^26.6.2", - "throat": "^5.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-leak-detector": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", - "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", - "dev": true, - "requires": { - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" - } - }, - "jest-matcher-utils": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", - "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "pretty-format": "^26.6.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-message-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", - "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "pretty-format": "^26.6.2", - "slash": "^3.0.0", - "stack-utils": "^2.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-mock": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", - "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "@types/node": "*" - } - }, - "jest-pnp-resolver": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", - "dev": true, - "requires": {} - }, - "jest-regex-util": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz", - "integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==", - "dev": true - }, - "jest-resolve": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", - "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^26.6.2", - "read-pkg-up": "^7.0.1", - "resolve": "^1.18.1", - "slash": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-resolve-dependencies": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", - "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-snapshot": "^26.6.2" - } - }, - "jest-runner": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", - "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", - "dev": true, - "requires": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.7.1", - "exit": "^0.1.2", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-docblock": "^26.0.0", - "jest-haste-map": "^26.6.2", - "jest-leak-detector": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "jest-runtime": "^26.6.3", - "jest-util": "^26.6.2", - "jest-worker": "^26.6.2", - "source-map-support": "^0.5.6", - "throat": "^5.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-runtime": { - "version": "26.6.3", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", - "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", - "dev": true, - "requires": { - "@jest/console": "^26.6.2", - "@jest/environment": "^26.6.2", - "@jest/fake-timers": "^26.6.2", - "@jest/globals": "^26.6.2", - "@jest/source-map": "^26.6.2", - "@jest/test-result": "^26.6.2", - "@jest/transform": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0", - "cjs-module-lexer": "^0.6.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.4", - "jest-config": "^26.6.3", - "jest-haste-map": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-mock": "^26.6.2", - "jest-regex-util": "^26.0.0", - "jest-resolve": "^26.6.2", - "jest-snapshot": "^26.6.2", - "jest-util": "^26.6.2", - "jest-validate": "^26.6.2", - "slash": "^3.0.0", - "strip-bom": "^4.0.0", - "yargs": "^15.4.1" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-serializer": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", - "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", - "dev": true, - "requires": { - "@types/node": "*", - "graceful-fs": "^4.2.4" - } - }, - "jest-snapshot": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", - "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", - "dev": true, - "requires": { - "@babel/types": "^7.0.0", - "@jest/types": "^26.6.2", - "@types/babel__traverse": "^7.0.4", - "@types/prettier": "^2.0.0", - "chalk": "^4.0.0", - "expect": "^26.6.2", - "graceful-fs": "^4.2.4", - "jest-diff": "^26.6.2", - "jest-get-type": "^26.3.0", - "jest-haste-map": "^26.6.2", - "jest-matcher-utils": "^26.6.2", - "jest-message-util": "^26.6.2", - "jest-resolve": "^26.6.2", - "natural-compare": "^1.4.0", - "pretty-format": "^26.6.2", - "semver": "^7.3.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-util": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", - "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "@types/node": "*", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "micromatch": "^4.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-validate": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", - "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "camelcase": "^6.0.0", - "chalk": "^4.0.0", - "jest-get-type": "^26.3.0", - "leven": "^3.1.0", - "pretty-format": "^26.6.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-watcher": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", - "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", - "dev": true, - "requires": { - "@jest/test-result": "^26.6.2", - "@jest/types": "^26.6.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "jest-util": "^26.6.2", - "string-length": "^4.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-worker": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", - "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", - "dev": true, - "requires": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsdom": { - "version": "16.7.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", - "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", - "dev": true, - "requires": { - "abab": "^2.0.5", - "acorn": "^8.2.4", - "acorn-globals": "^6.0.0", - "cssom": "^0.4.4", - "cssstyle": "^2.3.0", - "data-urls": "^2.0.0", - "decimal.js": "^10.2.1", - "domexception": "^2.0.1", - "escodegen": "^2.0.0", - "form-data": "^3.0.0", - "html-encoding-sniffer": "^2.0.1", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", - "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.5.0", - "ws": "^7.4.6", - "xml-name-validator": "^3.0.0" - }, - "dependencies": { - "ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", - "dev": true, - "requires": {} - } - } - }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "json-parse-even-better-errors": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "dev": true - }, - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true - }, - "leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "dev": true - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, - "loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", - "dev": true - }, - "loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", - "dev": true, - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - }, - "dependencies": { - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, - "requires": { - "minimist": "^1.2.0" - } - } - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "makeerror": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", - "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", - "dev": true, - "requires": { - "tmpl": "1.0.5" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "mime-db": { - "version": "1.50.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", - "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==", - "dev": true - }, - "mime-types": { - "version": "2.1.33", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", - "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", - "dev": true, - "requires": { - "mime-db": "1.50.0" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "minipass": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", - "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - } - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - }, - "dependencies": { - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } - } - }, - "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 - }, - "nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", - "dev": true, - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", - "dev": true - }, - "node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, - "node-modules-regexp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", - "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", - "dev": true - }, - "node-notifier": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.2.tgz", - "integrity": "sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg==", - "dev": true, - "optional": true, - "requires": { - "growly": "^1.3.0", - "is-wsl": "^2.2.0", - "semver": "^7.3.2", - "shellwords": "^0.1.1", - "uuid": "^8.3.0", - "which": "^2.0.2" - }, - "dependencies": { - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "optional": true, - "requires": { - "lru-cache": "^6.0.0" - } - } - } - }, - "node-releases": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", - "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", - "dev": true - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, - "requires": { - "path-key": "^3.0.0" - } - }, - "nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "p-each-series": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", - "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "requires": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, - "parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "dev": true, - "requires": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, - "parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true, - "optional": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true - }, - "pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", - "dev": true - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pirates": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", - "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", - "dev": true, - "requires": { - "node-modules-regexp": "^1.0.0" - } - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "pretty-format": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", - "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", - "dev": true, - "requires": { - "@jest/types": "^26.6.2", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^17.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, - "prompts": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", - "dev": true, - "requires": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" - } - }, - "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", - "dev": true - }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "dev": true - }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", - "dev": true - } - } - }, - "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, - "react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "dev": true - }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true - } - } - }, - "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "dev": true, - "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "optional": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "regenerate": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", - "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", - "dev": true - }, - "regenerate-unicode-properties": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz", - "integrity": "sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==", - "dev": true, - "requires": { - "regenerate": "^1.4.2" - } - }, - "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", - "dev": true - }, - "regenerator-transform": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", - "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", - "dev": true, - "requires": { - "@babel/runtime": "^7.8.4" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "regexpu-core": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", - "integrity": "sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==", - "dev": true, - "requires": { - "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^9.0.0", - "regjsgen": "^0.5.2", - "regjsparser": "^0.7.0", - "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.0.0" - } - }, - "regjsgen": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", - "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", - "dev": true - }, - "regjsparser": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.7.0.tgz", - "integrity": "sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==", - "dev": true, - "requires": { - "jsesc": "~0.5.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", - "dev": true - } - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", - "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, - "resolve-cwd": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", - "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", - "dev": true, - "requires": { - "resolve-from": "^5.0.0" - } - }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "dependencies": { - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "rsvp": { - "version": "4.8.5", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", - "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", - "dev": true - }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "sane": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", - "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", - "dev": true, - "requires": { - "@cnakazawa/watch": "^1.0.3", - "anymatch": "^2.0.0", - "capture-exit": "^2.0.0", - "exec-sh": "^0.3.2", - "execa": "^1.0.0", - "fb-watchman": "^2.0.0", - "micromatch": "^3.1.4", - "minimist": "^1.1.1", - "walker": "~1.0.5" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "dev": true, - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "^2.0.0" - } - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", - "dev": true, - "requires": { - "xmlchars": "^2.2.0" - } - }, - "schema-utils": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", - "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", - "dev": true, - "requires": { - "@types/json-schema": "^7.0.5", - "ajv": "^6.12.4", - "ajv-keywords": "^3.5.2" - } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - }, - "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-4.1.0.tgz", - "integrity": "sha512-zTEg4HL0RwVrqcWs3ztF+x1vkxfm0lP+MQQFPiMJTKVceBwEV0A569Ou8l9IYQG8jOZdMVI1hGsc0tmeD2o/Lw==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4", - "is-primitive": "^3.0.1" - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", - "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", - "dev": true - }, - "sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-list-map": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", - "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", - "dev": true - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.20", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", - "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "source-map-url": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", - "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", - "dev": true - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz", - "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "ssri": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", - "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "dev": true, - "requires": { - "minipass": "^3.1.1" - } - }, - "stack-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", - "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", - "dev": true, - "requires": { - "escape-string-regexp": "^2.0.0" - }, - "dependencies": { - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - } - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "string-length": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", - "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", - "dev": true, - "requires": { - "char-regex": "^1.0.2", - "strip-ansi": "^6.0.0" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-final-newline": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "supports-hyperlinks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", - "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", - "dev": true, - "requires": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "symbol-tree": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", - "dev": true - }, - "tapable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", - "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", - "dev": true - }, - "terminal-link": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", - "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", - "dev": true, - "requires": { - "ansi-escapes": "^4.2.1", - "supports-hyperlinks": "^2.0.0" - } - }, - "terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", - "dev": true, - "requires": { - "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "terser-webpack-plugin": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", - "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", - "dev": true, - "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^4.0.0", - "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" - }, - "dependencies": { - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", - "dev": true, - "requires": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" - } - }, - "throat": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", - "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "timers-browserify": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", - "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, - "tmpl": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "dev": true - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", - "dev": true, - "requires": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.1.2" - } - }, - "tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", - "dev": true, - "requires": { - "punycode": "^2.1.1" - } - }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, - "unicode-canonical-property-names-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", - "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", - "dev": true - }, - "unicode-match-property-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", - "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", - "dev": true, - "requires": { - "unicode-canonical-property-names-ecmascript": "^2.0.0", - "unicode-property-aliases-ecmascript": "^2.0.0" - } - }, - "unicode-match-property-value-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", - "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", - "dev": true - }, - "unicode-property-aliases-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", - "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", - "dev": true - }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - } - } - } - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "optional": true - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, - "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "optional": true - }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "v8-to-istanbul": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.2.tgz", - "integrity": "sha512-TxNb7YEUwkLXCQYeudi6lgQ/SZrzNO4kMdlqVxaZPUIUjCv6iSSypUQX70kNBSERpQ8fk48+d61FXk+tgqcWow==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0", - "source-map": "^0.7.3" - }, - "dependencies": { - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - } - } - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, - "w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "dev": true, - "requires": { - "browser-process-hrtime": "^1.0.0" - } - }, - "w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", - "dev": true, - "requires": { - "xml-name-validator": "^3.0.0" - } - }, - "walker": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", - "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", - "dev": true, - "requires": { - "makeerror": "1.0.12" - } - }, - "watchpack": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", - "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", - "dev": true, - "requires": { - "chokidar": "^3.4.1", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.1" - } - }, - "watchpack-chokidar2": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", - "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", - "dev": true, - "optional": true, - "requires": { - "chokidar": "^2.1.8" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "optional": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "optional": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "optional": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "dev": true, - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1" - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "optional": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "optional": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, - "optional": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "optional": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } - } - }, - "webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", - "dev": true - }, - "webpack": { - "version": "4.46.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz", - "integrity": "sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q==", - "dev": true, - "requires": { - "@webassemblyjs/ast": "1.9.0", - "@webassemblyjs/helper-module-context": "1.9.0", - "@webassemblyjs/wasm-edit": "1.9.0", - "@webassemblyjs/wasm-parser": "1.9.0", - "acorn": "^6.4.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.5.0", - "eslint-scope": "^4.0.3", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.3", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.3", - "watchpack": "^1.7.4", - "webpack-sources": "^1.4.1" - }, - "dependencies": { - "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "dev": true, - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } - } - }, - "webpack-cli": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", - "integrity": "sha512-NVWBaz9k839ZH/sinurM+HcDvJOTXwSjYp1ku+5XKeOC03z8v5QitnK/x+lAxGXFyhdayoIf/GOpv85z3/xPag==", - "dev": true, - "requires": { - "chalk": "^2.4.2", - "cross-spawn": "^6.0.5", - "enhanced-resolve": "^4.1.1", - "findup-sync": "^3.0.0", - "global-modules": "^2.0.0", - "import-local": "^2.0.0", - "interpret": "^1.4.0", - "loader-utils": "^1.4.0", - "supports-color": "^6.1.0", - "v8-compile-cache": "^2.1.1", - "yargs": "^13.3.2" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", - "dev": true, - "requires": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", - "dev": true, - "requires": { - "find-up": "^3.0.0" - } - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - } - }, - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" } }, - "webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", + "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", + "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", "dev": true, "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" }, "dependencies": { "source-map": { @@ -21406,190 +7439,333 @@ } } }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, + "peer": true, "requires": { - "iconv-lite": "0.4.24" + "ansi-regex": "^5.0.1" } }, - "whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true }, - "whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "requires": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" - } + "peer": true }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "isexe": "^2.0.0" + "has-flag": "^3.0.0" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", "dev": true }, - "worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "terser": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", + "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", "dev": true, "requires": { - "errno": "~0.1.7" + "commander": "^2.20.0", + "source-map": "~0.7.2", + "source-map-support": "~0.5.20" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true + } } }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "terser-webpack-plugin": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.0.tgz", + "integrity": "sha512-LPIisi3Ol4chwAaPP8toUJ3L4qCM1G0wao7L3qNv57Drezxj6+VEyySpPw4B1HSO2Eg/hDY/MNF5XihCAoqnsQ==", "dev": true, "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "jest-worker": "^27.4.1", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.0", + "source-map": "^0.6.1", + "terser": "^5.7.2" }, "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", "dev": true, "requires": { - "color-name": "~1.1.4" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true, + "peer": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, - "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "is-number": "^7.0.0" } }, - "ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, - "requires": {} + "peer": true, + "requires": { + "prelude-ls": "^1.2.1" + } }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "peer": true }, - "xmlchars": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "unicode-canonical-property-names-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", "dev": true }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true + "unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + } }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "unicode-match-property-value-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", + "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", "dev": true }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "unicode-property-aliases-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", + "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", "dev": true }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true, + "peer": true + }, + "watchpack": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz", + "integrity": "sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA==", "dev": true, "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + } + }, + "webpack": { + "version": "5.66.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.66.0.tgz", + "integrity": "sha512-NJNtGT7IKpGzdW7Iwpn/09OXz9inIkeIQ/ibY6B+MdV1x6+uReqz/5z1L89ezWnpPDWpXF0TY5PCYKQdWVn8Vg==", + "dev": true, + "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.50", + "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/wasm-edit": "1.11.1", + "@webassemblyjs/wasm-parser": "1.11.1", + "acorn": "^8.4.1", + "acorn-import-assertions": "^1.7.6", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.8.3", + "es-module-lexer": "^0.9.0", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.1.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.1.3", + "watchpack": "^2.3.1", + "webpack-sources": "^3.2.2" + }, + "dependencies": { + "schema-utils": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", + "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + } + } + }, + "webpack-cli": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.1.tgz", + "integrity": "sha512-JYRFVuyFpzDxMDB+v/nanUdQYcZtqFPGzmlW4s+UkPMFhSpfRNmf1z4AwYcHJVdvEFAM7FFCQdNTpsBYhDLusQ==", + "dev": true, + "requires": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^1.1.0", + "@webpack-cli/info": "^1.4.0", + "@webpack-cli/serve": "^1.6.0", + "colorette": "^2.0.14", + "commander": "^7.0.0", + "execa": "^5.0.0", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^2.2.0", + "rechoir": "^0.7.0", + "webpack-merge": "^5.7.3" }, "dependencies": { - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true } } }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "webpack-merge": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz", + "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==", + "dev": true, + "requires": { + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" + } + }, + "webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "isexe": "^2.0.0" } + }, + "wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "peer": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true } } } diff --git a/runtime/JavaScript/package.json b/runtime/JavaScript/package.json index dbb1934927..51cb034aeb 100644 --- a/runtime/JavaScript/package.json +++ b/runtime/JavaScript/package.json @@ -1,6 +1,7 @@ { "name": "antlr4", - "version": "4.9.3", + "version": "4.10.0", + "type": "module", "description": "JavaScript runtime for ANTLR4", "main": "src/antlr4/index.js", "repository": "antlr/antlr4.git", @@ -17,28 +18,27 @@ }, "homepage": "https://github.com/antlr/antlr4", "devDependencies": { - "@babel/core": "^7.13.10", - "@babel/preset-env": "^7.13.10", - "ansi-regex": "^5.0.1", - "babel-loader": "^8.2.2", - "browserslist": ">=4.16.5", - "hosted-git-info": ">=2.8.9", - "ini": "1.3.6", - "jest": "^26.6.3", - "path-parse": ">=1.0.7", - "set-value": ">=4.0.1", - "ssri": ">=6.0.2", - "tmpl": "^1.0.5", - "webpack": "^4.46.0", - "webpack-cli": "^3.3.12", - "ws": ">=7.4.6", - "y18n": ">=4.0.1" + "@babel/preset-env": "^7.16.11", + "babel-loader": "^8.2.4", + "eslint-plugin-es5": "^1.5.0", + "eslint-webpack-plugin": "^3.1.1", + "glob-parent": "^6.0.2", + "jasmine": "^4.0.2", + "jasmine-spec-reporter": "^7.0.0", + "minimist": "^1.2.6", + "webpack": "^5.66.0", + "webpack-cli": "^4.9.1" }, "scripts": { "build": "webpack", - "test": "jest" + "test": "jasmine" }, "engines": { "node": ">=14" + }, + "browser": { + "fs": false, + "net": false, + "module": false } } diff --git a/runtime/JavaScript/spec/IntervalSetSpec.js b/runtime/JavaScript/spec/IntervalSetSpec.js new file mode 100644 index 0000000000..78baa6f77e --- /dev/null +++ b/runtime/JavaScript/spec/IntervalSetSpec.js @@ -0,0 +1,61 @@ +import antlr4 from "../src/antlr4/index.js"; +const IntervalSet = antlr4.IntervalSet; + +describe('IntervalSet', () => { + it("computes interval set length", () => { + const s1 = new IntervalSet(); + s1.addOne(20); + s1.addOne(154); + s1.addRange(169, 171); + expect(s1.length).toEqual(5); + }); + + it("merges simple interval sets", () => { + const s1 = new IntervalSet(); + s1.addOne(10); + expect(s1.toString()).toEqual("10"); + const s2 = new IntervalSet(); + s2.addOne(12); + expect(s2.toString()).toEqual("12"); + const merged = new IntervalSet(); + merged.addSet(s1); + expect(merged.toString()).toEqual("10"); + merged.addSet(s2); + expect(merged.toString()).toEqual("{10, 12}"); + let s3 = new IntervalSet(); + s3.addOne(10); + merged.addSet(s3); + expect(merged.toString()).toEqual("{10, 12}"); + s3 = new IntervalSet(); + s3.addOne(11); + merged.addSet(s3); + expect(merged.toString()).toEqual("10..12"); + s3 = new IntervalSet(); + s3.addOne(12); + merged.addSet(s3); + expect(merged.toString()).toEqual("10..12"); + + }); + + it("merges complex interval sets", () => { + const s1 = new IntervalSet(); + s1.addOne(20); + s1.addOne(141); + s1.addOne(144); + s1.addOne(154); + s1.addRange(169, 171); + s1.addOne(173); + expect(s1.toString()).toEqual("{20, 141, 144, 154, 169..171, 173}"); + const s2 = new IntervalSet(); + s2.addRange(9, 14); + s2.addOne(53); + s2.addRange(55, 63); + s2.addRange(65, 72); + s2.addRange(74, 117); + s2.addRange(119, 152); + s2.addRange(154, 164); + expect(s2.toString()).toEqual("{9..14, 53, 55..63, 65..72, 74..117, 119..152, 154..164}"); + s1.addSet(s2); + expect(s1.toString()).toEqual("{9..14, 20, 53, 55..63, 65..72, 74..117, 119..152, 154..164, 169..171, 173}"); + }); +}); diff --git a/runtime/JavaScript/spec/helpers/Reporter.js b/runtime/JavaScript/spec/helpers/Reporter.js new file mode 100644 index 0000000000..d1cf4c0978 --- /dev/null +++ b/runtime/JavaScript/spec/helpers/Reporter.js @@ -0,0 +1,10 @@ +import { SpecReporter } from 'jasmine-spec-reporter'; + +jasmine.getEnv().clearReporters(); +jasmine.getEnv().addReporter( + new SpecReporter({ + spec: { + displayPending: true, + }, + }) +); diff --git a/runtime/JavaScript/spec/support/jasmine.json b/runtime/JavaScript/spec/support/jasmine.json new file mode 100644 index 0000000000..b62f0ad643 --- /dev/null +++ b/runtime/JavaScript/spec/support/jasmine.json @@ -0,0 +1,12 @@ +{ + "spec_dir": "spec", + "spec_files": [ + "**/*Spec.js" + ], + "helpers": [ + "helpers/**/*.js" + ], + "env": { + "random": false + } +} diff --git a/runtime/JavaScript/src/antlr4/BufferedTokenStream.js b/runtime/JavaScript/src/antlr4/BufferedTokenStream.js index 4d5a131487..019c34efdf 100644 --- a/runtime/JavaScript/src/antlr4/BufferedTokenStream.js +++ b/runtime/JavaScript/src/antlr4/BufferedTokenStream.js @@ -1,14 +1,12 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Token} = require('./Token'); -const Lexer = require('./Lexer'); -const {Interval} = require('./IntervalSet'); - -// this is just to keep meaningful parameter types to Parser -class TokenStream {} +import Token from './Token.js'; +import Lexer from './Lexer.js'; +import Interval from './misc/Interval.js'; +import TokenStream from "./TokenStream.js"; /** * This implementation of {@link TokenStream} loads tokens from a @@ -22,7 +20,7 @@ class TokenStream {} * {@link Token//HIDDEN_CHANNEL}, use a filtering token stream such a * {@link CommonTokenStream}.

*/ -class BufferedTokenStream extends TokenStream { +export default class BufferedTokenStream extends TokenStream { constructor(tokenSource) { super(); @@ -381,6 +379,3 @@ class BufferedTokenStream extends TokenStream { } } } - - -module.exports = BufferedTokenStream; diff --git a/runtime/JavaScript/src/antlr4/CharStreams.js b/runtime/JavaScript/src/antlr4/CharStreams.js index fcf4ae8f2e..befafb353e 100644 --- a/runtime/JavaScript/src/antlr4/CharStreams.js +++ b/runtime/JavaScript/src/antlr4/CharStreams.js @@ -1,10 +1,10 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const InputStream = require('./InputStream'); -const fs = require("fs"); +import InputStream from './InputStream.js'; +import fs from "fs"; /** * Utility functions to create InputStreams from various sources. @@ -13,7 +13,7 @@ const fs = require("fs"); * up to U+10FFFF (the default behavior of InputStream only supports * code points up to U+FFFF). */ -const CharStreams = { +export default { // Creates an InputStream from a string. fromString: function(str) { return new InputStream(str, true); @@ -72,5 +72,3 @@ const CharStreams = { return new InputStream(data, true); } }; - -module.exports = CharStreams; diff --git a/runtime/JavaScript/src/antlr4/CommonToken.js b/runtime/JavaScript/src/antlr4/CommonToken.js new file mode 100644 index 0000000000..a4ed1b7713 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/CommonToken.js @@ -0,0 +1,80 @@ +import Token from "./Token.js"; + +export default class CommonToken extends Token { + constructor(source, type, channel, start, stop) { + super(); + this.source = source !== undefined ? source : CommonToken.EMPTY_SOURCE; + this.type = type !== undefined ? type : null; + this.channel = channel !== undefined ? channel : Token.DEFAULT_CHANNEL; + this.start = start !== undefined ? start : -1; + this.stop = stop !== undefined ? stop : -1; + this.tokenIndex = -1; + if (this.source[0] !== null) { + this.line = source[0].line; + this.column = source[0].column; + } else { + this.column = -1; + } + } + + /** + * Constructs a new {@link CommonToken} as a copy of another {@link Token}. + * + *

+ * If {@code oldToken} is also a {@link CommonToken} instance, the newly + * constructed token will share a reference to the {@link //text} field and + * the {@link Pair} stored in {@link //source}. Otherwise, {@link //text} will + * be assigned the result of calling {@link //getText}, and {@link //source} + * will be constructed from the result of {@link Token//getTokenSource} and + * {@link Token//getInputStream}.

+ * + * @param oldToken The token to copy. + */ + clone() { + const t = new CommonToken(this.source, this.type, this.channel, this.start, this.stop); + t.tokenIndex = this.tokenIndex; + t.line = this.line; + t.column = this.column; + t.text = this.text; + return t; + } + + toString() { + let txt = this.text; + if (txt !== null) { + txt = txt.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t"); + } else { + txt = ""; + } + return "[@" + this.tokenIndex + "," + this.start + ":" + this.stop + "='" + + txt + "',<" + this.type + ">" + + (this.channel > 0 ? ",channel=" + this.channel : "") + "," + + this.line + ":" + this.column + "]"; + } + + get text(){ + if (this._text !== null) { + return this._text; + } + const input = this.getInputStream(); + if (input === null) { + return null; + } + const n = input.size; + if (this.start < n && this.stop < n) { + return input.getText(this.start, this.stop); + } else { + return ""; + } + } + + set text(text) { + this._text = text; + } +} + +/** + * An empty {@link Pair} which is used as the default value of + * {@link //source} for tokens that do not have a source. + */ +CommonToken.EMPTY_SOURCE = [ null, null ]; diff --git a/runtime/JavaScript/src/antlr4/CommonTokenFactory.js b/runtime/JavaScript/src/antlr4/CommonTokenFactory.js index 4b7a8dbd13..987999c525 100644 --- a/runtime/JavaScript/src/antlr4/CommonTokenFactory.js +++ b/runtime/JavaScript/src/antlr4/CommonTokenFactory.js @@ -1,9 +1,9 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const CommonToken = require('./Token').CommonToken; +import CommonToken from './CommonToken.js'; class TokenFactory {} @@ -11,7 +11,7 @@ class TokenFactory {} * This default implementation of {@link TokenFactory} creates * {@link CommonToken} objects. */ -class CommonTokenFactory extends TokenFactory { +export default class CommonTokenFactory extends TokenFactory { constructor(copyText) { super(); /** @@ -59,5 +59,3 @@ class CommonTokenFactory extends TokenFactory { * tokens.

*/ CommonTokenFactory.DEFAULT = new CommonTokenFactory(); - -module.exports = CommonTokenFactory; diff --git a/runtime/JavaScript/src/antlr4/CommonTokenStream.js b/runtime/JavaScript/src/antlr4/CommonTokenStream.js index 76c4ce3a08..0e44e009ad 100644 --- a/runtime/JavaScript/src/antlr4/CommonTokenStream.js +++ b/runtime/JavaScript/src/antlr4/CommonTokenStream.js @@ -1,11 +1,11 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const Token = require('./Token').Token; -const BufferedTokenStream = require('./BufferedTokenStream'); +import Token from './Token.js'; +import BufferedTokenStream from './BufferedTokenStream.js'; /** * This class extends {@link BufferedTokenStream} with functionality to filter @@ -31,7 +31,7 @@ const BufferedTokenStream = require('./BufferedTokenStream'); * such a rule will not be available as part of the token stream, regardless of * channel.

*/ -class CommonTokenStream extends BufferedTokenStream { +export default class CommonTokenStream extends BufferedTokenStream { constructor(lexer, channel) { super(lexer); this.channel = channel===undefined ? Token.DEFAULT_CHANNEL : channel; @@ -96,5 +96,3 @@ class CommonTokenStream extends BufferedTokenStream { return n; } } - -module.exports = CommonTokenStream; diff --git a/runtime/JavaScript/src/antlr4/FileStream.js b/runtime/JavaScript/src/antlr4/FileStream.js index 8632ec64c5..942ffa0706 100644 --- a/runtime/JavaScript/src/antlr4/FileStream.js +++ b/runtime/JavaScript/src/antlr4/FileStream.js @@ -1,21 +1,19 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const InputStream = require('./InputStream'); -const fs = require("fs"); +import InputStream from './InputStream.js'; +import fs from "fs"; /** * This is an InputStream that is loaded from a file all at once * when you construct the object. */ -class FileStream extends InputStream { +export default class FileStream extends InputStream { constructor(fileName, decodeToUnicodeCodePoints) { const data = fs.readFileSync(fileName, "utf8"); super(data, decodeToUnicodeCodePoints); this.fileName = fileName; } } - -module.exports = FileStream diff --git a/runtime/JavaScript/src/antlr4/InputStream.js b/runtime/JavaScript/src/antlr4/InputStream.js index 5493774ac3..63635c5c22 100644 --- a/runtime/JavaScript/src/antlr4/InputStream.js +++ b/runtime/JavaScript/src/antlr4/InputStream.js @@ -1,11 +1,11 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Token} = require('./Token'); -require('./polyfills/codepointat'); -require('./polyfills/fromcodepoint'); +import Token from './Token.js'; +import './polyfills/codepointat.js'; +import './polyfills/fromcodepoint.js'; /** * If decodeToUnicodeCodePoints is true, the input is treated @@ -14,7 +14,7 @@ require('./polyfills/fromcodepoint'); * Otherwise, the input is treated as a series of 16-bit UTF-16 code * units. */ -class InputStream { +export default class InputStream { constructor(data, decodeToUnicodeCodePoints) { this.name = ""; this.strdata = data; @@ -126,6 +126,3 @@ class InputStream { return this._size; } } - - -module.exports = InputStream; diff --git a/runtime/JavaScript/src/antlr4/Lexer.js b/runtime/JavaScript/src/antlr4/Lexer.js index 0c80ebaae0..0d1a494597 100644 --- a/runtime/JavaScript/src/antlr4/Lexer.js +++ b/runtime/JavaScript/src/antlr4/Lexer.js @@ -1,22 +1,20 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Token} = require('./Token'); -const Recognizer = require('./Recognizer'); -const CommonTokenFactory = require('./CommonTokenFactory'); -const {RecognitionException} = require('./error/Errors'); -const {LexerNoViableAltException} = require('./error/Errors'); - -class TokenSource {} +import Token from './Token.js'; +import Recognizer from './Recognizer.js'; +import CommonTokenFactory from './CommonTokenFactory.js'; +import RecognitionException from './error/RecognitionException.js'; +import LexerNoViableAltException from './error/LexerNoViableAltException.js'; /** * A lexer is recognizer that draws input symbols from a character stream. * lexer grammars result in a subclass of this object. A Lexer object * uses simplified match() and error recovery mechanisms in the interest of speed. */ -class Lexer extends Recognizer { +export default class Lexer extends Recognizer { constructor(input) { super(); this._input = input; @@ -101,7 +99,7 @@ class Lexer extends Recognizer { */ const tokenStartMarker = this._input.mark(); try { - while (true) { + for (;;) { if (this._hitEOF) { this.emitEOF(); return this._token; @@ -113,7 +111,7 @@ class Lexer extends Recognizer { this._tokenStartLine = this._interp.line; this._text = null; let continueOuter = false; - while (true) { + for (;;) { this._type = Token.INVALID_TYPE; let ttype = Lexer.SKIP; try { @@ -368,7 +366,3 @@ Lexer.HIDDEN = Token.HIDDEN_CHANNEL; Lexer.MIN_CHAR_VALUE = 0x0000; Lexer.MAX_CHAR_VALUE = 0x10FFFF; -// Set the char stream and reset the lexer - - -module.exports = Lexer; diff --git a/runtime/JavaScript/src/antlr4/Parser.js b/runtime/JavaScript/src/antlr4/Parser.js index 61bf99d953..47830df87c 100644 --- a/runtime/JavaScript/src/antlr4/Parser.js +++ b/runtime/JavaScript/src/antlr4/Parser.js @@ -1,681 +1,632 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Token} = require('./Token'); -const {ParseTreeListener, TerminalNode, ErrorNode} = require('./tree/Tree'); -const Recognizer = require('./Recognizer'); -const {DefaultErrorStrategy} = require('./error/ErrorStrategy'); -const ATNDeserializer = require('./atn/ATNDeserializer'); -const ATNDeserializationOptions = require('./atn/ATNDeserializationOptions'); -const Lexer = require('./Lexer'); - -class TraceListener extends ParseTreeListener { - constructor(parser) { - super(); - this.parser = parser; - } - - enterEveryRule(ctx) { - console.log("enter " + this.parser.ruleNames[ctx.ruleIndex] + ", LT(1)=" + this.parser._input.LT(1).text); - } - - visitTerminal(node) { - console.log("consume " + node.symbol + " rule " + this.parser.ruleNames[this.parser._ctx.ruleIndex]); - } - - exitEveryRule(ctx) { - console.log("exit " + this.parser.ruleNames[ctx.ruleIndex] + ", LT(1)=" + this.parser._input.LT(1).text); - } -} - -class Parser extends Recognizer { - /** - * this is all the parsing support code essentially; most of it is error - * recovery stuff. - */ - constructor(input) { - super(); - // The input stream. - this._input = null; - /** - * The error handling strategy for the parser. The default value is a new - * instance of {@link DefaultErrorStrategy}. - */ - this._errHandler = new DefaultErrorStrategy(); - this._precedenceStack = []; - this._precedenceStack.push(0); - /** - * The {@link ParserRuleContext} object for the currently executing rule. - * this is always non-null during the parsing process. - */ - this._ctx = null; - /** - * Specifies whether or not the parser should construct a parse tree during - * the parsing process. The default value is {@code true}. - */ - this.buildParseTrees = true; - /** - * When {@link //setTrace}{@code (true)} is called, a reference to the - * {@link TraceListener} is stored here so it can be easily removed in a - * later call to {@link //setTrace}{@code (false)}. The listener itself is - * implemented as a parser listener so this field is not directly used by - * other parser methods. - */ - this._tracer = null; - /** - * The list of {@link ParseTreeListener} listeners registered to receive - * events during the parse. - */ - this._parseListeners = null; - /** - * The number of syntax errors reported during parsing. this value is - * incremented each time {@link //notifyErrorListeners} is called. - */ - this._syntaxErrors = 0; - this.setInputStream(input); - } - - // reset the parser's state - reset() { - if (this._input !== null) { - this._input.seek(0); - } - this._errHandler.reset(this); - this._ctx = null; - this._syntaxErrors = 0; - this.setTrace(false); - this._precedenceStack = []; - this._precedenceStack.push(0); - if (this._interp !== null) { - this._interp.reset(); - } - } - - /** - * Match current input symbol against {@code ttype}. If the symbol type - * matches, {@link ANTLRErrorStrategy//reportMatch} and {@link //consume} are - * called to complete the match process. - * - *

If the symbol type does not match, - * {@link ANTLRErrorStrategy//recoverInline} is called on the current error - * strategy to attempt recovery. If {@link //getBuildParseTree} is - * {@code true} and the token index of the symbol returned by - * {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to - * the parse tree by calling {@link ParserRuleContext//addErrorNode}.

- * - * @param ttype the token type to match - * @return the matched symbol - * @throws RecognitionException if the current input symbol did not match - * {@code ttype} and the error strategy could not recover from the - * mismatched symbol - */ - match(ttype) { - let t = this.getCurrentToken(); - if (t.type === ttype) { - this._errHandler.reportMatch(this); - this.consume(); - } else { - t = this._errHandler.recoverInline(this); - if (this.buildParseTrees && t.tokenIndex === -1) { - // we must have conjured up a new token during single token - // insertion - // if it's not the current symbol - this._ctx.addErrorNode(t); - } - } - return t; - } - - /** - * Match current input symbol as a wildcard. If the symbol type matches - * (i.e. has a value greater than 0), {@link ANTLRErrorStrategy//reportMatch} - * and {@link //consume} are called to complete the match process. - * - *

If the symbol type does not match, - * {@link ANTLRErrorStrategy//recoverInline} is called on the current error - * strategy to attempt recovery. If {@link //getBuildParseTree} is - * {@code true} and the token index of the symbol returned by - * {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to - * the parse tree by calling {@link ParserRuleContext//addErrorNode}.

- * - * @return the matched symbol - * @throws RecognitionException if the current input symbol did not match - * a wildcard and the error strategy could not recover from the mismatched - * symbol - */ - matchWildcard() { - let t = this.getCurrentToken(); - if (t.type > 0) { - this._errHandler.reportMatch(this); - this.consume(); - } else { - t = this._errHandler.recoverInline(this); - if (this._buildParseTrees && t.tokenIndex === -1) { - // we must have conjured up a new token during single token - // insertion - // if it's not the current symbol - this._ctx.addErrorNode(t); - } - } - return t; - } - - getParseListeners() { - return this._parseListeners || []; - } - - /** - * Registers {@code listener} to receive events during the parsing process. - * - *

To support output-preserving grammar transformations (including but not - * limited to left-recursion removal, automated left-factoring, and - * optimized code generation), calls to listener methods during the parse - * may differ substantially from calls made by - * {@link ParseTreeWalker//DEFAULT} used after the parse is complete. In - * particular, rule entry and exit events may occur in a different order - * during the parse than after the parser. In addition, calls to certain - * rule entry methods may be omitted.

- * - *

With the following specific exceptions, calls to listener events are - * deterministic, i.e. for identical input the calls to listener - * methods will be the same.

- * - *
    - *
  • Alterations to the grammar used to generate code may change the - * behavior of the listener calls.
  • - *
  • Alterations to the command line options passed to ANTLR 4 when - * generating the parser may change the behavior of the listener calls.
  • - *
  • Changing the version of the ANTLR Tool used to generate the parser - * may change the behavior of the listener calls.
  • - *
- * - * @param listener the listener to add - * - * @throws NullPointerException if {@code} listener is {@code null} - */ - addParseListener(listener) { - if (listener === null) { - throw "listener"; - } - if (this._parseListeners === null) { - this._parseListeners = []; - } - this._parseListeners.push(listener); - } - - /** - * Remove {@code listener} from the list of parse listeners. - * - *

If {@code listener} is {@code null} or has not been added as a parse - * listener, this method does nothing.

- * @param listener the listener to remove - */ - removeParseListener(listener) { - if (this._parseListeners !== null) { - const idx = this._parseListeners.indexOf(listener); - if (idx >= 0) { - this._parseListeners.splice(idx, 1); - } - if (this._parseListeners.length === 0) { - this._parseListeners = null; - } - } - } - - // Remove all parse listeners. - removeParseListeners() { - this._parseListeners = null; - } - - // Notify any parse listeners of an enter rule event. - triggerEnterRuleEvent() { - if (this._parseListeners !== null) { - const ctx = this._ctx; - this._parseListeners.forEach(function(listener) { - listener.enterEveryRule(ctx); - ctx.enterRule(listener); - }); - } - } - - /** - * Notify any parse listeners of an exit rule event. - * @see //addParseListener - */ - triggerExitRuleEvent() { - if (this._parseListeners !== null) { - // reverse order walk of listeners - const ctx = this._ctx; - this._parseListeners.slice(0).reverse().forEach(function(listener) { - ctx.exitRule(listener); - listener.exitEveryRule(ctx); - }); - } - } - - getTokenFactory() { - return this._input.tokenSource._factory; - } - - // Tell our token source and error strategy about a new way to create tokens. - setTokenFactory(factory) { - this._input.tokenSource._factory = factory; - } - - /** - * The ATN with bypass alternatives is expensive to create so we create it - * lazily. - * - * @throws UnsupportedOperationException if the current parser does not - * implement the {@link //getSerializedATN()} method. - */ - getATNWithBypassAlts() { - const serializedAtn = this.getSerializedATN(); - if (serializedAtn === null) { - throw "The current parser does not support an ATN with bypass alternatives."; - } - let result = this.bypassAltsAtnCache[serializedAtn]; - if (result === null) { - const deserializationOptions = new ATNDeserializationOptions(); - deserializationOptions.generateRuleBypassTransitions = true; - result = new ATNDeserializer(deserializationOptions) - .deserialize(serializedAtn); - this.bypassAltsAtnCache[serializedAtn] = result; - } - return result; - } - - /** - * The preferred method of getting a tree pattern. For example, here's a - * sample use: - * - *
-	 * ParseTree t = parser.expr();
-	 * ParseTreePattern p = parser.compileParseTreePattern("<ID>+0",
-	 * MyParser.RULE_expr);
-	 * ParseTreeMatch m = p.match(t);
-	 * String id = m.get("ID");
-	 * 
- */ - compileParseTreePattern(pattern, patternRuleIndex, lexer) { - lexer = lexer || null; - if (lexer === null) { - if (this.getTokenStream() !== null) { - const tokenSource = this.getTokenStream().tokenSource; - if (tokenSource instanceof Lexer) { - lexer = tokenSource; - } - } - } - if (lexer === null) { - throw "Parser can't discover a lexer to use"; - } - const m = new ParseTreePatternMatcher(lexer, this); - return m.compile(pattern, patternRuleIndex); - } - - getInputStream() { - return this.getTokenStream(); - } - - setInputStream(input) { - this.setTokenStream(input); - } - - getTokenStream() { - return this._input; - } - - // Set the token stream and reset the parser. - setTokenStream(input) { - this._input = null; - this.reset(); - this._input = input; - } - - /** - * Match needs to return the current input symbol, which gets put - * into the label for the associated token ref; e.g., x=ID. - */ - getCurrentToken() { - return this._input.LT(1); - } - - notifyErrorListeners(msg, offendingToken, err) { - offendingToken = offendingToken || null; - err = err || null; - if (offendingToken === null) { - offendingToken = this.getCurrentToken(); - } - this._syntaxErrors += 1; - const line = offendingToken.line; - const column = offendingToken.column; - const listener = this.getErrorListenerDispatch(); - listener.syntaxError(this, offendingToken, line, column, msg, err); - } - - /** - * Consume and return the {@linkplain //getCurrentToken current symbol}. - * - *

E.g., given the following input with {@code A} being the current - * lookahead symbol, this function moves the cursor to {@code B} and returns - * {@code A}.

- * - *
-	 * A B
-	 * ^
-	 * 
- * - * If the parser is not in error recovery mode, the consumed symbol is added - * to the parse tree using {@link ParserRuleContext//addChild(Token)}, and - * {@link ParseTreeListener//visitTerminal} is called on any parse listeners. - * If the parser is in error recovery mode, the consumed symbol is - * added to the parse tree using - * {@link ParserRuleContext//addErrorNode(Token)}, and - * {@link ParseTreeListener//visitErrorNode} is called on any parse - * listeners. - */ - consume() { - const o = this.getCurrentToken(); - if (o.type !== Token.EOF) { - this.getInputStream().consume(); - } - const hasListener = this._parseListeners !== null && this._parseListeners.length > 0; - if (this.buildParseTrees || hasListener) { - let node; - if (this._errHandler.inErrorRecoveryMode(this)) { - node = this._ctx.addErrorNode(o); - } else { - node = this._ctx.addTokenNode(o); - } - node.invokingState = this.state; - if (hasListener) { - this._parseListeners.forEach(function(listener) { - if (node instanceof ErrorNode || (node.isErrorNode !== undefined && node.isErrorNode())) { - listener.visitErrorNode(node); - } else if (node instanceof TerminalNode) { - listener.visitTerminal(node); - } - }); - } - } - return o; - } - - addContextToParseTree() { - // add current context to parent if we have a parent - if (this._ctx.parentCtx !== null) { - this._ctx.parentCtx.addChild(this._ctx); - } - } - - /** - * Always called by generated parsers upon entry to a rule. Access field - * {@link //_ctx} get the current context. - */ - enterRule(localctx, state, ruleIndex) { - this.state = state; - this._ctx = localctx; - this._ctx.start = this._input.LT(1); - if (this.buildParseTrees) { - this.addContextToParseTree(); - } - this.triggerEnterRuleEvent(); - } - - exitRule() { - this._ctx.stop = this._input.LT(-1); - // trigger event on _ctx, before it reverts to parent - this.triggerExitRuleEvent(); - this.state = this._ctx.invokingState; - this._ctx = this._ctx.parentCtx; - } - - enterOuterAlt(localctx, altNum) { - localctx.setAltNumber(altNum); - // if we have new localctx, make sure we replace existing ctx - // that is previous child of parse tree - if (this.buildParseTrees && this._ctx !== localctx) { - if (this._ctx.parentCtx !== null) { - this._ctx.parentCtx.removeLastChild(); - this._ctx.parentCtx.addChild(localctx); - } - } - this._ctx = localctx; - } - - /** - * Get the precedence level for the top-most precedence rule. - * - * @return The precedence level for the top-most precedence rule, or -1 if - * the parser context is not nested within a precedence rule. - */ - getPrecedence() { - if (this._precedenceStack.length === 0) { - return -1; - } else { - return this._precedenceStack[this._precedenceStack.length-1]; - } - } - - enterRecursionRule(localctx, state, ruleIndex, precedence) { - this.state = state; - this._precedenceStack.push(precedence); - this._ctx = localctx; - this._ctx.start = this._input.LT(1); - this.triggerEnterRuleEvent(); // simulates rule entry for left-recursive rules - } - - // Like {@link //enterRule} but for recursive rules. - pushNewRecursionContext(localctx, state, ruleIndex) { - const previous = this._ctx; - previous.parentCtx = localctx; - previous.invokingState = state; - previous.stop = this._input.LT(-1); - - this._ctx = localctx; - this._ctx.start = previous.start; - if (this.buildParseTrees) { - this._ctx.addChild(previous); - } - this.triggerEnterRuleEvent(); // simulates rule entry for left-recursive rules - } - - unrollRecursionContexts(parentCtx) { - this._precedenceStack.pop(); - this._ctx.stop = this._input.LT(-1); - const retCtx = this._ctx; // save current ctx (return value) - // unroll so _ctx is as it was before call to recursive method - const parseListeners = this.getParseListeners(); - if (parseListeners !== null && parseListeners.length > 0) { - while (this._ctx !== parentCtx) { - this.triggerExitRuleEvent(); - this._ctx = this._ctx.parentCtx; - } - } else { - this._ctx = parentCtx; - } - // hook into tree - retCtx.parentCtx = parentCtx; - if (this.buildParseTrees && parentCtx !== null) { - // add return ctx into invoking rule's tree - parentCtx.addChild(retCtx); - } - } - - getInvokingContext(ruleIndex) { - let ctx = this._ctx; - while (ctx !== null) { - if (ctx.ruleIndex === ruleIndex) { - return ctx; - } - ctx = ctx.parentCtx; - } - return null; - } - - precpred(localctx, precedence) { - return precedence >= this._precedenceStack[this._precedenceStack.length-1]; - } - - inContext(context) { - // TODO: useful in parser? - return false; - } - - /** - * Checks whether or not {@code symbol} can follow the current state in the - * ATN. The behavior of this method is equivalent to the following, but is - * implemented such that the complete context-sensitive follow set does not - * need to be explicitly constructed. - * - *
-	 * return getExpectedTokens().contains(symbol);
-	 * 
- * - * @param symbol the symbol type to check - * @return {@code true} if {@code symbol} can follow the current state in - * the ATN, otherwise {@code false}. - */ - isExpectedToken(symbol) { - const atn = this._interp.atn; - let ctx = this._ctx; - const s = atn.states[this.state]; - let following = atn.nextTokens(s); - if (following.contains(symbol)) { - return true; - } - if (!following.contains(Token.EPSILON)) { - return false; - } - while (ctx !== null && ctx.invokingState >= 0 && following.contains(Token.EPSILON)) { - const invokingState = atn.states[ctx.invokingState]; - const rt = invokingState.transitions[0]; - following = atn.nextTokens(rt.followState); - if (following.contains(symbol)) { - return true; - } - ctx = ctx.parentCtx; - } - if (following.contains(Token.EPSILON) && symbol === Token.EOF) { - return true; - } else { - return false; - } - } - - /** - * Computes the set of input symbols which could follow the current parser - * state and context, as given by {@link //getState} and {@link //getContext}, - * respectively. - * - * @see ATN//getExpectedTokens(int, RuleContext) - */ - getExpectedTokens() { - return this._interp.atn.getExpectedTokens(this.state, this._ctx); - } - - getExpectedTokensWithinCurrentRule() { - const atn = this._interp.atn; - const s = atn.states[this.state]; - return atn.nextTokens(s); - } - - // Get a rule's index (i.e., {@code RULE_ruleName} field) or -1 if not found. - getRuleIndex(ruleName) { - const ruleIndex = this.getRuleIndexMap()[ruleName]; - if (ruleIndex !== null) { - return ruleIndex; - } else { - return -1; - } - } - - /** - * Return List<String> of the rule names in your parser instance - * leading up to a call to the current rule. You could override if - * you want more details such as the file/line info of where - * in the ATN a rule is invoked. - * - * this is very useful for error messages. - */ - getRuleInvocationStack(p) { - p = p || null; - if (p === null) { - p = this._ctx; - } - const stack = []; - while (p !== null) { - // compute what follows who invoked us - const ruleIndex = p.ruleIndex; - if (ruleIndex < 0) { - stack.push("n/a"); - } else { - stack.push(this.ruleNames[ruleIndex]); - } - p = p.parentCtx; - } - return stack; - } - - // For debugging and other purposes. - getDFAStrings() { - return this._interp.decisionToDFA.toString(); - } - - // For debugging and other purposes. - dumpDFA() { - let seenOne = false; - for (let i = 0; i < this._interp.decisionToDFA.length; i++) { - const dfa = this._interp.decisionToDFA[i]; - if (dfa.states.length > 0) { - if (seenOne) { - console.log(); - } - this.printer.println("Decision " + dfa.decision + ":"); - this.printer.print(dfa.toString(this.literalNames, this.symbolicNames)); - seenOne = true; - } - } - } - - /* - " printer = function() {\r\n" + - " this.println = function(s) { document.getElementById('output') += s + '\\n'; }\r\n" + - " this.print = function(s) { document.getElementById('output') += s; }\r\n" + - " };\r\n" + - */ - getSourceName() { - return this._input.sourceName; - } - - /** - * During a parse is sometimes useful to listen in on the rule entry and exit - * events as well as token matches. this is for quick and dirty debugging. - */ - setTrace(trace) { - if (!trace) { - this.removeParseListener(this._tracer); - this._tracer = null; - } else { - if (this._tracer !== null) { - this.removeParseListener(this._tracer); - } - this._tracer = new TraceListener(this); - this.addParseListener(this._tracer); - } - } +import Token from './Token.js'; +import TerminalNode from './tree/TerminalNode.js'; +import ErrorNode from './tree/ErrorNode.js'; +import Recognizer from './Recognizer.js'; +import DefaultErrorStrategy from './error/DefaultErrorStrategy.js'; +import ATNDeserializer from './atn/ATNDeserializer.js'; +import ATNDeserializationOptions from './atn/ATNDeserializationOptions.js'; +import TraceListener from "./TraceListener.js"; + +export default class Parser extends Recognizer { + /** + * this is all the parsing support code essentially; most of it is error + * recovery stuff. + */ + constructor(input) { + super(); + // The input stream. + this._input = null; + /** + * The error handling strategy for the parser. The default value is a new + * instance of {@link DefaultErrorStrategy}. + */ + this._errHandler = new DefaultErrorStrategy(); + this._precedenceStack = []; + this._precedenceStack.push(0); + /** + * The {@link ParserRuleContext} object for the currently executing rule. + * this is always non-null during the parsing process. + */ + this._ctx = null; + /** + * Specifies whether or not the parser should construct a parse tree during + * the parsing process. The default value is {@code true}. + */ + this.buildParseTrees = true; + /** + * When {@link //setTrace}{@code (true)} is called, a reference to the + * {@link TraceListener} is stored here so it can be easily removed in a + * later call to {@link //setTrace}{@code (false)}. The listener itself is + * implemented as a parser listener so this field is not directly used by + * other parser methods. + */ + this._tracer = null; + /** + * The list of {@link ParseTreeListener} listeners registered to receive + * events during the parse. + */ + this._parseListeners = null; + /** + * The number of syntax errors reported during parsing. this value is + * incremented each time {@link //notifyErrorListeners} is called. + */ + this._syntaxErrors = 0; + this.setInputStream(input); + } + + // reset the parser's state + reset() { + if (this._input !== null) { + this._input.seek(0); + } + this._errHandler.reset(this); + this._ctx = null; + this._syntaxErrors = 0; + this.setTrace(false); + this._precedenceStack = []; + this._precedenceStack.push(0); + if (this._interp !== null) { + this._interp.reset(); + } + } + + /** + * Match current input symbol against {@code ttype}. If the symbol type + * matches, {@link ANTLRErrorStrategy//reportMatch} and {@link //consume} are + * called to complete the match process. + * + *

If the symbol type does not match, + * {@link ANTLRErrorStrategy//recoverInline} is called on the current error + * strategy to attempt recovery. If {@link //getBuildParseTree} is + * {@code true} and the token index of the symbol returned by + * {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to + * the parse tree by calling {@link ParserRuleContext//addErrorNode}.

+ * + * @param ttype the token type to match + * @return the matched symbol + * @throws RecognitionException if the current input symbol did not match + * {@code ttype} and the error strategy could not recover from the + * mismatched symbol + */ + match(ttype) { + let t = this.getCurrentToken(); + if (t.type === ttype) { + this._errHandler.reportMatch(this); + this.consume(); + } else { + t = this._errHandler.recoverInline(this); + if (this.buildParseTrees && t.tokenIndex === -1) { + // we must have conjured up a new token during single token + // insertion + // if it's not the current symbol + this._ctx.addErrorNode(t); + } + } + return t; + } + + /** + * Match current input symbol as a wildcard. If the symbol type matches + * (i.e. has a value greater than 0), {@link ANTLRErrorStrategy//reportMatch} + * and {@link //consume} are called to complete the match process. + * + *

If the symbol type does not match, + * {@link ANTLRErrorStrategy//recoverInline} is called on the current error + * strategy to attempt recovery. If {@link //getBuildParseTree} is + * {@code true} and the token index of the symbol returned by + * {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to + * the parse tree by calling {@link ParserRuleContext//addErrorNode}.

+ * + * @return the matched symbol + * @throws RecognitionException if the current input symbol did not match + * a wildcard and the error strategy could not recover from the mismatched + * symbol + */ + matchWildcard() { + let t = this.getCurrentToken(); + if (t.type > 0) { + this._errHandler.reportMatch(this); + this.consume(); + } else { + t = this._errHandler.recoverInline(this); + if (this._buildParseTrees && t.tokenIndex === -1) { + // we must have conjured up a new token during single token + // insertion + // if it's not the current symbol + this._ctx.addErrorNode(t); + } + } + return t; + } + + getParseListeners() { + return this._parseListeners || []; + } + + /** + * Registers {@code listener} to receive events during the parsing process. + * + *

To support output-preserving grammar transformations (including but not + * limited to left-recursion removal, automated left-factoring, and + * optimized code generation), calls to listener methods during the parse + * may differ substantially from calls made by + * {@link ParseTreeWalker//DEFAULT} used after the parse is complete. In + * particular, rule entry and exit events may occur in a different order + * during the parse than after the parser. In addition, calls to certain + * rule entry methods may be omitted.

+ * + *

With the following specific exceptions, calls to listener events are + * deterministic, i.e. for identical input the calls to listener + * methods will be the same.

+ * + *
    + *
  • Alterations to the grammar used to generate code may change the + * behavior of the listener calls.
  • + *
  • Alterations to the command line options passed to ANTLR 4 when + * generating the parser may change the behavior of the listener calls.
  • + *
  • Changing the version of the ANTLR Tool used to generate the parser + * may change the behavior of the listener calls.
  • + *
+ * + * @param listener the listener to add + * + * @throws NullPointerException if {@code} listener is {@code null} + */ + addParseListener(listener) { + if (listener === null) { + throw "listener"; + } + if (this._parseListeners === null) { + this._parseListeners = []; + } + this._parseListeners.push(listener); + } + + /** + * Remove {@code listener} from the list of parse listeners. + * + *

If {@code listener} is {@code null} or has not been added as a parse + * listener, this method does nothing.

+ * @param listener the listener to remove + */ + removeParseListener(listener) { + if (this._parseListeners !== null) { + const idx = this._parseListeners.indexOf(listener); + if (idx >= 0) { + this._parseListeners.splice(idx, 1); + } + if (this._parseListeners.length === 0) { + this._parseListeners = null; + } + } + } + + // Remove all parse listeners. + removeParseListeners() { + this._parseListeners = null; + } + + // Notify any parse listeners of an enter rule event. + triggerEnterRuleEvent() { + if (this._parseListeners !== null) { + const ctx = this._ctx; + this._parseListeners.forEach(function (listener) { + listener.enterEveryRule(ctx); + ctx.enterRule(listener); + }); + } + } + + /** + * Notify any parse listeners of an exit rule event. + * @see //addParseListener + */ + triggerExitRuleEvent() { + if (this._parseListeners !== null) { + // reverse order walk of listeners + const ctx = this._ctx; + this._parseListeners.slice(0).reverse().forEach(function (listener) { + ctx.exitRule(listener); + listener.exitEveryRule(ctx); + }); + } + } + + getTokenFactory() { + return this._input.tokenSource._factory; + } + + // Tell our token source and error strategy about a new way to create tokens. + setTokenFactory(factory) { + this._input.tokenSource._factory = factory; + } + + /** + * The ATN with bypass alternatives is expensive to create so we create it + * lazily. + * + * @throws UnsupportedOperationException if the current parser does not + * implement the {@link //getSerializedATN()} method. + */ + getATNWithBypassAlts() { + const serializedAtn = this.getSerializedATN(); + if (serializedAtn === null) { + throw "The current parser does not support an ATN with bypass alternatives."; + } + let result = this.bypassAltsAtnCache[serializedAtn]; + if (result === null) { + const deserializationOptions = new ATNDeserializationOptions(); + deserializationOptions.generateRuleBypassTransitions = true; + result = new ATNDeserializer(deserializationOptions) + .deserialize(serializedAtn); + this.bypassAltsAtnCache[serializedAtn] = result; + } + return result; + } + + getInputStream() { + return this.getTokenStream(); + } + + setInputStream(input) { + this.setTokenStream(input); + } + + getTokenStream() { + return this._input; + } + + // Set the token stream and reset the parser. + setTokenStream(input) { + this._input = null; + this.reset(); + this._input = input; + } + + /** + * Match needs to return the current input symbol, which gets put + * into the label for the associated token ref; e.g., x=ID. + */ + getCurrentToken() { + return this._input.LT(1); + } + + notifyErrorListeners(msg, offendingToken, err) { + offendingToken = offendingToken || null; + err = err || null; + if (offendingToken === null) { + offendingToken = this.getCurrentToken(); + } + this._syntaxErrors += 1; + const line = offendingToken.line; + const column = offendingToken.column; + const listener = this.getErrorListenerDispatch(); + listener.syntaxError(this, offendingToken, line, column, msg, err); + } + + /** + * Consume and return the {@linkplain //getCurrentToken current symbol}. + * + *

E.g., given the following input with {@code A} being the current + * lookahead symbol, this function moves the cursor to {@code B} and returns + * {@code A}.

+ * + *
+     * A B
+     * ^
+     * 
+ * + * If the parser is not in error recovery mode, the consumed symbol is added + * to the parse tree using {@link ParserRuleContext//addChild(Token)}, and + * {@link ParseTreeListener//visitTerminal} is called on any parse listeners. + * If the parser is in error recovery mode, the consumed symbol is + * added to the parse tree using + * {@link ParserRuleContext//addErrorNode(Token)}, and + * {@link ParseTreeListener//visitErrorNode} is called on any parse + * listeners. + */ + consume() { + const o = this.getCurrentToken(); + if (o.type !== Token.EOF) { + this.getInputStream().consume(); + } + const hasListener = this._parseListeners !== null && this._parseListeners.length > 0; + if (this.buildParseTrees || hasListener) { + let node; + if (this._errHandler.inErrorRecoveryMode(this)) { + node = this._ctx.addErrorNode(o); + } else { + node = this._ctx.addTokenNode(o); + } + node.invokingState = this.state; + if (hasListener) { + this._parseListeners.forEach(function (listener) { + if (node instanceof ErrorNode || (node.isErrorNode !== undefined && node.isErrorNode())) { + listener.visitErrorNode(node); + } else if (node instanceof TerminalNode) { + listener.visitTerminal(node); + } + }); + } + } + return o; + } + + addContextToParseTree() { + // add current context to parent if we have a parent + if (this._ctx.parentCtx !== null) { + this._ctx.parentCtx.addChild(this._ctx); + } + } + + /** + * Always called by generated parsers upon entry to a rule. Access field + * {@link //_ctx} get the current context. + */ + enterRule(localctx, state, ruleIndex) { + this.state = state; + this._ctx = localctx; + this._ctx.start = this._input.LT(1); + if (this.buildParseTrees) { + this.addContextToParseTree(); + } + this.triggerEnterRuleEvent(); + } + + exitRule() { + this._ctx.stop = this._input.LT(-1); + // trigger event on _ctx, before it reverts to parent + this.triggerExitRuleEvent(); + this.state = this._ctx.invokingState; + this._ctx = this._ctx.parentCtx; + } + + enterOuterAlt(localctx, altNum) { + localctx.setAltNumber(altNum); + // if we have new localctx, make sure we replace existing ctx + // that is previous child of parse tree + if (this.buildParseTrees && this._ctx !== localctx) { + if (this._ctx.parentCtx !== null) { + this._ctx.parentCtx.removeLastChild(); + this._ctx.parentCtx.addChild(localctx); + } + } + this._ctx = localctx; + } + + /** + * Get the precedence level for the top-most precedence rule. + * + * @return The precedence level for the top-most precedence rule, or -1 if + * the parser context is not nested within a precedence rule. + */ + getPrecedence() { + if (this._precedenceStack.length === 0) { + return -1; + } else { + return this._precedenceStack[this._precedenceStack.length - 1]; + } + } + + enterRecursionRule(localctx, state, ruleIndex, precedence) { + this.state = state; + this._precedenceStack.push(precedence); + this._ctx = localctx; + this._ctx.start = this._input.LT(1); + this.triggerEnterRuleEvent(); // simulates rule entry for left-recursive rules + } + + // Like {@link //enterRule} but for recursive rules. + pushNewRecursionContext(localctx, state, ruleIndex) { + const previous = this._ctx; + previous.parentCtx = localctx; + previous.invokingState = state; + previous.stop = this._input.LT(-1); + + this._ctx = localctx; + this._ctx.start = previous.start; + if (this.buildParseTrees) { + this._ctx.addChild(previous); + } + this.triggerEnterRuleEvent(); // simulates rule entry for left-recursive rules + } + + unrollRecursionContexts(parentCtx) { + this._precedenceStack.pop(); + this._ctx.stop = this._input.LT(-1); + const retCtx = this._ctx; // save current ctx (return value) + // unroll so _ctx is as it was before call to recursive method + const parseListeners = this.getParseListeners(); + if (parseListeners !== null && parseListeners.length > 0) { + while (this._ctx !== parentCtx) { + this.triggerExitRuleEvent(); + this._ctx = this._ctx.parentCtx; + } + } else { + this._ctx = parentCtx; + } + // hook into tree + retCtx.parentCtx = parentCtx; + if (this.buildParseTrees && parentCtx !== null) { + // add return ctx into invoking rule's tree + parentCtx.addChild(retCtx); + } + } + + getInvokingContext(ruleIndex) { + let ctx = this._ctx; + while (ctx !== null) { + if (ctx.ruleIndex === ruleIndex) { + return ctx; + } + ctx = ctx.parentCtx; + } + return null; + } + + precpred(localctx, precedence) { + return precedence >= this._precedenceStack[this._precedenceStack.length - 1]; + } + + inContext(context) { + // TODO: useful in parser? + return false; + } + + /** + * Checks whether or not {@code symbol} can follow the current state in the + * ATN. The behavior of this method is equivalent to the following, but is + * implemented such that the complete context-sensitive follow set does not + * need to be explicitly constructed. + * + *
+     * return getExpectedTokens().contains(symbol);
+     * 
+ * + * @param symbol the symbol type to check + * @return {@code true} if {@code symbol} can follow the current state in + * the ATN, otherwise {@code false}. + */ + isExpectedToken(symbol) { + const atn = this._interp.atn; + let ctx = this._ctx; + const s = atn.states[this.state]; + let following = atn.nextTokens(s); + if (following.contains(symbol)) { + return true; + } + if (!following.contains(Token.EPSILON)) { + return false; + } + while (ctx !== null && ctx.invokingState >= 0 && following.contains(Token.EPSILON)) { + const invokingState = atn.states[ctx.invokingState]; + const rt = invokingState.transitions[0]; + following = atn.nextTokens(rt.followState); + if (following.contains(symbol)) { + return true; + } + ctx = ctx.parentCtx; + } + if (following.contains(Token.EPSILON) && symbol === Token.EOF) { + return true; + } else { + return false; + } + } + + /** + * Computes the set of input symbols which could follow the current parser + * state and context, as given by {@link //getState} and {@link //getContext}, + * respectively. + * + * @see ATN//getExpectedTokens(int, RuleContext) + */ + getExpectedTokens() { + return this._interp.atn.getExpectedTokens(this.state, this._ctx); + } + + getExpectedTokensWithinCurrentRule() { + const atn = this._interp.atn; + const s = atn.states[this.state]; + return atn.nextTokens(s); + } + + // Get a rule's index (i.e., {@code RULE_ruleName} field) or -1 if not found. + getRuleIndex(ruleName) { + const ruleIndex = this.getRuleIndexMap()[ruleName]; + if (ruleIndex !== null) { + return ruleIndex; + } else { + return -1; + } + } + + /** + * Return List<String> of the rule names in your parser instance + * leading up to a call to the current rule. You could override if + * you want more details such as the file/line info of where + * in the ATN a rule is invoked. + * + * this is very useful for error messages. + */ + getRuleInvocationStack(p) { + p = p || null; + if (p === null) { + p = this._ctx; + } + const stack = []; + while (p !== null) { + // compute what follows who invoked us + const ruleIndex = p.ruleIndex; + if (ruleIndex < 0) { + stack.push("n/a"); + } else { + stack.push(this.ruleNames[ruleIndex]); + } + p = p.parentCtx; + } + return stack; + } + + // For debugging and other purposes. + getDFAStrings() { + return this._interp.decisionToDFA.toString(); + } + + // For debugging and other purposes. + dumpDFA() { + let seenOne = false; + for (let i = 0; i < this._interp.decisionToDFA.length; i++) { + const dfa = this._interp.decisionToDFA[i]; + if (dfa.states.length > 0) { + if (seenOne) { + console.log(); + } + this.printer.println("Decision " + dfa.decision + ":"); + this.printer.print(dfa.toString(this.literalNames, this.symbolicNames)); + seenOne = true; + } + } + } + + /* + " printer = function() {\r\n" + + " this.println = function(s) { document.getElementById('output') += s + '\\n'; }\r\n" + + " this.print = function(s) { document.getElementById('output') += s; }\r\n" + + " };\r\n" + + */ + getSourceName() { + return this._input.sourceName; + } + + /** + * During a parse is sometimes useful to listen in on the rule entry and exit + * events as well as token matches. this is for quick and dirty debugging. + */ + setTrace(trace) { + if (!trace) { + this.removeParseListener(this._tracer); + this._tracer = null; + } else { + if (this._tracer !== null) { + this.removeParseListener(this._tracer); + } + this._tracer = new TraceListener(this); + this.addParseListener(this._tracer); + } + } } /** * this field maps from the serialized ATN string to the deserialized {@link - * ATN} with + * ATN} with * bypass alternatives. * * @see ATNDeserializationOptions//isGenerateRuleBypassTransitions() */ Parser.bypassAltsAtnCache = {}; - -module.exports = Parser; diff --git a/runtime/JavaScript/src/antlr4/PredictionContext.js b/runtime/JavaScript/src/antlr4/PredictionContext.js deleted file mode 100644 index ed95600a2c..0000000000 --- a/runtime/JavaScript/src/antlr4/PredictionContext.js +++ /dev/null @@ -1,741 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -const RuleContext = require('./RuleContext'); -const {Hash, Map, equalArrays} = require('./Utils'); - -class PredictionContext { - - constructor(cachedHashCode) { - this.cachedHashCode = cachedHashCode; - } - - /** - * Stores the computed hash code of this {@link PredictionContext}. The hash - * code is computed in parts to match the following reference algorithm. - * - *
-	 * private int referenceHashCode() {
-	 * int hash = {@link MurmurHash//initialize MurmurHash.initialize}({@link
-	 * //INITIAL_HASH});
-	 *
-	 * for (int i = 0; i < {@link //size()}; i++) {
-	 * hash = {@link MurmurHash//update MurmurHash.update}(hash, {@link //getParent
-	 * getParent}(i));
-	 * }
-	 *
-	 * for (int i = 0; i < {@link //size()}; i++) {
-	 * hash = {@link MurmurHash//update MurmurHash.update}(hash, {@link
-	 * //getReturnState getReturnState}(i));
-	 * }
-	 *
-	 * hash = {@link MurmurHash//finish MurmurHash.finish}(hash, 2// {@link
-	 * //size()});
-	 * return hash;
-	 * }
-	 * 
- * This means only the {@link //EMPTY} context is in set. - */ - isEmpty() { - return this === PredictionContext.EMPTY; - } - - hasEmptyPath() { - return this.getReturnState(this.length - 1) === PredictionContext.EMPTY_RETURN_STATE; - } - - hashCode() { - return this.cachedHashCode; - } - - updateHashCode(hash) { - hash.update(this.cachedHashCode); - } -} - -/** - * Represents {@code $} in local context prediction, which means wildcard. - * {@code//+x =//}. - */ -PredictionContext.EMPTY = null; - -/** - * Represents {@code $} in an array in full context mode, when {@code $} - * doesn't mean wildcard: {@code $ + x = [$,x]}. Here, - * {@code $} = {@link //EMPTY_RETURN_STATE}. - */ -PredictionContext.EMPTY_RETURN_STATE = 0x7FFFFFFF; - -PredictionContext.globalNodeCount = 1; -PredictionContext.id = PredictionContext.globalNodeCount; - - -/* -function calculateHashString(parent, returnState) { - return "" + parent + returnState; -} -*/ - -/** - * Used to cache {@link PredictionContext} objects. Its used for the shared - * context cash associated with contexts in DFA states. This cache - * can be used for both lexers and parsers. - */ -class PredictionContextCache { - - constructor() { - this.cache = new Map(); - } - - /** - * Add a context to the cache and return it. If the context already exists, - * return that one instead and do not add a new context to the cache. - * Protect shared cache from unsafe thread access. - */ - add(ctx) { - if (ctx === PredictionContext.EMPTY) { - return PredictionContext.EMPTY; - } - const existing = this.cache.get(ctx) || null; - if (existing !== null) { - return existing; - } - this.cache.put(ctx, ctx); - return ctx; - } - - get(ctx) { - return this.cache.get(ctx) || null; - } - - get length(){ - return this.cache.length; - } -} - - -class SingletonPredictionContext extends PredictionContext { - - constructor(parent, returnState) { - let hashCode = 0; - const hash = new Hash(); - if(parent !== null) { - hash.update(parent, returnState); - } else { - hash.update(1); - } - hashCode = hash.finish(); - super(hashCode); - this.parentCtx = parent; - this.returnState = returnState; - } - - getParent(index) { - return this.parentCtx; - } - - getReturnState(index) { - return this.returnState; - } - - equals(other) { - if (this === other) { - return true; - } else if (!(other instanceof SingletonPredictionContext)) { - return false; - } else if (this.hashCode() !== other.hashCode()) { - return false; // can't be same if hash is different - } else { - if(this.returnState !== other.returnState) - return false; - else if(this.parentCtx==null) - return other.parentCtx==null - else - return this.parentCtx.equals(other.parentCtx); - } - } - - toString() { - const up = this.parentCtx === null ? "" : this.parentCtx.toString(); - if (up.length === 0) { - if (this.returnState === PredictionContext.EMPTY_RETURN_STATE) { - return "$"; - } else { - return "" + this.returnState; - } - } else { - return "" + this.returnState + " " + up; - } - } - - get length(){ - return 1; - } - - static create(parent, returnState) { - if (returnState === PredictionContext.EMPTY_RETURN_STATE && parent === null) { - // someone can pass in the bits of an array ctx that mean $ - return PredictionContext.EMPTY; - } else { - return new SingletonPredictionContext(parent, returnState); - } - } -} - -class EmptyPredictionContext extends SingletonPredictionContext { - - constructor() { - super(null, PredictionContext.EMPTY_RETURN_STATE); - } - - isEmpty() { - return true; - } - - getParent(index) { - return null; - } - - getReturnState(index) { - return this.returnState; - } - - equals(other) { - return this === other; - } - - toString() { - return "$"; - } -} - - -PredictionContext.EMPTY = new EmptyPredictionContext(); - -class ArrayPredictionContext extends PredictionContext { - - constructor(parents, returnStates) { - /** - * Parent can be null only if full ctx mode and we make an array - * from {@link //EMPTY} and non-empty. We merge {@link //EMPTY} by using - * null parent and - * returnState == {@link //EMPTY_RETURN_STATE}. - */ - const h = new Hash(); - h.update(parents, returnStates); - const hashCode = h.finish(); - super(hashCode); - this.parents = parents; - this.returnStates = returnStates; - return this; - } - - isEmpty() { - // since EMPTY_RETURN_STATE can only appear in the last position, we - // don't need to verify that size==1 - return this.returnStates[0] === PredictionContext.EMPTY_RETURN_STATE; - } - - getParent(index) { - return this.parents[index]; - } - - getReturnState(index) { - return this.returnStates[index]; - } - - equals(other) { - if (this === other) { - return true; - } else if (!(other instanceof ArrayPredictionContext)) { - return false; - } else if (this.hashCode() !== other.hashCode()) { - return false; // can't be same if hash is different - } else { - return equalArrays(this.returnStates, other.returnStates) && - equalArrays(this.parents, other.parents); - } - } - - toString() { - if (this.isEmpty()) { - return "[]"; - } else { - let s = "["; - for (let i = 0; i < this.returnStates.length; i++) { - if (i > 0) { - s = s + ", "; - } - if (this.returnStates[i] === PredictionContext.EMPTY_RETURN_STATE) { - s = s + "$"; - continue; - } - s = s + this.returnStates[i]; - if (this.parents[i] !== null) { - s = s + " " + this.parents[i]; - } else { - s = s + "null"; - } - } - return s + "]"; - } - } - - get length(){ - return this.returnStates.length; - } -} - - -/** - * Convert a {@link RuleContext} tree to a {@link PredictionContext} graph. - * Return {@link //EMPTY} if {@code outerContext} is empty or null. - */ -function predictionContextFromRuleContext(atn, outerContext) { - if (outerContext === undefined || outerContext === null) { - outerContext = RuleContext.EMPTY; - } - // if we are in RuleContext of start rule, s, then PredictionContext - // is EMPTY. Nobody called us. (if we are empty, return empty) - if (outerContext.parentCtx === null || outerContext === RuleContext.EMPTY) { - return PredictionContext.EMPTY; - } - // If we have a parent, convert it to a PredictionContext graph - const parent = predictionContextFromRuleContext(atn, outerContext.parentCtx); - const state = atn.states[outerContext.invokingState]; - const transition = state.transitions[0]; - return SingletonPredictionContext.create(parent, transition.followState.stateNumber); -} -/* -function calculateListsHashString(parents, returnStates) { - const s = ""; - parents.map(function(p) { - s = s + p; - }); - returnStates.map(function(r) { - s = s + r; - }); - return s; -} -*/ -function merge(a, b, rootIsWildcard, mergeCache) { - // share same graph if both same - if (a === b) { - return a; - } - if (a instanceof SingletonPredictionContext && b instanceof SingletonPredictionContext) { - return mergeSingletons(a, b, rootIsWildcard, mergeCache); - } - // At least one of a or b is array - // If one is $ and rootIsWildcard, return $ as// wildcard - if (rootIsWildcard) { - if (a instanceof EmptyPredictionContext) { - return a; - } - if (b instanceof EmptyPredictionContext) { - return b; - } - } - // convert singleton so both are arrays to normalize - if (a instanceof SingletonPredictionContext) { - a = new ArrayPredictionContext([a.getParent()], [a.returnState]); - } - if (b instanceof SingletonPredictionContext) { - b = new ArrayPredictionContext([b.getParent()], [b.returnState]); - } - return mergeArrays(a, b, rootIsWildcard, mergeCache); -} - -/** - * Merge two {@link SingletonPredictionContext} instances. - * - *

Stack tops equal, parents merge is same; return left graph.
- *

- * - *

Same stack top, parents differ; merge parents giving array node, then - * remainders of those graphs. A new root node is created to point to the - * merged parents.
- *

- * - *

Different stack tops pointing to same parent. Make array node for the - * root where both element in the root point to the same (original) - * parent.
- *

- * - *

Different stack tops pointing to different parents. Make array node for - * the root where each element points to the corresponding original - * parent.
- *

- * - * @param a the first {@link SingletonPredictionContext} - * @param b the second {@link SingletonPredictionContext} - * @param rootIsWildcard {@code true} if this is a local-context merge, - * otherwise false to indicate a full-context merge - * @param mergeCache - */ -function mergeSingletons(a, b, rootIsWildcard, mergeCache) { - if (mergeCache !== null) { - let previous = mergeCache.get(a, b); - if (previous !== null) { - return previous; - } - previous = mergeCache.get(b, a); - if (previous !== null) { - return previous; - } - } - - const rootMerge = mergeRoot(a, b, rootIsWildcard); - if (rootMerge !== null) { - if (mergeCache !== null) { - mergeCache.set(a, b, rootMerge); - } - return rootMerge; - } - if (a.returnState === b.returnState) { - const parent = merge(a.parentCtx, b.parentCtx, rootIsWildcard, mergeCache); - // if parent is same as existing a or b parent or reduced to a parent, - // return it - if (parent === a.parentCtx) { - return a; // ax + bx = ax, if a=b - } - if (parent === b.parentCtx) { - return b; // ax + bx = bx, if a=b - } - // else: ax + ay = a'[x,y] - // merge parents x and y, giving array node with x,y then remainders - // of those graphs. dup a, a' points at merged array - // new joined parent so create new singleton pointing to it, a' - const spc = SingletonPredictionContext.create(parent, a.returnState); - if (mergeCache !== null) { - mergeCache.set(a, b, spc); - } - return spc; - } else { // a != b payloads differ - // see if we can collapse parents due to $+x parents if local ctx - let singleParent = null; - if (a === b || (a.parentCtx !== null && a.parentCtx === b.parentCtx)) { // ax + - // bx = - // [a,b]x - singleParent = a.parentCtx; - } - if (singleParent !== null) { // parents are same - // sort payloads and use same parent - const payloads = [ a.returnState, b.returnState ]; - if (a.returnState > b.returnState) { - payloads[0] = b.returnState; - payloads[1] = a.returnState; - } - const parents = [ singleParent, singleParent ]; - const apc = new ArrayPredictionContext(parents, payloads); - if (mergeCache !== null) { - mergeCache.set(a, b, apc); - } - return apc; - } - // parents differ and can't merge them. Just pack together - // into array; can't merge. - // ax + by = [ax,by] - const payloads = [ a.returnState, b.returnState ]; - let parents = [ a.parentCtx, b.parentCtx ]; - if (a.returnState > b.returnState) { // sort by payload - payloads[0] = b.returnState; - payloads[1] = a.returnState; - parents = [ b.parentCtx, a.parentCtx ]; - } - const a_ = new ArrayPredictionContext(parents, payloads); - if (mergeCache !== null) { - mergeCache.set(a, b, a_); - } - return a_; - } -} - -/** - * Handle case where at least one of {@code a} or {@code b} is - * {@link //EMPTY}. In the following diagrams, the symbol {@code $} is used - * to represent {@link //EMPTY}. - * - *

Local-Context Merges

- * - *

These local-context merge operations are used when {@code rootIsWildcard} - * is true.

- * - *

{@link //EMPTY} is superset of any graph; return {@link //EMPTY}.
- *

- * - *

{@link //EMPTY} and anything is {@code //EMPTY}, so merged parent is - * {@code //EMPTY}; return left graph.
- *

- * - *

Special case of last merge if local context.
- *

- * - *

Full-Context Merges

- * - *

These full-context merge operations are used when {@code rootIsWildcard} - * is false.

- * - *

- * - *

Must keep all contexts; {@link //EMPTY} in array is a special value (and - * null parent).
- *

- * - *

- * - * @param a the first {@link SingletonPredictionContext} - * @param b the second {@link SingletonPredictionContext} - * @param rootIsWildcard {@code true} if this is a local-context merge, - * otherwise false to indicate a full-context merge - */ -function mergeRoot(a, b, rootIsWildcard) { - if (rootIsWildcard) { - if (a === PredictionContext.EMPTY) { - return PredictionContext.EMPTY; // // + b =// - } - if (b === PredictionContext.EMPTY) { - return PredictionContext.EMPTY; // a +// =// - } - } else { - if (a === PredictionContext.EMPTY && b === PredictionContext.EMPTY) { - return PredictionContext.EMPTY; // $ + $ = $ - } else if (a === PredictionContext.EMPTY) { // $ + x = [$,x] - const payloads = [ b.returnState, - PredictionContext.EMPTY_RETURN_STATE ]; - const parents = [ b.parentCtx, null ]; - return new ArrayPredictionContext(parents, payloads); - } else if (b === PredictionContext.EMPTY) { // x + $ = [$,x] ($ is always first if present) - const payloads = [ a.returnState, PredictionContext.EMPTY_RETURN_STATE ]; - const parents = [ a.parentCtx, null ]; - return new ArrayPredictionContext(parents, payloads); - } - } - return null; -} - -/** - * Merge two {@link ArrayPredictionContext} instances. - * - *

Different tops, different parents.
- *

- * - *

Shared top, same parents.
- *

- * - *

Shared top, different parents.
- *

- * - *

Shared top, all shared parents.
- *

- * - *

Equal tops, merge parents and reduce top to - * {@link SingletonPredictionContext}.
- *

- */ -function mergeArrays(a, b, rootIsWildcard, mergeCache) { - if (mergeCache !== null) { - let previous = mergeCache.get(a, b); - if (previous !== null) { - return previous; - } - previous = mergeCache.get(b, a); - if (previous !== null) { - return previous; - } - } - // merge sorted payloads a + b => M - let i = 0; // walks a - let j = 0; // walks b - let k = 0; // walks target M array - - let mergedReturnStates = []; - let mergedParents = []; - // walk and merge to yield mergedParents, mergedReturnStates - while (i < a.returnStates.length && j < b.returnStates.length) { - const a_parent = a.parents[i]; - const b_parent = b.parents[j]; - if (a.returnStates[i] === b.returnStates[j]) { - // same payload (stack tops are equal), must yield merged singleton - const payload = a.returnStates[i]; - // $+$ = $ - const bothDollars = payload === PredictionContext.EMPTY_RETURN_STATE && - a_parent === null && b_parent === null; - const ax_ax = (a_parent !== null && b_parent !== null && a_parent === b_parent); // ax+ax - // -> - // ax - if (bothDollars || ax_ax) { - mergedParents[k] = a_parent; // choose left - mergedReturnStates[k] = payload; - } else { // ax+ay -> a'[x,y] - mergedParents[k] = merge(a_parent, b_parent, rootIsWildcard, mergeCache); - mergedReturnStates[k] = payload; - } - i += 1; // hop over left one as usual - j += 1; // but also skip one in right side since we merge - } else if (a.returnStates[i] < b.returnStates[j]) { // copy a[i] to M - mergedParents[k] = a_parent; - mergedReturnStates[k] = a.returnStates[i]; - i += 1; - } else { // b > a, copy b[j] to M - mergedParents[k] = b_parent; - mergedReturnStates[k] = b.returnStates[j]; - j += 1; - } - k += 1; - } - // copy over any payloads remaining in either array - if (i < a.returnStates.length) { - for (let p = i; p < a.returnStates.length; p++) { - mergedParents[k] = a.parents[p]; - mergedReturnStates[k] = a.returnStates[p]; - k += 1; - } - } else { - for (let p = j; p < b.returnStates.length; p++) { - mergedParents[k] = b.parents[p]; - mergedReturnStates[k] = b.returnStates[p]; - k += 1; - } - } - // trim merged if we combined a few that had same stack tops - if (k < mergedParents.length) { // write index < last position; trim - if (k === 1) { // for just one merged element, return singleton top - const a_ = SingletonPredictionContext.create(mergedParents[0], - mergedReturnStates[0]); - if (mergeCache !== null) { - mergeCache.set(a, b, a_); - } - return a_; - } - mergedParents = mergedParents.slice(0, k); - mergedReturnStates = mergedReturnStates.slice(0, k); - } - - const M = new ArrayPredictionContext(mergedParents, mergedReturnStates); - - // if we created same array as a or b, return that instead - // TODO: track whether this is possible above during merge sort for speed - if (M === a) { - if (mergeCache !== null) { - mergeCache.set(a, b, a); - } - return a; - } - if (M === b) { - if (mergeCache !== null) { - mergeCache.set(a, b, b); - } - return b; - } - combineCommonParents(mergedParents); - - if (mergeCache !== null) { - mergeCache.set(a, b, M); - } - return M; -} - -/** - * Make pass over all M {@code parents}; merge any {@code equals()} - * ones. - */ -function combineCommonParents(parents) { - const uniqueParents = new Map(); - - for (let p = 0; p < parents.length; p++) { - const parent = parents[p]; - if (!(uniqueParents.containsKey(parent))) { - uniqueParents.put(parent, parent); - } - } - for (let q = 0; q < parents.length; q++) { - parents[q] = uniqueParents.get(parents[q]); - } -} - -function getCachedPredictionContext(context, contextCache, visited) { - if (context.isEmpty()) { - return context; - } - let existing = visited.get(context) || null; - if (existing !== null) { - return existing; - } - existing = contextCache.get(context); - if (existing !== null) { - visited.put(context, existing); - return existing; - } - let changed = false; - let parents = []; - for (let i = 0; i < parents.length; i++) { - const parent = getCachedPredictionContext(context.getParent(i), contextCache, visited); - if (changed || parent !== context.getParent(i)) { - if (!changed) { - parents = []; - for (let j = 0; j < context.length; j++) { - parents[j] = context.getParent(j); - } - changed = true; - } - parents[i] = parent; - } - } - if (!changed) { - contextCache.add(context); - visited.put(context, context); - return context; - } - let updated = null; - if (parents.length === 0) { - updated = PredictionContext.EMPTY; - } else if (parents.length === 1) { - updated = SingletonPredictionContext.create(parents[0], context - .getReturnState(0)); - } else { - updated = new ArrayPredictionContext(parents, context.returnStates); - } - contextCache.add(updated); - visited.put(updated, updated); - visited.put(context, updated); - - return updated; -} - -// ter's recursive version of Sam's getAllNodes() -function getAllContextNodes(context, nodes, visited) { - if (nodes === null) { - nodes = []; - return getAllContextNodes(context, nodes, visited); - } else if (visited === null) { - visited = new Map(); - return getAllContextNodes(context, nodes, visited); - } else { - if (context === null || visited.containsKey(context)) { - return nodes; - } - visited.put(context, context); - nodes.push(context); - for (let i = 0; i < context.length; i++) { - getAllContextNodes(context.getParent(i), nodes, visited); - } - return nodes; - } -} - -module.exports = { - merge, - PredictionContext, - PredictionContextCache, - SingletonPredictionContext, - predictionContextFromRuleContext, - getCachedPredictionContext -} diff --git a/runtime/JavaScript/src/antlr4/Recognizer.js b/runtime/JavaScript/src/antlr4/Recognizer.js index 0a93402404..e28a321cb1 100644 --- a/runtime/JavaScript/src/antlr4/Recognizer.js +++ b/runtime/JavaScript/src/antlr4/Recognizer.js @@ -1,13 +1,13 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Token} = require('./Token'); -const {ConsoleErrorListener} = require('./error/ErrorListener'); -const {ProxyErrorListener} = require('./error/ErrorListener'); +import Token from './Token.js'; +import ConsoleErrorListener from './error/ConsoleErrorListener.js'; +import ProxyErrorListener from './error/ProxyErrorListener.js'; -class Recognizer { +export default class Recognizer { constructor() { this._listeners = [ ConsoleErrorListener.INSTANCE ]; this._interp = null; @@ -15,7 +15,7 @@ class Recognizer { } checkVersion(toolVersion) { - const runtimeVersion = "4.9.3"; + const runtimeVersion = "4.10"; if (runtimeVersion!==toolVersion) { console.log("ANTLR runtime and generated code versions disagree: "+runtimeVersion+"!="+toolVersion); } @@ -153,5 +153,3 @@ class Recognizer { Recognizer.tokenTypeMapCache = {}; Recognizer.ruleIndexMapCache = {}; - -module.exports = Recognizer; diff --git a/runtime/JavaScript/src/antlr4/RuleContext.js b/runtime/JavaScript/src/antlr4/RuleContext.js deleted file mode 100644 index f18355e04a..0000000000 --- a/runtime/JavaScript/src/antlr4/RuleContext.js +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -const {RuleNode} = require('./tree/Tree'); -const {INVALID_INTERVAL} = require('./tree/Tree'); -const Trees = require('./tree/Trees'); - -class RuleContext extends RuleNode { - /** A rule context is a record of a single rule invocation. It knows - * which context invoked it, if any. If there is no parent context, then - * naturally the invoking state is not valid. The parent link - * provides a chain upwards from the current rule invocation to the root - * of the invocation tree, forming a stack. We actually carry no - * information about the rule associated with this context (except - * when parsing). We keep only the state number of the invoking state from - * the ATN submachine that invoked this. Contrast this with the s - * pointer inside ParserRuleContext that tracks the current state - * being "executed" for the current rule. - * - * The parent contexts are useful for computing lookahead sets and - * getting error information. - * - * These objects are used during parsing and prediction. - * For the special case of parsers, we use the subclass - * ParserRuleContext. - * - * @see ParserRuleContext - */ - constructor(parent, invokingState) { - // What context invoked this rule? - super(); - this.parentCtx = parent || null; - /** - * What state invoked the rule associated with this context? - * The "return address" is the followState of invokingState - * If parent is null, this should be -1. - */ - this.invokingState = invokingState || -1; - } - - depth() { - let n = 0; - let p = this; - while (p !== null) { - p = p.parentCtx; - n += 1; - } - return n; - } - - /** - * A context is empty if there is no invoking state; meaning nobody call - * current context. - */ - isEmpty() { - return this.invokingState === -1; - } - -// satisfy the ParseTree / SyntaxTree interface - getSourceInterval() { - return INVALID_INTERVAL; - } - - getRuleContext() { - return this; - } - - getPayload() { - return this; - } - - /** - * Return the combined text of all child nodes. This method only considers - * tokens which have been added to the parse tree. - *

- * Since tokens on hidden channels (e.g. whitespace or comments) are not - * added to the parse trees, they will not appear in the output of this - * method. - */ - getText() { - if (this.getChildCount() === 0) { - return ""; - } else { - return this.children.map(function(child) { - return child.getText(); - }).join(""); - } - } - - /** - * For rule associated with this parse tree internal node, return - * the outer alternative number used to match the input. Default - * implementation does not compute nor store this alt num. Create - * a subclass of ParserRuleContext with backing field and set - * option contextSuperClass. - * to set it. - */ - getAltNumber() { - // use constant value of ATN.INVALID_ALT_NUMBER to avoid circular dependency - return 0; - } - - /** - * Set the outer alternative number for this context node. Default - * implementation does nothing to avoid backing field overhead for - * trees that don't need it. Create - * a subclass of ParserRuleContext with backing field and set - * option contextSuperClass. - */ - setAltNumber(altNumber) { } - - getChild(i) { - return null; - } - - getChildCount() { - return 0; - } - - accept(visitor) { - return visitor.visitChildren(this); - } - - /** - * Print out a whole tree, not just a node, in LISP format - * (root child1 .. childN). Print just a node if this is a leaf. - */ - toStringTree(ruleNames, recog) { - return Trees.toStringTree(this, ruleNames, recog); - } - - toString(ruleNames, stop) { - ruleNames = ruleNames || null; - stop = stop || null; - let p = this; - let s = "["; - while (p !== null && p !== stop) { - if (ruleNames === null) { - if (!p.isEmpty()) { - s += p.invokingState; - } - } else { - const ri = p.ruleIndex; - const ruleName = (ri >= 0 && ri < ruleNames.length) ? ruleNames[ri] - : "" + ri; - s += ruleName; - } - if (p.parentCtx !== null && (ruleNames !== null || !p.parentCtx.isEmpty())) { - s += " "; - } - p = p.parentCtx; - } - s += "]"; - return s; - } -} - -module.exports = RuleContext; diff --git a/runtime/JavaScript/src/antlr4/Token.js b/runtime/JavaScript/src/antlr4/Token.js index e52c225268..a92f43357d 100644 --- a/runtime/JavaScript/src/antlr4/Token.js +++ b/runtime/JavaScript/src/antlr4/Token.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ @@ -8,7 +8,7 @@ * (so we can ignore tabs), token channel, index, and source from which * we obtained this token. */ -class Token { +export default class Token { constructor() { this.source = null; this.type = null; // token type of the token @@ -63,87 +63,3 @@ Token.DEFAULT_CHANNEL = 0; */ Token.HIDDEN_CHANNEL = 1; - -class CommonToken extends Token { - constructor(source, type, channel, start, stop) { - super(); - this.source = source !== undefined ? source : CommonToken.EMPTY_SOURCE; - this.type = type !== undefined ? type : null; - this.channel = channel !== undefined ? channel : Token.DEFAULT_CHANNEL; - this.start = start !== undefined ? start : -1; - this.stop = stop !== undefined ? stop : -1; - this.tokenIndex = -1; - if (this.source[0] !== null) { - this.line = source[0].line; - this.column = source[0].column; - } else { - this.column = -1; - } - } - - /** - * Constructs a new {@link CommonToken} as a copy of another {@link Token}. - * - *

- * If {@code oldToken} is also a {@link CommonToken} instance, the newly - * constructed token will share a reference to the {@link //text} field and - * the {@link Pair} stored in {@link //source}. Otherwise, {@link //text} will - * be assigned the result of calling {@link //getText}, and {@link //source} - * will be constructed from the result of {@link Token//getTokenSource} and - * {@link Token//getInputStream}.

- * - * @param oldToken The token to copy. - */ - clone() { - const t = new CommonToken(this.source, this.type, this.channel, this.start, this.stop); - t.tokenIndex = this.tokenIndex; - t.line = this.line; - t.column = this.column; - t.text = this.text; - return t; - } - - toString() { - let txt = this.text; - if (txt !== null) { - txt = txt.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t"); - } else { - txt = ""; - } - return "[@" + this.tokenIndex + "," + this.start + ":" + this.stop + "='" + - txt + "',<" + this.type + ">" + - (this.channel > 0 ? ",channel=" + this.channel : "") + "," + - this.line + ":" + this.column + "]"; - } - - get text(){ - if (this._text !== null) { - return this._text; - } - const input = this.getInputStream(); - if (input === null) { - return null; - } - const n = input.size; - if (this.start < n && this.stop < n) { - return input.getText(this.start, this.stop); - } else { - return ""; - } - } - - set text(text) { - this._text = text; - } -} - -/** - * An empty {@link Pair} which is used as the default value of - * {@link //source} for tokens that do not have a source. - */ -CommonToken.EMPTY_SOURCE = [ null, null ]; - -module.exports = { - Token, - CommonToken -} diff --git a/runtime/JavaScript/src/antlr4/TokenSource.js b/runtime/JavaScript/src/antlr4/TokenSource.js new file mode 100644 index 0000000000..0c232e641c --- /dev/null +++ b/runtime/JavaScript/src/antlr4/TokenSource.js @@ -0,0 +1,6 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default class TokenSource {} + diff --git a/runtime/JavaScript/src/antlr4/TokenStream.js b/runtime/JavaScript/src/antlr4/TokenStream.js new file mode 100644 index 0000000000..eba65e1b5f --- /dev/null +++ b/runtime/JavaScript/src/antlr4/TokenStream.js @@ -0,0 +1,7 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +// this is just to keep meaningful parameter types to Parser +export default class TokenStream {} + diff --git a/runtime/JavaScript/src/antlr4/TraceListener.js b/runtime/JavaScript/src/antlr4/TraceListener.js new file mode 100644 index 0000000000..13e929859e --- /dev/null +++ b/runtime/JavaScript/src/antlr4/TraceListener.js @@ -0,0 +1,24 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ParseTreeListener from "./tree/ParseTreeListener.js"; + +export default class TraceListener extends ParseTreeListener { + constructor(parser) { + super(); + this.parser = parser; + } + + enterEveryRule(ctx) { + console.log("enter " + this.parser.ruleNames[ctx.ruleIndex] + ", LT(1)=" + this.parser._input.LT(1).text); + } + + visitTerminal(node) { + console.log("consume " + node.symbol + " rule " + this.parser.ruleNames[this.parser._ctx.ruleIndex]); + } + + exitEveryRule(ctx) { + console.log("exit " + this.parser.ruleNames[ctx.ruleIndex] + ", LT(1)=" + this.parser._input.LT(1).text); + } +} diff --git a/runtime/JavaScript/src/antlr4/Utils.js b/runtime/JavaScript/src/antlr4/Utils.js deleted file mode 100644 index 9ff166e879..0000000000 --- a/runtime/JavaScript/src/antlr4/Utils.js +++ /dev/null @@ -1,455 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -function valueToString(v) { - return v === null ? "null" : v; -} - -function arrayToString(a) { - return Array.isArray(a) ? ("[" + a.map(valueToString).join(", ") + "]") : "null"; -} - -String.prototype.seed = String.prototype.seed || Math.round(Math.random() * Math.pow(2, 32)); - -String.prototype.hashCode = function () { - const key = this.toString(); - let h1b, k1; - - const remainder = key.length & 3; // key.length % 4 - const bytes = key.length - remainder; - let h1 = String.prototype.seed; - const c1 = 0xcc9e2d51; - const c2 = 0x1b873593; - let i = 0; - - while (i < bytes) { - k1 = - ((key.charCodeAt(i) & 0xff)) | - ((key.charCodeAt(++i) & 0xff) << 8) | - ((key.charCodeAt(++i) & 0xff) << 16) | - ((key.charCodeAt(++i) & 0xff) << 24); - ++i; - - k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff; - k1 = (k1 << 15) | (k1 >>> 17); - k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff; - - h1 ^= k1; - h1 = (h1 << 13) | (h1 >>> 19); - h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff; - h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16)); - } - - k1 = 0; - - switch (remainder) { - case 3: - k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16; - case 2: - k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8; - case 1: - k1 ^= (key.charCodeAt(i) & 0xff); - - k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff; - k1 = (k1 << 15) | (k1 >>> 17); - k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff; - h1 ^= k1; - } - - h1 ^= key.length; - - h1 ^= h1 >>> 16; - h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff; - h1 ^= h1 >>> 13; - h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff; - h1 ^= h1 >>> 16; - - return h1 >>> 0; -}; - -function standardEqualsFunction(a, b) { - return a ? a.equals(b) : a==b; -} - -function standardHashCodeFunction(a) { - return a ? a.hashCode() : -1; -} - -class Set { - constructor(hashFunction, equalsFunction) { - this.data = {}; - this.hashFunction = hashFunction || standardHashCodeFunction; - this.equalsFunction = equalsFunction || standardEqualsFunction; - } - - add(value) { - const hash = this.hashFunction(value); - const key = "hash_" + hash; - if (key in this.data) { - const values = this.data[key]; - for (let i = 0; i < values.length; i++) { - if (this.equalsFunction(value, values[i])) { - return values[i]; - } - } - values.push(value); - return value; - } else { - this.data[key] = [value]; - return value; - } - } - - contains(value) { - return this.get(value) != null; - } - - get(value) { - const hash = this.hashFunction(value); - const key = "hash_" + hash; - if (key in this.data) { - const values = this.data[key]; - for (let i = 0; i < values.length; i++) { - if (this.equalsFunction(value, values[i])) { - return values[i]; - } - } - } - return null; - } - - values() { - let l = []; - for (const key in this.data) { - if (key.indexOf("hash_") === 0) { - l = l.concat(this.data[key]); - } - } - return l; - } - - toString() { - return arrayToString(this.values()); - } - - get length(){ - let l = 0; - for (const key in this.data) { - if (key.indexOf("hash_") === 0) { - l = l + this.data[key].length; - } - } - return l; - } -} - - -class BitSet { - constructor() { - this.data = []; - } - - add(value) { - this.data[value] = true; - } - - or(set) { - const bits = this; - Object.keys(set.data).map(function (alt) { - bits.add(alt); - }); - } - - remove(value) { - delete this.data[value]; - } - - contains(value) { - return this.data[value] === true; - } - - values() { - return Object.keys(this.data); - } - - minValue() { - return Math.min.apply(null, this.values()); - } - - hashCode() { - const hash = new Hash(); - hash.update(this.values()); - return hash.finish(); - } - - equals(other) { - if (!(other instanceof BitSet)) { - return false; - } - return this.hashCode() === other.hashCode(); - } - - toString() { - return "{" + this.values().join(", ") + "}"; - } - - get length(){ - return this.values().length; - } -} - - -class Map { - constructor(hashFunction, equalsFunction) { - this.data = {}; - this.hashFunction = hashFunction || standardHashCodeFunction; - this.equalsFunction = equalsFunction || standardEqualsFunction; - } - - put(key, value) { - const hashKey = "hash_" + this.hashFunction(key); - if (hashKey in this.data) { - const entries = this.data[hashKey]; - for (let i = 0; i < entries.length; i++) { - const entry = entries[i]; - if (this.equalsFunction(key, entry.key)) { - const oldValue = entry.value; - entry.value = value; - return oldValue; - } - } - entries.push({key:key, value:value}); - return value; - } else { - this.data[hashKey] = [{key:key, value:value}]; - return value; - } - } - - containsKey(key) { - const hashKey = "hash_" + this.hashFunction(key); - if(hashKey in this.data) { - const entries = this.data[hashKey]; - for (let i = 0; i < entries.length; i++) { - const entry = entries[i]; - if (this.equalsFunction(key, entry.key)) - return true; - } - } - return false; - } - - get(key) { - const hashKey = "hash_" + this.hashFunction(key); - if(hashKey in this.data) { - const entries = this.data[hashKey]; - for (let i = 0; i < entries.length; i++) { - const entry = entries[i]; - if (this.equalsFunction(key, entry.key)) - return entry.value; - } - } - return null; - } - - entries() { - let l = []; - for (const key in this.data) { - if (key.indexOf("hash_") === 0) { - l = l.concat(this.data[key]); - } - } - return l; - } - - getKeys() { - return this.entries().map(function(e) { - return e.key; - }); - } - - getValues() { - return this.entries().map(function(e) { - return e.value; - }); - } - - toString() { - const ss = this.entries().map(function(entry) { - return '{' + entry.key + ':' + entry.value + '}'; - }); - return '[' + ss.join(", ") + ']'; - } - - get length(){ - let l = 0; - for (const hashKey in this.data) { - if (hashKey.indexOf("hash_") === 0) { - l = l + this.data[hashKey].length; - } - } - return l; - } -} - - -class AltDict { - constructor() { - this.data = {}; - } - - get(key) { - key = "k-" + key; - if (key in this.data) { - return this.data[key]; - } else { - return null; - } - } - - put(key, value) { - key = "k-" + key; - this.data[key] = value; - } - - values() { - const data = this.data; - const keys = Object.keys(this.data); - return keys.map(function (key) { - return data[key]; - }); - } -} - - -class DoubleDict { - constructor(defaultMapCtor) { - this.defaultMapCtor = defaultMapCtor || Map; - this.cacheMap = new this.defaultMapCtor(); - } - - get(a, b) { - const d = this.cacheMap.get(a) || null; - return d === null ? null : (d.get(b) || null); - } - - set(a, b, o) { - let d = this.cacheMap.get(a) || null; - if (d === null) { - d = new this.defaultMapCtor(); - this.cacheMap.put(a, d); - } - d.put(b, o); - } -} - -class Hash { - constructor() { - this.count = 0; - this.hash = 0; - } - - update() { - for(let i=0;i>> (32 - 15)); - k = k * 0x1B873593; - this.count = this.count + 1; - let hash = this.hash ^ k; - hash = (hash << 13) | (hash >>> (32 - 13)); - hash = hash * 5 + 0xE6546B64; - this.hash = hash; - } - } - } - - finish() { - let hash = this.hash ^ (this.count * 4); - hash = hash ^ (hash >>> 16); - hash = hash * 0x85EBCA6B; - hash = hash ^ (hash >>> 13); - hash = hash * 0xC2B2AE35; - hash = hash ^ (hash >>> 16); - return hash; - } -} - -function hashStuff() { - const hash = new Hash(); - hash.update.apply(hash, arguments); - return hash.finish(); -} - - -function escapeWhitespace(s, escapeSpaces) { - s = s.replace(/\t/g, "\\t") - .replace(/\n/g, "\\n") - .replace(/\r/g, "\\r"); - if (escapeSpaces) { - s = s.replace(/ /g, "\u00B7"); - } - return s; -} - -function titleCase(str) { - return str.replace(/\w\S*/g, function (txt) { - return txt.charAt(0).toUpperCase() + txt.substr(1); - }); -} - -function equalArrays(a, b) { - if (!Array.isArray(a) || !Array.isArray(b)) - return false; - if (a === b) - return true; - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) { - if (a[i] === b[i]) - continue; - if (!a[i].equals || !a[i].equals(b[i])) - return false; - } - return true; -} - -module.exports = { - Hash, - Set, - Map, - BitSet, - AltDict, - DoubleDict, - hashStuff, - escapeWhitespace, - arrayToString, - titleCase, - equalArrays -} diff --git a/runtime/JavaScript/src/antlr4/action/LexerAction.js b/runtime/JavaScript/src/antlr4/action/LexerAction.js new file mode 100644 index 0000000000..3683880c32 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/action/LexerAction.js @@ -0,0 +1,33 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import HashCode from "../misc/HashCode.js"; + +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + + +export default class LexerAction { + constructor(action) { + this.actionType = action; + this.isPositionDependent = false; + } + + hashCode() { + const hash = new HashCode(); + this.updateHashCode(hash); + return hash.finish() + } + + updateHashCode(hash) { + hash.update(this.actionType); + } + + equals(other) { + return this === other; + } +} + diff --git a/runtime/JavaScript/src/antlr4/action/LexerChannelAction.js b/runtime/JavaScript/src/antlr4/action/LexerChannelAction.js new file mode 100644 index 0000000000..734206b1f7 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/action/LexerChannelAction.js @@ -0,0 +1,46 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import {default as LexerActionType } from "../atn/LexerActionType.js"; +import LexerAction from "./LexerAction.js"; + +/** + * Implements the {@code channel} lexer action by calling + * {@link Lexer//setChannel} with the assigned channel. + * Constructs a new {@code channel} action with the specified channel value. + * @param channel The channel value to pass to {@link Lexer//setChannel} + */ +export default class LexerChannelAction extends LexerAction { + constructor(channel) { + super(LexerActionType.CHANNEL); + this.channel = channel; + } + + /** + *

This action is implemented by calling {@link Lexer//setChannel} with the + * value provided by {@link //getChannel}.

+ */ + execute(lexer) { + lexer._channel = this.channel; + } + + updateHashCode(hash) { + hash.update(this.actionType, this.channel); + } + + equals(other) { + if (this === other) { + return true; + } else if (! (other instanceof LexerChannelAction)) { + return false; + } else { + return this.channel === other.channel; + } + } + + toString() { + return "channel(" + this.channel + ")"; + } +} + diff --git a/runtime/JavaScript/src/antlr4/action/LexerCustomAction.js b/runtime/JavaScript/src/antlr4/action/LexerCustomAction.js new file mode 100644 index 0000000000..c40ac0d001 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/action/LexerCustomAction.js @@ -0,0 +1,56 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import {default as LexerActionType } from "../atn/LexerActionType.js"; +import LexerAction from "./LexerAction.js"; + +/** + * Executes a custom lexer action by calling {@link Recognizer//action} with the + * rule and action indexes assigned to the custom action. The implementation of + * a custom action is added to the generated code for the lexer in an override + * of {@link Recognizer//action} when the grammar is compiled. + * + *

This class may represent embedded actions created with the {...} + * syntax in ANTLR 4, as well as actions created for lexer commands where the + * command argument could not be evaluated when the grammar was compiled.

+ */ +export default class LexerCustomAction extends LexerAction { + /** + * Constructs a custom lexer action with the specified rule and action + * indexes. + * + * @param ruleIndex The rule index to use for calls to + * {@link Recognizer//action}. + * @param actionIndex The action index to use for calls to + * {@link Recognizer//action}. + */ + constructor(ruleIndex, actionIndex) { + super(LexerActionType.CUSTOM); + this.ruleIndex = ruleIndex; + this.actionIndex = actionIndex; + this.isPositionDependent = true; + } + + /** + *

Custom actions are implemented by calling {@link Lexer//action} with the + * appropriate rule and action indexes.

+ */ + execute(lexer) { + lexer.action(null, this.ruleIndex, this.actionIndex); + } + + updateHashCode(hash) { + hash.update(this.actionType, this.ruleIndex, this.actionIndex); + } + + equals(other) { + if (this === other) { + return true; + } else if (! (other instanceof LexerCustomAction)) { + return false; + } else { + return this.ruleIndex === other.ruleIndex && this.actionIndex === other.actionIndex; + } + } +} diff --git a/runtime/JavaScript/src/antlr4/action/LexerIndexedCustomAction.js b/runtime/JavaScript/src/antlr4/action/LexerIndexedCustomAction.js new file mode 100644 index 0000000000..6557a5db86 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/action/LexerIndexedCustomAction.js @@ -0,0 +1,60 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +/** + * This implementation of {@link LexerAction} is used for tracking input offsets + * for position-dependent actions within a {@link LexerActionExecutor}. + * + *

This action is not serialized as part of the ATN, and is only required for + * position-dependent lexer actions which appear at a location other than the + * end of a rule. For more information about DFA optimizations employed for + * lexer actions, see {@link LexerActionExecutor//append} and + * {@link LexerActionExecutor//fixOffsetBeforeMatch}.

+ * + * Constructs a new indexed custom action by associating a character offset + * with a {@link LexerAction}. + * + *

Note: This class is only required for lexer actions for which + * {@link LexerAction//isPositionDependent} returns {@code true}.

+ * + * @param offset The offset into the input {@link CharStream}, relative to + * the token start index, at which the specified lexer action should be + * executed. + * @param action The lexer action to execute at a particular offset in the + * input {@link CharStream}. + */ +import LexerAction from "./LexerAction.js"; + + +export default class LexerIndexedCustomAction extends LexerAction { + constructor(offset, action) { + super(action.actionType); + this.offset = offset; + this.action = action; + this.isPositionDependent = true; + } + + /** + *

This method calls {@link //execute} on the result of {@link //getAction} + * using the provided {@code lexer}.

+ */ + execute(lexer) { + // assume the input stream position was properly set by the calling code + this.action.execute(lexer); + } + + updateHashCode(hash) { + hash.update(this.actionType, this.offset, this.action); + } + + equals(other) { + if (this === other) { + return true; + } else if (! (other instanceof LexerIndexedCustomAction)) { + return false; + } else { + return this.offset === other.offset && this.action === other.action; + } + } +} diff --git a/runtime/JavaScript/src/antlr4/action/LexerModeAction.js b/runtime/JavaScript/src/antlr4/action/LexerModeAction.js new file mode 100644 index 0000000000..81f7aca154 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/action/LexerModeAction.js @@ -0,0 +1,43 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import {default as LexerActionType } from "../atn/LexerActionType.js"; +import LexerAction from "./LexerAction.js"; + +/** + * Implements the {@code mode} lexer action by calling {@link Lexer//mode} with + * the assigned mode + */ +export default class LexerModeAction extends LexerAction { + constructor(mode) { + super(LexerActionType.MODE); + this.mode = mode; + } + + /** + *

This action is implemented by calling {@link Lexer//mode} with the + * value provided by {@link //getMode}.

+ */ + execute(lexer) { + lexer.mode(this.mode); + } + + updateHashCode(hash) { + hash.update(this.actionType, this.mode); + } + + equals(other) { + if (this === other) { + return true; + } else if (! (other instanceof LexerModeAction)) { + return false; + } else { + return this.mode === other.mode; + } + } + + toString() { + return "mode(" + this.mode + ")"; + } +} diff --git a/runtime/JavaScript/src/antlr4/action/LexerMoreAction.js b/runtime/JavaScript/src/antlr4/action/LexerMoreAction.js new file mode 100644 index 0000000000..6dd1885d1d --- /dev/null +++ b/runtime/JavaScript/src/antlr4/action/LexerMoreAction.js @@ -0,0 +1,32 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import {default as LexerActionType } from "../atn/LexerActionType.js"; +import LexerAction from "./LexerAction.js"; + +/** + * Implements the {@code more} lexer action by calling {@link Lexer//more}. + * + *

The {@code more} command does not have any parameters, so this action is + * implemented as a singleton instance exposed by {@link //INSTANCE}.

+ */ +export default class LexerMoreAction extends LexerAction { + constructor() { + super(LexerActionType.MORE); + } + + /** + *

This action is implemented by calling {@link Lexer//popMode}.

+ */ + execute(lexer) { + lexer.more(); + } + + toString() { + return "more"; + } +} + +LexerMoreAction.INSTANCE = new LexerMoreAction(); + diff --git a/runtime/JavaScript/src/antlr4/action/LexerPopModeAction.js b/runtime/JavaScript/src/antlr4/action/LexerPopModeAction.js new file mode 100644 index 0000000000..c6fc7b7735 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/action/LexerPopModeAction.js @@ -0,0 +1,31 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import {default as LexerActionType } from "../atn/LexerActionType.js"; +import LexerAction from "./LexerAction.js"; + +/** + * Implements the {@code popMode} lexer action by calling {@link Lexer//popMode}. + * + *

The {@code popMode} command does not have any parameters, so this action is + * implemented as a singleton instance exposed by {@link //INSTANCE}.

+ */ +export default class LexerPopModeAction extends LexerAction { + constructor() { + super(LexerActionType.POP_MODE); + } + + /** + *

This action is implemented by calling {@link Lexer//popMode}.

+ */ + execute(lexer) { + lexer.popMode(); + } + + toString() { + return "popMode"; + } +} + +LexerPopModeAction.INSTANCE = new LexerPopModeAction(); diff --git a/runtime/JavaScript/src/antlr4/action/LexerPushModeAction.js b/runtime/JavaScript/src/antlr4/action/LexerPushModeAction.js new file mode 100644 index 0000000000..2c694b3da6 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/action/LexerPushModeAction.js @@ -0,0 +1,43 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import {default as LexerActionType } from "../atn/LexerActionType.js"; +import LexerAction from "./LexerAction.js"; + +/** + * Implements the {@code pushMode} lexer action by calling + * {@link Lexer//pushMode} with the assigned mode + */ +export default class LexerPushModeAction extends LexerAction { + constructor(mode) { + super(LexerActionType.PUSH_MODE); + this.mode = mode; + } + + /** + *

This action is implemented by calling {@link Lexer//pushMode} with the + * value provided by {@link //getMode}.

+ */ + execute(lexer) { + lexer.pushMode(this.mode); + } + + updateHashCode(hash) { + hash.update(this.actionType, this.mode); + } + + equals(other) { + if (this === other) { + return true; + } else if (! (other instanceof LexerPushModeAction)) { + return false; + } else { + return this.mode === other.mode; + } + } + + toString() { + return "pushMode(" + this.mode + ")"; + } +} diff --git a/runtime/JavaScript/src/antlr4/action/LexerSkipAction.js b/runtime/JavaScript/src/antlr4/action/LexerSkipAction.js new file mode 100644 index 0000000000..68a2636fd8 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/action/LexerSkipAction.js @@ -0,0 +1,29 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import {default as LexerActionType } from "../atn/LexerActionType.js"; +import LexerAction from "./LexerAction.js"; + +/** + * Implements the {@code skip} lexer action by calling {@link Lexer//skip}. + * + *

The {@code skip} command does not have any parameters, so this action is + * implemented as a singleton instance exposed by {@link //INSTANCE}.

+ */ +export default class LexerSkipAction extends LexerAction { + constructor() { + super(LexerActionType.SKIP); + } + + execute(lexer) { + lexer.skip(); + } + + toString() { + return "skip"; + } +} + +// Provides a singleton instance of this parameterless lexer action. +LexerSkipAction.INSTANCE = new LexerSkipAction(); diff --git a/runtime/JavaScript/src/antlr4/action/LexerTypeAction.js b/runtime/JavaScript/src/antlr4/action/LexerTypeAction.js new file mode 100644 index 0000000000..98092b3828 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/action/LexerTypeAction.js @@ -0,0 +1,41 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import {default as LexerActionType } from "../atn/LexerActionType.js"; +import LexerAction from "./LexerAction.js"; + +/** + * Implements the {@code type} lexer action by calling {@link Lexer//setType} + * with the assigned type + */ + +export default class LexerTypeAction extends LexerAction { + constructor(type) { + super(LexerActionType.TYPE); + this.type = type; + } + + execute(lexer) { + lexer.type = this.type; + } + + updateHashCode(hash) { + hash.update(this.actionType, this.type); + } + + equals(other) { + if(this === other) { + return true; + } else if (! (other instanceof LexerTypeAction)) { + return false; + } else { + return this.type === other.type; + } + } + + toString() { + return "type(" + this.type + ")"; + } +} + diff --git a/runtime/JavaScript/src/antlr4/atn/ATN.js b/runtime/JavaScript/src/antlr4/atn/ATN.js index 6125f4f4ad..0ddcdca335 100644 --- a/runtime/JavaScript/src/antlr4/atn/ATN.js +++ b/runtime/JavaScript/src/antlr4/atn/ATN.js @@ -1,13 +1,13 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const LL1Analyzer = require('./../LL1Analyzer'); -const {IntervalSet} = require('./../IntervalSet'); -const {Token} = require('./../Token'); +import LL1Analyzer from './LL1Analyzer.js'; +import IntervalSet from '../misc/IntervalSet.js'; +import Token from '../Token.js'; -class ATN { +export default class ATN { constructor(grammarType , maxTokenType) { /** @@ -153,4 +153,3 @@ class ATN { ATN.INVALID_ALT_NUMBER = 0; -module.exports = ATN; diff --git a/runtime/JavaScript/src/antlr4/atn/ATNConfig.js b/runtime/JavaScript/src/antlr4/atn/ATNConfig.js index b5c4f9927f..a6ab45b1ef 100644 --- a/runtime/JavaScript/src/antlr4/atn/ATNConfig.js +++ b/runtime/JavaScript/src/antlr4/atn/ATNConfig.js @@ -1,12 +1,10 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {DecisionState} = require('./ATNState'); -const {SemanticContext} = require('./SemanticContext'); -const {Hash} = require("../Utils"); - +import SemanticContext from './SemanticContext.js'; +import HashCode from "../misc/HashCode.js"; function checkParams(params, isCfg) { if(params===null) { @@ -29,7 +27,7 @@ function checkParams(params, isCfg) { } } -class ATNConfig { +export default class ATNConfig { /** * @param {Object} params A tuple: (ATN state, predicted alt, syntactic, semantic context). * The syntactic context is a graph-structured stack node whose @@ -77,7 +75,7 @@ class ATNConfig { } hashCode() { - const hash = new Hash(); + const hash = new HashCode(); this.updateHashCode(hash); return hash.finish(); } @@ -106,7 +104,7 @@ class ATNConfig { } hashCodeForConfigSet() { - const hash = new Hash(); + const hash = new HashCode(); hash.update(this.state.stateNumber, this.alt, this.semanticContext); return hash.finish(); } @@ -134,39 +132,3 @@ class ATNConfig { : "") + ")"; } } - - -class LexerATNConfig extends ATNConfig { - constructor(params, config) { - super(params, config); - - // This is the backing field for {@link //getLexerActionExecutor}. - const lexerActionExecutor = params.lexerActionExecutor || null; - this.lexerActionExecutor = lexerActionExecutor || (config!==null ? config.lexerActionExecutor : null); - this.passedThroughNonGreedyDecision = config!==null ? this.checkNonGreedyDecision(config, this.state) : false; - this.hashCodeForConfigSet = LexerATNConfig.prototype.hashCode; - this.equalsForConfigSet = LexerATNConfig.prototype.equals; - return this; - } - - updateHashCode(hash) { - hash.update(this.state.stateNumber, this.alt, this.context, this.semanticContext, this.passedThroughNonGreedyDecision, this.lexerActionExecutor); - } - - equals(other) { - return this === other || - (other instanceof LexerATNConfig && - this.passedThroughNonGreedyDecision === other.passedThroughNonGreedyDecision && - (this.lexerActionExecutor ? this.lexerActionExecutor.equals(other.lexerActionExecutor) : !other.lexerActionExecutor) && - super.equals(other)); - } - - checkNonGreedyDecision(source, target) { - return source.passedThroughNonGreedyDecision || - (target instanceof DecisionState) && target.nonGreedy; - } -} - - -module.exports.ATNConfig = ATNConfig; -module.exports.LexerATNConfig = LexerATNConfig; diff --git a/runtime/JavaScript/src/antlr4/atn/ATNConfigSet.js b/runtime/JavaScript/src/antlr4/atn/ATNConfigSet.js index 1b5b46e83b..0265d56bc5 100644 --- a/runtime/JavaScript/src/antlr4/atn/ATNConfigSet.js +++ b/runtime/JavaScript/src/antlr4/atn/ATNConfigSet.js @@ -1,12 +1,15 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const ATN = require('./ATN'); -const Utils = require('./../Utils'); -const {SemanticContext} = require('./SemanticContext'); -const {merge} = require('./../PredictionContext'); +import ATN from './ATN.js'; +import SemanticContext from './SemanticContext.js'; +import { merge } from '../context/PredictionContextUtils.js'; +import arrayToString from "../utils/arrayToString.js"; +import HashSet from "../misc/HashSet.js"; +import equalArrays from "../utils/equalArrays.js"; +import HashCode from "../misc/HashCode.js"; function hashATNConfig(c) { return c.hashCodeForConfigSet(); @@ -26,7 +29,7 @@ function equalATNConfigs(a, b) { * info about the set, with support for combining similar configurations using a * graph-structured stack */ -class ATNConfigSet { +export default class ATNConfigSet { constructor(fullCtx) { /** * The reason that we need this is because we don't want the hash map to use @@ -40,7 +43,7 @@ class ATNConfigSet { * All configs but hashed by (s, i, _, pi) not including context. Wiped out * when we go readonly as this set becomes a DFA state */ - this.configLookup = new Utils.Set(hashATNConfig, equalATNConfigs); + this.configLookup = new HashSet(hashATNConfig, equalATNConfigs); /** * Indicates that this configuration set is part of a full context * LL prediction. It will be used to determine how to merge $. With SLL @@ -122,7 +125,7 @@ class ATNConfigSet { } getStates() { - const states = new Utils.Set(); + const states = new HashSet(); for (let i = 0; i < this.configs.length; i++) { states.add(this.configs[i].state); } @@ -163,7 +166,7 @@ class ATNConfigSet { equals(other) { return this === other || (other instanceof ATNConfigSet && - Utils.equalArrays(this.configs, other.configs) && + equalArrays(this.configs, other.configs) && this.fullCtx === other.fullCtx && this.uniqueAlt === other.uniqueAlt && this.conflictingAlts === other.conflictingAlts && @@ -172,7 +175,7 @@ class ATNConfigSet { } hashCode() { - const hash = new Utils.Hash(); + const hash = new HashCode(); hash.update(this.configs); return hash.finish(); } @@ -212,7 +215,7 @@ class ATNConfigSet { } this.configs = []; this.cachedHashCode = -1; - this.configLookup = new Utils.Set(); + this.configLookup = new HashSet(); } setReadonly(readOnly) { @@ -223,7 +226,7 @@ class ATNConfigSet { } toString() { - return Utils.arrayToString(this.configs) + + return arrayToString(this.configs) + (this.hasSemanticContext ? ",hasSemanticContext=" + this.hasSemanticContext : "") + (this.uniqueAlt !== ATN.INVALID_ALT_NUMBER ? ",uniqueAlt=" + this.uniqueAlt : "") + (this.conflictingAlts !== null ? ",conflictingAlts=" + this.conflictingAlts : "") + @@ -239,15 +242,3 @@ class ATNConfigSet { } } - -class OrderedATNConfigSet extends ATNConfigSet { - constructor() { - super(); - this.configLookup = new Utils.Set(); - } -} - -module.exports = { - ATNConfigSet, - OrderedATNConfigSet -} diff --git a/runtime/JavaScript/src/antlr4/atn/ATNDeserializationOptions.js b/runtime/JavaScript/src/antlr4/atn/ATNDeserializationOptions.js index dc82dc3059..48fe8cf561 100644 --- a/runtime/JavaScript/src/antlr4/atn/ATNDeserializationOptions.js +++ b/runtime/JavaScript/src/antlr4/atn/ATNDeserializationOptions.js @@ -1,9 +1,9 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -class ATNDeserializationOptions { +export default class ATNDeserializationOptions { constructor(copyFrom) { if(copyFrom===undefined) { copyFrom = null; @@ -17,9 +17,3 @@ class ATNDeserializationOptions { ATNDeserializationOptions.defaultOptions = new ATNDeserializationOptions(); ATNDeserializationOptions.defaultOptions.readOnly = true; -// def __setattr__(self, key, value): -// if key!="readOnly" and self.readOnly: -// raise Exception("The object is read only.") -// super(type(self), self).__setattr__(key,value) - -module.exports = ATNDeserializationOptions diff --git a/runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js b/runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js index 64bb575f98..1dd96c4901 100644 --- a/runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js +++ b/runtime/JavaScript/src/antlr4/atn/ATNDeserializer.js @@ -1,78 +1,55 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Token} = require('./../Token'); -const ATN = require('./ATN'); -const ATNType = require('./ATNType'); - -const { - ATNState, - BasicState, - DecisionState, - BlockStartState, - BlockEndState, - LoopEndState, - RuleStartState, - RuleStopState, - TokensStartState, - PlusLoopbackState, - StarLoopbackState, - StarLoopEntryState, - PlusBlockStartState, - StarBlockStartState, - BasicBlockStartState -} = require('./ATNState'); - -const { - Transition, - AtomTransition, - SetTransition, - NotSetTransition, - RuleTransition, - RangeTransition, - ActionTransition, - EpsilonTransition, - WildcardTransition, - PredicateTransition, - PrecedencePredicateTransition -} = require('./Transition') - -const {IntervalSet} = require('./../IntervalSet'); -const ATNDeserializationOptions = require('./ATNDeserializationOptions'); - -const { - LexerActionType, - LexerSkipAction, - LexerChannelAction, - LexerCustomAction, - LexerMoreAction, - LexerTypeAction, - LexerPushModeAction, - LexerPopModeAction, - LexerModeAction, -} = require('./LexerAction'); - -// This is the earliest supported serialized UUID. -// stick to serialized version for now, we don't need a UUID instance -const BASE_SERIALIZED_UUID = "AADB8D7E-AEEF-4415-AD2B-8204D6CF042E"; - -// -// This UUID indicates the serialized ATN contains two sets of -// IntervalSets, where the second set's values are encoded as -// 32-bit integers to support the full Unicode SMP range up to U+10FFFF. -// -const ADDED_UNICODE_SMP = "59627784-3BE5-417A-B9EB-8131A7286089"; - -// This list contains all of the currently supported UUIDs, ordered by when -// the feature first appeared in this branch. -const SUPPORTED_UUIDS = [ BASE_SERIALIZED_UUID, ADDED_UNICODE_SMP ]; - -const SERIALIZED_VERSION = 3; - -// This is the current serialized UUID. -const SERIALIZED_UUID = ADDED_UNICODE_SMP; +import Token from '../Token.js'; +import ATN from './ATN.js'; +import ATNType from './ATNType.js'; + +import ATNState from '../state/ATNState.js'; +import BasicState from '../state/BasicState.js'; +import DecisionState from '../state/DecisionState.js'; +import BlockStartState from '../state/BlockStartState.js'; +import BlockEndState from '../state/BlockEndState.js'; +import LoopEndState from '../state/LoopEndState.js'; +import RuleStartState from '../state/RuleStartState.js'; +import RuleStopState from '../state/RuleStopState.js'; +import TokensStartState from '../state/TokensStartState.js'; +import PlusLoopbackState from '../state/PlusLoopbackState.js'; +import StarLoopbackState from '../state/StarLoopbackState.js'; +import StarLoopEntryState from '../state/StarLoopEntryState.js'; +import PlusBlockStartState from '../state/PlusBlockStartState.js'; +import StarBlockStartState from '../state/StarBlockStartState.js'; +import BasicBlockStartState from '../state/BasicBlockStartState.js'; + +import Transition from '../transition/Transition.js'; +import AtomTransition from '../transition/AtomTransition.js'; +import SetTransition from '../transition/SetTransition.js'; +import NotSetTransition from '../transition/NotSetTransition.js'; +import RuleTransition from '../transition/RuleTransition.js'; +import RangeTransition from '../transition/RangeTransition.js'; +import ActionTransition from '../transition/ActionTransition.js'; +import EpsilonTransition from '../transition/EpsilonTransition.js'; +import WildcardTransition from '../transition/WildcardTransition.js'; +import PredicateTransition from '../transition/PredicateTransition.js'; +import PrecedencePredicateTransition from '../transition/PrecedencePredicateTransition.js'; + + +import IntervalSet from '../misc/IntervalSet.js'; +import ATNDeserializationOptions from './ATNDeserializationOptions.js'; + +import LexerActionType from './LexerActionType.js'; +import LexerSkipAction from '../action/LexerSkipAction.js'; +import LexerChannelAction from '../action/LexerChannelAction.js'; +import LexerCustomAction from '../action/LexerCustomAction.js'; +import LexerMoreAction from '../action/LexerMoreAction.js'; +import LexerTypeAction from '../action/LexerTypeAction.js'; +import LexerPushModeAction from '../action/LexerPushModeAction.js'; +import LexerPopModeAction from '../action/LexerPopModeAction.js'; +import LexerModeAction from '../action/LexerModeAction.js'; + +const SERIALIZED_VERSION = 4; function initArray( length, value) { const tmp = []; @@ -80,7 +57,7 @@ function initArray( length, value) { return tmp.map(function(i) {return value;}); } -class ATNDeserializer { +export default class ATNDeserializer { constructor(options) { if ( options=== undefined || options === null ) { @@ -91,47 +68,22 @@ class ATNDeserializer { this.actionFactories = null; } - /** - * Determines if a particular serialized representation of an ATN supports - * a particular feature, identified by the {@link UUID} used for serializing - * the ATN at the time the feature was first introduced. - * - * @param feature The {@link UUID} marking the first time the feature was - * supported in the serialized ATN. - * @param actualUuid The {@link UUID} of the actual serialized ATN which is - * currently being deserialized. - * @return {@code true} if the {@code actualUuid} value represents a - * serialized ATN at or after the feature identified by {@code feature} was - * introduced; otherwise, {@code false}. - */ - isFeatureSupported(feature, actualUuid) { - const idx1 = SUPPORTED_UUIDS.indexOf(feature); - if (idx1<0) { - return false; - } - const idx2 = SUPPORTED_UUIDS.indexOf(actualUuid); - return idx2 >= idx1; - } - deserialize(data) { - this.reset(data); - this.checkVersion(); - this.checkUUID(); + const legacy = this.reset(data); + this.checkVersion(legacy); + if(legacy) + this.skipUUID(); const atn = this.readATN(); - this.readStates(atn); - this.readRules(atn); + this.readStates(atn, legacy); + this.readRules(atn, legacy); this.readModes(atn); const sets = []; - // First, deserialize sets with 16-bit arguments <= U+FFFF. this.readSets(atn, sets, this.readInt.bind(this)); - // Next, if the ATN was serialized with the Unicode SMP feature, - // deserialize sets with 32-bit arguments <= U+10FFFF. - if (this.isFeatureSupported(ADDED_UNICODE_SMP, this.uuid)) { + if(legacy) this.readSets(atn, sets, this.readInt32.bind(this)); - } this.readEdges(atn, sets); this.readDecisions(atn); - this.readLexerActions(atn); + this.readLexerActions(atn, legacy); this.markPrecedenceDecisions(atn); this.verifyATN(atn); if (this.deserializationOptions.generateRuleBypassTransitions && atn.grammarType === ATNType.PARSER ) { @@ -143,31 +95,36 @@ class ATNDeserializer { } reset(data) { - const adjust = function(c) { - const v = c.charCodeAt(0); - return v>1 ? v-2 : v + 65534; - }; - const temp = data.split("").map(adjust); - // don't adjust the first value since that's the version number - temp[0] = data.charCodeAt(0); - this.data = temp; - this.pos = 0; + const version = data.charCodeAt ? data.charCodeAt(0) : data[0]; + if(version === SERIALIZED_VERSION - 1) { + const adjust = function (c) { + const v = c.charCodeAt(0); + return v > 1 ? v - 2 : v + 65534; + }; + const temp = data.split("").map(adjust); + // don't adjust the first value since that's the version number + temp[0] = data.charCodeAt(0); + this.data = temp; + this.pos = 0; + return true; + } else { + this.data = data + this.pos = 0; + return false; + } } - checkVersion() { - const version = this.readInt(); - if ( version !== SERIALIZED_VERSION ) { - throw ("Could not deserialize ATN with version " + version + " (expected " + SERIALIZED_VERSION + ")."); - } + skipUUID() { + let count = 0; + while(count++ < 8) + this.readInt(); } - checkUUID() { - const uuid = this.readUUID(); - if (SUPPORTED_UUIDS.indexOf(uuid)<0) { - throw ("Could not deserialize ATN with UUID: " + uuid + - " (expected " + SERIALIZED_UUID + " or a legacy UUID).", uuid, SERIALIZED_UUID); + checkVersion(legacy) { + const version = this.readInt(); + if ( !legacy && version !== SERIALIZED_VERSION ) { + throw ("Could not deserialize ATN with version " + version + " (expected " + SERIALIZED_VERSION + ")."); } - this.uuid = uuid; } readATN() { @@ -176,7 +133,7 @@ class ATNDeserializer { return new ATN(grammarType, maxTokenType); } - readStates(atn) { + readStates(atn, legacy) { let j, pair, stateNumber; const loopBackStateNumbers = []; const endStateNumbers = []; @@ -189,7 +146,7 @@ class ATNDeserializer { continue; } let ruleIndex = this.readInt(); - if (ruleIndex === 0xFFFF) { + if (legacy && ruleIndex === 0xFFFF) { ruleIndex = -1; } const s = this.stateFactory(stype, ruleIndex); @@ -227,7 +184,7 @@ class ATNDeserializer { } } - readRules(atn) { + readRules(atn, legacy) { let i; const nrules = this.readInt(); if (atn.grammarType === ATNType.LEXER ) { @@ -239,7 +196,7 @@ class ATNDeserializer { atn.ruleToStartState[i] = atn.states[s]; if ( atn.grammarType === ATNType.LEXER ) { let tokenType = this.readInt(); - if (tokenType === 0xFFFF) { + if (legacy && tokenType === 0xFFFF) { tokenType = Token.EOF; } atn.ruleToTokenType[i] = tokenType; @@ -264,7 +221,7 @@ class ATNDeserializer { } } - readSets(atn, sets, readUnicode) { + readSets(atn, sets, reader) { const m = this.readInt(); for (let i=0; i=0;i--) { - const int = this.readInt(); - /* jshint bitwise: false */ - bb[(2*i)+1] = int & 0xFF; - bb[2*i] = (int >> 8) & 0xFF; - } - return byteToHex[bb[0]] + byteToHex[bb[1]] + - byteToHex[bb[2]] + byteToHex[bb[3]] + '-' + - byteToHex[bb[4]] + byteToHex[bb[5]] + '-' + - byteToHex[bb[6]] + byteToHex[bb[7]] + '-' + - byteToHex[bb[8]] + byteToHex[bb[9]] + '-' + - byteToHex[bb[10]] + byteToHex[bb[11]] + - byteToHex[bb[12]] + byteToHex[bb[13]] + - byteToHex[bb[14]] + byteToHex[bb[15]]; - } - edgeFactory(atn, type, src, trg, arg1, arg2, arg3, sets) { const target = atn.states[trg]; switch(type) { @@ -669,15 +601,3 @@ class ATNDeserializer { } } -function createByteToHex() { - const bth = []; - for (let i = 0; i < 256; i++) { - bth[i] = (i + 0x100).toString(16).substr(1).toUpperCase(); - } - return bth; -} - -const byteToHex = createByteToHex(); - - -module.exports = ATNDeserializer; diff --git a/runtime/JavaScript/src/antlr4/atn/ATNSimulator.js b/runtime/JavaScript/src/antlr4/atn/ATNSimulator.js index 02169d1d86..1db2102b4a 100644 --- a/runtime/JavaScript/src/antlr4/atn/ATNSimulator.js +++ b/runtime/JavaScript/src/antlr4/atn/ATNSimulator.js @@ -1,14 +1,14 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {DFAState} = require('./../dfa/DFAState'); -const {ATNConfigSet} = require('./ATNConfigSet'); -const {getCachedPredictionContext} = require('./../PredictionContext'); -const {Map} = require('./../Utils'); +import DFAState from '../dfa/DFAState.js'; +import ATNConfigSet from './ATNConfigSet.js'; +import { getCachedPredictionContext } from '../context/PredictionContextUtils.js'; +import HashMap from "../misc/HashMap.js"; -class ATNSimulator { +export default class ATNSimulator { constructor(atn, sharedContextCache) { /** * The context cache maps all PredictionContext objects that are == @@ -40,7 +40,7 @@ class ATNSimulator { if (this.sharedContextCache ===null) { return context; } - const visited = new Map(); + const visited = new HashMap(); return getCachedPredictionContext(context, this.sharedContextCache, visited); } } @@ -48,5 +48,3 @@ class ATNSimulator { // Must distinguish between missing edge and edge we know leads nowhere/// ATNSimulator.ERROR = new DFAState(0x7FFFFFFF, new ATNConfigSet()); - -module.exports = ATNSimulator; diff --git a/runtime/JavaScript/src/antlr4/atn/ATNType.js b/runtime/JavaScript/src/antlr4/atn/ATNType.js index 7c222a48bd..9516fda05f 100644 --- a/runtime/JavaScript/src/antlr4/atn/ATNType.js +++ b/runtime/JavaScript/src/antlr4/atn/ATNType.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ @@ -6,7 +6,7 @@ /** * Represents the type of recognizer an ATN applies to */ -module.exports = { +export default { LEXER: 0, PARSER: 1 }; diff --git a/runtime/JavaScript/src/antlr4/atn/AbstractPredicateTransition.js b/runtime/JavaScript/src/antlr4/atn/AbstractPredicateTransition.js new file mode 100644 index 0000000000..0026fded92 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/atn/AbstractPredicateTransition.js @@ -0,0 +1,11 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import Transition from "../transition/Transition.js"; + +export default class AbstractPredicateTransition extends Transition { + constructor(target) { + super(target); + } +} diff --git a/runtime/JavaScript/src/antlr4/LL1Analyzer.js b/runtime/JavaScript/src/antlr4/atn/LL1Analyzer.js similarity index 85% rename from runtime/JavaScript/src/antlr4/LL1Analyzer.js rename to runtime/JavaScript/src/antlr4/atn/LL1Analyzer.js index 18ed878996..7e6d9ed76c 100644 --- a/runtime/JavaScript/src/antlr4/LL1Analyzer.js +++ b/runtime/JavaScript/src/antlr4/atn/LL1Analyzer.js @@ -1,17 +1,23 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Set, BitSet} = require('./Utils'); -const {Token} = require('./Token'); -const {ATNConfig} = require('./atn/ATNConfig'); -const {IntervalSet} = require('./IntervalSet'); -const {RuleStopState} = require('./atn/ATNState'); -const {RuleTransition, NotSetTransition, WildcardTransition, AbstractPredicateTransition} = require('./atn/Transition'); -const {predictionContextFromRuleContext, PredictionContext, SingletonPredictionContext} = require('./PredictionContext'); +import Token from '../Token.js'; +import ATNConfig from './ATNConfig.js'; +import IntervalSet from '../misc/IntervalSet.js'; +import RuleStopState from '../state/RuleStopState.js'; +import RuleTransition from '../transition/RuleTransition.js'; +import NotSetTransition from '../transition/NotSetTransition.js'; +import WildcardTransition from '../transition/WildcardTransition.js'; +import AbstractPredicateTransition from './AbstractPredicateTransition.js'; +import { predictionContextFromRuleContext } from '../context/PredictionContextUtils.js'; +import PredictionContext from '../context/PredictionContext.js'; +import SingletonPredictionContext from '../context/SingletonPredictionContext.js'; +import BitSet from "../misc/BitSet.js"; +import HashSet from "../misc/HashSet.js"; -class LL1Analyzer { +export default class LL1Analyzer { constructor(atn) { this.atn = atn; } @@ -34,7 +40,7 @@ class LL1Analyzer { const look = []; for(let alt=0; alt< count; alt++) { look[alt] = new IntervalSet(); - const lookBusy = new Set(); + const lookBusy = new HashSet(); const seeThruPreds = false; // fail to get lookahead upon pred this._LOOK(s.transition(alt).target, null, PredictionContext.EMPTY, look[alt], lookBusy, new BitSet(), seeThruPreds, false); @@ -70,7 +76,7 @@ class LL1Analyzer { const seeThruPreds = true; // ignore preds; get all lookahead ctx = ctx || null; const lookContext = ctx!==null ? predictionContextFromRuleContext(s.atn, ctx) : null; - this._LOOK(s, stopState, lookContext, r, new Set(), new BitSet(), seeThruPreds, true); + this._LOOK(s, stopState, lookContext, r, new HashSet(), new BitSet(), seeThruPreds, true); return r; } @@ -92,7 +98,7 @@ class LL1Analyzer { * @param look The result lookahead set. * @param lookBusy A set used for preventing epsilon closures in the ATN * from causing a stack overflow. Outside code should pass - * {@code new Set} for this argument. + * {@code new CustomizedSet} for this argument. * @param calledRuleStack A set used for preventing left recursion in the * ATN from causing a stack overflow. Outside code should pass * {@code new BitSet()} for this argument. @@ -106,7 +112,7 @@ class LL1Analyzer { */ _LOOK(s, stopState , ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF) { const c = new ATNConfig({state:s, alt:0, context: ctx}, null); - if (lookBusy.contains(c)) { + if (lookBusy.has(c)) { return; } lookBusy.add(c); @@ -128,7 +134,7 @@ class LL1Analyzer { return; } if (ctx !== PredictionContext.EMPTY) { - const removed = calledRuleStack.contains(s.ruleIndex); + const removed = calledRuleStack.has(s.ruleIndex); try { calledRuleStack.remove(s.ruleIndex); // run thru all possible stack tops in ctx @@ -147,7 +153,7 @@ class LL1Analyzer { for(let j=0; jWe track these variables separately for the DFA and ATN simulation - * because the DFA simulation often has to fail over to the ATN - * simulation. If the ATN simulation fails, we need the DFA to fall - * back to its previously accepted state, if any. If the ATN succeeds, - * then the ATN does the accept and the DFA simulator that invoked it - * can simply return the predicted token type.

- */ - constructor(recog, atn, decisionToDFA, sharedContextCache) { - super(atn, sharedContextCache); - this.decisionToDFA = decisionToDFA; - this.recog = recog; - /** - * The current token's starting index into the character stream. - * Shared across DFA to ATN simulation in case the ATN fails and the - * DFA did not have a previous accept state. In this case, we use the - * ATN-generated exception object - */ - this.startIndex = -1; - // line number 1..n within the input/// - this.line = 1; - /** - * The index of the character relative to the beginning of the line - * 0..n-1 - */ - this.column = 0; - this.mode = Lexer.DEFAULT_MODE; - /** - * Used during DFA/ATN exec to record the most recent accept configuration - * info - */ - this.prevAccept = new SimState(); - } - - copyState(simulator) { - this.column = simulator.column; - this.line = simulator.line; - this.mode = simulator.mode; - this.startIndex = simulator.startIndex; - } - - match(input, mode) { - this.match_calls += 1; - this.mode = mode; - const mark = input.mark(); - try { - this.startIndex = input.index; - this.prevAccept.reset(); - const dfa = this.decisionToDFA[mode]; - if (dfa.s0 === null) { - return this.matchATN(input); - } else { - return this.execATN(input, dfa.s0); - } - } finally { - input.release(mark); - } - } - - reset() { - this.prevAccept.reset(); - this.startIndex = -1; - this.line = 1; - this.column = 0; - this.mode = Lexer.DEFAULT_MODE; - } - - matchATN(input) { - const startState = this.atn.modeToStartState[this.mode]; - - if (LexerATNSimulator.debug) { - console.log("matchATN mode " + this.mode + " start: " + startState); - } - const old_mode = this.mode; - const s0_closure = this.computeStartState(input, startState); - const suppressEdge = s0_closure.hasSemanticContext; - s0_closure.hasSemanticContext = false; - - const next = this.addDFAState(s0_closure); - if (!suppressEdge) { - this.decisionToDFA[this.mode].s0 = next; - } - - const predict = this.execATN(input, next); - - if (LexerATNSimulator.debug) { - console.log("DFA after matchATN: " + this.decisionToDFA[old_mode].toLexerString()); - } - return predict; - } - - execATN(input, ds0) { - if (LexerATNSimulator.debug) { - console.log("start state closure=" + ds0.configs); - } - if (ds0.isAcceptState) { - // allow zero-length tokens - this.captureSimState(this.prevAccept, input, ds0); - } - let t = input.LA(1); - let s = ds0; // s is current/from DFA state - - while (true) { // while more work - if (LexerATNSimulator.debug) { - console.log("execATN loop starting closure: " + s.configs); - } - - /** - * As we move src->trg, src->trg, we keep track of the previous trg to - * avoid looking up the DFA state again, which is expensive. - * If the previous target was already part of the DFA, we might - * be able to avoid doing a reach operation upon t. If s!=null, - * it means that semantic predicates didn't prevent us from - * creating a DFA state. Once we know s!=null, we check to see if - * the DFA state has an edge already for t. If so, we can just reuse - * it's configuration set; there's no point in re-computing it. - * This is kind of like doing DFA simulation within the ATN - * simulation because DFA simulation is really just a way to avoid - * computing reach/closure sets. Technically, once we know that - * we have a previously added DFA state, we could jump over to - * the DFA simulator. But, that would mean popping back and forth - * a lot and making things more complicated algorithmically. - * This optimization makes a lot of sense for loops within DFA. - * A character will take us back to an existing DFA state - * that already has lots of edges out of it. e.g., .* in comments. - * print("Target for:" + str(s) + " and:" + str(t)) - */ - let target = this.getExistingTargetState(s, t); - // print("Existing:" + str(target)) - if (target === null) { - target = this.computeTargetState(input, s, t); - // print("Computed:" + str(target)) - } - if (target === ATNSimulator.ERROR) { - break; - } - // If this is a consumable input element, make sure to consume before - // capturing the accept state so the input index, line, and char - // position accurately reflect the state of the interpreter at the - // end of the token. - if (t !== Token.EOF) { - this.consume(input); - } - if (target.isAcceptState) { - this.captureSimState(this.prevAccept, input, target); - if (t === Token.EOF) { - break; - } - } - t = input.LA(1); - s = target; // flip; current DFA target becomes new src/from state - } - return this.failOrAccept(this.prevAccept, input, s.configs, t); - } - - /** - * Get an existing target state for an edge in the DFA. If the target state - * for the edge has not yet been computed or is otherwise not available, - * this method returns {@code null}. - * - * @param s The current DFA state - * @param t The next input symbol - * @return The existing target DFA state for the given input symbol - * {@code t}, or {@code null} if the target state for this edge is not - * already cached - */ - getExistingTargetState(s, t) { - if (s.edges === null || t < LexerATNSimulator.MIN_DFA_EDGE || t > LexerATNSimulator.MAX_DFA_EDGE) { - return null; - } - - let target = s.edges[t - LexerATNSimulator.MIN_DFA_EDGE]; - if(target===undefined) { - target = null; - } - if (LexerATNSimulator.debug && target !== null) { - console.log("reuse state " + s.stateNumber + " edge to " + target.stateNumber); - } - return target; - } - - /** - * Compute a target state for an edge in the DFA, and attempt to add the - * computed state and corresponding edge to the DFA. - * - * @param input The input stream - * @param s The current DFA state - * @param t The next input symbol - * - * @return The computed target DFA state for the given input symbol - * {@code t}. If {@code t} does not lead to a valid DFA state, this method - * returns {@link //ERROR}. - */ - computeTargetState(input, s, t) { - const reach = new OrderedATNConfigSet(); - // if we don't find an existing DFA state - // Fill reach starting from closure, following t transitions - this.getReachableConfigSet(input, s.configs, reach, t); - - if (reach.items.length === 0) { // we got nowhere on t from s - if (!reach.hasSemanticContext) { - // we got nowhere on t, don't throw out this knowledge; it'd - // cause a failover from DFA later. - this.addDFAEdge(s, t, ATNSimulator.ERROR); - } - // stop when we can't match any more char - return ATNSimulator.ERROR; - } - // Add an edge from s to target DFA found/created for reach - return this.addDFAEdge(s, t, null, reach); - } - - failOrAccept(prevAccept, input, reach, t) { - if (this.prevAccept.dfaState !== null) { - const lexerActionExecutor = prevAccept.dfaState.lexerActionExecutor; - this.accept(input, lexerActionExecutor, this.startIndex, - prevAccept.index, prevAccept.line, prevAccept.column); - return prevAccept.dfaState.prediction; - } else { - // if no accept and EOF is first char, return EOF - if (t === Token.EOF && input.index === this.startIndex) { - return Token.EOF; - } - throw new LexerNoViableAltException(this.recog, input, this.startIndex, reach); - } - } - - /** - * Given a starting configuration set, figure out all ATN configurations - * we can reach upon input {@code t}. Parameter {@code reach} is a return - * parameter. - */ - getReachableConfigSet(input, closure, - reach, t) { - // this is used to skip processing for configs which have a lower priority - // than a config that already reached an accept state for the same rule - let skipAlt = ATN.INVALID_ALT_NUMBER; - for (let i = 0; i < closure.items.length; i++) { - const cfg = closure.items[i]; - const currentAltReachedAcceptState = (cfg.alt === skipAlt); - if (currentAltReachedAcceptState && cfg.passedThroughNonGreedyDecision) { - continue; - } - if (LexerATNSimulator.debug) { - console.log("testing %s at %s\n", this.getTokenName(t), cfg - .toString(this.recog, true)); - } - for (let j = 0; j < cfg.state.transitions.length; j++) { - const trans = cfg.state.transitions[j]; // for each transition - const target = this.getReachableTarget(trans, t); - if (target !== null) { - let lexerActionExecutor = cfg.lexerActionExecutor; - if (lexerActionExecutor !== null) { - lexerActionExecutor = lexerActionExecutor.fixOffsetBeforeMatch(input.index - this.startIndex); - } - const treatEofAsEpsilon = (t === Token.EOF); - const config = new LexerATNConfig({state:target, lexerActionExecutor:lexerActionExecutor}, cfg); - if (this.closure(input, config, reach, - currentAltReachedAcceptState, true, treatEofAsEpsilon)) { - // any remaining configs for this alt have a lower priority - // than the one that just reached an accept state. - skipAlt = cfg.alt; - } - } - } - } - } - - accept(input, lexerActionExecutor, - startIndex, index, line, charPos) { - if (LexerATNSimulator.debug) { - console.log("ACTION %s\n", lexerActionExecutor); - } - // seek to after last char in token - input.seek(index); - this.line = line; - this.column = charPos; - if (lexerActionExecutor !== null && this.recog !== null) { - lexerActionExecutor.execute(this.recog, input, startIndex); - } - } - - getReachableTarget(trans, t) { - if (trans.matches(t, 0, Lexer.MAX_CHAR_VALUE)) { - return trans.target; - } else { - return null; - } - } - - computeStartState(input, p) { - const initialContext = PredictionContext.EMPTY; - const configs = new OrderedATNConfigSet(); - for (let i = 0; i < p.transitions.length; i++) { - const target = p.transitions[i].target; - const cfg = new LexerATNConfig({state:target, alt:i+1, context:initialContext}, null); - this.closure(input, cfg, configs, false, false, false); - } - return configs; - } - - /** - * Since the alternatives within any lexer decision are ordered by - * preference, this method stops pursuing the closure as soon as an accept - * state is reached. After the first accept state is reached by depth-first - * search from {@code config}, all other (potentially reachable) states for - * this rule would have a lower priority. - * - * @return {Boolean} {@code true} if an accept state is reached, otherwise - * {@code false}. - */ - closure(input, config, configs, - currentAltReachedAcceptState, speculative, treatEofAsEpsilon) { - let cfg = null; - if (LexerATNSimulator.debug) { - console.log("closure(" + config.toString(this.recog, true) + ")"); - } - if (config.state instanceof RuleStopState) { - if (LexerATNSimulator.debug) { - if (this.recog !== null) { - console.log("closure at %s rule stop %s\n", this.recog.ruleNames[config.state.ruleIndex], config); - } else { - console.log("closure at rule stop %s\n", config); - } - } - if (config.context === null || config.context.hasEmptyPath()) { - if (config.context === null || config.context.isEmpty()) { - configs.add(config); - return true; - } else { - configs.add(new LexerATNConfig({ state:config.state, context:PredictionContext.EMPTY}, config)); - currentAltReachedAcceptState = true; - } - } - if (config.context !== null && !config.context.isEmpty()) { - for (let i = 0; i < config.context.length; i++) { - if (config.context.getReturnState(i) !== PredictionContext.EMPTY_RETURN_STATE) { - const newContext = config.context.getParent(i); // "pop" return state - const returnState = this.atn.states[config.context.getReturnState(i)]; - cfg = new LexerATNConfig({ state:returnState, context:newContext }, config); - currentAltReachedAcceptState = this.closure(input, cfg, - configs, currentAltReachedAcceptState, speculative, - treatEofAsEpsilon); - } - } - } - return currentAltReachedAcceptState; - } - // optimization - if (!config.state.epsilonOnlyTransitions) { - if (!currentAltReachedAcceptState || !config.passedThroughNonGreedyDecision) { - configs.add(config); - } - } - for (let j = 0; j < config.state.transitions.length; j++) { - const trans = config.state.transitions[j]; - cfg = this.getEpsilonTarget(input, config, trans, configs, speculative, treatEofAsEpsilon); - if (cfg !== null) { - currentAltReachedAcceptState = this.closure(input, cfg, configs, - currentAltReachedAcceptState, speculative, treatEofAsEpsilon); - } - } - return currentAltReachedAcceptState; - } - - // side-effect: can alter configs.hasSemanticContext - getEpsilonTarget(input, config, trans, - configs, speculative, treatEofAsEpsilon) { - let cfg = null; - if (trans.serializationType === Transition.RULE) { - const newContext = SingletonPredictionContext.create(config.context, trans.followState.stateNumber); - cfg = new LexerATNConfig( { state:trans.target, context:newContext}, config); - } else if (trans.serializationType === Transition.PRECEDENCE) { - throw "Precedence predicates are not supported in lexers."; - } else if (trans.serializationType === Transition.PREDICATE) { - // Track traversing semantic predicates. If we traverse, - // we cannot add a DFA state for this "reach" computation - // because the DFA would not test the predicate again in the - // future. Rather than creating collections of semantic predicates - // like v3 and testing them on prediction, v4 will test them on the - // fly all the time using the ATN not the DFA. This is slower but - // semantically it's not used that often. One of the key elements to - // this predicate mechanism is not adding DFA states that see - // predicates immediately afterwards in the ATN. For example, - - // a : ID {p1}? | ID {p2}? ; - - // should create the start state for rule 'a' (to save start state - // competition), but should not create target of ID state. The - // collection of ATN states the following ID references includes - // states reached by traversing predicates. Since this is when we - // test them, we cannot cash the DFA state target of ID. - - if (LexerATNSimulator.debug) { - console.log("EVAL rule " + trans.ruleIndex + ":" + trans.predIndex); - } - configs.hasSemanticContext = true; - if (this.evaluatePredicate(input, trans.ruleIndex, trans.predIndex, speculative)) { - cfg = new LexerATNConfig({ state:trans.target}, config); - } - } else if (trans.serializationType === Transition.ACTION) { - if (config.context === null || config.context.hasEmptyPath()) { - // execute actions anywhere in the start rule for a token. - // - // TODO: if the entry rule is invoked recursively, some - // actions may be executed during the recursive call. The - // problem can appear when hasEmptyPath() is true but - // isEmpty() is false. In this case, the config needs to be - // split into two contexts - one with just the empty path - // and another with everything but the empty path. - // Unfortunately, the current algorithm does not allow - // getEpsilonTarget to return two configurations, so - // additional modifications are needed before we can support - // the split operation. - const lexerActionExecutor = LexerActionExecutor.append(config.lexerActionExecutor, - this.atn.lexerActions[trans.actionIndex]); - cfg = new LexerATNConfig({ state:trans.target, lexerActionExecutor:lexerActionExecutor }, config); - } else { - // ignore actions in referenced rules - cfg = new LexerATNConfig( { state:trans.target}, config); - } - } else if (trans.serializationType === Transition.EPSILON) { - cfg = new LexerATNConfig({ state:trans.target}, config); - } else if (trans.serializationType === Transition.ATOM || - trans.serializationType === Transition.RANGE || - trans.serializationType === Transition.SET) { - if (treatEofAsEpsilon) { - if (trans.matches(Token.EOF, 0, Lexer.MAX_CHAR_VALUE)) { - cfg = new LexerATNConfig( { state:trans.target }, config); - } - } - } - return cfg; - } - - /** - * Evaluate a predicate specified in the lexer. - * - *

If {@code speculative} is {@code true}, this method was called before - * {@link //consume} for the matched character. This method should call - * {@link //consume} before evaluating the predicate to ensure position - * sensitive values, including {@link Lexer//getText}, {@link Lexer//getLine}, - * and {@link Lexer//getcolumn}, properly reflect the current - * lexer state. This method should restore {@code input} and the simulator - * to the original state before returning (i.e. undo the actions made by the - * call to {@link //consume}.

- * - * @param input The input stream. - * @param ruleIndex The rule containing the predicate. - * @param predIndex The index of the predicate within the rule. - * @param speculative {@code true} if the current index in {@code input} is - * one character before the predicate's location. - * - * @return {@code true} if the specified predicate evaluates to - * {@code true}. - */ - evaluatePredicate(input, ruleIndex, - predIndex, speculative) { - // assume true if no recognizer was provided - if (this.recog === null) { - return true; - } - if (!speculative) { - return this.recog.sempred(null, ruleIndex, predIndex); - } - const savedcolumn = this.column; - const savedLine = this.line; - const index = input.index; - const marker = input.mark(); - try { - this.consume(input); - return this.recog.sempred(null, ruleIndex, predIndex); - } finally { - this.column = savedcolumn; - this.line = savedLine; - input.seek(index); - input.release(marker); - } - } - - captureSimState(settings, input, dfaState) { - settings.index = input.index; - settings.line = this.line; - settings.column = this.column; - settings.dfaState = dfaState; - } - - addDFAEdge(from_, tk, to, cfgs) { - if (to === undefined) { - to = null; - } - if (cfgs === undefined) { - cfgs = null; - } - if (to === null && cfgs !== null) { - // leading to this call, ATNConfigSet.hasSemanticContext is used as a - // marker indicating dynamic predicate evaluation makes this edge - // dependent on the specific input sequence, so the static edge in the - // DFA should be omitted. The target DFAState is still created since - // execATN has the ability to resynchronize with the DFA state cache - // following the predicate evaluation step. - // - // TJP notes: next time through the DFA, we see a pred again and eval. - // If that gets us to a previously created (but dangling) DFA - // state, we can continue in pure DFA mode from there. - // / - const suppressEdge = cfgs.hasSemanticContext; - cfgs.hasSemanticContext = false; - - to = this.addDFAState(cfgs); - - if (suppressEdge) { - return to; - } - } - // add the edge - if (tk < LexerATNSimulator.MIN_DFA_EDGE || tk > LexerATNSimulator.MAX_DFA_EDGE) { - // Only track edges within the DFA bounds - return to; - } - if (LexerATNSimulator.debug) { - console.log("EDGE " + from_ + " -> " + to + " upon " + tk); - } - if (from_.edges === null) { - // make room for tokens 1..n and -1 masquerading as index 0 - from_.edges = []; - } - from_.edges[tk - LexerATNSimulator.MIN_DFA_EDGE] = to; // connect - - return to; - } - - /** - * Add a new DFA state if there isn't one with this set of - * configurations already. This method also detects the first - * configuration containing an ATN rule stop state. Later, when - * traversing the DFA, we will know which rule to accept. - */ - addDFAState(configs) { - const proposed = new DFAState(null, configs); - let firstConfigWithRuleStopState = null; - for (let i = 0; i < configs.items.length; i++) { - const cfg = configs.items[i]; - if (cfg.state instanceof RuleStopState) { - firstConfigWithRuleStopState = cfg; - break; - } - } - if (firstConfigWithRuleStopState !== null) { - proposed.isAcceptState = true; - proposed.lexerActionExecutor = firstConfigWithRuleStopState.lexerActionExecutor; - proposed.prediction = this.atn.ruleToTokenType[firstConfigWithRuleStopState.state.ruleIndex]; - } - const dfa = this.decisionToDFA[this.mode]; - const existing = dfa.states.get(proposed); - if (existing!==null) { - return existing; - } - const newState = proposed; - newState.stateNumber = dfa.states.length; - configs.setReadonly(true); - newState.configs = configs; - dfa.states.add(newState); - return newState; - } - - getDFA(mode) { - return this.decisionToDFA[mode]; - } +export default class LexerATNSimulator extends ATNSimulator { + /** + * When we hit an accept state in either the DFA or the ATN, we + * have to notify the character stream to start buffering characters + * via {@link IntStream//mark} and record the current state. The current sim state + * includes the current index into the input, the current line, + * and current character position in that line. Note that the Lexer is + * tracking the starting line and characterization of the token. These + * variables track the "state" of the simulator when it hits an accept state. + * + *

We track these variables separately for the DFA and ATN simulation + * because the DFA simulation often has to fail over to the ATN + * simulation. If the ATN simulation fails, we need the DFA to fall + * back to its previously accepted state, if any. If the ATN succeeds, + * then the ATN does the accept and the DFA simulator that invoked it + * can simply return the predicted token type.

+ */ + constructor(recog, atn, decisionToDFA, sharedContextCache) { + super(atn, sharedContextCache); + this.decisionToDFA = decisionToDFA; + this.recog = recog; + /** + * The current token's starting index into the character stream. + * Shared across DFA to ATN simulation in case the ATN fails and the + * DFA did not have a previous accept state. In this case, we use the + * ATN-generated exception object + */ + this.startIndex = -1; + // line number 1..n within the input/// + this.line = 1; + /** + * The index of the character relative to the beginning of the line + * 0..n-1 + */ + this.column = 0; + this.mode = Lexer.DEFAULT_MODE; + /** + * Used during DFA/ATN exec to record the most recent accept configuration + * info + */ + this.prevAccept = new SimState(); + } + + copyState(simulator) { + this.column = simulator.column; + this.line = simulator.line; + this.mode = simulator.mode; + this.startIndex = simulator.startIndex; + } + + match(input, mode) { + this.mode = mode; + const mark = input.mark(); + try { + this.startIndex = input.index; + this.prevAccept.reset(); + const dfa = this.decisionToDFA[mode]; + if (dfa.s0 === null) { + return this.matchATN(input); + } else { + return this.execATN(input, dfa.s0); + } + } finally { + input.release(mark); + } + } + + reset() { + this.prevAccept.reset(); + this.startIndex = -1; + this.line = 1; + this.column = 0; + this.mode = Lexer.DEFAULT_MODE; + } + + matchATN(input) { + const startState = this.atn.modeToStartState[this.mode]; + + if (LexerATNSimulator.debug) { + console.log("matchATN mode " + this.mode + " start: " + startState); + } + const old_mode = this.mode; + const s0_closure = this.computeStartState(input, startState); + const suppressEdge = s0_closure.hasSemanticContext; + s0_closure.hasSemanticContext = false; + + const next = this.addDFAState(s0_closure); + if (!suppressEdge) { + this.decisionToDFA[this.mode].s0 = next; + } + + const predict = this.execATN(input, next); + + if (LexerATNSimulator.debug) { + console.log("DFA after matchATN: " + this.decisionToDFA[old_mode].toLexerString()); + } + return predict; + } + + execATN(input, ds0) { + if (LexerATNSimulator.debug) { + console.log("start state closure=" + ds0.configs); + } + if (ds0.isAcceptState) { + // allow zero-length tokens + this.captureSimState(this.prevAccept, input, ds0); + } + let t = input.LA(1); + let s = ds0; // s is current/from DFA state + + for (; ;) { // while more work + if (LexerATNSimulator.debug) { + console.log("execATN loop starting closure: " + s.configs); + } + + /** + * As we move src->trg, src->trg, we keep track of the previous trg to + * avoid looking up the DFA state again, which is expensive. + * If the previous target was already part of the DFA, we might + * be able to avoid doing a reach operation upon t. If s!=null, + * it means that semantic predicates didn't prevent us from + * creating a DFA state. Once we know s!=null, we check to see if + * the DFA state has an edge already for t. If so, we can just reuse + * it's configuration set; there's no point in re-computing it. + * This is kind of like doing DFA simulation within the ATN + * simulation because DFA simulation is really just a way to avoid + * computing reach/closure sets. Technically, once we know that + * we have a previously added DFA state, we could jump over to + * the DFA simulator. But, that would mean popping back and forth + * a lot and making things more complicated algorithmically. + * This optimization makes a lot of sense for loops within DFA. + * A character will take us back to an existing DFA state + * that already has lots of edges out of it. e.g., .* in comments. + * print("Target for:" + str(s) + " and:" + str(t)) + */ + let target = this.getExistingTargetState(s, t); + // print("Existing:" + str(target)) + if (target === null) { + target = this.computeTargetState(input, s, t); + // print("Computed:" + str(target)) + } + if (target === ATNSimulator.ERROR) { + break; + } + // If this is a consumable input element, make sure to consume before + // capturing the accept state so the input index, line, and char + // position accurately reflect the state of the interpreter at the + // end of the token. + if (t !== Token.EOF) { + this.consume(input); + } + if (target.isAcceptState) { + this.captureSimState(this.prevAccept, input, target); + if (t === Token.EOF) { + break; + } + } + t = input.LA(1); + s = target; // flip; current DFA target becomes new src/from state + } + return this.failOrAccept(this.prevAccept, input, s.configs, t); + } + + /** + * Get an existing target state for an edge in the DFA. If the target state + * for the edge has not yet been computed or is otherwise not available, + * this method returns {@code null}. + * + * @param s The current DFA state + * @param t The next input symbol + * @return The existing target DFA state for the given input symbol + * {@code t}, or {@code null} if the target state for this edge is not + * already cached + */ + getExistingTargetState(s, t) { + if (s.edges === null || t < LexerATNSimulator.MIN_DFA_EDGE || t > LexerATNSimulator.MAX_DFA_EDGE) { + return null; + } + + let target = s.edges[t - LexerATNSimulator.MIN_DFA_EDGE]; + if (target === undefined) { + target = null; + } + if (LexerATNSimulator.debug && target !== null) { + console.log("reuse state " + s.stateNumber + " edge to " + target.stateNumber); + } + return target; + } + + /** + * Compute a target state for an edge in the DFA, and attempt to add the + * computed state and corresponding edge to the DFA. + * + * @param input The input stream + * @param s The current DFA state + * @param t The next input symbol + * + * @return The computed target DFA state for the given input symbol + * {@code t}. If {@code t} does not lead to a valid DFA state, this method + * returns {@link //ERROR}. + */ + computeTargetState(input, s, t) { + const reach = new OrderedATNConfigSet(); + // if we don't find an existing DFA state + // Fill reach starting from closure, following t transitions + this.getReachableConfigSet(input, s.configs, reach, t); + + if (reach.items.length === 0) { // we got nowhere on t from s + if (!reach.hasSemanticContext) { + // we got nowhere on t, don't throw out this knowledge; it'd + // cause a failover from DFA later. + this.addDFAEdge(s, t, ATNSimulator.ERROR); + } + // stop when we can't match any more char + return ATNSimulator.ERROR; + } + // Add an edge from s to target DFA found/created for reach + return this.addDFAEdge(s, t, null, reach); + } + + failOrAccept(prevAccept, input, reach, t) { + if (this.prevAccept.dfaState !== null) { + const lexerActionExecutor = prevAccept.dfaState.lexerActionExecutor; + this.accept(input, lexerActionExecutor, this.startIndex, + prevAccept.index, prevAccept.line, prevAccept.column); + return prevAccept.dfaState.prediction; + } else { + // if no accept and EOF is first char, return EOF + if (t === Token.EOF && input.index === this.startIndex) { + return Token.EOF; + } + throw new LexerNoViableAltException(this.recog, input, this.startIndex, reach); + } + } + + /** + * Given a starting configuration set, figure out all ATN configurations + * we can reach upon input {@code t}. Parameter {@code reach} is a return + * parameter. + */ + getReachableConfigSet(input, closure, reach, t) { + // this is used to skip processing for configs which have a lower priority + // than a config that already reached an accept state for the same rule + let skipAlt = ATN.INVALID_ALT_NUMBER; + for (let i = 0; i < closure.items.length; i++) { + const cfg = closure.items[i]; + const currentAltReachedAcceptState = (cfg.alt === skipAlt); + if (currentAltReachedAcceptState && cfg.passedThroughNonGreedyDecision) { + continue; + } + if (LexerATNSimulator.debug) { + console.log("testing %s at %s\n", this.getTokenName(t), cfg + .toString(this.recog, true)); + } + for (let j = 0; j < cfg.state.transitions.length; j++) { + const trans = cfg.state.transitions[j]; // for each transition + const target = this.getReachableTarget(trans, t); + if (target !== null) { + let lexerActionExecutor = cfg.lexerActionExecutor; + if (lexerActionExecutor !== null) { + lexerActionExecutor = lexerActionExecutor.fixOffsetBeforeMatch(input.index - this.startIndex); + } + const treatEofAsEpsilon = (t === Token.EOF); + const config = new LexerATNConfig({state: target, lexerActionExecutor: lexerActionExecutor}, cfg); + if (this.closure(input, config, reach, + currentAltReachedAcceptState, true, treatEofAsEpsilon)) { + // any remaining configs for this alt have a lower priority + // than the one that just reached an accept state. + skipAlt = cfg.alt; + } + } + } + } + } + + accept(input, lexerActionExecutor, startIndex, index, line, charPos) { + if (LexerATNSimulator.debug) { + console.log("ACTION %s\n", lexerActionExecutor); + } + // seek to after last char in token + input.seek(index); + this.line = line; + this.column = charPos; + if (lexerActionExecutor !== null && this.recog !== null) { + lexerActionExecutor.execute(this.recog, input, startIndex); + } + } + + getReachableTarget(trans, t) { + if (trans.matches(t, 0, Lexer.MAX_CHAR_VALUE)) { + return trans.target; + } else { + return null; + } + } + + computeStartState(input, p) { + const initialContext = PredictionContext.EMPTY; + const configs = new OrderedATNConfigSet(); + for (let i = 0; i < p.transitions.length; i++) { + const target = p.transitions[i].target; + const cfg = new LexerATNConfig({state: target, alt: i + 1, context: initialContext}, null); + this.closure(input, cfg, configs, false, false, false); + } + return configs; + } + + /** + * Since the alternatives within any lexer decision are ordered by + * preference, this method stops pursuing the closure as soon as an accept + * state is reached. After the first accept state is reached by depth-first + * search from {@code config}, all other (potentially reachable) states for + * this rule would have a lower priority. + * + * @return {Boolean} {@code true} if an accept state is reached, otherwise + * {@code false}. + */ + closure(input, config, configs, + currentAltReachedAcceptState, speculative, treatEofAsEpsilon) { + let cfg = null; + if (LexerATNSimulator.debug) { + console.log("closure(" + config.toString(this.recog, true) + ")"); + } + if (config.state instanceof RuleStopState) { + if (LexerATNSimulator.debug) { + if (this.recog !== null) { + console.log("closure at %s rule stop %s\n", this.recog.ruleNames[config.state.ruleIndex], config); + } else { + console.log("closure at rule stop %s\n", config); + } + } + if (config.context === null || config.context.hasEmptyPath()) { + if (config.context === null || config.context.isEmpty()) { + configs.add(config); + return true; + } else { + configs.add(new LexerATNConfig({state: config.state, context: PredictionContext.EMPTY}, config)); + currentAltReachedAcceptState = true; + } + } + if (config.context !== null && !config.context.isEmpty()) { + for (let i = 0; i < config.context.length; i++) { + if (config.context.getReturnState(i) !== PredictionContext.EMPTY_RETURN_STATE) { + const newContext = config.context.getParent(i); // "pop" return state + const returnState = this.atn.states[config.context.getReturnState(i)]; + cfg = new LexerATNConfig({state: returnState, context: newContext}, config); + currentAltReachedAcceptState = this.closure(input, cfg, + configs, currentAltReachedAcceptState, speculative, + treatEofAsEpsilon); + } + } + } + return currentAltReachedAcceptState; + } + // optimization + if (!config.state.epsilonOnlyTransitions) { + if (!currentAltReachedAcceptState || !config.passedThroughNonGreedyDecision) { + configs.add(config); + } + } + for (let j = 0; j < config.state.transitions.length; j++) { + const trans = config.state.transitions[j]; + cfg = this.getEpsilonTarget(input, config, trans, configs, speculative, treatEofAsEpsilon); + if (cfg !== null) { + currentAltReachedAcceptState = this.closure(input, cfg, configs, + currentAltReachedAcceptState, speculative, treatEofAsEpsilon); + } + } + return currentAltReachedAcceptState; + } + + // side-effect: can alter configs.hasSemanticContext + getEpsilonTarget(input, config, trans, + configs, speculative, treatEofAsEpsilon) { + let cfg = null; + if (trans.serializationType === Transition.RULE) { + const newContext = SingletonPredictionContext.create(config.context, trans.followState.stateNumber); + cfg = new LexerATNConfig({state: trans.target, context: newContext}, config); + } else if (trans.serializationType === Transition.PRECEDENCE) { + throw "Precedence predicates are not supported in lexers."; + } else if (trans.serializationType === Transition.PREDICATE) { + // Track traversing semantic predicates. If we traverse, + // we cannot add a DFA state for this "reach" computation + // because the DFA would not test the predicate again in the + // future. Rather than creating collections of semantic predicates + // like v3 and testing them on prediction, v4 will test them on the + // fly all the time using the ATN not the DFA. This is slower but + // semantically it's not used that often. One of the key elements to + // this predicate mechanism is not adding DFA states that see + // predicates immediately afterwards in the ATN. For example, + + // a : ID {p1}? | ID {p2}? ; + + // should create the start state for rule 'a' (to save start state + // competition), but should not create target of ID state. The + // collection of ATN states the following ID references includes + // states reached by traversing predicates. Since this is when we + // test them, we cannot cash the DFA state target of ID. + + if (LexerATNSimulator.debug) { + console.log("EVAL rule " + trans.ruleIndex + ":" + trans.predIndex); + } + configs.hasSemanticContext = true; + if (this.evaluatePredicate(input, trans.ruleIndex, trans.predIndex, speculative)) { + cfg = new LexerATNConfig({state: trans.target}, config); + } + } else if (trans.serializationType === Transition.ACTION) { + if (config.context === null || config.context.hasEmptyPath()) { + // execute actions anywhere in the start rule for a token. + // + // TODO: if the entry rule is invoked recursively, some + // actions may be executed during the recursive call. The + // problem can appear when hasEmptyPath() is true but + // isEmpty() is false. In this case, the config needs to be + // split into two contexts - one with just the empty path + // and another with everything but the empty path. + // Unfortunately, the current algorithm does not allow + // getEpsilonTarget to return two configurations, so + // additional modifications are needed before we can support + // the split operation. + const lexerActionExecutor = LexerActionExecutor.append(config.lexerActionExecutor, + this.atn.lexerActions[trans.actionIndex]); + cfg = new LexerATNConfig({state: trans.target, lexerActionExecutor: lexerActionExecutor}, config); + } else { + // ignore actions in referenced rules + cfg = new LexerATNConfig({state: trans.target}, config); + } + } else if (trans.serializationType === Transition.EPSILON) { + cfg = new LexerATNConfig({state: trans.target}, config); + } else if (trans.serializationType === Transition.ATOM || + trans.serializationType === Transition.RANGE || + trans.serializationType === Transition.SET) { + if (treatEofAsEpsilon) { + if (trans.matches(Token.EOF, 0, Lexer.MAX_CHAR_VALUE)) { + cfg = new LexerATNConfig({state: trans.target}, config); + } + } + } + return cfg; + } + + /** + * Evaluate a predicate specified in the lexer. + * + *

If {@code speculative} is {@code true}, this method was called before + * {@link //consume} for the matched character. This method should call + * {@link //consume} before evaluating the predicate to ensure position + * sensitive values, including {@link Lexer//getText}, {@link Lexer//getLine}, + * and {@link Lexer//getcolumn}, properly reflect the current + * lexer state. This method should restore {@code input} and the simulator + * to the original state before returning (i.e. undo the actions made by the + * call to {@link //consume}.

+ * + * @param input The input stream. + * @param ruleIndex The rule containing the predicate. + * @param predIndex The index of the predicate within the rule. + * @param speculative {@code true} if the current index in {@code input} is + * one character before the predicate's location. + * + * @return {@code true} if the specified predicate evaluates to + * {@code true}. + */ + evaluatePredicate(input, ruleIndex, + predIndex, speculative) { + // assume true if no recognizer was provided + if (this.recog === null) { + return true; + } + if (!speculative) { + return this.recog.sempred(null, ruleIndex, predIndex); + } + const savedcolumn = this.column; + const savedLine = this.line; + const index = input.index; + const marker = input.mark(); + try { + this.consume(input); + return this.recog.sempred(null, ruleIndex, predIndex); + } finally { + this.column = savedcolumn; + this.line = savedLine; + input.seek(index); + input.release(marker); + } + } + + captureSimState(settings, input, dfaState) { + settings.index = input.index; + settings.line = this.line; + settings.column = this.column; + settings.dfaState = dfaState; + } + + addDFAEdge(from_, tk, to, cfgs) { + if (to === undefined) { + to = null; + } + if (cfgs === undefined) { + cfgs = null; + } + if (to === null && cfgs !== null) { + // leading to this call, ATNConfigSet.hasSemanticContext is used as a + // marker indicating dynamic predicate evaluation makes this edge + // dependent on the specific input sequence, so the static edge in the + // DFA should be omitted. The target DFAState is still created since + // execATN has the ability to resynchronize with the DFA state cache + // following the predicate evaluation step. + // + // TJP notes: next time through the DFA, we see a pred again and eval. + // If that gets us to a previously created (but dangling) DFA + // state, we can continue in pure DFA mode from there. + // / + const suppressEdge = cfgs.hasSemanticContext; + cfgs.hasSemanticContext = false; + + to = this.addDFAState(cfgs); + + if (suppressEdge) { + return to; + } + } + // add the edge + if (tk < LexerATNSimulator.MIN_DFA_EDGE || tk > LexerATNSimulator.MAX_DFA_EDGE) { + // Only track edges within the DFA bounds + return to; + } + if (LexerATNSimulator.debug) { + console.log("EDGE " + from_ + " -> " + to + " upon " + tk); + } + if (from_.edges === null) { + // make room for tokens 1..n and -1 masquerading as index 0 + from_.edges = []; + } + from_.edges[tk - LexerATNSimulator.MIN_DFA_EDGE] = to; // connect + + return to; + } + + /** + * Add a new DFA state if there isn't one with this set of + * configurations already. This method also detects the first + * configuration containing an ATN rule stop state. Later, when + * traversing the DFA, we will know which rule to accept. + */ + addDFAState(configs) { + const proposed = new DFAState(null, configs); + let firstConfigWithRuleStopState = null; + for (let i = 0; i < configs.items.length; i++) { + const cfg = configs.items[i]; + if (cfg.state instanceof RuleStopState) { + firstConfigWithRuleStopState = cfg; + break; + } + } + if (firstConfigWithRuleStopState !== null) { + proposed.isAcceptState = true; + proposed.lexerActionExecutor = firstConfigWithRuleStopState.lexerActionExecutor; + proposed.prediction = this.atn.ruleToTokenType[firstConfigWithRuleStopState.state.ruleIndex]; + } + const dfa = this.decisionToDFA[this.mode]; + const existing = dfa.states.get(proposed); + if (existing !== null) { + return existing; + } + const newState = proposed; + newState.stateNumber = dfa.states.length; + configs.setReadonly(true); + newState.configs = configs; + dfa.states.add(newState); + return newState; + } + + getDFA(mode) { + return this.decisionToDFA[mode]; + } // Get the text matched so far for the current token. - getText(input) { - // index is first lookahead char, don't include. - return input.getText(this.startIndex, input.index - 1); - } - - consume(input) { - const curChar = input.LA(1); - if (curChar === "\n".charCodeAt(0)) { - this.line += 1; - this.column = 0; - } else { - this.column += 1; - } - input.consume(); - } - - getTokenName(tt) { - if (tt === -1) { - return "EOF"; - } else { - return "'" + String.fromCharCode(tt) + "'"; - } - } + getText(input) { + // index is first lookahead char, don't include. + return input.getText(this.startIndex, input.index - 1); + } + + consume(input) { + const curChar = input.LA(1); + if (curChar === "\n".charCodeAt(0)) { + this.line += 1; + this.column = 0; + } else { + this.column += 1; + } + input.consume(); + } + + getTokenName(tt) { + if (tt === -1) { + return "EOF"; + } else { + return "'" + String.fromCharCode(tt) + "'"; + } + } } LexerATNSimulator.debug = false; @@ -644,7 +641,3 @@ LexerATNSimulator.dfa_debug = false; LexerATNSimulator.MIN_DFA_EDGE = 0; LexerATNSimulator.MAX_DFA_EDGE = 127; // forces unicode to stay in ATN - -LexerATNSimulator.match_calls = 0; - -module.exports = LexerATNSimulator; diff --git a/runtime/JavaScript/src/antlr4/atn/LexerAction.js b/runtime/JavaScript/src/antlr4/atn/LexerAction.js deleted file mode 100644 index faf2ed92b9..0000000000 --- a/runtime/JavaScript/src/antlr4/atn/LexerAction.js +++ /dev/null @@ -1,384 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -const LexerActionType = { - // The type of a {@link LexerChannelAction} action. - CHANNEL: 0, - // The type of a {@link LexerCustomAction} action - CUSTOM: 1, - // The type of a {@link LexerModeAction} action. - MODE: 2, - //The type of a {@link LexerMoreAction} action. - MORE: 3, - //The type of a {@link LexerPopModeAction} action. - POP_MODE: 4, - //The type of a {@link LexerPushModeAction} action. - PUSH_MODE: 5, - //The type of a {@link LexerSkipAction} action. - SKIP: 6, - //The type of a {@link LexerTypeAction} action. - TYPE: 7 -} - -class LexerAction { - constructor(action) { - this.actionType = action; - this.isPositionDependent = false; - } - - hashCode() { - const hash = new Hash(); - this.updateHashCode(hash); - return hash.finish() - } - - updateHashCode(hash) { - hash.update(this.actionType); - } - - equals(other) { - return this === other; - } -} - - -/** - * Implements the {@code skip} lexer action by calling {@link Lexer//skip}. - * - *

The {@code skip} command does not have any parameters, so this action is - * implemented as a singleton instance exposed by {@link //INSTANCE}.

- */ -class LexerSkipAction extends LexerAction { - constructor() { - super(LexerActionType.SKIP); - } - - execute(lexer) { - lexer.skip(); - } - - toString() { - return "skip"; - } -} - -// Provides a singleton instance of this parameterless lexer action. -LexerSkipAction.INSTANCE = new LexerSkipAction(); - -/** - * Implements the {@code type} lexer action by calling {@link Lexer//setType} - * with the assigned type - */ -class LexerTypeAction extends LexerAction { - constructor(type) { - super(LexerActionType.TYPE); - this.type = type; - } - - execute(lexer) { - lexer.type = this.type; - } - - updateHashCode(hash) { - hash.update(this.actionType, this.type); - } - - equals(other) { - if(this === other) { - return true; - } else if (! (other instanceof LexerTypeAction)) { - return false; - } else { - return this.type === other.type; - } - } - - toString() { - return "type(" + this.type + ")"; - } -} - - -/** - * Implements the {@code pushMode} lexer action by calling - * {@link Lexer//pushMode} with the assigned mode - */ -class LexerPushModeAction extends LexerAction { - constructor(mode) { - super(LexerActionType.PUSH_MODE); - this.mode = mode; - } - - /** - *

This action is implemented by calling {@link Lexer//pushMode} with the - * value provided by {@link //getMode}.

- */ - execute(lexer) { - lexer.pushMode(this.mode); - } - - updateHashCode(hash) { - hash.update(this.actionType, this.mode); - } - - equals(other) { - if (this === other) { - return true; - } else if (! (other instanceof LexerPushModeAction)) { - return false; - } else { - return this.mode === other.mode; - } - } - - toString() { - return "pushMode(" + this.mode + ")"; - } -} - -/** - * Implements the {@code popMode} lexer action by calling {@link Lexer//popMode}. - * - *

The {@code popMode} command does not have any parameters, so this action is - * implemented as a singleton instance exposed by {@link //INSTANCE}.

- */ -class LexerPopModeAction extends LexerAction { - constructor() { - super(LexerActionType.POP_MODE); - } - - /** - *

This action is implemented by calling {@link Lexer//popMode}.

- */ - execute(lexer) { - lexer.popMode(); - } - - toString() { - return "popMode"; - } -} - -LexerPopModeAction.INSTANCE = new LexerPopModeAction(); - -/** - * Implements the {@code more} lexer action by calling {@link Lexer//more}. - * - *

The {@code more} command does not have any parameters, so this action is - * implemented as a singleton instance exposed by {@link //INSTANCE}.

- */ -class LexerMoreAction extends LexerAction { - constructor() { - super(LexerActionType.MORE); - } - - /** - *

This action is implemented by calling {@link Lexer//popMode}.

- */ - execute(lexer) { - lexer.more(); - } - - toString() { - return "more"; - } -} - -LexerMoreAction.INSTANCE = new LexerMoreAction(); - - -/** - * Implements the {@code mode} lexer action by calling {@link Lexer//mode} with - * the assigned mode - */ -class LexerModeAction extends LexerAction { - constructor(mode) { - super(LexerActionType.MODE); - this.mode = mode; - } - - /** - *

This action is implemented by calling {@link Lexer//mode} with the - * value provided by {@link //getMode}.

- */ - execute(lexer) { - lexer.mode(this.mode); - } - - updateHashCode(hash) { - hash.update(this.actionType, this.mode); - } - - equals(other) { - if (this === other) { - return true; - } else if (! (other instanceof LexerModeAction)) { - return false; - } else { - return this.mode === other.mode; - } - } - - toString() { - return "mode(" + this.mode + ")"; - } -} - -/** - * Executes a custom lexer action by calling {@link Recognizer//action} with the - * rule and action indexes assigned to the custom action. The implementation of - * a custom action is added to the generated code for the lexer in an override - * of {@link Recognizer//action} when the grammar is compiled. - * - *

This class may represent embedded actions created with the {...} - * syntax in ANTLR 4, as well as actions created for lexer commands where the - * command argument could not be evaluated when the grammar was compiled.

- */ -class LexerCustomAction extends LexerAction { - /** - * Constructs a custom lexer action with the specified rule and action - * indexes. - * - * @param ruleIndex The rule index to use for calls to - * {@link Recognizer//action}. - * @param actionIndex The action index to use for calls to - * {@link Recognizer//action}. - */ - constructor(ruleIndex, actionIndex) { - super(LexerActionType.CUSTOM); - this.ruleIndex = ruleIndex; - this.actionIndex = actionIndex; - this.isPositionDependent = true; - } - - /** - *

Custom actions are implemented by calling {@link Lexer//action} with the - * appropriate rule and action indexes.

- */ - execute(lexer) { - lexer.action(null, this.ruleIndex, this.actionIndex); - } - - updateHashCode(hash) { - hash.update(this.actionType, this.ruleIndex, this.actionIndex); - } - - equals(other) { - if (this === other) { - return true; - } else if (! (other instanceof LexerCustomAction)) { - return false; - } else { - return this.ruleIndex === other.ruleIndex && this.actionIndex === other.actionIndex; - } - } -} - -/** - * Implements the {@code channel} lexer action by calling - * {@link Lexer//setChannel} with the assigned channel. - * Constructs a new {@code channel} action with the specified channel value. - * @param channel The channel value to pass to {@link Lexer//setChannel} - */ -class LexerChannelAction extends LexerAction { - constructor(channel) { - super(LexerActionType.CHANNEL); - this.channel = channel; - } - - /** - *

This action is implemented by calling {@link Lexer//setChannel} with the - * value provided by {@link //getChannel}.

- */ - execute(lexer) { - lexer._channel = this.channel; - } - - updateHashCode(hash) { - hash.update(this.actionType, this.channel); - } - - equals(other) { - if (this === other) { - return true; - } else if (! (other instanceof LexerChannelAction)) { - return false; - } else { - return this.channel === other.channel; - } - } - - toString() { - return "channel(" + this.channel + ")"; - } -} - - -/** - * This implementation of {@link LexerAction} is used for tracking input offsets - * for position-dependent actions within a {@link LexerActionExecutor}. - * - *

This action is not serialized as part of the ATN, and is only required for - * position-dependent lexer actions which appear at a location other than the - * end of a rule. For more information about DFA optimizations employed for - * lexer actions, see {@link LexerActionExecutor//append} and - * {@link LexerActionExecutor//fixOffsetBeforeMatch}.

- * - * Constructs a new indexed custom action by associating a character offset - * with a {@link LexerAction}. - * - *

Note: This class is only required for lexer actions for which - * {@link LexerAction//isPositionDependent} returns {@code true}.

- * - * @param offset The offset into the input {@link CharStream}, relative to - * the token start index, at which the specified lexer action should be - * executed. - * @param action The lexer action to execute at a particular offset in the - * input {@link CharStream}. - */ -class LexerIndexedCustomAction extends LexerAction { - constructor(offset, action) { - super(action.actionType); - this.offset = offset; - this.action = action; - this.isPositionDependent = true; - } - - /** - *

This method calls {@link //execute} on the result of {@link //getAction} - * using the provided {@code lexer}.

- */ - execute(lexer) { - // assume the input stream position was properly set by the calling code - this.action.execute(lexer); - } - - updateHashCode(hash) { - hash.update(this.actionType, this.offset, this.action); - } - - equals(other) { - if (this === other) { - return true; - } else if (! (other instanceof LexerIndexedCustomAction)) { - return false; - } else { - return this.offset === other.offset && this.action === other.action; - } - } -} - -module.exports = { - LexerActionType, - LexerSkipAction, - LexerChannelAction, - LexerCustomAction, - LexerIndexedCustomAction, - LexerMoreAction, - LexerTypeAction, - LexerPushModeAction, - LexerPopModeAction, - LexerModeAction -} diff --git a/runtime/JavaScript/src/antlr4/atn/LexerActionExecutor.js b/runtime/JavaScript/src/antlr4/atn/LexerActionExecutor.js index 95567d48b8..02edfb4919 100644 --- a/runtime/JavaScript/src/antlr4/atn/LexerActionExecutor.js +++ b/runtime/JavaScript/src/antlr4/atn/LexerActionExecutor.js @@ -1,12 +1,12 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {hashStuff} = require("../Utils"); -const {LexerIndexedCustomAction} = require('./LexerAction'); +import LexerIndexedCustomAction from '../action/LexerIndexedCustomAction.js'; +import HashCode from "../misc/HashCode.js"; -class LexerActionExecutor { +export default class LexerActionExecutor { /** * Represents an executor for a sequence of lexer actions which traversed during * the matching operation of a lexer rule (token). @@ -21,7 +21,7 @@ class LexerActionExecutor { * Caches the result of {@link //hashCode} since the hash code is an element * of the performance-critical {@link LexerATNConfig//hashCode} operation */ - this.cachedHashCode = hashStuff(lexerActions); // "".join([str(la) for la in + this.cachedHashCode = HashCode.hashStuff(lexerActions); // "".join([str(la) for la in // lexerActions])) return this; } @@ -168,6 +168,3 @@ class LexerActionExecutor { return new LexerActionExecutor(lexerActions); } } - - -module.exports = LexerActionExecutor; diff --git a/runtime/JavaScript/src/antlr4/atn/LexerActionType.js b/runtime/JavaScript/src/antlr4/atn/LexerActionType.js new file mode 100644 index 0000000000..1d31b3a7b6 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/atn/LexerActionType.js @@ -0,0 +1,22 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default { + // The type of a {@link LexerChannelAction} action. + CHANNEL: 0, + // The type of a {@link LexerCustomAction} action + CUSTOM: 1, + // The type of a {@link LexerModeAction} action. + MODE: 2, + //The type of a {@link LexerMoreAction} action. + MORE: 3, + //The type of a {@link LexerPopModeAction} action. + POP_MODE: 4, + //The type of a {@link LexerPushModeAction} action. + PUSH_MODE: 5, + //The type of a {@link LexerSkipAction} action. + SKIP: 6, + //The type of a {@link LexerTypeAction} action. + TYPE: 7 +} diff --git a/runtime/JavaScript/src/antlr4/atn/OrderedATNConfigSet.js b/runtime/JavaScript/src/antlr4/atn/OrderedATNConfigSet.js new file mode 100644 index 0000000000..ca5854dfe1 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/atn/OrderedATNConfigSet.js @@ -0,0 +1,13 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ATNConfigSet from "./ATNConfigSet.js"; +import HashSet from "../misc/HashSet.js"; + +export default class OrderedATNConfigSet extends ATNConfigSet { + constructor() { + super(); + this.configLookup = new HashSet(); + } +} diff --git a/runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js b/runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js index 05b45d5a04..ad5bbe8e34 100644 --- a/runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js +++ b/runtime/JavaScript/src/antlr4/atn/ParserATNSimulator.js @@ -1,29 +1,35 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const Utils = require('./../Utils'); -const {Set, BitSet, DoubleDict} = Utils; - -const ATN = require('./ATN'); -const {ATNState, RuleStopState} = require('./ATNState'); - -const {ATNConfig} = require('./ATNConfig'); -const {ATNConfigSet} = require('./ATNConfigSet'); -const {Token} = require('./../Token'); -const {DFAState, PredPrediction} = require('./../dfa/DFAState'); -const ATNSimulator = require('./ATNSimulator'); -const PredictionMode = require('./PredictionMode'); -const RuleContext = require('./../RuleContext'); -const ParserRuleContext = require('./../ParserRuleContext'); -const {SemanticContext} = require('./SemanticContext'); -const {PredictionContext} = require('./../PredictionContext'); -const {Interval} = require('./../IntervalSet'); -const {Transition, SetTransition, NotSetTransition, RuleTransition, ActionTransition} = require('./Transition'); -const {NoViableAltException} = require('./../error/Errors'); -const {SingletonPredictionContext, predictionContextFromRuleContext} = require('./../PredictionContext'); - +import ATN from './ATN.js'; +import ATNState from '../state/ATNState.js'; +import RuleStopState from '../state/RuleStopState.js'; +import ATNConfig from './ATNConfig.js'; +import ATNConfigSet from './ATNConfigSet.js'; +import Token from '../Token.js'; +import DFAState from '../dfa/DFAState.js'; +import PredPrediction from '../dfa/PredPrediction.js'; +import ATNSimulator from './ATNSimulator.js'; +import PredictionMode from './PredictionMode.js'; +import RuleContext from '../context/RuleContext.js'; +import SemanticContext from './SemanticContext.js'; +import PredictionContext from '../context/PredictionContext.js'; +import Interval from '../misc/Interval.js'; +import Transition from '../transition/Transition.js'; +import SetTransition from '../transition/SetTransition.js'; +import NotSetTransition from '../transition/NotSetTransition.js'; +import RuleTransition from '../transition/RuleTransition.js'; +import ActionTransition from '../transition/ActionTransition.js'; +import NoViableAltException from '../error/NoViableAltException.js'; +import SingletonPredictionContext from '../context/SingletonPredictionContext.js'; +import { predictionContextFromRuleContext } from '../context/PredictionContextUtils.js'; +import AtomTransition from "../transition/AtomTransition.js"; +import arrayToString from "../utils/arrayToString.js"; +import BitSet from "../misc/BitSet.js"; +import DoubleDict from "../utils/DoubleDict.js"; +import HashSet from "../misc/HashSet.js"; /** * The embodiment of the adaptive LL(*), ALL(*), parsing strategy. @@ -252,7 +258,7 @@ const {SingletonPredictionContext, predictionContextFromRuleContext} = require(' * both SLL and LL parsing. Erroneous input will therefore require 2 passes over * the input.

*/ -class ParserATNSimulator extends ATNSimulator { +export default class ParserATNSimulator extends ATNSimulator { constructor(parser, atn, decisionToDFA, sharedContextCache) { super(atn, sharedContextCache); this.parser = parser; @@ -399,7 +405,7 @@ class ParserATNSimulator extends ATNSimulator { console.log("s0 = " + s0); } let t = input.LA(1); - while(true) { // while more work + for(;;) { // while more work let D = this.getExistingTargetState(previousD, t); if(D===null) { D = this.computeTargetState(dfa, previousD, t); @@ -527,7 +533,7 @@ class ParserATNSimulator extends ATNSimulator { if (this.debug) { const altSubSets = PredictionMode.getConflictingAltSubsets(reach); - console.log("SLL altSubSets=" + Utils.arrayToString(altSubSets) + + console.log("SLL altSubSets=" + arrayToString(altSubSets) + /*", previous=" + previousD.configs + */ ", configs=" + reach + ", predict=" + predictedAlt + @@ -594,7 +600,7 @@ class ParserATNSimulator extends ATNSimulator { input.seek(startIndex); let t = input.LA(1); let predictedAlt = -1; - while (true) { // while more work + for (;;) { // while more work reach = this.computeReachSet(previous, t, fullCtx); if (reach===null) { // if any configs in previous dipped into outer context, that @@ -769,7 +775,7 @@ class ParserATNSimulator extends ATNSimulator { // if (reach===null) { reach = new ATNConfigSet(fullCtx); - const closureBusy = new Set(); + const closureBusy = new HashSet(); const treatEofAsEpsilon = t === Token.EOF; for (let k=0; k=_p, ctx dependent=true"); if (this.parser!==null) { - console.log("context surrounding pred is " + Utils.arrayToString(this.parser.getRuleInvocationStack())); + console.log("context surrounding pred is " + arrayToString(this.parser.getRuleInvocationStack())); } } let c = null; @@ -1447,7 +1453,7 @@ class ParserATNSimulator extends ATNSimulator { console.log("PRED (collectPredicates=" + collectPredicates + ") " + pt.ruleIndex + ":" + pt.predIndex + ", ctx dependent=" + pt.isCtxDependent); if (this.parser!==null) { - console.log("context surrounding pred is " + Utils.arrayToString(this.parser.getRuleInvocationStack())); + console.log("context surrounding pred is " + arrayToString(this.parser.getRuleInvocationStack())); } } let c = null; @@ -1713,5 +1719,3 @@ class ParserATNSimulator extends ATNSimulator { } } } - -module.exports = ParserATNSimulator; diff --git a/runtime/JavaScript/src/antlr4/atn/PrecedencePredicate.js b/runtime/JavaScript/src/antlr4/atn/PrecedencePredicate.js new file mode 100644 index 0000000000..44f69daea3 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/atn/PrecedencePredicate.js @@ -0,0 +1,51 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import SemanticContext from "./SemanticContext.js"; + +export default class PrecedencePredicate extends SemanticContext { + + constructor(precedence) { + super(); + this.precedence = precedence === undefined ? 0 : precedence; + } + + evaluate(parser, outerContext) { + return parser.precpred(outerContext, this.precedence); + } + + evalPrecedence(parser, outerContext) { + if (parser.precpred(outerContext, this.precedence)) { + return SemanticContext.NONE; + } else { + return null; + } + } + + compareTo(other) { + return this.precedence - other.precedence; + } + + updateHashCode(hash) { + hash.update(this.precedence); + } + + equals(other) { + if (this === other) { + return true; + } else if (!(other instanceof PrecedencePredicate)) { + return false; + } else { + return this.precedence === other.precedence; + } + } + + toString() { + return "{" + this.precedence + ">=prec}?"; + } + +} + +// HORRIBLE workaround circular import, avoiding dynamic import +SemanticContext.PrecedencePredicate = PrecedencePredicate; diff --git a/runtime/JavaScript/src/antlr4/atn/Predicate.js b/runtime/JavaScript/src/antlr4/atn/Predicate.js new file mode 100644 index 0000000000..59dcd9688c --- /dev/null +++ b/runtime/JavaScript/src/antlr4/atn/Predicate.js @@ -0,0 +1,46 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import SemanticContext from "./SemanticContext.js"; + +export default class Predicate extends SemanticContext { + + constructor(ruleIndex, predIndex, isCtxDependent) { + super(); + this.ruleIndex = ruleIndex === undefined ? -1 : ruleIndex; + this.predIndex = predIndex === undefined ? -1 : predIndex; + this.isCtxDependent = isCtxDependent === undefined ? false : isCtxDependent; // e.g., $i ref in pred + } + + evaluate(parser, outerContext) { + const localctx = this.isCtxDependent ? outerContext : null; + return parser.sempred(localctx, this.ruleIndex, this.predIndex); + } + + updateHashCode(hash) { + hash.update(this.ruleIndex, this.predIndex, this.isCtxDependent); + } + + equals(other) { + if (this === other) { + return true; + } else if (!(other instanceof Predicate)) { + return false; + } else { + return this.ruleIndex === other.ruleIndex && + this.predIndex === other.predIndex && + this.isCtxDependent === other.isCtxDependent; + } + } + + toString() { + return "{" + this.ruleIndex + ":" + this.predIndex + "}?"; + } +} + +/** + * The default {@link SemanticContext}, which is semantically equivalent to + * a predicate of the form {@code {true}?} + */ +SemanticContext.NONE = new Predicate(); diff --git a/runtime/JavaScript/src/antlr4/atn/PredictionContextCache.js b/runtime/JavaScript/src/antlr4/atn/PredictionContextCache.js new file mode 100644 index 0000000000..2abbe1f4f3 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/atn/PredictionContextCache.js @@ -0,0 +1,43 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import PredictionContext from "../context/PredictionContext.js"; +import HashMap from "../misc/HashMap.js"; + +/** + * Used to cache {@link PredictionContext} objects. Its used for the shared + * context cash associated with contexts in DFA states. This cache + * can be used for both lexers and parsers. + */ +export default class PredictionContextCache { + + constructor() { + this.cache = new HashMap(); + } + + /** + * Add a context to the cache and return it. If the context already exists, + * return that one instead and do not add a new context to the cache. + * Protect shared cache from unsafe thread access. + */ + add(ctx) { + if (ctx === PredictionContext.EMPTY) { + return PredictionContext.EMPTY; + } + const existing = this.cache.get(ctx) || null; + if (existing !== null) { + return existing; + } + this.cache.set(ctx, ctx); + return ctx; + } + + get(ctx) { + return this.cache.get(ctx) || null; + } + + get length(){ + return this.cache.length; + } +} diff --git a/runtime/JavaScript/src/antlr4/atn/PredictionMode.js b/runtime/JavaScript/src/antlr4/atn/PredictionMode.js index b2cf736edd..9a1be3db35 100644 --- a/runtime/JavaScript/src/antlr4/atn/PredictionMode.js +++ b/runtime/JavaScript/src/antlr4/atn/PredictionMode.js @@ -1,14 +1,17 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Map, BitSet, AltDict, hashStuff} = require('./../Utils'); -const ATN = require('./ATN'); -const {RuleStopState} = require('./ATNState'); -const {ATNConfigSet} = require('./ATNConfigSet'); -const {ATNConfig} = require('./ATNConfig'); -const {SemanticContext} = require('./SemanticContext'); +import ATN from './ATN.js'; +import RuleStopState from '../state/RuleStopState.js'; +import ATNConfigSet from './ATNConfigSet.js'; +import ATNConfig from './ATNConfig.js'; +import SemanticContext from './SemanticContext.js'; +import BitSet from "../misc/BitSet.js"; +import AltDict from "../misc/AltDict.js"; +import HashCode from "../misc/HashCode.js"; +import HashMap from "../misc/HashMap.js"; /** * This enumeration defines the prediction modes available in ANTLR 4 along with @@ -499,14 +502,14 @@ const PredictionMode = { * */ getConflictingAltSubsets: function(configs) { - const configToAlts = new Map(); - configToAlts.hashFunction = function(cfg) { hashStuff(cfg.state.stateNumber, cfg.context); }; + const configToAlts = new HashMap(); + configToAlts.hashFunction = function(cfg) { HashCode.hashStuff(cfg.state.stateNumber, cfg.context); }; configToAlts.equalsFunction = function(c1, c2) { return c1.state.stateNumber === c2.state.stateNumber && c1.context.equals(c2.context);}; configs.items.map(function(cfg) { let alts = configToAlts.get(cfg); if (alts === null) { alts = new BitSet(); - configToAlts.put(cfg, alts); + configToAlts.set(cfg, alts); } alts.add(cfg.alt); }); @@ -527,7 +530,7 @@ const PredictionMode = { let alts = m.get(c.state); if (alts === null) { alts = new BitSet(); - m.put(c.state, alts); + m.set(c.state, alts); } alts.add(c.alt); }); @@ -559,4 +562,4 @@ const PredictionMode = { } }; -module.exports = PredictionMode; +export default PredictionMode; diff --git a/runtime/JavaScript/src/antlr4/atn/SemanticContext.js b/runtime/JavaScript/src/antlr4/atn/SemanticContext.js index d1c5181c17..59dfb2e046 100644 --- a/runtime/JavaScript/src/antlr4/atn/SemanticContext.js +++ b/runtime/JavaScript/src/antlr4/atn/SemanticContext.js @@ -1,9 +1,11 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const { Set, Hash, equalArrays } = require('./../Utils'); +import equalArrays from "../utils/equalArrays.js"; +import HashCode from "../misc/HashCode.js"; +import HashSet from "../misc/HashSet.js"; /** * A tree structure used to record the semantic context in which @@ -13,10 +15,10 @@ const { Set, Hash, equalArrays } = require('./../Utils'); *

I have scoped the {@link AND}, {@link OR}, and {@link Predicate} subclasses of * {@link SemanticContext} within the scope of this outer class.

*/ -class SemanticContext { +export default class SemanticContext { hashCode() { - const hash = new Hash(); + const hash = new HashCode(); this.updateHashCode(hash); return hash.finish(); } @@ -93,99 +95,6 @@ class SemanticContext { } -class Predicate extends SemanticContext { - - constructor(ruleIndex, predIndex, isCtxDependent) { - super(); - this.ruleIndex = ruleIndex === undefined ? -1 : ruleIndex; - this.predIndex = predIndex === undefined ? -1 : predIndex; - this.isCtxDependent = isCtxDependent === undefined ? false : isCtxDependent; // e.g., $i ref in pred - } - - evaluate(parser, outerContext) { - const localctx = this.isCtxDependent ? outerContext : null; - return parser.sempred(localctx, this.ruleIndex, this.predIndex); - } - - updateHashCode(hash) { - hash.update(this.ruleIndex, this.predIndex, this.isCtxDependent); - } - - equals(other) { - if (this === other) { - return true; - } else if (!(other instanceof Predicate)) { - return false; - } else { - return this.ruleIndex === other.ruleIndex && - this.predIndex === other.predIndex && - this.isCtxDependent === other.isCtxDependent; - } - } - - toString() { - return "{" + this.ruleIndex + ":" + this.predIndex + "}?"; - } -} - -/** - * The default {@link SemanticContext}, which is semantically equivalent to - * a predicate of the form {@code {true}?} - */ -SemanticContext.NONE = new Predicate(); - - -class PrecedencePredicate extends SemanticContext { - - constructor(precedence) { - super(); - this.precedence = precedence === undefined ? 0 : precedence; - } - - evaluate(parser, outerContext) { - return parser.precpred(outerContext, this.precedence); - } - - evalPrecedence(parser, outerContext) { - if (parser.precpred(outerContext, this.precedence)) { - return SemanticContext.NONE; - } else { - return null; - } - } - - compareTo(other) { - return this.precedence - other.precedence; - } - - updateHashCode(hash) { - hash.update(this.precedence); - } - - equals(other) { - if (this === other) { - return true; - } else if (!(other instanceof PrecedencePredicate)) { - return false; - } else { - return this.precedence === other.precedence; - } - } - - toString() { - return "{" + this.precedence + ">=prec}?"; - } - - static filterPrecedencePredicates(set) { - const result = []; - set.values().map( function(context) { - if (context instanceof PrecedencePredicate) { - result.push(context); - } - }); - return result; - } -} class AND extends SemanticContext { /** @@ -194,7 +103,7 @@ class AND extends SemanticContext { */ constructor(a, b) { super(); - const operands = new Set(); + const operands = new HashSet(); if (a instanceof AND) { a.opnds.map(function(o) { operands.add(o); @@ -209,7 +118,7 @@ class AND extends SemanticContext { } else { operands.add(b); } - const precedencePredicates = PrecedencePredicate.filterPrecedencePredicates(operands); + const precedencePredicates = filterPrecedencePredicates(operands); if (precedencePredicates.length > 0) { // interested in the transition with the lowest precedence let reduced = null; @@ -296,7 +205,7 @@ class OR extends SemanticContext { */ constructor(a, b) { super(); - const operands = new Set(); + const operands = new HashSet(); if (a instanceof OR) { a.opnds.map(function(o) { operands.add(o); @@ -312,7 +221,7 @@ class OR extends SemanticContext { operands.add(b); } - const precedencePredicates = PrecedencePredicate.filterPrecedencePredicates(operands); + const precedencePredicates = filterPrecedencePredicates(operands); if (precedencePredicates.length > 0) { // interested in the transition with the highest precedence const s = precedencePredicates.sort(function(a, b) { @@ -387,8 +296,12 @@ class OR extends SemanticContext { } } -module.exports = { - SemanticContext, - PrecedencePredicate, - Predicate +function filterPrecedencePredicates(set) { + const result = []; + set.values().map( function(context) { + if (context instanceof SemanticContext.PrecedencePredicate) { + result.push(context); + } + }); + return result; } diff --git a/runtime/JavaScript/src/antlr4/atn/Transition.js b/runtime/JavaScript/src/antlr4/atn/Transition.js deleted file mode 100644 index a900acf3b4..0000000000 --- a/runtime/JavaScript/src/antlr4/atn/Transition.js +++ /dev/null @@ -1,303 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -const {Token} = require('./../Token'); -const {IntervalSet} = require('./../IntervalSet'); -const {Predicate, PrecedencePredicate} = require('./SemanticContext'); - -/** - * An ATN transition between any two ATN states. Subclasses define - * atom, set, epsilon, action, predicate, rule transitions. - * - *

This is a one way link. It emanates from a state (usually via a list of - * transitions) and has a target state.

- * - *

Since we never have to change the ATN transitions once we construct it, - * we can fix these transitions as specific classes. The DFA transitions - * on the other hand need to update the labels as it adds transitions to - * the states. We'll use the term Edge for the DFA to distinguish them from - * ATN transitions.

- */ -class Transition { - constructor(target) { - // The target of this transition. - if (target===undefined || target===null) { - throw "target cannot be null."; - } - this.target = target; - // Are we epsilon, action, sempred? - this.isEpsilon = false; - this.label = null; - } -} - -// constants for serialization - -Transition.EPSILON = 1; -Transition.RANGE = 2; -Transition.RULE = 3; -// e.g., {isType(input.LT(1))}? -Transition.PREDICATE = 4; -Transition.ATOM = 5; -Transition.ACTION = 6; -// ~(A|B) or ~atom, wildcard, which convert to next 2 -Transition.SET = 7; -Transition.NOT_SET = 8; -Transition.WILDCARD = 9; -Transition.PRECEDENCE = 10; - -Transition.serializationNames = [ - "INVALID", - "EPSILON", - "RANGE", - "RULE", - "PREDICATE", - "ATOM", - "ACTION", - "SET", - "NOT_SET", - "WILDCARD", - "PRECEDENCE" - ]; - -Transition.serializationTypes = { - EpsilonTransition: Transition.EPSILON, - RangeTransition: Transition.RANGE, - RuleTransition: Transition.RULE, - PredicateTransition: Transition.PREDICATE, - AtomTransition: Transition.ATOM, - ActionTransition: Transition.ACTION, - SetTransition: Transition.SET, - NotSetTransition: Transition.NOT_SET, - WildcardTransition: Transition.WILDCARD, - PrecedencePredicateTransition: Transition.PRECEDENCE - }; - - -// TODO: make all transitions sets? no, should remove set edges - -class AtomTransition extends Transition { - constructor(target, label) { - super(target); - // The token type or character value; or, signifies special label. - this.label_ = label; - this.label = this.makeLabel(); - this.serializationType = Transition.ATOM; - } - - makeLabel() { - const s = new IntervalSet(); - s.addOne(this.label_); - return s; - } - - matches(symbol, minVocabSymbol, maxVocabSymbol) { - return this.label_ === symbol; - } - - toString() { - return this.label_; - } -} - - -class RuleTransition extends Transition { - constructor(ruleStart, ruleIndex, precedence, followState) { - super(ruleStart); - // ptr to the rule definition object for this rule ref - this.ruleIndex = ruleIndex; - this.precedence = precedence; - // what node to begin computations following ref to rule - this.followState = followState; - this.serializationType = Transition.RULE; - this.isEpsilon = true; - } - - matches(symbol, minVocabSymbol, maxVocabSymbol) { - return false; - } -} - -class EpsilonTransition extends Transition { - constructor(target, outermostPrecedenceReturn) { - super(target); - this.serializationType = Transition.EPSILON; - this.isEpsilon = true; - this.outermostPrecedenceReturn = outermostPrecedenceReturn; - } - - matches(symbol, minVocabSymbol, maxVocabSymbol) { - return false; - } - - toString() { - return "epsilon"; - } -} - - -class RangeTransition extends Transition { - constructor(target, start, stop) { - super(target); - this.serializationType = Transition.RANGE; - this.start = start; - this.stop = stop; - this.label = this.makeLabel(); - } - - makeLabel() { - const s = new IntervalSet(); - s.addRange(this.start, this.stop); - return s; - } - - matches(symbol, minVocabSymbol, maxVocabSymbol) { - return symbol >= this.start && symbol <= this.stop; - } - - toString() { - return "'" + String.fromCharCode(this.start) + "'..'" + String.fromCharCode(this.stop) + "'"; - } -} - - -class AbstractPredicateTransition extends Transition { - constructor(target) { - super(target); - } -} - -class PredicateTransition extends AbstractPredicateTransition { - constructor(target, ruleIndex, predIndex, isCtxDependent) { - super(target); - this.serializationType = Transition.PREDICATE; - this.ruleIndex = ruleIndex; - this.predIndex = predIndex; - this.isCtxDependent = isCtxDependent; // e.g., $i ref in pred - this.isEpsilon = true; - } - - matches(symbol, minVocabSymbol, maxVocabSymbol) { - return false; - } - - getPredicate() { - return new Predicate(this.ruleIndex, this.predIndex, this.isCtxDependent); - } - - toString() { - return "pred_" + this.ruleIndex + ":" + this.predIndex; - } -} - - -class ActionTransition extends Transition { - constructor(target, ruleIndex, actionIndex, isCtxDependent) { - super(target); - this.serializationType = Transition.ACTION; - this.ruleIndex = ruleIndex; - this.actionIndex = actionIndex===undefined ? -1 : actionIndex; - this.isCtxDependent = isCtxDependent===undefined ? false : isCtxDependent; // e.g., $i ref in pred - this.isEpsilon = true; - } - - matches(symbol, minVocabSymbol, maxVocabSymbol) { - return false; - } - - toString() { - return "action_" + this.ruleIndex + ":" + this.actionIndex; - } -} - - -// A transition containing a set of values. -class SetTransition extends Transition { - constructor(target, set) { - super(target); - this.serializationType = Transition.SET; - if (set !==undefined && set !==null) { - this.label = set; - } else { - this.label = new IntervalSet(); - this.label.addOne(Token.INVALID_TYPE); - } - } - - matches(symbol, minVocabSymbol, maxVocabSymbol) { - return this.label.contains(symbol); - } - - toString() { - return this.label.toString(); - } -} - -class NotSetTransition extends SetTransition { - constructor(target, set) { - super(target, set); - this.serializationType = Transition.NOT_SET; - } - - matches(symbol, minVocabSymbol, maxVocabSymbol) { - return symbol >= minVocabSymbol && symbol <= maxVocabSymbol && - !super.matches(symbol, minVocabSymbol, maxVocabSymbol); - } - - toString() { - return '~' + super.toString(); - } -} - -class WildcardTransition extends Transition { - constructor(target) { - super(target); - this.serializationType = Transition.WILDCARD; - } - - matches(symbol, minVocabSymbol, maxVocabSymbol) { - return symbol >= minVocabSymbol && symbol <= maxVocabSymbol; - } - - toString() { - return "."; - } -} - -class PrecedencePredicateTransition extends AbstractPredicateTransition { - constructor(target, precedence) { - super(target); - this.serializationType = Transition.PRECEDENCE; - this.precedence = precedence; - this.isEpsilon = true; - } - - matches(symbol, minVocabSymbol, maxVocabSymbol) { - return false; - } - - getPredicate() { - return new PrecedencePredicate(this.precedence); - } - - toString() { - return this.precedence + " >= _p"; - } -} - -module.exports = { - Transition, - AtomTransition, - SetTransition, - NotSetTransition, - RuleTransition, - ActionTransition, - EpsilonTransition, - RangeTransition, - WildcardTransition, - PredicateTransition, - PrecedencePredicateTransition, - AbstractPredicateTransition -} diff --git a/runtime/JavaScript/src/antlr4/atn/index.js b/runtime/JavaScript/src/antlr4/atn/index.js index 5f6dcdce54..b66f451c8e 100644 --- a/runtime/JavaScript/src/antlr4/atn/index.js +++ b/runtime/JavaScript/src/antlr4/atn/index.js @@ -1,10 +1,12 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -exports.ATN = require('./ATN'); -exports.ATNDeserializer = require('./ATNDeserializer'); -exports.LexerATNSimulator = require('./LexerATNSimulator'); -exports.ParserATNSimulator = require('./ParserATNSimulator'); -exports.PredictionMode = require('./PredictionMode'); +import ATN from './ATN.js'; +import ATNDeserializer from './ATNDeserializer.js'; +import LexerATNSimulator from './LexerATNSimulator.js'; +import ParserATNSimulator from './ParserATNSimulator.js'; +import PredictionMode from './PredictionMode.js'; + +export default { ATN, ATNDeserializer, LexerATNSimulator, ParserATNSimulator, PredictionMode } diff --git a/runtime/JavaScript/src/antlr4/context/ArrayPredictionContext.js b/runtime/JavaScript/src/antlr4/context/ArrayPredictionContext.js new file mode 100644 index 0000000000..fc2394c9fd --- /dev/null +++ b/runtime/JavaScript/src/antlr4/context/ArrayPredictionContext.js @@ -0,0 +1,82 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import PredictionContext from "./PredictionContext.js"; +import equalArrays from "../utils/equalArrays.js"; +import HashCode from "../misc/HashCode.js"; + +export default class ArrayPredictionContext extends PredictionContext { + + constructor(parents, returnStates) { + /** + * Parent can be null only if full ctx mode and we make an array + * from {@link //EMPTY} and non-empty. We merge {@link //EMPTY} by using + * null parent and + * returnState == {@link //EMPTY_RETURN_STATE}. + */ + const h = new HashCode(); + h.update(parents, returnStates); + const hashCode = h.finish(); + super(hashCode); + this.parents = parents; + this.returnStates = returnStates; + return this; + } + + isEmpty() { + // since EMPTY_RETURN_STATE can only appear in the last position, we + // don't need to verify that size==1 + return this.returnStates[0] === PredictionContext.EMPTY_RETURN_STATE; + } + + getParent(index) { + return this.parents[index]; + } + + getReturnState(index) { + return this.returnStates[index]; + } + + equals(other) { + if (this === other) { + return true; + } else if (!(other instanceof ArrayPredictionContext)) { + return false; + } else if (this.hashCode() !== other.hashCode()) { + return false; // can't be same if hash is different + } else { + return equalArrays(this.returnStates, other.returnStates) && + equalArrays(this.parents, other.parents); + } + } + + toString() { + if (this.isEmpty()) { + return "[]"; + } else { + let s = "["; + for (let i = 0; i < this.returnStates.length; i++) { + if (i > 0) { + s = s + ", "; + } + if (this.returnStates[i] === PredictionContext.EMPTY_RETURN_STATE) { + s = s + "$"; + continue; + } + s = s + this.returnStates[i]; + if (this.parents[i] !== null) { + s = s + " " + this.parents[i]; + } else { + s = s + "null"; + } + } + return s + "]"; + } + } + + get length(){ + return this.returnStates.length; + } +} + diff --git a/runtime/JavaScript/src/antlr4/context/EmptyPredictionContext.js b/runtime/JavaScript/src/antlr4/context/EmptyPredictionContext.js new file mode 100644 index 0000000000..f64a56cb10 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/context/EmptyPredictionContext.js @@ -0,0 +1,36 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import PredictionContext from "./PredictionContext.js"; +import SingletonPredictionContext from "./SingletonPredictionContext.js"; + +export default class EmptyPredictionContext extends SingletonPredictionContext { + + constructor() { + super(null, PredictionContext.EMPTY_RETURN_STATE); + } + + isEmpty() { + return true; + } + + getParent(index) { + return null; + } + + getReturnState(index) { + return this.returnState; + } + + equals(other) { + return this === other; + } + + toString() { + return "$"; + } +} + + +PredictionContext.EMPTY = new EmptyPredictionContext(); diff --git a/runtime/JavaScript/src/antlr4/context/InterpreterRuleContext.js b/runtime/JavaScript/src/antlr4/context/InterpreterRuleContext.js new file mode 100644 index 0000000000..6648c5fa23 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/context/InterpreterRuleContext.js @@ -0,0 +1,12 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ParserRuleContext from "./ParserRuleContext.js"; + +export default class InterpreterRuleContext extends ParserRuleContext { + constructor(parent, invokingStateNumber, ruleIndex) { + super(parent, invokingStateNumber); + this.ruleIndex = ruleIndex; + } +} diff --git a/runtime/JavaScript/src/antlr4/ParserRuleContext.js b/runtime/JavaScript/src/antlr4/context/ParserRuleContext.js similarity index 88% rename from runtime/JavaScript/src/antlr4/ParserRuleContext.js rename to runtime/JavaScript/src/antlr4/context/ParserRuleContext.js index d0fce90b74..f9beb5ddfd 100644 --- a/runtime/JavaScript/src/antlr4/ParserRuleContext.js +++ b/runtime/JavaScript/src/antlr4/context/ParserRuleContext.js @@ -1,15 +1,13 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const RuleContext = require('./RuleContext'); -const Tree = require('./tree/Tree'); -const INVALID_INTERVAL = Tree.INVALID_INTERVAL; -const TerminalNode = Tree.TerminalNode; -const TerminalNodeImpl = Tree.TerminalNodeImpl; -const ErrorNodeImpl = Tree.ErrorNodeImpl; -const Interval = require("./IntervalSet").Interval; +import RuleContext from './RuleContext.js'; +import TerminalNode from '../tree/TerminalNode.js'; +import TerminalNodeImpl from '../tree/TerminalNodeImpl.js'; +import ErrorNodeImpl from '../tree/ErrorNodeImpl.js'; +import Interval from "../misc/Interval.js"; /** * A rule invocation record for parsing. @@ -35,7 +33,7 @@ const Interval = require("./IntervalSet").Interval; * group values such as this aggregate. The getters/setters are there to * satisfy the superclass interface. */ -class ParserRuleContext extends RuleContext { +export default class ParserRuleContext extends RuleContext { constructor(parent, invokingStateNumber) { parent = parent || null; invokingStateNumber = invokingStateNumber || null; @@ -206,7 +204,7 @@ class ParserRuleContext extends RuleContext { getSourceInterval() { if( this.start === null || this.stop === null) { - return INVALID_INTERVAL; + return Interval.INVALID_INTERVAL; } else { return new Interval(this.start.tokenIndex, this.stop.tokenIndex); } @@ -215,11 +213,4 @@ class ParserRuleContext extends RuleContext { RuleContext.EMPTY = new ParserRuleContext(); -class InterpreterRuleContext extends ParserRuleContext { - constructor(parent, invokingStateNumber, ruleIndex) { - super(parent, invokingStateNumber); - this.ruleIndex = ruleIndex; - } -} -module.exports = ParserRuleContext; diff --git a/runtime/JavaScript/src/antlr4/context/PredictionContext.js b/runtime/JavaScript/src/antlr4/context/PredictionContext.js new file mode 100644 index 0000000000..31d1c17a3a --- /dev/null +++ b/runtime/JavaScript/src/antlr4/context/PredictionContext.js @@ -0,0 +1,69 @@ +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +export default class PredictionContext { + + constructor(cachedHashCode) { + this.cachedHashCode = cachedHashCode; + } + + /** + * Stores the computed hash code of this {@link PredictionContext}. The hash + * code is computed in parts to match the following reference algorithm. + * + *
+	 * private int referenceHashCode() {
+	 * int hash = {@link MurmurHash//initialize MurmurHash.initialize}({@link
+	 * //INITIAL_HASH});
+	 *
+	 * for (int i = 0; i < {@link //size()}; i++) {
+	 * hash = {@link MurmurHash//update MurmurHash.update}(hash, {@link //getParent
+	 * getParent}(i));
+	 * }
+	 *
+	 * for (int i = 0; i < {@link //size()}; i++) {
+	 * hash = {@link MurmurHash//update MurmurHash.update}(hash, {@link
+	 * //getReturnState getReturnState}(i));
+	 * }
+	 *
+	 * hash = {@link MurmurHash//finish MurmurHash.finish}(hash, 2// {@link
+	 * //size()});
+	 * return hash;
+	 * }
+	 * 
+ * This means only the {@link //EMPTY} context is in set. + */ + isEmpty() { + return this === PredictionContext.EMPTY; + } + + hasEmptyPath() { + return this.getReturnState(this.length - 1) === PredictionContext.EMPTY_RETURN_STATE; + } + + hashCode() { + return this.cachedHashCode; + } + + updateHashCode(hash) { + hash.update(this.cachedHashCode); + } +} + +/** + * Represents {@code $} in local context prediction, which means wildcard. + * {@code//+x =//}. + */ +PredictionContext.EMPTY = null; + +/** + * Represents {@code $} in an array in full context mode, when {@code $} + * doesn't mean wildcard: {@code $ + x = [$,x]}. Here, + * {@code $} = {@link //EMPTY_RETURN_STATE}. + */ +PredictionContext.EMPTY_RETURN_STATE = 0x7FFFFFFF; + +PredictionContext.globalNodeCount = 1; +PredictionContext.id = PredictionContext.globalNodeCount; diff --git a/runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js b/runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js new file mode 100644 index 0000000000..2bc64fd507 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/context/PredictionContextUtils.js @@ -0,0 +1,448 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import RuleContext from "./RuleContext.js"; +import PredictionContext from "./PredictionContext.js"; +import ArrayPredictionContext from "./ArrayPredictionContext.js"; +import SingletonPredictionContext from "./SingletonPredictionContext.js"; +import EmptyPredictionContext from "./EmptyPredictionContext.js"; +import HashMap from "../misc/HashMap.js"; + +/** + * Convert a {@link RuleContext} tree to a {@link PredictionContext} graph. + * Return {@link //EMPTY} if {@code outerContext} is empty or null. + */ +export function predictionContextFromRuleContext(atn, outerContext) { + if (outerContext === undefined || outerContext === null) { + outerContext = RuleContext.EMPTY; + } + // if we are in RuleContext of start rule, s, then PredictionContext + // is EMPTY. Nobody called us. (if we are empty, return empty) + if (outerContext.parentCtx === null || outerContext === RuleContext.EMPTY) { + return PredictionContext.EMPTY; + } + // If we have a parent, convert it to a PredictionContext graph + const parent = predictionContextFromRuleContext(atn, outerContext.parentCtx); + const state = atn.states[outerContext.invokingState]; + const transition = state.transitions[0]; + return SingletonPredictionContext.create(parent, transition.followState.stateNumber); +} + + +export function getCachedPredictionContext(context, contextCache, visited) { + if (context.isEmpty()) { + return context; + } + let existing = visited.get(context) || null; + if (existing !== null) { + return existing; + } + existing = contextCache.get(context); + if (existing !== null) { + visited.set(context, existing); + return existing; + } + let changed = false; + let parents = []; + for (let i = 0; i < parents.length; i++) { + const parent = getCachedPredictionContext(context.getParent(i), contextCache, visited); + if (changed || parent !== context.getParent(i)) { + if (!changed) { + parents = []; + for (let j = 0; j < context.length; j++) { + parents[j] = context.getParent(j); + } + changed = true; + } + parents[i] = parent; + } + } + if (!changed) { + contextCache.add(context); + visited.set(context, context); + return context; + } + let updated = null; + if (parents.length === 0) { + updated = PredictionContext.EMPTY; + } else if (parents.length === 1) { + updated = SingletonPredictionContext.create(parents[0], context + .getReturnState(0)); + } else { + updated = new ArrayPredictionContext(parents, context.returnStates); + } + contextCache.add(updated); + visited.set(updated, updated); + visited.set(context, updated); + + return updated; +} + +export function merge(a, b, rootIsWildcard, mergeCache) { + // share same graph if both same + if (a === b) { + return a; + } + if (a instanceof SingletonPredictionContext && b instanceof SingletonPredictionContext) { + return mergeSingletons(a, b, rootIsWildcard, mergeCache); + } + // At least one of a or b is array + // If one is $ and rootIsWildcard, return $ as// wildcard + if (rootIsWildcard) { + if (a instanceof EmptyPredictionContext) { + return a; + } + if (b instanceof EmptyPredictionContext) { + return b; + } + } + // convert singleton so both are arrays to normalize + if (a instanceof SingletonPredictionContext) { + a = new ArrayPredictionContext([a.getParent()], [a.returnState]); + } + if (b instanceof SingletonPredictionContext) { + b = new ArrayPredictionContext([b.getParent()], [b.returnState]); + } + return mergeArrays(a, b, rootIsWildcard, mergeCache); +} + + +/** + * Merge two {@link ArrayPredictionContext} instances. + * + *

Different tops, different parents.
+ *

+ * + *

Shared top, same parents.
+ *

+ * + *

Shared top, different parents.
+ *

+ * + *

Shared top, all shared parents.
+ *

+ * + *

Equal tops, merge parents and reduce top to + * {@link SingletonPredictionContext}.
+ *

+ */ +function mergeArrays(a, b, rootIsWildcard, mergeCache) { + if (mergeCache !== null) { + let previous = mergeCache.get(a, b); + if (previous !== null) { + return previous; + } + previous = mergeCache.get(b, a); + if (previous !== null) { + return previous; + } + } + // merge sorted payloads a + b => M + let i = 0; // walks a + let j = 0; // walks b + let k = 0; // walks target M array + + let mergedReturnStates = []; + let mergedParents = []; + // walk and merge to yield mergedParents, mergedReturnStates + while (i < a.returnStates.length && j < b.returnStates.length) { + const a_parent = a.parents[i]; + const b_parent = b.parents[j]; + if (a.returnStates[i] === b.returnStates[j]) { + // same payload (stack tops are equal), must yield merged singleton + const payload = a.returnStates[i]; + // $+$ = $ + const bothDollars = payload === PredictionContext.EMPTY_RETURN_STATE && + a_parent === null && b_parent === null; + const ax_ax = (a_parent !== null && b_parent !== null && a_parent === b_parent); // ax+ax + // -> + // ax + if (bothDollars || ax_ax) { + mergedParents[k] = a_parent; // choose left + mergedReturnStates[k] = payload; + } else { // ax+ay -> a'[x,y] + mergedParents[k] = merge(a_parent, b_parent, rootIsWildcard, mergeCache); + mergedReturnStates[k] = payload; + } + i += 1; // hop over left one as usual + j += 1; // but also skip one in right side since we merge + } else if (a.returnStates[i] < b.returnStates[j]) { // copy a[i] to M + mergedParents[k] = a_parent; + mergedReturnStates[k] = a.returnStates[i]; + i += 1; + } else { // b > a, copy b[j] to M + mergedParents[k] = b_parent; + mergedReturnStates[k] = b.returnStates[j]; + j += 1; + } + k += 1; + } + // copy over any payloads remaining in either array + if (i < a.returnStates.length) { + for (let p = i; p < a.returnStates.length; p++) { + mergedParents[k] = a.parents[p]; + mergedReturnStates[k] = a.returnStates[p]; + k += 1; + } + } else { + for (let p = j; p < b.returnStates.length; p++) { + mergedParents[k] = b.parents[p]; + mergedReturnStates[k] = b.returnStates[p]; + k += 1; + } + } + // trim merged if we combined a few that had same stack tops + if (k < mergedParents.length) { // write index < last position; trim + if (k === 1) { // for just one merged element, return singleton top + const a_ = SingletonPredictionContext.create(mergedParents[0], + mergedReturnStates[0]); + if (mergeCache !== null) { + mergeCache.set(a, b, a_); + } + return a_; + } + mergedParents = mergedParents.slice(0, k); + mergedReturnStates = mergedReturnStates.slice(0, k); + } + + const M = new ArrayPredictionContext(mergedParents, mergedReturnStates); + + // if we created same array as a or b, return that instead + // TODO: track whether this is possible above during merge sort for speed + if (M === a) { + if (mergeCache !== null) { + mergeCache.set(a, b, a); + } + return a; + } + if (M === b) { + if (mergeCache !== null) { + mergeCache.set(a, b, b); + } + return b; + } + combineCommonParents(mergedParents); + + if (mergeCache !== null) { + mergeCache.set(a, b, M); + } + return M; +} + + +/** + * Make pass over all M {@code parents}; merge any {@code equals()} + * ones. + */ +function combineCommonParents(parents) { + const uniqueParents = new HashMap(); + + for (let p = 0; p < parents.length; p++) { + const parent = parents[p]; + if (!(uniqueParents.containsKey(parent))) { + uniqueParents.set(parent, parent); + } + } + for (let q = 0; q < parents.length; q++) { + parents[q] = uniqueParents.get(parents[q]); + } +} + + +/** + * Merge two {@link SingletonPredictionContext} instances. + * + *

Stack tops equal, parents merge is same; return left graph.
+ *

+ * + *

Same stack top, parents differ; merge parents giving array node, then + * remainders of those graphs. A new root node is created to point to the + * merged parents.
+ *

+ * + *

Different stack tops pointing to same parent. Make array node for the + * root where both element in the root point to the same (original) + * parent.
+ *

+ * + *

Different stack tops pointing to different parents. Make array node for + * the root where each element points to the corresponding original + * parent.
+ *

+ * + * @param a the first {@link SingletonPredictionContext} + * @param b the second {@link SingletonPredictionContext} + * @param rootIsWildcard {@code true} if this is a local-context merge, + * otherwise false to indicate a full-context merge + * @param mergeCache + */ +function mergeSingletons(a, b, rootIsWildcard, mergeCache) { + if (mergeCache !== null) { + let previous = mergeCache.get(a, b); + if (previous !== null) { + return previous; + } + previous = mergeCache.get(b, a); + if (previous !== null) { + return previous; + } + } + + const rootMerge = mergeRoot(a, b, rootIsWildcard); + if (rootMerge !== null) { + if (mergeCache !== null) { + mergeCache.set(a, b, rootMerge); + } + return rootMerge; + } + if (a.returnState === b.returnState) { + const parent = merge(a.parentCtx, b.parentCtx, rootIsWildcard, mergeCache); + // if parent is same as existing a or b parent or reduced to a parent, + // return it + if (parent === a.parentCtx) { + return a; // ax + bx = ax, if a=b + } + if (parent === b.parentCtx) { + return b; // ax + bx = bx, if a=b + } + // else: ax + ay = a'[x,y] + // merge parents x and y, giving array node with x,y then remainders + // of those graphs. dup a, a' points at merged array + // new joined parent so create new singleton pointing to it, a' + const spc = SingletonPredictionContext.create(parent, a.returnState); + if (mergeCache !== null) { + mergeCache.set(a, b, spc); + } + return spc; + } else { // a != b payloads differ + // see if we can collapse parents due to $+x parents if local ctx + let singleParent = null; + if (a === b || (a.parentCtx !== null && a.parentCtx === b.parentCtx)) { // ax + + // bx = + // [a,b]x + singleParent = a.parentCtx; + } + if (singleParent !== null) { // parents are same + // sort payloads and use same parent + const payloads = [ a.returnState, b.returnState ]; + if (a.returnState > b.returnState) { + payloads[0] = b.returnState; + payloads[1] = a.returnState; + } + const parents = [ singleParent, singleParent ]; + const apc = new ArrayPredictionContext(parents, payloads); + if (mergeCache !== null) { + mergeCache.set(a, b, apc); + } + return apc; + } + // parents differ and can't merge them. Just pack together + // into array; can't merge. + // ax + by = [ax,by] + const payloads = [ a.returnState, b.returnState ]; + let parents = [ a.parentCtx, b.parentCtx ]; + if (a.returnState > b.returnState) { // sort by payload + payloads[0] = b.returnState; + payloads[1] = a.returnState; + parents = [ b.parentCtx, a.parentCtx ]; + } + const a_ = new ArrayPredictionContext(parents, payloads); + if (mergeCache !== null) { + mergeCache.set(a, b, a_); + } + return a_; + } +} + + +/** + * Handle case where at least one of {@code a} or {@code b} is + * {@link //EMPTY}. In the following diagrams, the symbol {@code $} is used + * to represent {@link //EMPTY}. + * + *

Local-Context Merges

+ * + *

These local-context merge operations are used when {@code rootIsWildcard} + * is true.

+ * + *

{@link //EMPTY} is superset of any graph; return {@link //EMPTY}.
+ *

+ * + *

{@link //EMPTY} and anything is {@code //EMPTY}, so merged parent is + * {@code //EMPTY}; return left graph.
+ *

+ * + *

Special case of last merge if local context.
+ *

+ * + *

Full-Context Merges

+ * + *

These full-context merge operations are used when {@code rootIsWildcard} + * is false.

+ * + *

+ * + *

Must keep all contexts; {@link //EMPTY} in array is a special value (and + * null parent).
+ *

+ * + *

+ * + * @param a the first {@link SingletonPredictionContext} + * @param b the second {@link SingletonPredictionContext} + * @param rootIsWildcard {@code true} if this is a local-context merge, + * otherwise false to indicate a full-context merge + */ +function mergeRoot(a, b, rootIsWildcard) { + if (rootIsWildcard) { + if (a === PredictionContext.EMPTY) { + return PredictionContext.EMPTY; // // + b =// + } + if (b === PredictionContext.EMPTY) { + return PredictionContext.EMPTY; // a +// =// + } + } else { + if (a === PredictionContext.EMPTY && b === PredictionContext.EMPTY) { + return PredictionContext.EMPTY; // $ + $ = $ + } else if (a === PredictionContext.EMPTY) { // $ + x = [$,x] + const payloads = [ b.returnState, + PredictionContext.EMPTY_RETURN_STATE ]; + const parents = [ b.parentCtx, null ]; + return new ArrayPredictionContext(parents, payloads); + } else if (b === PredictionContext.EMPTY) { // x + $ = [$,x] ($ is always first if present) + const payloads = [ a.returnState, PredictionContext.EMPTY_RETURN_STATE ]; + const parents = [ a.parentCtx, null ]; + return new ArrayPredictionContext(parents, payloads); + } + } + return null; +} + + +// ter's recursive version of Sam's getAllNodes() +export function getAllContextNodes(context, nodes, visited) { + if (nodes === null) { + nodes = []; + return getAllContextNodes(context, nodes, visited); + } else if (visited === null) { + visited = new HashMap(); + return getAllContextNodes(context, nodes, visited); + } else { + if (context === null || visited.containsKey(context)) { + return nodes; + } + visited.set(context, context); + nodes.push(context); + for (let i = 0; i < context.length; i++) { + getAllContextNodes(context.getParent(i), nodes, visited); + } + return nodes; + } +} + diff --git a/runtime/JavaScript/src/antlr4/context/RuleContext.js b/runtime/JavaScript/src/antlr4/context/RuleContext.js new file mode 100644 index 0000000000..8b9126dd87 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/context/RuleContext.js @@ -0,0 +1,159 @@ +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +import RuleNode from '../tree/RuleNode.js'; +import Interval from '../misc/Interval.js'; +import Trees from '../tree/Trees.js'; + +export default class RuleContext extends RuleNode { + /** A rule context is a record of a single rule invocation. It knows + * which context invoked it, if any. If there is no parent context, then + * naturally the invoking state is not valid. The parent link + * provides a chain upwards from the current rule invocation to the root + * of the invocation tree, forming a stack. We actually carry no + * information about the rule associated with this context (except + * when parsing). We keep only the state number of the invoking state from + * the ATN submachine that invoked this. Contrast this with the s + * pointer inside ParserRuleContext that tracks the current state + * being "executed" for the current rule. + * + * The parent contexts are useful for computing lookahead sets and + * getting error information. + * + * These objects are used during parsing and prediction. + * For the special case of parsers, we use the subclass + * ParserRuleContext. + * + * @see ParserRuleContext + */ + constructor(parent, invokingState) { + // What context invoked this rule? + super(); + this.parentCtx = parent || null; + /** + * What state invoked the rule associated with this context? + * The "return address" is the followState of invokingState + * If parent is null, this should be -1. + */ + this.invokingState = invokingState || -1; + } + + depth() { + let n = 0; + let p = this; + while (p !== null) { + p = p.parentCtx; + n += 1; + } + return n; + } + + /** + * A context is empty if there is no invoking state; meaning nobody call + * current context. + */ + isEmpty() { + return this.invokingState === -1; + } + +// satisfy the ParseTree / SyntaxTree interface + getSourceInterval() { + return Interval.INVALID_INTERVAL; + } + + getRuleContext() { + return this; + } + + getPayload() { + return this; + } + + /** + * Return the combined text of all child nodes. This method only considers + * tokens which have been added to the parse tree. + *

+ * Since tokens on hidden channels (e.g. whitespace or comments) are not + * added to the parse trees, they will not appear in the output of this + * method. + */ + getText() { + if (this.getChildCount() === 0) { + return ""; + } else { + return this.children.map(function (child) { + return child.getText(); + }).join(""); + } + } + + /** + * For rule associated with this parse tree internal node, return + * the outer alternative number used to match the input. Default + * implementation does not compute nor store this alt num. Create + * a subclass of ParserRuleContext with backing field and set + * option contextSuperClass. + * to set it. + */ + getAltNumber() { + // use constant value of ATN.INVALID_ALT_NUMBER to avoid circular dependency + return 0; + } + + /** + * Set the outer alternative number for this context node. Default + * implementation does nothing to avoid backing field overhead for + * trees that don't need it. Create + * a subclass of ParserRuleContext with backing field and set + * option contextSuperClass. + */ + setAltNumber(altNumber) { + } + + getChild(i) { + return null; + } + + getChildCount() { + return 0; + } + + accept(visitor) { + return visitor.visitChildren(this); + } + + /** + * Print out a whole tree, not just a node, in LISP format + * (root child1 .. childN). Print just a node if this is a leaf. + */ + toStringTree(ruleNames, recog) { + return Trees.toStringTree(this, ruleNames, recog); + } + + toString(ruleNames, stop) { + ruleNames = ruleNames || null; + stop = stop || null; + let p = this; + let s = "["; + while (p !== null && p !== stop) { + if (ruleNames === null) { + if (!p.isEmpty()) { + s += p.invokingState; + } + } else { + const ri = p.ruleIndex; + const ruleName = (ri >= 0 && ri < ruleNames.length) ? ruleNames[ri] + : "" + ri; + s += ruleName; + } + if (p.parentCtx !== null && (ruleNames !== null || !p.parentCtx.isEmpty())) { + s += " "; + } + p = p.parentCtx; + } + s += "]"; + return s; + } +} diff --git a/runtime/JavaScript/src/antlr4/context/SingletonPredictionContext.js b/runtime/JavaScript/src/antlr4/context/SingletonPredictionContext.js new file mode 100644 index 0000000000..99e545c3df --- /dev/null +++ b/runtime/JavaScript/src/antlr4/context/SingletonPredictionContext.js @@ -0,0 +1,75 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import PredictionContext from './PredictionContext.js'; +import HashCode from "../misc/HashCode.js"; + +export default class SingletonPredictionContext extends PredictionContext { + + constructor(parent, returnState) { + let hashCode = 0; + const hash = new HashCode(); + if(parent !== null) { + hash.update(parent, returnState); + } else { + hash.update(1); + } + hashCode = hash.finish(); + super(hashCode); + this.parentCtx = parent; + this.returnState = returnState; + } + + getParent(index) { + return this.parentCtx; + } + + getReturnState(index) { + return this.returnState; + } + + equals(other) { + if (this === other) { + return true; + } else if (!(other instanceof SingletonPredictionContext)) { + return false; + } else if (this.hashCode() !== other.hashCode()) { + return false; // can't be same if hash is different + } else { + if(this.returnState !== other.returnState) + return false; + else if(this.parentCtx==null) + return other.parentCtx==null + else + return this.parentCtx.equals(other.parentCtx); + } + } + + toString() { + const up = this.parentCtx === null ? "" : this.parentCtx.toString(); + if (up.length === 0) { + if (this.returnState === PredictionContext.EMPTY_RETURN_STATE) { + return "$"; + } else { + return "" + this.returnState; + } + } else { + return "" + this.returnState + " " + up; + } + } + + get length(){ + return 1; + } + + static create(parent, returnState) { + if (returnState === PredictionContext.EMPTY_RETURN_STATE && parent === null) { + // someone can pass in the bits of an array ctx that mean $ + return PredictionContext.EMPTY; + } else { + return new SingletonPredictionContext(parent, returnState); + } + } +} + diff --git a/runtime/JavaScript/src/antlr4/dfa/DFA.js b/runtime/JavaScript/src/antlr4/dfa/DFA.js index 1863f878ad..01c7a4a625 100644 --- a/runtime/JavaScript/src/antlr4/dfa/DFA.js +++ b/runtime/JavaScript/src/antlr4/dfa/DFA.js @@ -1,16 +1,16 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Set} = require("../Utils"); -const {DFAState} = require('./DFAState'); -const {StarLoopEntryState} = require('../atn/ATNState'); -const {ATNConfigSet} = require('./../atn/ATNConfigSet'); -const {DFASerializer} = require('./DFASerializer'); -const {LexerDFASerializer} = require('./DFASerializer'); +import DFAState from './DFAState.js'; +import StarLoopEntryState from '../state/StarLoopEntryState.js'; +import ATNConfigSet from './../atn/ATNConfigSet.js'; +import DFASerializer from './DFASerializer.js'; +import LexerDFASerializer from './LexerDFASerializer.js'; +import HashSet from "../misc/HashSet.js"; -class DFA { +export default class DFA { constructor(atnStartState, decision) { if (decision === undefined) { decision = 0; @@ -24,7 +24,7 @@ class DFA { * A set of all DFA states. Use {@link Map} so we can get old state back * ({@link Set} only allows you to see if it's there). */ - this._states = new Set(); + this._states = new HashSet(); this.s0 = null; /** * {@code true} if this DFA is for a precedence decision; otherwise, @@ -111,7 +111,7 @@ class DFA { */ setPrecedenceDfa(precedenceDfa) { if (this.precedenceDfa!==precedenceDfa) { - this._states = new Set(); + this._states = new HashSet(); if (precedenceDfa) { const precedenceState = new DFAState(null, new ATNConfigSet()); precedenceState.edges = []; @@ -157,6 +157,3 @@ class DFA { return this._states; } } - - -module.exports = DFA; diff --git a/runtime/JavaScript/src/antlr4/dfa/DFASerializer.js b/runtime/JavaScript/src/antlr4/dfa/DFASerializer.js index 5175a44082..dc581d98d1 100644 --- a/runtime/JavaScript/src/antlr4/dfa/DFASerializer.js +++ b/runtime/JavaScript/src/antlr4/dfa/DFASerializer.js @@ -1,13 +1,15 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const Utils = require('./../Utils'); + + +import arrayToString from "../utils/arrayToString.js"; /** * A DFA walker that knows how to dump them to serialized strings. */ -class DFASerializer { +export default class DFASerializer { constructor(dfa, literalNames, symbolicNames) { this.dfa = dfa; this.literalNames = literalNames || []; @@ -54,7 +56,7 @@ class DFASerializer { const baseStateStr = ( s.isAcceptState ? ":" : "") + "s" + s.stateNumber + ( s.requiresFullContext ? "^" : ""); if(s.isAcceptState) { if (s.predicates !== null) { - return baseStateStr + "=>" + Utils.arrayToString(s.predicates); + return baseStateStr + "=>" + arrayToString(s.predicates); } else { return baseStateStr + "=>" + s.prediction.toString(); } @@ -64,15 +66,4 @@ class DFASerializer { } } -class LexerDFASerializer extends DFASerializer { - constructor(dfa) { - super(dfa, null); - } - - getEdgeLabel(i) { - return "'" + String.fromCharCode(i) + "'"; - } -} - -module.exports = { DFASerializer , LexerDFASerializer }; diff --git a/runtime/JavaScript/src/antlr4/dfa/DFAState.js b/runtime/JavaScript/src/antlr4/dfa/DFAState.js index 49a1ee3d48..ae635a36cf 100644 --- a/runtime/JavaScript/src/antlr4/dfa/DFAState.js +++ b/runtime/JavaScript/src/antlr4/dfa/DFAState.js @@ -1,24 +1,12 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {ATNConfigSet} = require('./../atn/ATNConfigSet'); -const {Hash, Set} = require('./../Utils'); +import ATNConfigSet from '../atn/ATNConfigSet.js'; +import HashCode from "../misc/HashCode.js"; +import HashSet from "../misc/HashSet.js"; -/** - * Map a predicate to a predicted alternative. - */ -class PredPrediction { - constructor(pred, alt) { - this.alt = alt; - this.pred = pred; - } - - toString() { - return "(" + this.pred + ", " + this.alt + ")"; - } -} /** * A DFA state represents a set of possible ATN configurations. @@ -45,7 +33,7 @@ class PredPrediction { * but with different ATN contexts (with same or different alts) * meaning that state was reached via a different set of rule invocations.

*/ -class DFAState { +export default class DFAState { constructor(stateNumber, configs) { if (stateNumber === null) { stateNumber = -1; @@ -100,7 +88,7 @@ class DFAState { * DFA state. */ getAltSet() { - const alts = new Set(); + const alts = new HashSet(); if (this.configs !== null) { for (let i = 0; i < this.configs.length; i++) { const c = this.configs[i]; @@ -147,10 +135,8 @@ class DFAState { } hashCode() { - const hash = new Hash(); + const hash = new HashCode(); hash.update(this.configs); return hash.finish(); } } - -module.exports = { DFAState, PredPrediction }; diff --git a/runtime/JavaScript/src/antlr4/dfa/LexerDFASerializer.js b/runtime/JavaScript/src/antlr4/dfa/LexerDFASerializer.js new file mode 100644 index 0000000000..89da71c608 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/dfa/LexerDFASerializer.js @@ -0,0 +1,15 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import DFASerializer from "./DFASerializer.js"; + +export default class LexerDFASerializer extends DFASerializer { + constructor(dfa) { + super(dfa, null); + } + + getEdgeLabel(i) { + return "'" + String.fromCharCode(i) + "'"; + } +} diff --git a/runtime/JavaScript/src/antlr4/dfa/PredPrediction.js b/runtime/JavaScript/src/antlr4/dfa/PredPrediction.js new file mode 100644 index 0000000000..f61da1a0f7 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/dfa/PredPrediction.js @@ -0,0 +1,17 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +/** + * Map a predicate to a predicted alternative. + */ +export default class PredPrediction { + constructor(pred, alt) { + this.alt = alt; + this.pred = pred; + } + + toString() { + return "(" + this.pred + ", " + this.alt + ")"; + } +} diff --git a/runtime/JavaScript/src/antlr4/dfa/index.js b/runtime/JavaScript/src/antlr4/dfa/index.js index 9a98bd076a..a5075915cd 100644 --- a/runtime/JavaScript/src/antlr4/dfa/index.js +++ b/runtime/JavaScript/src/antlr4/dfa/index.js @@ -1,9 +1,11 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -exports.DFA = require('./DFA'); -exports.DFASerializer = require('./DFASerializer').DFASerializer; -exports.LexerDFASerializer = require('./DFASerializer').LexerDFASerializer; -exports.PredPrediction = require('./DFAState').PredPrediction; +import DFA from './DFA.js'; +import DFASerializer from './DFASerializer.js'; +import LexerDFASerializer from './LexerDFASerializer.js'; +import PredPrediction from './PredPrediction.js'; + +export default { DFA, DFASerializer, LexerDFASerializer, PredPrediction }; diff --git a/runtime/JavaScript/src/antlr4/error/BailErrorStrategy.js b/runtime/JavaScript/src/antlr4/error/BailErrorStrategy.js new file mode 100644 index 0000000000..f468267557 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/error/BailErrorStrategy.js @@ -0,0 +1,70 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import InputMismatchException from "./InputMismatchException.js"; +import ParseCancellationException from "./ParseCancellationException.js"; +import DefaultErrorStrategy from "./DefaultErrorStrategy.js"; + +/** + * This implementation of {@link ANTLRErrorStrategy} responds to syntax errors + * by immediately canceling the parse operation with a + * {@link ParseCancellationException}. The implementation ensures that the + * {@link ParserRuleContext//exception} field is set for all parse tree nodes + * that were not completed prior to encountering the error. + * + *

+ * This error strategy is useful in the following scenarios.

+ * + *
    + *
  • Two-stage parsing: This error strategy allows the first + * stage of two-stage parsing to immediately terminate if an error is + * encountered, and immediately fall back to the second stage. In addition to + * avoiding wasted work by attempting to recover from errors here, the empty + * implementation of {@link BailErrorStrategy//sync} improves the performance of + * the first stage.
  • + *
  • Silent validation: When syntax errors are not being + * reported or logged, and the parse result is simply ignored if errors occur, + * the {@link BailErrorStrategy} avoids wasting work on recovering from errors + * when the result will be ignored either way.
  • + *
+ * + *

+ * {@code myparser.setErrorHandler(new BailErrorStrategy());}

+ * + * @see Parser//setErrorHandler(ANTLRErrorStrategy) + * */ +export default class BailErrorStrategy extends DefaultErrorStrategy { + + constructor() { + super(); + } + + /** + * Instead of recovering from exception {@code e}, re-throw it wrapped + * in a {@link ParseCancellationException} so it is not caught by the + * rule function catches. Use {@link Exception//getCause()} to get the + * original {@link RecognitionException}. + */ + recover(recognizer, e) { + let context = recognizer._ctx + while (context !== null) { + context.exception = e; + context = context.parentCtx; + } + throw new ParseCancellationException(e); + } + + /** + * Make sure we don't attempt to recover inline; if the parser + * successfully recovers, it won't throw an exception. + */ + recoverInline(recognizer) { + this.recover(recognizer, new InputMismatchException(recognizer)); + } + +// Make sure we don't attempt to recover from problems in subrules.// + sync(recognizer) { + // pass + } +} diff --git a/runtime/JavaScript/src/antlr4/error/ConsoleErrorListener.js b/runtime/JavaScript/src/antlr4/error/ConsoleErrorListener.js new file mode 100644 index 0000000000..91912d0bfb --- /dev/null +++ b/runtime/JavaScript/src/antlr4/error/ConsoleErrorListener.js @@ -0,0 +1,34 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ErrorListener from "./ErrorListener.js"; + +/** + * {@inheritDoc} + * + *

+ * This implementation prints messages to {@link System//err} containing the + * values of {@code line}, {@code charPositionInLine}, and {@code msg} using + * the following format.

+ * + *
+ * line line:charPositionInLine msg
+ * 
+ * + */ +export default class ConsoleErrorListener extends ErrorListener { + constructor() { + super(); + } + + syntaxError(recognizer, offendingSymbol, line, column, msg, e) { + console.error("line " + line + ":" + column + " " + msg); + } +} + + +/** + * Provides a default instance of {@link ConsoleErrorListener}. + */ +ConsoleErrorListener.INSTANCE = new ConsoleErrorListener(); diff --git a/runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js b/runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js new file mode 100644 index 0000000000..f498091b8a --- /dev/null +++ b/runtime/JavaScript/src/antlr4/error/DefaultErrorStrategy.js @@ -0,0 +1,694 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import FailedPredicateException from "./FailedPredicateException.js"; +import InputMismatchException from "./InputMismatchException.js"; +import NoViableAltException from "./NoViableAltException.js"; +import ATNState from "../state/ATNState.js"; +import Token from '../Token.js'; +import Interval from "../misc/Interval.js"; +import IntervalSet from "../misc/IntervalSet.js"; +import ErrorStrategy from "./ErrorStrategy.js"; + +/** + * This is the default implementation of {@link ANTLRErrorStrategy} used for + * error reporting and recovery in ANTLR parsers. + */ +export default class DefaultErrorStrategy extends ErrorStrategy { + constructor() { + super(); + /** + * Indicates whether the error strategy is currently "recovering from an + * error". This is used to suppress reporting multiple error messages while + * attempting to recover from a detected syntax error. + * + * @see //inErrorRecoveryMode + */ + this.errorRecoveryMode = false; + + /** + * The index into the input stream where the last error occurred. + * This is used to prevent infinite loops where an error is found + * but no token is consumed during recovery...another error is found, + * ad nauseum. This is a failsafe mechanism to guarantee that at least + * one token/tree node is consumed for two errors. + */ + this.lastErrorIndex = -1; + this.lastErrorStates = null; + this.nextTokensContext = null; + this.nextTokenState = 0; + } + + /** + *

The default implementation simply calls {@link //endErrorCondition} to + * ensure that the handler is not in error recovery mode.

+ */ + reset(recognizer) { + this.endErrorCondition(recognizer); + } + + /** + * This method is called to enter error recovery mode when a recognition + * exception is reported. + * + * @param recognizer the parser instance + */ + beginErrorCondition(recognizer) { + this.errorRecoveryMode = true; + } + + inErrorRecoveryMode(recognizer) { + return this.errorRecoveryMode; + } + + /** + * This method is called to leave error recovery mode after recovering from + * a recognition exception. + * @param recognizer + */ + endErrorCondition(recognizer) { + this.errorRecoveryMode = false; + this.lastErrorStates = null; + this.lastErrorIndex = -1; + } + + /** + * {@inheritDoc} + *

The default implementation simply calls {@link //endErrorCondition}.

+ */ + reportMatch(recognizer) { + this.endErrorCondition(recognizer); + } + + /** + * {@inheritDoc} + * + *

The default implementation returns immediately if the handler is already + * in error recovery mode. Otherwise, it calls {@link //beginErrorCondition} + * and dispatches the reporting task based on the runtime type of {@code e} + * according to the following table.

+ * + *
    + *
  • {@link NoViableAltException}: Dispatches the call to + * {@link //reportNoViableAlternative}
  • + *
  • {@link InputMismatchException}: Dispatches the call to + * {@link //reportInputMismatch}
  • + *
  • {@link FailedPredicateException}: Dispatches the call to + * {@link //reportFailedPredicate}
  • + *
  • All other types: calls {@link Parser//notifyErrorListeners} to report + * the exception
  • + *
+ */ + reportError(recognizer, e) { + // if we've already reported an error and have not matched a token + // yet successfully, don't report any errors. + if(this.inErrorRecoveryMode(recognizer)) { + return; // don't report spurious errors + } + this.beginErrorCondition(recognizer); + if ( e instanceof NoViableAltException ) { + this.reportNoViableAlternative(recognizer, e); + } else if ( e instanceof InputMismatchException ) { + this.reportInputMismatch(recognizer, e); + } else if ( e instanceof FailedPredicateException ) { + this.reportFailedPredicate(recognizer, e); + } else { + console.log("unknown recognition error type: " + e.constructor.name); + console.log(e.stack); + recognizer.notifyErrorListeners(e.getOffendingToken(), e.getMessage(), e); + } + } + + /** + * + * {@inheritDoc} + * + *

The default implementation resynchronizes the parser by consuming tokens + * until we find one in the resynchronization set--loosely the set of tokens + * that can follow the current rule.

+ * + */ + recover(recognizer, e) { + if (this.lastErrorIndex===recognizer.getInputStream().index && + this.lastErrorStates !== null && this.lastErrorStates.indexOf(recognizer.state)>=0) { + // uh oh, another error at same token index and previously-visited + // state in ATN; must be a case where LT(1) is in the recovery + // token set so nothing got consumed. Consume a single token + // at least to prevent an infinite loop; this is a failsafe. + recognizer.consume(); + } + this.lastErrorIndex = recognizer._input.index; + if (this.lastErrorStates === null) { + this.lastErrorStates = []; + } + this.lastErrorStates.push(recognizer.state); + const followSet = this.getErrorRecoverySet(recognizer) + this.consumeUntil(recognizer, followSet); + } + + /** + * The default implementation of {@link ANTLRErrorStrategy//sync} makes sure + * that the current lookahead symbol is consistent with what were expecting + * at this point in the ATN. You can call this anytime but ANTLR only + * generates code to check before subrules/loops and each iteration. + * + *

Implements Jim Idle's magic sync mechanism in closures and optional + * subrules. E.g.,

+ * + *
+     * a : sync ( stuff sync )* ;
+     * sync : {consume to what can follow sync} ;
+     * 
+ * + * At the start of a sub rule upon error, {@link //sync} performs single + * token deletion, if possible. If it can't do that, it bails on the current + * rule and uses the default error recovery, which consumes until the + * resynchronization set of the current rule. + * + *

If the sub rule is optional ({@code (...)?}, {@code (...)*}, or block + * with an empty alternative), then the expected set includes what follows + * the subrule.

+ * + *

During loop iteration, it consumes until it sees a token that can start a + * sub rule or what follows loop. Yes, that is pretty aggressive. We opt to + * stay in the loop as long as possible.

+ * + *

ORIGINS

+ * + *

Previous versions of ANTLR did a poor job of their recovery within loops. + * A single mismatch token or missing token would force the parser to bail + * out of the entire rules surrounding the loop. So, for rule

+ * + *
+     * classDef : 'class' ID '{' member* '}'
+     * 
+ * + * input with an extra token between members would force the parser to + * consume until it found the next class definition rather than the next + * member definition of the current class. + * + *

This functionality cost a little bit of effort because the parser has to + * compare token set at the start of the loop and at each iteration. If for + * some reason speed is suffering for you, you can turn off this + * functionality by simply overriding this method as a blank { }.

+ * + */ + sync(recognizer) { + // If already recovering, don't try to sync + if (this.inErrorRecoveryMode(recognizer)) { + return; + } + const s = recognizer._interp.atn.states[recognizer.state]; + const la = recognizer.getTokenStream().LA(1); + // try cheaper subset first; might get lucky. seems to shave a wee bit off + const nextTokens = recognizer.atn.nextTokens(s); + if(nextTokens.contains(la)) { + this.nextTokensContext = null; + this.nextTokenState = ATNState.INVALID_STATE_NUMBER; + return; + } else if (nextTokens.contains(Token.EPSILON)) { + if(this.nextTokensContext === null) { + // It's possible the next token won't match information tracked + // by sync is restricted for performance. + this.nextTokensContext = recognizer._ctx; + this.nextTokensState = recognizer._stateNumber; + } + return; + } + switch (s.stateType) { + case ATNState.BLOCK_START: + case ATNState.STAR_BLOCK_START: + case ATNState.PLUS_BLOCK_START: + case ATNState.STAR_LOOP_ENTRY: + // report error and recover if possible + if( this.singleTokenDeletion(recognizer) !== null) { + return; + } else { + throw new InputMismatchException(recognizer); + } + case ATNState.PLUS_LOOP_BACK: + case ATNState.STAR_LOOP_BACK: + { + this.reportUnwantedToken(recognizer); + const expecting = new IntervalSet(); + expecting.addSet(recognizer.getExpectedTokens()); + const whatFollowsLoopIterationOrRule = expecting.addSet(this.getErrorRecoverySet(recognizer)); + this.consumeUntil(recognizer, whatFollowsLoopIterationOrRule); + } + break; + default: + // do nothing if we can't identify the exact kind of ATN state + } + } + + /** + * This is called by {@link //reportError} when the exception is a + * {@link NoViableAltException}. + * + * @see //reportError + * + * @param recognizer the parser instance + * @param e the recognition exception + */ + reportNoViableAlternative(recognizer, e) { + const tokens = recognizer.getTokenStream() + let input + if(tokens !== null) { + if (e.startToken.type===Token.EOF) { + input = ""; + } else { + input = tokens.getText(new Interval(e.startToken.tokenIndex, e.offendingToken.tokenIndex)); + } + } else { + input = ""; + } + const msg = "no viable alternative at input " + this.escapeWSAndQuote(input) + recognizer.notifyErrorListeners(msg, e.offendingToken, e); + } + + /** + * This is called by {@link //reportError} when the exception is an + * {@link InputMismatchException}. + * + * @see //reportError + * + * @param recognizer the parser instance + * @param e the recognition exception + */ + reportInputMismatch(recognizer, e) { + const msg = "mismatched input " + this.getTokenErrorDisplay(e.offendingToken) + + " expecting " + e.getExpectedTokens().toString(recognizer.literalNames, recognizer.symbolicNames) + recognizer.notifyErrorListeners(msg, e.offendingToken, e); + } + + /** + * This is called by {@link //reportError} when the exception is a + * {@link FailedPredicateException}. + * + * @see //reportError + * + * @param recognizer the parser instance + * @param e the recognition exception + */ + reportFailedPredicate(recognizer, e) { + const ruleName = recognizer.ruleNames[recognizer._ctx.ruleIndex] + const msg = "rule " + ruleName + " " + e.message + recognizer.notifyErrorListeners(msg, e.offendingToken, e); + } + + /** + * This method is called to report a syntax error which requires the removal + * of a token from the input stream. At the time this method is called, the + * erroneous symbol is current {@code LT(1)} symbol and has not yet been + * removed from the input stream. When this method returns, + * {@code recognizer} is in error recovery mode. + * + *

This method is called when {@link //singleTokenDeletion} identifies + * single-token deletion as a viable recovery strategy for a mismatched + * input error.

+ * + *

The default implementation simply returns if the handler is already in + * error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to + * enter error recovery mode, followed by calling + * {@link Parser//notifyErrorListeners}.

+ * + * @param recognizer the parser instance + * + */ + reportUnwantedToken(recognizer) { + if (this.inErrorRecoveryMode(recognizer)) { + return; + } + this.beginErrorCondition(recognizer); + const t = recognizer.getCurrentToken() + const tokenName = this.getTokenErrorDisplay(t) + const expecting = this.getExpectedTokens(recognizer) + const msg = "extraneous input " + tokenName + " expecting " + + expecting.toString(recognizer.literalNames, recognizer.symbolicNames) + recognizer.notifyErrorListeners(msg, t, null); + } + + /** + * This method is called to report a syntax error which requires the + * insertion of a missing token into the input stream. At the time this + * method is called, the missing token has not yet been inserted. When this + * method returns, {@code recognizer} is in error recovery mode. + * + *

This method is called when {@link //singleTokenInsertion} identifies + * single-token insertion as a viable recovery strategy for a mismatched + * input error.

+ * + *

The default implementation simply returns if the handler is already in + * error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to + * enter error recovery mode, followed by calling + * {@link Parser//notifyErrorListeners}.

+ * + * @param recognizer the parser instance + */ + reportMissingToken(recognizer) { + if ( this.inErrorRecoveryMode(recognizer)) { + return; + } + this.beginErrorCondition(recognizer); + const t = recognizer.getCurrentToken() + const expecting = this.getExpectedTokens(recognizer) + const msg = "missing " + expecting.toString(recognizer.literalNames, recognizer.symbolicNames) + + " at " + this.getTokenErrorDisplay(t) + recognizer.notifyErrorListeners(msg, t, null); + } + + /** + *

The default implementation attempts to recover from the mismatched input + * by using single token insertion and deletion as described below. If the + * recovery attempt fails, this method throws an + * {@link InputMismatchException}.

+ * + *

EXTRA TOKEN (single token deletion)

+ * + *

{@code LA(1)} is not what we are looking for. If {@code LA(2)} has the + * right token, however, then assume {@code LA(1)} is some extra spurious + * token and delete it. Then consume and return the next token (which was + * the {@code LA(2)} token) as the successful result of the match operation.

+ * + *

This recovery strategy is implemented by {@link + * //singleTokenDeletion}.

+ * + *

MISSING TOKEN (single token insertion)

+ * + *

If current token (at {@code LA(1)}) is consistent with what could come + * after the expected {@code LA(1)} token, then assume the token is missing + * and use the parser's {@link TokenFactory} to create it on the fly. The + * "insertion" is performed by returning the created token as the successful + * result of the match operation.

+ * + *

This recovery strategy is implemented by {@link + * //singleTokenInsertion}.

+ * + *

EXAMPLE

+ * + *

For example, Input {@code i=(3;} is clearly missing the {@code ')'}. When + * the parser returns from the nested call to {@code expr}, it will have + * call chain:

+ * + *
+     * stat → expr → atom
+     * 
+ * + * and it will be trying to match the {@code ')'} at this point in the + * derivation: + * + *
+     * => ID '=' '(' INT ')' ('+' atom)* ';'
+     * ^
+     * 
+ * + * The attempt to match {@code ')'} will fail when it sees {@code ';'} and + * call {@link //recoverInline}. To recover, it sees that {@code LA(1)==';'} + * is in the set of tokens that can follow the {@code ')'} token reference + * in rule {@code atom}. It can assume that you forgot the {@code ')'}. + */ + recoverInline(recognizer) { + // SINGLE TOKEN DELETION + const matchedSymbol = this.singleTokenDeletion(recognizer) + if (matchedSymbol !== null) { + // we have deleted the extra token. + // now, move past ttype token as if all were ok + recognizer.consume(); + return matchedSymbol; + } + // SINGLE TOKEN INSERTION + if (this.singleTokenInsertion(recognizer)) { + return this.getMissingSymbol(recognizer); + } + // even that didn't work; must throw the exception + throw new InputMismatchException(recognizer); + } + + /** + * This method implements the single-token insertion inline error recovery + * strategy. It is called by {@link //recoverInline} if the single-token + * deletion strategy fails to recover from the mismatched input. If this + * method returns {@code true}, {@code recognizer} will be in error recovery + * mode. + * + *

This method determines whether or not single-token insertion is viable by + * checking if the {@code LA(1)} input symbol could be successfully matched + * if it were instead the {@code LA(2)} symbol. If this method returns + * {@code true}, the caller is responsible for creating and inserting a + * token with the correct type to produce this behavior.

+ * + * @param recognizer the parser instance + * @return {@code true} if single-token insertion is a viable recovery + * strategy for the current mismatched input, otherwise {@code false} + */ + singleTokenInsertion(recognizer) { + const currentSymbolType = recognizer.getTokenStream().LA(1) + // if current token is consistent with what could come after current + // ATN state, then we know we're missing a token; error recovery + // is free to conjure up and insert the missing token + const atn = recognizer._interp.atn + const currentState = atn.states[recognizer.state] + const next = currentState.transitions[0].target + const expectingAtLL2 = atn.nextTokens(next, recognizer._ctx) + if (expectingAtLL2.contains(currentSymbolType) ){ + this.reportMissingToken(recognizer); + return true; + } else { + return false; + } + } + + /** + * This method implements the single-token deletion inline error recovery + * strategy. It is called by {@link //recoverInline} to attempt to recover + * from mismatched input. If this method returns null, the parser and error + * handler state will not have changed. If this method returns non-null, + * {@code recognizer} will not be in error recovery mode since the + * returned token was a successful match. + * + *

If the single-token deletion is successful, this method calls + * {@link //reportUnwantedToken} to report the error, followed by + * {@link Parser//consume} to actually "delete" the extraneous token. Then, + * before returning {@link //reportMatch} is called to signal a successful + * match.

+ * + * @param recognizer the parser instance + * @return the successfully matched {@link Token} instance if single-token + * deletion successfully recovers from the mismatched input, otherwise + * {@code null} + */ + singleTokenDeletion(recognizer) { + const nextTokenType = recognizer.getTokenStream().LA(2) + const expecting = this.getExpectedTokens(recognizer) + if (expecting.contains(nextTokenType)) { + this.reportUnwantedToken(recognizer); + // print("recoverFromMismatchedToken deleting " \ + // + str(recognizer.getTokenStream().LT(1)) \ + // + " since " + str(recognizer.getTokenStream().LT(2)) \ + // + " is what we want", file=sys.stderr) + recognizer.consume(); // simply delete extra token + // we want to return the token we're actually matching + const matchedSymbol = recognizer.getCurrentToken() + this.reportMatch(recognizer); // we know current token is correct + return matchedSymbol; + } else { + return null; + } + } + + /** + * Conjure up a missing token during error recovery. + * + * The recognizer attempts to recover from single missing + * symbols. But, actions might refer to that missing symbol. + * For example, x=ID {f($x);}. The action clearly assumes + * that there has been an identifier matched previously and that + * $x points at that token. If that token is missing, but + * the next token in the stream is what we want we assume that + * this token is missing and we keep going. Because we + * have to return some token to replace the missing token, + * we have to conjure one up. This method gives the user control + * over the tokens returned for missing tokens. Mostly, + * you will want to create something special for identifier + * tokens. For literals such as '{' and ',', the default + * action in the parser or tree parser works. It simply creates + * a CommonToken of the appropriate type. The text will be the token. + * If you change what tokens must be created by the lexer, + * override this method to create the appropriate tokens. + * + */ + getMissingSymbol(recognizer) { + const currentSymbol = recognizer.getCurrentToken() + const expecting = this.getExpectedTokens(recognizer) + const expectedTokenType = expecting.first() // get any element + let tokenText + if (expectedTokenType===Token.EOF) { + tokenText = ""; + } else { + tokenText = ""; + } + let current = currentSymbol + const lookback = recognizer.getTokenStream().LT(-1) + if (current.type===Token.EOF && lookback !== null) { + current = lookback; + } + return recognizer.getTokenFactory().create(current.source, + expectedTokenType, tokenText, Token.DEFAULT_CHANNEL, + -1, -1, current.line, current.column); + } + + getExpectedTokens(recognizer) { + return recognizer.getExpectedTokens(); + } + + /** + * How should a token be displayed in an error message? The default + * is to display just the text, but during development you might + * want to have a lot of information spit out. Override in that case + * to use t.toString() (which, for CommonToken, dumps everything about + * the token). This is better than forcing you to override a method in + * your token objects because you don't have to go modify your lexer + * so that it creates a new Java type. + */ + getTokenErrorDisplay(t) { + if (t === null) { + return ""; + } + let s = t.text + if (s === null) { + if (t.type===Token.EOF) { + s = ""; + } else { + s = "<" + t.type + ">"; + } + } + return this.escapeWSAndQuote(s); + } + + escapeWSAndQuote(s) { + s = s.replace(/\n/g,"\\n"); + s = s.replace(/\r/g,"\\r"); + s = s.replace(/\t/g,"\\t"); + return "'" + s + "'"; + } + + /** + * Compute the error recovery set for the current rule. During + * rule invocation, the parser pushes the set of tokens that can + * follow that rule reference on the stack; this amounts to + * computing FIRST of what follows the rule reference in the + * enclosing rule. See LinearApproximator.FIRST(). + * This local follow set only includes tokens + * from within the rule; i.e., the FIRST computation done by + * ANTLR stops at the end of a rule. + * + * EXAMPLE + * + * When you find a "no viable alt exception", the input is not + * consistent with any of the alternatives for rule r. The best + * thing to do is to consume tokens until you see something that + * can legally follow a call to r//or* any rule that called r. + * You don't want the exact set of viable next tokens because the + * input might just be missing a token--you might consume the + * rest of the input looking for one of the missing tokens. + * + * Consider grammar: + * + * a : '[' b ']' + * | '(' b ')' + * ; + * b : c '^' INT ; + * c : ID + * | INT + * ; + * + * At each rule invocation, the set of tokens that could follow + * that rule is pushed on a stack. Here are the various + * context-sensitive follow sets: + * + * FOLLOW(b1_in_a) = FIRST(']') = ']' + * FOLLOW(b2_in_a) = FIRST(')') = ')' + * FOLLOW(c_in_b) = FIRST('^') = '^' + * + * Upon erroneous input "[]", the call chain is + * + * a -> b -> c + * + * and, hence, the follow context stack is: + * + * depth follow set start of rule execution + * 0 a (from main()) + * 1 ']' b + * 2 '^' c + * + * Notice that ')' is not included, because b would have to have + * been called from a different context in rule a for ')' to be + * included. + * + * For error recovery, we cannot consider FOLLOW(c) + * (context-sensitive or otherwise). We need the combined set of + * all context-sensitive FOLLOW sets--the set of all tokens that + * could follow any reference in the call chain. We need to + * resync to one of those tokens. Note that FOLLOW(c)='^' and if + * we resync'd to that token, we'd consume until EOF. We need to + * sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}. + * In this case, for input "[]", LA(1) is ']' and in the set, so we would + * not consume anything. After printing an error, rule c would + * return normally. Rule b would not find the required '^' though. + * At this point, it gets a mismatched token error and throws an + * exception (since LA(1) is not in the viable following token + * set). The rule exception handler tries to recover, but finds + * the same recovery set and doesn't consume anything. Rule b + * exits normally returning to rule a. Now it finds the ']' (and + * with the successful match exits errorRecovery mode). + * + * So, you can see that the parser walks up the call chain looking + * for the token that was a member of the recovery set. + * + * Errors are not generated in errorRecovery mode. + * + * ANTLR's error recovery mechanism is based upon original ideas: + * + * "Algorithms + Data Structures = Programs" by Niklaus Wirth + * + * and + * + * "A note on error recovery in recursive descent parsers": + * http://portal.acm.org/citation.cfm?id=947902.947905 + * + * Later, Josef Grosch had some good ideas: + * + * "Efficient and Comfortable Error Recovery in Recursive Descent + * Parsers": + * ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip + * + * Like Grosch I implement context-sensitive FOLLOW sets that are combined + * at run-time upon error to avoid overhead during parsing. + */ + getErrorRecoverySet(recognizer) { + const atn = recognizer._interp.atn + let ctx = recognizer._ctx + const recoverSet = new IntervalSet() + while (ctx !== null && ctx.invokingState>=0) { + // compute what follows who invoked us + const invokingState = atn.states[ctx.invokingState] + const rt = invokingState.transitions[0] + const follow = atn.nextTokens(rt.followState) + recoverSet.addSet(follow); + ctx = ctx.parentCtx; + } + recoverSet.removeOne(Token.EPSILON); + return recoverSet; + } + +// Consume tokens until one matches the given token set.// + consumeUntil(recognizer, set) { + let ttype = recognizer.getTokenStream().LA(1) + while( ttype !== Token.EOF && !set.contains(ttype)) { + recognizer.consume(); + ttype = recognizer.getTokenStream().LA(1); + } + } +} + diff --git a/runtime/JavaScript/src/antlr4/error/DiagnosticErrorListener.js b/runtime/JavaScript/src/antlr4/error/DiagnosticErrorListener.js index 4536fa4845..110f2f056a 100644 --- a/runtime/JavaScript/src/antlr4/error/DiagnosticErrorListener.js +++ b/runtime/JavaScript/src/antlr4/error/DiagnosticErrorListener.js @@ -1,11 +1,11 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {BitSet} = require('./../Utils'); -const {ErrorListener} = require('./ErrorListener') -const {Interval} = require('./../IntervalSet') +import ErrorListener from './ErrorListener.js'; +import Interval from '../misc/Interval.js'; +import BitSet from "../misc/BitSet.js"; /** @@ -27,7 +27,7 @@ const {Interval} = require('./../IntervalSet') * this situation occurs. * */ -class DiagnosticErrorListener extends ErrorListener { +export default class DiagnosticErrorListener extends ErrorListener { constructor(exactOnly) { super(); exactOnly = exactOnly || true; @@ -101,5 +101,3 @@ class DiagnosticErrorListener extends ErrorListener { return `{${result.values().join(", ")}}`; } } - -module.exports = DiagnosticErrorListener diff --git a/runtime/JavaScript/src/antlr4/error/ErrorListener.js b/runtime/JavaScript/src/antlr4/error/ErrorListener.js index 41da189f1d..49304f04e4 100644 --- a/runtime/JavaScript/src/antlr4/error/ErrorListener.js +++ b/runtime/JavaScript/src/antlr4/error/ErrorListener.js @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ @@ -8,7 +8,7 @@ * default implementation of each method does nothing, but can be overridden as * necessary. */ -class ErrorListener { +export default class ErrorListener { syntaxError(recognizer, offendingSymbol, line, column, msg, e) { } @@ -21,62 +21,3 @@ class ErrorListener { reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs) { } } - -/** - * {@inheritDoc} - * - *

- * This implementation prints messages to {@link System//err} containing the - * values of {@code line}, {@code charPositionInLine}, and {@code msg} using - * the following format.

- * - *
- * line line:charPositionInLine msg
- * 
- * - */ -class ConsoleErrorListener extends ErrorListener { - constructor() { - super(); - } - - syntaxError(recognizer, offendingSymbol, line, column, msg, e) { - console.error("line " + line + ":" + column + " " + msg); - } -} - - -/** - * Provides a default instance of {@link ConsoleErrorListener}. - */ -ConsoleErrorListener.INSTANCE = new ConsoleErrorListener(); - -class ProxyErrorListener extends ErrorListener { - constructor(delegates) { - super(); - if (delegates===null) { - throw "delegates"; - } - this.delegates = delegates; - return this; - } - - syntaxError(recognizer, offendingSymbol, line, column, msg, e) { - this.delegates.map(d => d.syntaxError(recognizer, offendingSymbol, line, column, msg, e)); - } - - reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) { - this.delegates.map(d => d.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs)); - } - - reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) { - this.delegates.map(d => d.reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs)); - } - - reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs) { - this.delegates.map(d => d.reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs)); - } -} - -module.exports = {ErrorListener, ConsoleErrorListener, ProxyErrorListener} - diff --git a/runtime/JavaScript/src/antlr4/error/ErrorStrategy.js b/runtime/JavaScript/src/antlr4/error/ErrorStrategy.js index 3da80f28bf..bcefdb0478 100644 --- a/runtime/JavaScript/src/antlr4/error/ErrorStrategy.js +++ b/runtime/JavaScript/src/antlr4/error/ErrorStrategy.js @@ -1,14 +1,9 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Token} = require('./../Token') -const {NoViableAltException, InputMismatchException, FailedPredicateException, ParseCancellationException} = require('./Errors') -const {ATNState} = require('./../atn/ATNState') -const {Interval, IntervalSet} = require('./../IntervalSet') - -class ErrorStrategy { +export default class ErrorStrategy { reset(recognizer) { } @@ -30,747 +25,3 @@ class ErrorStrategy { } -/** - * This is the default implementation of {@link ANTLRErrorStrategy} used for - * error reporting and recovery in ANTLR parsers. -*/ -class DefaultErrorStrategy extends ErrorStrategy { - constructor() { - super(); - /** - * Indicates whether the error strategy is currently "recovering from an - * error". This is used to suppress reporting multiple error messages while - * attempting to recover from a detected syntax error. - * - * @see //inErrorRecoveryMode - */ - this.errorRecoveryMode = false; - - /** - * The index into the input stream where the last error occurred. - * This is used to prevent infinite loops where an error is found - * but no token is consumed during recovery...another error is found, - * ad nauseum. This is a failsafe mechanism to guarantee that at least - * one token/tree node is consumed for two errors. - */ - this.lastErrorIndex = -1; - this.lastErrorStates = null; - this.nextTokensContext = null; - this.nextTokenState = 0; - } - - /** - *

The default implementation simply calls {@link //endErrorCondition} to - * ensure that the handler is not in error recovery mode.

- */ - reset(recognizer) { - this.endErrorCondition(recognizer); - } - - /** - * This method is called to enter error recovery mode when a recognition - * exception is reported. - * - * @param recognizer the parser instance - */ - beginErrorCondition(recognizer) { - this.errorRecoveryMode = true; - } - - inErrorRecoveryMode(recognizer) { - return this.errorRecoveryMode; - } - - /** - * This method is called to leave error recovery mode after recovering from - * a recognition exception. - * @param recognizer - */ - endErrorCondition(recognizer) { - this.errorRecoveryMode = false; - this.lastErrorStates = null; - this.lastErrorIndex = -1; - } - - /** - * {@inheritDoc} - *

The default implementation simply calls {@link //endErrorCondition}.

- */ - reportMatch(recognizer) { - this.endErrorCondition(recognizer); - } - - /** - * {@inheritDoc} - * - *

The default implementation returns immediately if the handler is already - * in error recovery mode. Otherwise, it calls {@link //beginErrorCondition} - * and dispatches the reporting task based on the runtime type of {@code e} - * according to the following table.

- * - *
    - *
  • {@link NoViableAltException}: Dispatches the call to - * {@link //reportNoViableAlternative}
  • - *
  • {@link InputMismatchException}: Dispatches the call to - * {@link //reportInputMismatch}
  • - *
  • {@link FailedPredicateException}: Dispatches the call to - * {@link //reportFailedPredicate}
  • - *
  • All other types: calls {@link Parser//notifyErrorListeners} to report - * the exception
  • - *
- */ - reportError(recognizer, e) { - // if we've already reported an error and have not matched a token - // yet successfully, don't report any errors. - if(this.inErrorRecoveryMode(recognizer)) { - return; // don't report spurious errors - } - this.beginErrorCondition(recognizer); - if ( e instanceof NoViableAltException ) { - this.reportNoViableAlternative(recognizer, e); - } else if ( e instanceof InputMismatchException ) { - this.reportInputMismatch(recognizer, e); - } else if ( e instanceof FailedPredicateException ) { - this.reportFailedPredicate(recognizer, e); - } else { - console.log("unknown recognition error type: " + e.constructor.name); - console.log(e.stack); - recognizer.notifyErrorListeners(e.getOffendingToken(), e.getMessage(), e); - } - } - - /** - * - * {@inheritDoc} - * - *

The default implementation resynchronizes the parser by consuming tokens - * until we find one in the resynchronization set--loosely the set of tokens - * that can follow the current rule.

- * - */ - recover(recognizer, e) { - if (this.lastErrorIndex===recognizer.getInputStream().index && - this.lastErrorStates !== null && this.lastErrorStates.indexOf(recognizer.state)>=0) { - // uh oh, another error at same token index and previously-visited - // state in ATN; must be a case where LT(1) is in the recovery - // token set so nothing got consumed. Consume a single token - // at least to prevent an infinite loop; this is a failsafe. - recognizer.consume(); - } - this.lastErrorIndex = recognizer._input.index; - if (this.lastErrorStates === null) { - this.lastErrorStates = []; - } - this.lastErrorStates.push(recognizer.state); - const followSet = this.getErrorRecoverySet(recognizer) - this.consumeUntil(recognizer, followSet); - } - - /** - * The default implementation of {@link ANTLRErrorStrategy//sync} makes sure - * that the current lookahead symbol is consistent with what were expecting - * at this point in the ATN. You can call this anytime but ANTLR only - * generates code to check before subrules/loops and each iteration. - * - *

Implements Jim Idle's magic sync mechanism in closures and optional - * subrules. E.g.,

- * - *
-     * a : sync ( stuff sync )* ;
-     * sync : {consume to what can follow sync} ;
-     * 
- * - * At the start of a sub rule upon error, {@link //sync} performs single - * token deletion, if possible. If it can't do that, it bails on the current - * rule and uses the default error recovery, which consumes until the - * resynchronization set of the current rule. - * - *

If the sub rule is optional ({@code (...)?}, {@code (...)*}, or block - * with an empty alternative), then the expected set includes what follows - * the subrule.

- * - *

During loop iteration, it consumes until it sees a token that can start a - * sub rule or what follows loop. Yes, that is pretty aggressive. We opt to - * stay in the loop as long as possible.

- * - *

ORIGINS

- * - *

Previous versions of ANTLR did a poor job of their recovery within loops. - * A single mismatch token or missing token would force the parser to bail - * out of the entire rules surrounding the loop. So, for rule

- * - *
-     * classDef : 'class' ID '{' member* '}'
-     * 
- * - * input with an extra token between members would force the parser to - * consume until it found the next class definition rather than the next - * member definition of the current class. - * - *

This functionality cost a little bit of effort because the parser has to - * compare token set at the start of the loop and at each iteration. If for - * some reason speed is suffering for you, you can turn off this - * functionality by simply overriding this method as a blank { }.

- * - */ - sync(recognizer) { - // If already recovering, don't try to sync - if (this.inErrorRecoveryMode(recognizer)) { - return; - } - const s = recognizer._interp.atn.states[recognizer.state]; - const la = recognizer.getTokenStream().LA(1); - // try cheaper subset first; might get lucky. seems to shave a wee bit off - const nextTokens = recognizer.atn.nextTokens(s); - if(nextTokens.contains(la)) { - this.nextTokensContext = null; - this.nextTokenState = ATNState.INVALID_STATE_NUMBER; - return; - } else if (nextTokens.contains(Token.EPSILON)) { - if(this.nextTokensContext === null) { - // It's possible the next token won't match information tracked - // by sync is restricted for performance. - this.nextTokensContext = recognizer._ctx; - this.nextTokensState = recognizer._stateNumber; - } - return; - } - switch (s.stateType) { - case ATNState.BLOCK_START: - case ATNState.STAR_BLOCK_START: - case ATNState.PLUS_BLOCK_START: - case ATNState.STAR_LOOP_ENTRY: - // report error and recover if possible - if( this.singleTokenDeletion(recognizer) !== null) { - return; - } else { - throw new InputMismatchException(recognizer); - } - case ATNState.PLUS_LOOP_BACK: - case ATNState.STAR_LOOP_BACK: - this.reportUnwantedToken(recognizer); - const expecting = new IntervalSet() - expecting.addSet(recognizer.getExpectedTokens()); - const whatFollowsLoopIterationOrRule = expecting.addSet(this.getErrorRecoverySet(recognizer)) - this.consumeUntil(recognizer, whatFollowsLoopIterationOrRule); - break; - default: - // do nothing if we can't identify the exact kind of ATN state - } - } - - /** - * This is called by {@link //reportError} when the exception is a - * {@link NoViableAltException}. - * - * @see //reportError - * - * @param recognizer the parser instance - * @param e the recognition exception - */ - reportNoViableAlternative(recognizer, e) { - const tokens = recognizer.getTokenStream() - let input - if(tokens !== null) { - if (e.startToken.type===Token.EOF) { - input = ""; - } else { - input = tokens.getText(new Interval(e.startToken.tokenIndex, e.offendingToken.tokenIndex)); - } - } else { - input = ""; - } - const msg = "no viable alternative at input " + this.escapeWSAndQuote(input) - recognizer.notifyErrorListeners(msg, e.offendingToken, e); - } - - /** - * This is called by {@link //reportError} when the exception is an - * {@link InputMismatchException}. - * - * @see //reportError - * - * @param recognizer the parser instance - * @param e the recognition exception - */ - reportInputMismatch(recognizer, e) { - const msg = "mismatched input " + this.getTokenErrorDisplay(e.offendingToken) + - " expecting " + e.getExpectedTokens().toString(recognizer.literalNames, recognizer.symbolicNames) - recognizer.notifyErrorListeners(msg, e.offendingToken, e); - } - - /** - * This is called by {@link //reportError} when the exception is a - * {@link FailedPredicateException}. - * - * @see //reportError - * - * @param recognizer the parser instance - * @param e the recognition exception - */ - reportFailedPredicate(recognizer, e) { - const ruleName = recognizer.ruleNames[recognizer._ctx.ruleIndex] - const msg = "rule " + ruleName + " " + e.message - recognizer.notifyErrorListeners(msg, e.offendingToken, e); - } - - /** - * This method is called to report a syntax error which requires the removal - * of a token from the input stream. At the time this method is called, the - * erroneous symbol is current {@code LT(1)} symbol and has not yet been - * removed from the input stream. When this method returns, - * {@code recognizer} is in error recovery mode. - * - *

This method is called when {@link //singleTokenDeletion} identifies - * single-token deletion as a viable recovery strategy for a mismatched - * input error.

- * - *

The default implementation simply returns if the handler is already in - * error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to - * enter error recovery mode, followed by calling - * {@link Parser//notifyErrorListeners}.

- * - * @param recognizer the parser instance - * - */ - reportUnwantedToken(recognizer) { - if (this.inErrorRecoveryMode(recognizer)) { - return; - } - this.beginErrorCondition(recognizer); - const t = recognizer.getCurrentToken() - const tokenName = this.getTokenErrorDisplay(t) - const expecting = this.getExpectedTokens(recognizer) - const msg = "extraneous input " + tokenName + " expecting " + - expecting.toString(recognizer.literalNames, recognizer.symbolicNames) - recognizer.notifyErrorListeners(msg, t, null); - } - - /** - * This method is called to report a syntax error which requires the - * insertion of a missing token into the input stream. At the time this - * method is called, the missing token has not yet been inserted. When this - * method returns, {@code recognizer} is in error recovery mode. - * - *

This method is called when {@link //singleTokenInsertion} identifies - * single-token insertion as a viable recovery strategy for a mismatched - * input error.

- * - *

The default implementation simply returns if the handler is already in - * error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to - * enter error recovery mode, followed by calling - * {@link Parser//notifyErrorListeners}.

- * - * @param recognizer the parser instance - */ - reportMissingToken(recognizer) { - if ( this.inErrorRecoveryMode(recognizer)) { - return; - } - this.beginErrorCondition(recognizer); - const t = recognizer.getCurrentToken() - const expecting = this.getExpectedTokens(recognizer) - const msg = "missing " + expecting.toString(recognizer.literalNames, recognizer.symbolicNames) + - " at " + this.getTokenErrorDisplay(t) - recognizer.notifyErrorListeners(msg, t, null); - } - - /** - *

The default implementation attempts to recover from the mismatched input - * by using single token insertion and deletion as described below. If the - * recovery attempt fails, this method throws an - * {@link InputMismatchException}.

- * - *

EXTRA TOKEN (single token deletion)

- * - *

{@code LA(1)} is not what we are looking for. If {@code LA(2)} has the - * right token, however, then assume {@code LA(1)} is some extra spurious - * token and delete it. Then consume and return the next token (which was - * the {@code LA(2)} token) as the successful result of the match operation.

- * - *

This recovery strategy is implemented by {@link - * //singleTokenDeletion}.

- * - *

MISSING TOKEN (single token insertion)

- * - *

If current token (at {@code LA(1)}) is consistent with what could come - * after the expected {@code LA(1)} token, then assume the token is missing - * and use the parser's {@link TokenFactory} to create it on the fly. The - * "insertion" is performed by returning the created token as the successful - * result of the match operation.

- * - *

This recovery strategy is implemented by {@link - * //singleTokenInsertion}.

- * - *

EXAMPLE

- * - *

For example, Input {@code i=(3;} is clearly missing the {@code ')'}. When - * the parser returns from the nested call to {@code expr}, it will have - * call chain:

- * - *
-     * stat → expr → atom
-     * 
- * - * and it will be trying to match the {@code ')'} at this point in the - * derivation: - * - *
-     * => ID '=' '(' INT ')' ('+' atom)* ';'
-     * ^
-     * 
- * - * The attempt to match {@code ')'} will fail when it sees {@code ';'} and - * call {@link //recoverInline}. To recover, it sees that {@code LA(1)==';'} - * is in the set of tokens that can follow the {@code ')'} token reference - * in rule {@code atom}. It can assume that you forgot the {@code ')'}. - */ - recoverInline(recognizer) { - // SINGLE TOKEN DELETION - const matchedSymbol = this.singleTokenDeletion(recognizer) - if (matchedSymbol !== null) { - // we have deleted the extra token. - // now, move past ttype token as if all were ok - recognizer.consume(); - return matchedSymbol; - } - // SINGLE TOKEN INSERTION - if (this.singleTokenInsertion(recognizer)) { - return this.getMissingSymbol(recognizer); - } - // even that didn't work; must throw the exception - throw new InputMismatchException(recognizer); - } - - /** - * This method implements the single-token insertion inline error recovery - * strategy. It is called by {@link //recoverInline} if the single-token - * deletion strategy fails to recover from the mismatched input. If this - * method returns {@code true}, {@code recognizer} will be in error recovery - * mode. - * - *

This method determines whether or not single-token insertion is viable by - * checking if the {@code LA(1)} input symbol could be successfully matched - * if it were instead the {@code LA(2)} symbol. If this method returns - * {@code true}, the caller is responsible for creating and inserting a - * token with the correct type to produce this behavior.

- * - * @param recognizer the parser instance - * @return {@code true} if single-token insertion is a viable recovery - * strategy for the current mismatched input, otherwise {@code false} - */ - singleTokenInsertion(recognizer) { - const currentSymbolType = recognizer.getTokenStream().LA(1) - // if current token is consistent with what could come after current - // ATN state, then we know we're missing a token; error recovery - // is free to conjure up and insert the missing token - const atn = recognizer._interp.atn - const currentState = atn.states[recognizer.state] - const next = currentState.transitions[0].target - const expectingAtLL2 = atn.nextTokens(next, recognizer._ctx) - if (expectingAtLL2.contains(currentSymbolType) ){ - this.reportMissingToken(recognizer); - return true; - } else { - return false; - } - } - - /** - * This method implements the single-token deletion inline error recovery - * strategy. It is called by {@link //recoverInline} to attempt to recover - * from mismatched input. If this method returns null, the parser and error - * handler state will not have changed. If this method returns non-null, - * {@code recognizer} will not be in error recovery mode since the - * returned token was a successful match. - * - *

If the single-token deletion is successful, this method calls - * {@link //reportUnwantedToken} to report the error, followed by - * {@link Parser//consume} to actually "delete" the extraneous token. Then, - * before returning {@link //reportMatch} is called to signal a successful - * match.

- * - * @param recognizer the parser instance - * @return the successfully matched {@link Token} instance if single-token - * deletion successfully recovers from the mismatched input, otherwise - * {@code null} - */ - singleTokenDeletion(recognizer) { - const nextTokenType = recognizer.getTokenStream().LA(2) - const expecting = this.getExpectedTokens(recognizer) - if (expecting.contains(nextTokenType)) { - this.reportUnwantedToken(recognizer); - // print("recoverFromMismatchedToken deleting " \ - // + str(recognizer.getTokenStream().LT(1)) \ - // + " since " + str(recognizer.getTokenStream().LT(2)) \ - // + " is what we want", file=sys.stderr) - recognizer.consume(); // simply delete extra token - // we want to return the token we're actually matching - const matchedSymbol = recognizer.getCurrentToken() - this.reportMatch(recognizer); // we know current token is correct - return matchedSymbol; - } else { - return null; - } - } - - /** - * Conjure up a missing token during error recovery. - * - * The recognizer attempts to recover from single missing - * symbols. But, actions might refer to that missing symbol. - * For example, x=ID {f($x);}. The action clearly assumes - * that there has been an identifier matched previously and that - * $x points at that token. If that token is missing, but - * the next token in the stream is what we want we assume that - * this token is missing and we keep going. Because we - * have to return some token to replace the missing token, - * we have to conjure one up. This method gives the user control - * over the tokens returned for missing tokens. Mostly, - * you will want to create something special for identifier - * tokens. For literals such as '{' and ',', the default - * action in the parser or tree parser works. It simply creates - * a CommonToken of the appropriate type. The text will be the token. - * If you change what tokens must be created by the lexer, - * override this method to create the appropriate tokens. - * - */ - getMissingSymbol(recognizer) { - const currentSymbol = recognizer.getCurrentToken() - const expecting = this.getExpectedTokens(recognizer) - const expectedTokenType = expecting.first() // get any element - let tokenText - if (expectedTokenType===Token.EOF) { - tokenText = ""; - } else { - tokenText = ""; - } - let current = currentSymbol - const lookback = recognizer.getTokenStream().LT(-1) - if (current.type===Token.EOF && lookback !== null) { - current = lookback; - } - return recognizer.getTokenFactory().create(current.source, - expectedTokenType, tokenText, Token.DEFAULT_CHANNEL, - -1, -1, current.line, current.column); - } - - getExpectedTokens(recognizer) { - return recognizer.getExpectedTokens(); - } - - /** - * How should a token be displayed in an error message? The default - * is to display just the text, but during development you might - * want to have a lot of information spit out. Override in that case - * to use t.toString() (which, for CommonToken, dumps everything about - * the token). This is better than forcing you to override a method in - * your token objects because you don't have to go modify your lexer - * so that it creates a new Java type. - */ - getTokenErrorDisplay(t) { - if (t === null) { - return ""; - } - let s = t.text - if (s === null) { - if (t.type===Token.EOF) { - s = ""; - } else { - s = "<" + t.type + ">"; - } - } - return this.escapeWSAndQuote(s); - } - - escapeWSAndQuote(s) { - s = s.replace(/\n/g,"\\n"); - s = s.replace(/\r/g,"\\r"); - s = s.replace(/\t/g,"\\t"); - return "'" + s + "'"; - } - - /** - * Compute the error recovery set for the current rule. During - * rule invocation, the parser pushes the set of tokens that can - * follow that rule reference on the stack; this amounts to - * computing FIRST of what follows the rule reference in the - * enclosing rule. See LinearApproximator.FIRST(). - * This local follow set only includes tokens - * from within the rule; i.e., the FIRST computation done by - * ANTLR stops at the end of a rule. - * - * EXAMPLE - * - * When you find a "no viable alt exception", the input is not - * consistent with any of the alternatives for rule r. The best - * thing to do is to consume tokens until you see something that - * can legally follow a call to r//or* any rule that called r. - * You don't want the exact set of viable next tokens because the - * input might just be missing a token--you might consume the - * rest of the input looking for one of the missing tokens. - * - * Consider grammar: - * - * a : '[' b ']' - * | '(' b ')' - * ; - * b : c '^' INT ; - * c : ID - * | INT - * ; - * - * At each rule invocation, the set of tokens that could follow - * that rule is pushed on a stack. Here are the various - * context-sensitive follow sets: - * - * FOLLOW(b1_in_a) = FIRST(']') = ']' - * FOLLOW(b2_in_a) = FIRST(')') = ')' - * FOLLOW(c_in_b) = FIRST('^') = '^' - * - * Upon erroneous input "[]", the call chain is - * - * a -> b -> c - * - * and, hence, the follow context stack is: - * - * depth follow set start of rule execution - * 0 a (from main()) - * 1 ']' b - * 2 '^' c - * - * Notice that ')' is not included, because b would have to have - * been called from a different context in rule a for ')' to be - * included. - * - * For error recovery, we cannot consider FOLLOW(c) - * (context-sensitive or otherwise). We need the combined set of - * all context-sensitive FOLLOW sets--the set of all tokens that - * could follow any reference in the call chain. We need to - * resync to one of those tokens. Note that FOLLOW(c)='^' and if - * we resync'd to that token, we'd consume until EOF. We need to - * sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}. - * In this case, for input "[]", LA(1) is ']' and in the set, so we would - * not consume anything. After printing an error, rule c would - * return normally. Rule b would not find the required '^' though. - * At this point, it gets a mismatched token error and throws an - * exception (since LA(1) is not in the viable following token - * set). The rule exception handler tries to recover, but finds - * the same recovery set and doesn't consume anything. Rule b - * exits normally returning to rule a. Now it finds the ']' (and - * with the successful match exits errorRecovery mode). - * - * So, you can see that the parser walks up the call chain looking - * for the token that was a member of the recovery set. - * - * Errors are not generated in errorRecovery mode. - * - * ANTLR's error recovery mechanism is based upon original ideas: - * - * "Algorithms + Data Structures = Programs" by Niklaus Wirth - * - * and - * - * "A note on error recovery in recursive descent parsers": - * http://portal.acm.org/citation.cfm?id=947902.947905 - * - * Later, Josef Grosch had some good ideas: - * - * "Efficient and Comfortable Error Recovery in Recursive Descent - * Parsers": - * ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip - * - * Like Grosch I implement context-sensitive FOLLOW sets that are combined - * at run-time upon error to avoid overhead during parsing. - */ - getErrorRecoverySet(recognizer) { - const atn = recognizer._interp.atn - let ctx = recognizer._ctx - const recoverSet = new IntervalSet() - while (ctx !== null && ctx.invokingState>=0) { - // compute what follows who invoked us - const invokingState = atn.states[ctx.invokingState] - const rt = invokingState.transitions[0] - const follow = atn.nextTokens(rt.followState) - recoverSet.addSet(follow); - ctx = ctx.parentCtx; - } - recoverSet.removeOne(Token.EPSILON); - return recoverSet; - } - -// Consume tokens until one matches the given token set.// - consumeUntil(recognizer, set) { - let ttype = recognizer.getTokenStream().LA(1) - while( ttype !== Token.EOF && !set.contains(ttype)) { - recognizer.consume(); - ttype = recognizer.getTokenStream().LA(1); - } - } -} - - -/** - * This implementation of {@link ANTLRErrorStrategy} responds to syntax errors - * by immediately canceling the parse operation with a - * {@link ParseCancellationException}. The implementation ensures that the - * {@link ParserRuleContext//exception} field is set for all parse tree nodes - * that were not completed prior to encountering the error. - * - *

- * This error strategy is useful in the following scenarios.

- * - *
    - *
  • Two-stage parsing: This error strategy allows the first - * stage of two-stage parsing to immediately terminate if an error is - * encountered, and immediately fall back to the second stage. In addition to - * avoiding wasted work by attempting to recover from errors here, the empty - * implementation of {@link BailErrorStrategy//sync} improves the performance of - * the first stage.
  • - *
  • Silent validation: When syntax errors are not being - * reported or logged, and the parse result is simply ignored if errors occur, - * the {@link BailErrorStrategy} avoids wasting work on recovering from errors - * when the result will be ignored either way.
  • - *
- * - *

- * {@code myparser.setErrorHandler(new BailErrorStrategy());}

- * - * @see Parser//setErrorHandler(ANTLRErrorStrategy) - * */ -class BailErrorStrategy extends DefaultErrorStrategy { - constructor() { - super(); - } - - /** - * Instead of recovering from exception {@code e}, re-throw it wrapped - * in a {@link ParseCancellationException} so it is not caught by the - * rule function catches. Use {@link Exception//getCause()} to get the - * original {@link RecognitionException}. - */ - recover(recognizer, e) { - let context = recognizer._ctx - while (context !== null) { - context.exception = e; - context = context.parentCtx; - } - throw new ParseCancellationException(e); - } - - /** - * Make sure we don't attempt to recover inline; if the parser - * successfully recovers, it won't throw an exception. - */ - recoverInline(recognizer) { - this.recover(recognizer, new InputMismatchException(recognizer)); - } - -// Make sure we don't attempt to recover from problems in subrules.// - sync(recognizer) { - // pass - } -} - - -module.exports = {BailErrorStrategy, DefaultErrorStrategy}; diff --git a/runtime/JavaScript/src/antlr4/error/Errors.js b/runtime/JavaScript/src/antlr4/error/Errors.js deleted file mode 100644 index 712d91798d..0000000000 --- a/runtime/JavaScript/src/antlr4/error/Errors.js +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. - * Use of this file is governed by the BSD 3-clause license that - * can be found in the LICENSE.txt file in the project root. - */ - -/** - * The root of the ANTLR exception hierarchy. In general, ANTLR tracks just - * 3 kinds of errors: prediction errors, failed predicate errors, and - * mismatched input errors. In each case, the parser knows where it is - * in the input, where it is in the ATN, the rule invocation stack, - * and what kind of problem occurred. - */ - -const {PredicateTransition} = require('./../atn/Transition'); -const {Interval} = require('../IntervalSet').Interval; - -class RecognitionException extends Error { - constructor(params) { - super(params.message); - if (!!Error.captureStackTrace) { - Error.captureStackTrace(this, RecognitionException); - } else { - var stack = new Error().stack; - } - this.message = params.message; - this.recognizer = params.recognizer; - this.input = params.input; - this.ctx = params.ctx; - /** - * The current {@link Token} when an error occurred. Since not all streams - * support accessing symbols by index, we have to track the {@link Token} - * instance itself - */ - this.offendingToken = null; - /** - * Get the ATN state number the parser was in at the time the error - * occurred. For {@link NoViableAltException} and - * {@link LexerNoViableAltException} exceptions, this is the - * {@link DecisionState} number. For others, it is the state whose outgoing - * edge we couldn't match. - */ - this.offendingState = -1; - if (this.recognizer!==null) { - this.offendingState = this.recognizer.state; - } - } - - /** - * Gets the set of input symbols which could potentially follow the - * previously matched symbol at the time this exception was thrown. - * - *

If the set of expected tokens is not known and could not be computed, - * this method returns {@code null}.

- * - * @return The set of token types that could potentially follow the current - * state in the ATN, or {@code null} if the information is not available. - */ - getExpectedTokens() { - if (this.recognizer!==null) { - return this.recognizer.atn.getExpectedTokens(this.offendingState, this.ctx); - } else { - return null; - } - } - - //

If the state number is not known, this method returns -1.

- toString() { - return this.message; - } -} - -class LexerNoViableAltException extends RecognitionException { - constructor(lexer, input, startIndex, deadEndConfigs) { - super({message: "", recognizer: lexer, input: input, ctx: null}); - this.startIndex = startIndex; - this.deadEndConfigs = deadEndConfigs; - } - - toString() { - let symbol = ""; - if (this.startIndex >= 0 && this.startIndex < this.input.size) { - symbol = this.input.getText(new Interval(this.startIndex,this.startIndex)); - } - return "LexerNoViableAltException" + symbol; - } -} - - -/** - * Indicates that the parser could not decide which of two or more paths - * to take based upon the remaining input. It tracks the starting token - * of the offending input and also knows where the parser was - * in the various paths when the error. Reported by reportNoViableAlternative() - */ -class NoViableAltException extends RecognitionException { - constructor(recognizer, input, startToken, offendingToken, deadEndConfigs, ctx) { - ctx = ctx || recognizer._ctx; - offendingToken = offendingToken || recognizer.getCurrentToken(); - startToken = startToken || recognizer.getCurrentToken(); - input = input || recognizer.getInputStream(); - super({message: "", recognizer: recognizer, input: input, ctx: ctx}); - // Which configurations did we try at input.index() that couldn't match - // input.LT(1)?// - this.deadEndConfigs = deadEndConfigs; - // The token object at the start index; the input stream might - // not be buffering tokens so get a reference to it. (At the - // time the error occurred, of course the stream needs to keep a - // buffer all of the tokens but later we might not have access to those.) - this.startToken = startToken; - this.offendingToken = offendingToken; - } -} - -/** - * This signifies any kind of mismatched input exceptions such as - * when the current input does not match the expected token. -*/ -class InputMismatchException extends RecognitionException { - constructor(recognizer) { - super({message: "", recognizer: recognizer, input: recognizer.getInputStream(), ctx: recognizer._ctx}); - this.offendingToken = recognizer.getCurrentToken(); - } -} - -function formatMessage(predicate, message) { - if (message !==null) { - return message; - } else { - return "failed predicate: {" + predicate + "}?"; - } -} - -/** - * A semantic predicate failed during validation. Validation of predicates - * occurs when normally parsing the alternative just like matching a token. - * Disambiguating predicate evaluation occurs when we test a predicate during - * prediction. -*/ -class FailedPredicateException extends RecognitionException { - constructor(recognizer, predicate, message) { - super({ - message: formatMessage(predicate, message || null), recognizer: recognizer, - input: recognizer.getInputStream(), ctx: recognizer._ctx - }); - const s = recognizer._interp.atn.states[recognizer.state] - const trans = s.transitions[0] - if (trans instanceof PredicateTransition) { - this.ruleIndex = trans.ruleIndex; - this.predicateIndex = trans.predIndex; - } else { - this.ruleIndex = 0; - this.predicateIndex = 0; - } - this.predicate = predicate; - this.offendingToken = recognizer.getCurrentToken(); - } -} - - -class ParseCancellationException extends Error{ - constructor() { - super() - Error.captureStackTrace(this, ParseCancellationException); - } -} - -module.exports = { - RecognitionException, - NoViableAltException, - LexerNoViableAltException, - InputMismatchException, - FailedPredicateException, - ParseCancellationException -}; diff --git a/runtime/JavaScript/src/antlr4/error/FailedPredicateException.js b/runtime/JavaScript/src/antlr4/error/FailedPredicateException.js new file mode 100644 index 0000000000..5b1b6264a6 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/error/FailedPredicateException.js @@ -0,0 +1,41 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import PredicateTransition from "../transition/PredicateTransition.js"; +import RecognitionException from "./RecognitionException.js"; + +/** + * A semantic predicate failed during validation. Validation of predicates + * occurs when normally parsing the alternative just like matching a token. + * Disambiguating predicate evaluation occurs when we test a predicate during + * prediction. + */ +export default class FailedPredicateException extends RecognitionException { + constructor(recognizer, predicate, message) { + super({ + message: formatMessage(predicate, message || null), recognizer: recognizer, + input: recognizer.getInputStream(), ctx: recognizer._ctx + }); + const s = recognizer._interp.atn.states[recognizer.state] + const trans = s.transitions[0] + if (trans instanceof PredicateTransition) { + this.ruleIndex = trans.ruleIndex; + this.predicateIndex = trans.predIndex; + } else { + this.ruleIndex = 0; + this.predicateIndex = 0; + } + this.predicate = predicate; + this.offendingToken = recognizer.getCurrentToken(); + } +} + + +function formatMessage(predicate, message) { + if (message !==null) { + return message; + } else { + return "failed predicate: {" + predicate + "}?"; + } +} diff --git a/runtime/JavaScript/src/antlr4/error/InputMismatchException.js b/runtime/JavaScript/src/antlr4/error/InputMismatchException.js new file mode 100644 index 0000000000..17d0ff29c7 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/error/InputMismatchException.js @@ -0,0 +1,16 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import RecognitionException from "./RecognitionException.js"; + +/** + * This signifies any kind of mismatched input exceptions such as + * when the current input does not match the expected token. + */ +export default class InputMismatchException extends RecognitionException { + constructor(recognizer) { + super({message: "", recognizer: recognizer, input: recognizer.getInputStream(), ctx: recognizer._ctx}); + this.offendingToken = recognizer.getCurrentToken(); + } +} diff --git a/runtime/JavaScript/src/antlr4/error/LexerNoViableAltException.js b/runtime/JavaScript/src/antlr4/error/LexerNoViableAltException.js new file mode 100644 index 0000000000..557fbbbc67 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/error/LexerNoViableAltException.js @@ -0,0 +1,22 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import Interval from "../misc/Interval.js"; +import RecognitionException from "./RecognitionException.js"; + +export default class LexerNoViableAltException extends RecognitionException { + constructor(lexer, input, startIndex, deadEndConfigs) { + super({message: "", recognizer: lexer, input: input, ctx: null}); + this.startIndex = startIndex; + this.deadEndConfigs = deadEndConfigs; + } + + toString() { + let symbol = ""; + if (this.startIndex >= 0 && this.startIndex < this.input.size) { + symbol = this.input.getText(new Interval(this.startIndex,this.startIndex)); + } + return "LexerNoViableAltException" + symbol; + } +} diff --git a/runtime/JavaScript/src/antlr4/error/NoViableAltException.js b/runtime/JavaScript/src/antlr4/error/NoViableAltException.js new file mode 100644 index 0000000000..1e4a4576b1 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/error/NoViableAltException.js @@ -0,0 +1,31 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import RecognitionException from "./RecognitionException.js"; + +/** + * Indicates that the parser could not decide which of two or more paths + * to take based upon the remaining input. It tracks the starting token + * of the offending input and also knows where the parser was + * in the various paths when the error. Reported by reportNoViableAlternative() + */ + +export default class NoViableAltException extends RecognitionException { + constructor(recognizer, input, startToken, offendingToken, deadEndConfigs, ctx) { + ctx = ctx || recognizer._ctx; + offendingToken = offendingToken || recognizer.getCurrentToken(); + startToken = startToken || recognizer.getCurrentToken(); + input = input || recognizer.getInputStream(); + super({message: "", recognizer: recognizer, input: input, ctx: ctx}); + // Which configurations did we try at input.index() that couldn't match + // input.LT(1)?// + this.deadEndConfigs = deadEndConfigs; + // The token object at the start index; the input stream might + // not be buffering tokens so get a reference to it. (At the + // time the error occurred, of course the stream needs to keep a + // buffer all of the tokens but later we might not have access to those.) + this.startToken = startToken; + this.offendingToken = offendingToken; + } +} diff --git a/runtime/JavaScript/src/antlr4/error/ParseCancellationException.js b/runtime/JavaScript/src/antlr4/error/ParseCancellationException.js new file mode 100644 index 0000000000..88a1978fd0 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/error/ParseCancellationException.js @@ -0,0 +1,10 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default class ParseCancellationException extends Error { + constructor() { + super() + Error.captureStackTrace(this, ParseCancellationException); + } +} diff --git a/runtime/JavaScript/src/antlr4/error/ProxyErrorListener.js b/runtime/JavaScript/src/antlr4/error/ProxyErrorListener.js new file mode 100644 index 0000000000..9cc8c6cdf1 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/error/ProxyErrorListener.js @@ -0,0 +1,32 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ErrorListener from "./ErrorListener.js"; + +export default class ProxyErrorListener extends ErrorListener { + constructor(delegates) { + super(); + if (delegates===null) { + throw "delegates"; + } + this.delegates = delegates; + return this; + } + + syntaxError(recognizer, offendingSymbol, line, column, msg, e) { + this.delegates.map(d => d.syntaxError(recognizer, offendingSymbol, line, column, msg, e)); + } + + reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) { + this.delegates.map(d => d.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs)); + } + + reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) { + this.delegates.map(d => d.reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs)); + } + + reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs) { + this.delegates.map(d => d.reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs)); + } +} diff --git a/runtime/JavaScript/src/antlr4/error/RecognitionException.js b/runtime/JavaScript/src/antlr4/error/RecognitionException.js new file mode 100644 index 0000000000..3358e6b254 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/error/RecognitionException.js @@ -0,0 +1,67 @@ +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +/** + * The root of the ANTLR exception hierarchy. In general, ANTLR tracks just + * 3 kinds of errors: prediction errors, failed predicate errors, and + * mismatched input errors. In each case, the parser knows where it is + * in the input, where it is in the ATN, the rule invocation stack, + * and what kind of problem occurred. + */ + +export default class RecognitionException extends Error { + constructor(params) { + super(params.message); + if (Error.captureStackTrace) + Error.captureStackTrace(this, RecognitionException); + this.message = params.message; + this.recognizer = params.recognizer; + this.input = params.input; + this.ctx = params.ctx; + /** + * The current {@link Token} when an error occurred. Since not all streams + * support accessing symbols by index, we have to track the {@link Token} + * instance itself + */ + this.offendingToken = null; + /** + * Get the ATN state number the parser was in at the time the error + * occurred. For {@link NoViableAltException} and + * {@link LexerNoViableAltException} exceptions, this is the + * {@link DecisionState} number. For others, it is the state whose outgoing + * edge we couldn't match. + */ + this.offendingState = -1; + if (this.recognizer!==null) { + this.offendingState = this.recognizer.state; + } + } + + /** + * Gets the set of input symbols which could potentially follow the + * previously matched symbol at the time this exception was thrown. + * + *

If the set of expected tokens is not known and could not be computed, + * this method returns {@code null}.

+ * + * @return The set of token types that could potentially follow the current + * state in the ATN, or {@code null} if the information is not available. + */ + getExpectedTokens() { + if (this.recognizer!==null) { + return this.recognizer.atn.getExpectedTokens(this.offendingState, this.ctx); + } else { + return null; + } + } + + //

If the state number is not known, this method returns -1.

+ toString() { + return this.message; + } +} + + + diff --git a/runtime/JavaScript/src/antlr4/error/index.js b/runtime/JavaScript/src/antlr4/error/index.js index 482b47edbe..d41bd91251 100644 --- a/runtime/JavaScript/src/antlr4/error/index.js +++ b/runtime/JavaScript/src/antlr4/error/index.js @@ -1,14 +1,19 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -module.exports.RecognitionException = require('./Errors').RecognitionException; -module.exports.NoViableAltException = require('./Errors').NoViableAltException; -module.exports.LexerNoViableAltException = require('./Errors').LexerNoViableAltException; -module.exports.InputMismatchException = require('./Errors').InputMismatchException; -module.exports.FailedPredicateException = require('./Errors').FailedPredicateException; -module.exports.DiagnosticErrorListener = require('./DiagnosticErrorListener'); -module.exports.BailErrorStrategy = require('./ErrorStrategy').BailErrorStrategy; -module.exports.DefaultErrorStrategy = require('./ErrorStrategy').DefaultErrorStrategy; -module.exports.ErrorListener = require('./ErrorListener').ErrorListener; +import RecognitionException from './RecognitionException.js'; +import NoViableAltException from './NoViableAltException.js'; +import LexerNoViableAltException from './LexerNoViableAltException.js'; +import InputMismatchException from './InputMismatchException.js'; +import FailedPredicateException from './FailedPredicateException.js'; +import DiagnosticErrorListener from './DiagnosticErrorListener.js'; +import BailErrorStrategy from './BailErrorStrategy.js'; +import DefaultErrorStrategy from './DefaultErrorStrategy.js'; +import ErrorListener from './ErrorListener.js'; + +export default { + RecognitionException, NoViableAltException, LexerNoViableAltException, InputMismatchException, FailedPredicateException, + DiagnosticErrorListener, BailErrorStrategy, DefaultErrorStrategy, ErrorListener +} diff --git a/runtime/JavaScript/src/antlr4/index.js b/runtime/JavaScript/src/antlr4/index.js index a8392d6d7e..c823104af9 100644 --- a/runtime/JavaScript/src/antlr4/index.js +++ b/runtime/JavaScript/src/antlr4/index.js @@ -1,25 +1,32 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -exports.atn = require('./atn/index'); -exports.codepointat = require('./polyfills/codepointat'); -exports.dfa = require('./dfa/index'); -exports.fromcodepoint = require('./polyfills/fromcodepoint'); -exports.tree = require('./tree/index'); -exports.error = require('./error/index'); -exports.Token = require('./Token').Token; -exports.CharStreams = require('./CharStreams'); -exports.CommonToken = require('./Token').CommonToken; -exports.InputStream = require('./InputStream'); -exports.FileStream = require('./FileStream'); -exports.CommonTokenStream = require('./CommonTokenStream'); -exports.Lexer = require('./Lexer'); -exports.Parser = require('./Parser'); -var pc = require('./PredictionContext'); -exports.PredictionContextCache = pc.PredictionContextCache; -exports.ParserRuleContext = require('./ParserRuleContext'); -exports.Interval = require('./IntervalSet').Interval; -exports.IntervalSet = require('./IntervalSet').IntervalSet; -exports.Utils = require('./Utils'); -exports.LL1Analyzer = require('./LL1Analyzer').LL1Analyzer; +import './utils/stringHashCode.js'; +import './polyfills/codepointat.js'; +import './polyfills/fromcodepoint.js'; +import { default as atn } from './atn/index.js'; +import { default as dfa } from './dfa/index.js'; +import { default as tree } from './tree/index.js'; +import { default as error } from './error/index.js'; +import Token from './Token.js'; +import CommonToken from './CommonToken.js'; +import { default as CharStreams } from './CharStreams.js'; +import InputStream from './InputStream.js'; +import FileStream from './FileStream.js'; +import CommonTokenStream from './CommonTokenStream.js'; +import Lexer from './Lexer.js'; +import Parser from './Parser.js'; +import PredictionContextCache from './atn/PredictionContextCache.js'; +import ParserRuleContext from './context/ParserRuleContext.js'; +import Interval from './misc/Interval.js'; +import IntervalSet from './misc/IntervalSet.js'; +import LL1Analyzer from './atn/LL1Analyzer.js'; +import { default as Utils } from './utils/index.js'; + +const antlr4 = { + atn, dfa, tree, error, Token, CommonToken, CharStreams, InputStream, FileStream, CommonTokenStream, Lexer, Parser, + PredictionContextCache, ParserRuleContext, Interval, IntervalSet, LL1Analyzer, Utils +}; + +export default antlr4; diff --git a/runtime/JavaScript/src/antlr4/misc/AltDict.js b/runtime/JavaScript/src/antlr4/misc/AltDict.js new file mode 100644 index 0000000000..436ce2eff7 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/misc/AltDict.js @@ -0,0 +1,22 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default class AltDict { + + constructor() { + this.data = {}; + } + + get(key) { + return this.data["k-" + key] || null; + } + + set(key, value) { + this.data["k-" + key] = value; + } + + values() { + return Object.keys(this.data).filter(key => key.startsWith("k-")).map(key => this.data[key], this); + } +} diff --git a/runtime/JavaScript/src/antlr4/misc/BitSet.js b/runtime/JavaScript/src/antlr4/misc/BitSet.js new file mode 100644 index 0000000000..90df4e9c7e --- /dev/null +++ b/runtime/JavaScript/src/antlr4/misc/BitSet.js @@ -0,0 +1,53 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import HashCode from "./HashCode.js"; +import equalArrays from "../utils/equalArrays.js"; + +export default class BitSet { + + constructor() { + this.data = []; + } + + add(value) { + this.data[value] = true; + } + + or(set) { + Object.keys(set.data).map(alt => this.add(alt), this); + } + + remove(value) { + delete this.data[value]; + } + + has(value) { + return this.data[value] === true; + } + + values() { + return Object.keys(this.data); + } + + minValue() { + return Math.min.apply(null, this.values()); + } + + hashCode() { + return HashCode.hashStuff(this.values()); + } + + equals(other) { + return other instanceof BitSet && equalArrays(this.data, other.data); + } + + toString() { + return "{" + this.values().join(", ") + "}"; + } + + get length(){ + return this.values().length; + } +} diff --git a/runtime/JavaScript/src/antlr4/misc/HashCode.js b/runtime/JavaScript/src/antlr4/misc/HashCode.js new file mode 100644 index 0000000000..4264f6591e --- /dev/null +++ b/runtime/JavaScript/src/antlr4/misc/HashCode.js @@ -0,0 +1,66 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default class HashCode { + + constructor() { + this.count = 0; + this.hash = 0; + } + + update() { + for(let i=0;i>> (32 - 15)); + k = k * 0x1B873593; + this.count = this.count + 1; + let hash = this.hash ^ k; + hash = (hash << 13) | (hash >>> (32 - 13)); + hash = hash * 5 + 0xE6546B64; + this.hash = hash; + } + } + } + + finish() { + let hash = this.hash ^ (this.count * 4); + hash = hash ^ (hash >>> 16); + hash = hash * 0x85EBCA6B; + hash = hash ^ (hash >>> 13); + hash = hash * 0xC2B2AE35; + hash = hash ^ (hash >>> 16); + return hash; + } + + static hashStuff() { + const hash = new HashCode(); + hash.update.apply(hash, arguments); + return hash.finish(); + } +} diff --git a/runtime/JavaScript/src/antlr4/misc/HashMap.js b/runtime/JavaScript/src/antlr4/misc/HashMap.js new file mode 100644 index 0000000000..13c46cada2 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/misc/HashMap.js @@ -0,0 +1,84 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import standardEqualsFunction from "../utils/standardEqualsFunction.js"; +import standardHashCodeFunction from "../utils/standardHashCodeFunction.js"; + +const HASH_KEY_PREFIX = "h-"; + +export default class HashMap { + + constructor(hashFunction, equalsFunction) { + this.data = {}; + this.hashFunction = hashFunction || standardHashCodeFunction; + this.equalsFunction = equalsFunction || standardEqualsFunction; + } + + set(key, value) { + const hashKey = HASH_KEY_PREFIX + this.hashFunction(key); + if (hashKey in this.data) { + const entries = this.data[hashKey]; + for (let i = 0; i < entries.length; i++) { + const entry = entries[i]; + if (this.equalsFunction(key, entry.key)) { + const oldValue = entry.value; + entry.value = value; + return oldValue; + } + } + entries.push({key:key, value:value}); + return value; + } else { + this.data[hashKey] = [{key:key, value:value}]; + return value; + } + } + + containsKey(key) { + const hashKey = HASH_KEY_PREFIX + this.hashFunction(key); + if(hashKey in this.data) { + const entries = this.data[hashKey]; + for (let i = 0; i < entries.length; i++) { + const entry = entries[i]; + if (this.equalsFunction(key, entry.key)) + return true; + } + } + return false; + } + + get(key) { + const hashKey = HASH_KEY_PREFIX + this.hashFunction(key); + if(hashKey in this.data) { + const entries = this.data[hashKey]; + for (let i = 0; i < entries.length; i++) { + const entry = entries[i]; + if (this.equalsFunction(key, entry.key)) + return entry.value; + } + } + return null; + } + + entries() { + return Object.keys(this.data).filter(key => key.startsWith(HASH_KEY_PREFIX)).flatMap(key => this.data[key], this); + } + + getKeys() { + return this.entries().map(e => e.key); + } + + getValues() { + return this.entries().map(e => e.value); + } + + toString() { + const ss = this.entries().map(e => '{' + e.key + ':' + e.value + '}'); + return '[' + ss.join(", ") + ']'; + } + + get length() { + return Object.keys(this.data).filter(key => key.startsWith(HASH_KEY_PREFIX)).map(key => this.data[key].length, this).reduce((accum, item) => accum + item, 0); + } +} diff --git a/runtime/JavaScript/src/antlr4/misc/HashSet.js b/runtime/JavaScript/src/antlr4/misc/HashSet.js new file mode 100644 index 0000000000..7fe7fc2407 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/misc/HashSet.js @@ -0,0 +1,64 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import standardHashCodeFunction from "../utils/standardHashCodeFunction.js"; +import standardEqualsFunction from "../utils/standardEqualsFunction.js"; +import arrayToString from "../utils/arrayToString.js"; + +const HASH_KEY_PREFIX = "h-"; + +export default class HashSet { + + constructor(hashFunction, equalsFunction) { + this.data = {}; + this.hashFunction = hashFunction || standardHashCodeFunction; + this.equalsFunction = equalsFunction || standardEqualsFunction; + } + + add(value) { + const key = HASH_KEY_PREFIX + this.hashFunction(value); + if (key in this.data) { + const values = this.data[key]; + for (let i = 0; i < values.length; i++) { + if (this.equalsFunction(value, values[i])) { + return values[i]; + } + } + values.push(value); + return value; + } else { + this.data[key] = [value]; + return value; + } + } + + has(value) { + return this.get(value) != null; + } + + get(value) { + const key = HASH_KEY_PREFIX + this.hashFunction(value); + if (key in this.data) { + const values = this.data[key]; + for (let i = 0; i < values.length; i++) { + if (this.equalsFunction(value, values[i])) { + return values[i]; + } + } + } + return null; + } + + values() { + return Object.keys(this.data).filter(key => key.startsWith(HASH_KEY_PREFIX)).flatMap(key => this.data[key], this); + } + + toString() { + return arrayToString(this.values()); + } + + get length() { + return Object.keys(this.data).filter(key => key.startsWith(HASH_KEY_PREFIX)).map(key => this.data[key].length, this).reduce((accum, item) => accum + item, 0); + } +} diff --git a/runtime/JavaScript/src/antlr4/misc/Interval.js b/runtime/JavaScript/src/antlr4/misc/Interval.js new file mode 100644 index 0000000000..ea0913be70 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/misc/Interval.js @@ -0,0 +1,35 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +/* stop is not included! */ +export default class Interval { + + constructor(start, stop) { + this.start = start; + this.stop = stop; + } + + clone() { + return new Interval(this.start, this.stop); + } + + contains(item) { + return item >= this.start && item < this.stop; + } + + toString() { + if(this.start===this.stop-1) { + return this.start.toString(); + } else { + return this.start.toString() + ".." + (this.stop-1).toString(); + } + } + + get length(){ + return this.stop - this.start; + } +} + +Interval.INVALID_INTERVAL = new Interval(-1, -2); + diff --git a/runtime/JavaScript/src/antlr4/IntervalSet.js b/runtime/JavaScript/src/antlr4/misc/IntervalSet.js similarity index 91% rename from runtime/JavaScript/src/antlr4/IntervalSet.js rename to runtime/JavaScript/src/antlr4/misc/IntervalSet.js index c96718d12f..49471355aa 100644 --- a/runtime/JavaScript/src/antlr4/IntervalSet.js +++ b/runtime/JavaScript/src/antlr4/misc/IntervalSet.js @@ -1,41 +1,12 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Token} = require('./Token'); +import Token from '../Token.js'; +import Interval from "./Interval.js"; -/* stop is not included! */ -class Interval { - - constructor(start, stop) { - this.start = start; - this.stop = stop; - } - - clone() { - return new Interval(this.start, this.stop); - } - - contains(item) { - return item >= this.start && item < this.stop; - } - - toString() { - if(this.start===this.stop-1) { - return this.start.toString(); - } else { - return this.start.toString() + ".." + (this.stop-1).toString(); - } - } - - get length(){ - return this.stop - this.start; - } -} - - -class IntervalSet { +export default class IntervalSet { constructor() { this.intervals = null; this.readOnly = false; @@ -287,8 +258,3 @@ class IntervalSet { return this.intervals.map( interval => interval.length ).reduce((acc, val) => acc + val); } } - -module.exports = { - Interval, - IntervalSet -}; diff --git a/runtime/JavaScript/src/antlr4/polyfills/codepointat.js b/runtime/JavaScript/src/antlr4/polyfills/codepointat.js index 616f254d4f..6e71d48f50 100644 --- a/runtime/JavaScript/src/antlr4/polyfills/codepointat.js +++ b/runtime/JavaScript/src/antlr4/polyfills/codepointat.js @@ -1,3 +1,7 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ /*! https://mths.be/codepointat v0.2.0 by @mathias */ if (!String.prototype.codePointAt) { (function() { @@ -10,6 +14,7 @@ if (!String.prototype.codePointAt) { const $defineProperty = Object.defineProperty; result = $defineProperty(object, object, object) && $defineProperty; } catch(error) { + /* eslint no-empty: [ "off" ] */ } return result; }()); diff --git a/runtime/JavaScript/src/antlr4/polyfills/fromcodepoint.js b/runtime/JavaScript/src/antlr4/polyfills/fromcodepoint.js index cf53f93f69..e6d25e6650 100644 --- a/runtime/JavaScript/src/antlr4/polyfills/fromcodepoint.js +++ b/runtime/JavaScript/src/antlr4/polyfills/fromcodepoint.js @@ -1,3 +1,7 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ /*! https://mths.be/fromcodepoint v0.2.1 by @mathias */ if (!String.fromCodePoint) { (function() { @@ -8,7 +12,9 @@ if (!String.fromCodePoint) { const object = {}; const $defineProperty = Object.defineProperty; result = $defineProperty(object, object, object) && $defineProperty; - } catch(error) {} + } catch(error) { + /* eslint no-empty: [ "off" ] */ + } return result; }()); const stringFromCharCode = String.fromCharCode; diff --git a/runtime/JavaScript/src/antlr4/atn/ATNState.js b/runtime/JavaScript/src/antlr4/state/ATNState.js similarity index 50% rename from runtime/JavaScript/src/antlr4/atn/ATNState.js rename to runtime/JavaScript/src/antlr4/state/ATNState.js index eb5baf4ced..a0111afc4f 100644 --- a/runtime/JavaScript/src/antlr4/atn/ATNState.js +++ b/runtime/JavaScript/src/antlr4/state/ATNState.js @@ -1,10 +1,8 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const INITIAL_NUM_TRANSITIONS = 4; - /** * The following images show the relation of states and * {@link ATNState//transitions} for various grammar constructs. @@ -65,7 +63,7 @@ const INITIAL_NUM_TRANSITIONS = 4; * * */ -class ATNState { +export default class ATNState { constructor() { // Which ATN are we in? this.atn = null; @@ -145,171 +143,21 @@ ATNState.serializationNames = [ ATNState.INVALID_STATE_NUMBER = -1; -class BasicState extends ATNState { - constructor() { - super(); - this.stateType = ATNState.BASIC; - } -} -class DecisionState extends ATNState { - constructor() { - super(); - this.decision = -1; - this.nonGreedy = false; - return this; - } -} -/** - * The start of a regular {@code (...)} block - */ -class BlockStartState extends DecisionState { - constructor() { - super(); - this.endState = null; - return this; - } -} -class BasicBlockStartState extends BlockStartState { - constructor() { - super(); - this.stateType = ATNState.BLOCK_START; - return this; - } -} -/** - * Terminal node of a simple {@code (a|b|c)} block - */ -class BlockEndState extends ATNState { - constructor() { - super(); - this.stateType = ATNState.BLOCK_END; - this.startState = null; - return this; - } -} -/** - * The last node in the ATN for a rule, unless that rule is the start symbol. - * In that case, there is one transition to EOF. Later, we might encode - * references to all calls to this rule to compute FOLLOW sets for - * error handling - */ -class RuleStopState extends ATNState { - constructor() { - super(); - this.stateType = ATNState.RULE_STOP; - return this; - } -} -class RuleStartState extends ATNState { - constructor() { - super(); - this.stateType = ATNState.RULE_START; - this.stopState = null; - this.isPrecedenceRule = false; - return this; - } -} -/** - * Decision state for {@code A+} and {@code (A|B)+}. It has two transitions: - * one to the loop back to start of the block and one to exit. - */ -class PlusLoopbackState extends DecisionState { - constructor() { - super(); - this.stateType = ATNState.PLUS_LOOP_BACK; - return this; - } -} -/** - * Start of {@code (A|B|...)+} loop. Technically a decision state, but - * we don't use for code generation; somebody might need it, so I'm defining - * it for completeness. In reality, the {@link PlusLoopbackState} node is the - * real decision-making note for {@code A+} - */ -class PlusBlockStartState extends BlockStartState { - constructor() { - super(); - this.stateType = ATNState.PLUS_BLOCK_START; - this.loopBackState = null; - return this; - } -} -/** - * The block that begins a closure loop - */ -class StarBlockStartState extends BlockStartState { - constructor() { - super(); - this.stateType = ATNState.STAR_BLOCK_START; - return this; - } -} -class StarLoopbackState extends ATNState { - constructor() { - super(); - this.stateType = ATNState.STAR_LOOP_BACK; - return this; - } -} -class StarLoopEntryState extends DecisionState { - constructor() { - super(); - this.stateType = ATNState.STAR_LOOP_ENTRY; - this.loopBackState = null; - // Indicates whether this state can benefit from a precedence DFA during SLL decision making. - this.isPrecedenceDecision = null; - return this; - } -} -/** - * Mark the end of a * or + loop - */ -class LoopEndState extends ATNState { - constructor() { - super(); - this.stateType = ATNState.LOOP_END; - this.loopBackState = null; - return this; - } -} -/** - * The Tokens rule start state linking to each lexer rule start state - */ -class TokensStartState extends DecisionState { - constructor() { - super(); - this.stateType = ATNState.TOKEN_START; - return this; - } -} -module.exports = { - ATNState, - BasicState, - DecisionState, - BlockStartState, - BlockEndState, - LoopEndState, - RuleStartState, - RuleStopState, - TokensStartState, - PlusLoopbackState, - StarLoopbackState, - StarLoopEntryState, - PlusBlockStartState, - StarBlockStartState, - BasicBlockStartState -} + + + + diff --git a/runtime/JavaScript/src/antlr4/state/BasicBlockStartState.js b/runtime/JavaScript/src/antlr4/state/BasicBlockStartState.js new file mode 100644 index 0000000000..70f34ea38f --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/BasicBlockStartState.js @@ -0,0 +1,14 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ATNState from "./ATNState.js"; +import BlockStartState from "./BlockStartState.js"; + +export default class BasicBlockStartState extends BlockStartState { + constructor() { + super(); + this.stateType = ATNState.BLOCK_START; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/BasicState.js b/runtime/JavaScript/src/antlr4/state/BasicState.js new file mode 100644 index 0000000000..9ea0a7fe4e --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/BasicState.js @@ -0,0 +1,12 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ATNState from "./ATNState.js"; + +export default class BasicState extends ATNState { + constructor() { + super(); + this.stateType = ATNState.BASIC; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/BlockEndState.js b/runtime/JavaScript/src/antlr4/state/BlockEndState.js new file mode 100644 index 0000000000..d3a623f696 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/BlockEndState.js @@ -0,0 +1,17 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ATNState from "./ATNState.js"; + +/** + * Terminal node of a simple {@code (a|b|c)} block + */ +export default class BlockEndState extends ATNState { + constructor() { + super(); + this.stateType = ATNState.BLOCK_END; + this.startState = null; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/BlockStartState.js b/runtime/JavaScript/src/antlr4/state/BlockStartState.js new file mode 100644 index 0000000000..0cf1222e07 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/BlockStartState.js @@ -0,0 +1,16 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import DecisionState from "./DecisionState.js"; + +/** + * The start of a regular {@code (...)} block + */ +export default class BlockStartState extends DecisionState { + constructor() { + super(); + this.endState = null; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/DecisionState.js b/runtime/JavaScript/src/antlr4/state/DecisionState.js new file mode 100644 index 0000000000..01b976d445 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/DecisionState.js @@ -0,0 +1,14 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ATNState from "./ATNState.js"; + +export default class DecisionState extends ATNState { + constructor() { + super(); + this.decision = -1; + this.nonGreedy = false; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/LoopEndState.js b/runtime/JavaScript/src/antlr4/state/LoopEndState.js new file mode 100644 index 0000000000..af3f2162c5 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/LoopEndState.js @@ -0,0 +1,17 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ATNState from "./ATNState.js"; + +/** + * Mark the end of a * or + loop + */ +export default class LoopEndState extends ATNState { + constructor() { + super(); + this.stateType = ATNState.LOOP_END; + this.loopBackState = null; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/PlusBlockStartState.js b/runtime/JavaScript/src/antlr4/state/PlusBlockStartState.js new file mode 100644 index 0000000000..ae374b0a56 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/PlusBlockStartState.js @@ -0,0 +1,21 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import BlockStartState from "./BlockStartState.js"; +import ATNState from "./ATNState.js"; + +/** + * Start of {@code (A|B|...)+} loop. Technically a decision state, but + * we don't use for code generation; somebody might need it, so I'm defining + * it for completeness. In reality, the {@link PlusLoopbackState} node is the + * real decision-making note for {@code A+} + */ +export default class PlusBlockStartState extends BlockStartState { + constructor() { + super(); + this.stateType = ATNState.PLUS_BLOCK_START; + this.loopBackState = null; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/PlusLoopbackState.js b/runtime/JavaScript/src/antlr4/state/PlusLoopbackState.js new file mode 100644 index 0000000000..1668f5caac --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/PlusLoopbackState.js @@ -0,0 +1,18 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import DecisionState from "./DecisionState.js"; +import ATNState from "./ATNState.js"; + +/** + * Decision state for {@code A+} and {@code (A|B)+}. It has two transitions: + * one to the loop back to start of the block and one to exit. + */ +export default class PlusLoopbackState extends DecisionState { + constructor() { + super(); + this.stateType = ATNState.PLUS_LOOP_BACK; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/RuleStartState.js b/runtime/JavaScript/src/antlr4/state/RuleStartState.js new file mode 100644 index 0000000000..8b9f01d77c --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/RuleStartState.js @@ -0,0 +1,15 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ATNState from "./ATNState.js"; + +export default class RuleStartState extends ATNState { + constructor() { + super(); + this.stateType = ATNState.RULE_START; + this.stopState = null; + this.isPrecedenceRule = false; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/RuleStopState.js b/runtime/JavaScript/src/antlr4/state/RuleStopState.js new file mode 100644 index 0000000000..fc58038dd6 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/RuleStopState.js @@ -0,0 +1,19 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ATNState from "./ATNState.js"; + +/** + * The last node in the ATN for a rule, unless that rule is the start symbol. + * In that case, there is one transition to EOF. Later, we might encode + * references to all calls to this rule to compute FOLLOW sets for + * error handling + */ +export default class RuleStopState extends ATNState { + constructor() { + super(); + this.stateType = ATNState.RULE_STOP; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/StarBlockStartState.js b/runtime/JavaScript/src/antlr4/state/StarBlockStartState.js new file mode 100644 index 0000000000..0d76281263 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/StarBlockStartState.js @@ -0,0 +1,17 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import BlockStartState from "./BlockStartState.js"; +import ATNState from "./ATNState.js"; + +/** + * The block that begins a closure loop + */ +export default class StarBlockStartState extends BlockStartState { + constructor() { + super(); + this.stateType = ATNState.STAR_BLOCK_START; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/StarLoopEntryState.js b/runtime/JavaScript/src/antlr4/state/StarLoopEntryState.js new file mode 100644 index 0000000000..3b1e275e33 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/StarLoopEntryState.js @@ -0,0 +1,17 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import DecisionState from "./DecisionState.js"; +import ATNState from "./ATNState.js"; + +export default class StarLoopEntryState extends DecisionState { + constructor() { + super(); + this.stateType = ATNState.STAR_LOOP_ENTRY; + this.loopBackState = null; + // Indicates whether this state can benefit from a precedence DFA during SLL decision making. + this.isPrecedenceDecision = null; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/StarLoopbackState.js b/runtime/JavaScript/src/antlr4/state/StarLoopbackState.js new file mode 100644 index 0000000000..bfde52869c --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/StarLoopbackState.js @@ -0,0 +1,13 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ATNState from "./ATNState.js"; + +export default class StarLoopbackState extends ATNState { + constructor() { + super(); + this.stateType = ATNState.STAR_LOOP_BACK; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/state/TokensStartState.js b/runtime/JavaScript/src/antlr4/state/TokensStartState.js new file mode 100644 index 0000000000..cccde01ef7 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/state/TokensStartState.js @@ -0,0 +1,17 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import DecisionState from "./DecisionState.js"; +import ATNState from "./ATNState.js"; + +/** + * The Tokens rule start state linking to each lexer rule start state + */ +export default class TokensStartState extends DecisionState { + constructor() { + super(); + this.stateType = ATNState.TOKEN_START; + return this; + } +} diff --git a/runtime/JavaScript/src/antlr4/transition/ActionTransition.js b/runtime/JavaScript/src/antlr4/transition/ActionTransition.js new file mode 100644 index 0000000000..1aecd1c04e --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/ActionTransition.js @@ -0,0 +1,24 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import Transition from "./Transition.js"; + +export default class ActionTransition extends Transition { + constructor(target, ruleIndex, actionIndex, isCtxDependent) { + super(target); + this.serializationType = Transition.ACTION; + this.ruleIndex = ruleIndex; + this.actionIndex = actionIndex===undefined ? -1 : actionIndex; + this.isCtxDependent = isCtxDependent===undefined ? false : isCtxDependent; // e.g., $i ref in pred + this.isEpsilon = true; + } + + matches(symbol, minVocabSymbol, maxVocabSymbol) { + return false; + } + + toString() { + return "action_" + this.ruleIndex + ":" + this.actionIndex; + } +} diff --git a/runtime/JavaScript/src/antlr4/transition/AtomTransition.js b/runtime/JavaScript/src/antlr4/transition/AtomTransition.js new file mode 100644 index 0000000000..ef8a4c4735 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/AtomTransition.js @@ -0,0 +1,30 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import IntervalSet from "../misc/IntervalSet.js"; +import Transition from "./Transition.js"; + +export default class AtomTransition extends Transition { + constructor(target, label) { + super(target); + // The token type or character value; or, signifies special label. + this.label_ = label; + this.label = this.makeLabel(); + this.serializationType = Transition.ATOM; + } + + makeLabel() { + const s = new IntervalSet(); + s.addOne(this.label_); + return s; + } + + matches(symbol, minVocabSymbol, maxVocabSymbol) { + return this.label_ === symbol; + } + + toString() { + return this.label_; + } +} diff --git a/runtime/JavaScript/src/antlr4/transition/EpsilonTransition.js b/runtime/JavaScript/src/antlr4/transition/EpsilonTransition.js new file mode 100644 index 0000000000..c448ae8719 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/EpsilonTransition.js @@ -0,0 +1,22 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import Transition from "./Transition.js"; + +export default class EpsilonTransition extends Transition { + constructor(target, outermostPrecedenceReturn) { + super(target); + this.serializationType = Transition.EPSILON; + this.isEpsilon = true; + this.outermostPrecedenceReturn = outermostPrecedenceReturn; + } + + matches(symbol, minVocabSymbol, maxVocabSymbol) { + return false; + } + + toString() { + return "epsilon"; + } +} diff --git a/runtime/JavaScript/src/antlr4/transition/NotSetTransition.js b/runtime/JavaScript/src/antlr4/transition/NotSetTransition.js new file mode 100644 index 0000000000..434feed87c --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/NotSetTransition.js @@ -0,0 +1,22 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import Transition from "./Transition.js"; +import SetTransition from "./SetTransition.js"; + +export default class NotSetTransition extends SetTransition { + constructor(target, set) { + super(target, set); + this.serializationType = Transition.NOT_SET; + } + + matches(symbol, minVocabSymbol, maxVocabSymbol) { + return symbol >= minVocabSymbol && symbol <= maxVocabSymbol && + !super.matches(symbol, minVocabSymbol, maxVocabSymbol); + } + + toString() { + return '~' + super.toString(); + } +} diff --git a/runtime/JavaScript/src/antlr4/transition/PrecedencePredicateTransition.js b/runtime/JavaScript/src/antlr4/transition/PrecedencePredicateTransition.js new file mode 100644 index 0000000000..ddd4381b36 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/PrecedencePredicateTransition.js @@ -0,0 +1,28 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import PrecedencePredicate from "../atn/PrecedencePredicate.js"; +import Transition from "./Transition.js"; +import AbstractPredicateTransition from "../atn/AbstractPredicateTransition.js"; + +export default class PrecedencePredicateTransition extends AbstractPredicateTransition { + constructor(target, precedence) { + super(target); + this.serializationType = Transition.PRECEDENCE; + this.precedence = precedence; + this.isEpsilon = true; + } + + matches(symbol, minVocabSymbol, maxVocabSymbol) { + return false; + } + + getPredicate() { + return new PrecedencePredicate(this.precedence); + } + + toString() { + return this.precedence + " >= _p"; + } +} diff --git a/runtime/JavaScript/src/antlr4/transition/PredicateTransition.js b/runtime/JavaScript/src/antlr4/transition/PredicateTransition.js new file mode 100644 index 0000000000..53bee7d13d --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/PredicateTransition.js @@ -0,0 +1,30 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import Predicate from "../atn/Predicate.js"; +import Transition from "./Transition.js"; +import AbstractPredicateTransition from "../atn/AbstractPredicateTransition.js"; + +export default class PredicateTransition extends AbstractPredicateTransition { + constructor(target, ruleIndex, predIndex, isCtxDependent) { + super(target); + this.serializationType = Transition.PREDICATE; + this.ruleIndex = ruleIndex; + this.predIndex = predIndex; + this.isCtxDependent = isCtxDependent; // e.g., $i ref in pred + this.isEpsilon = true; + } + + matches(symbol, minVocabSymbol, maxVocabSymbol) { + return false; + } + + getPredicate() { + return new Predicate(this.ruleIndex, this.predIndex, this.isCtxDependent); + } + + toString() { + return "pred_" + this.ruleIndex + ":" + this.predIndex; + } +} diff --git a/runtime/JavaScript/src/antlr4/transition/RangeTransition.js b/runtime/JavaScript/src/antlr4/transition/RangeTransition.js new file mode 100644 index 0000000000..2a73b529bf --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/RangeTransition.js @@ -0,0 +1,30 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import IntervalSet from "../misc/IntervalSet.js"; +import Transition from "./Transition.js"; + +export default class RangeTransition extends Transition { + constructor(target, start, stop) { + super(target); + this.serializationType = Transition.RANGE; + this.start = start; + this.stop = stop; + this.label = this.makeLabel(); + } + + makeLabel() { + const s = new IntervalSet(); + s.addRange(this.start, this.stop); + return s; + } + + matches(symbol, minVocabSymbol, maxVocabSymbol) { + return symbol >= this.start && symbol <= this.stop; + } + + toString() { + return "'" + String.fromCharCode(this.start) + "'..'" + String.fromCharCode(this.stop) + "'"; + } +} diff --git a/runtime/JavaScript/src/antlr4/transition/RuleTransition.js b/runtime/JavaScript/src/antlr4/transition/RuleTransition.js new file mode 100644 index 0000000000..c7c24bd771 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/RuleTransition.js @@ -0,0 +1,23 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import Transition from "./Transition.js"; + +export default class RuleTransition extends Transition { + constructor(ruleStart, ruleIndex, precedence, followState) { + super(ruleStart); + // ptr to the rule definition object for this rule ref + this.ruleIndex = ruleIndex; + this.precedence = precedence; + // what node to begin computations following ref to rule + this.followState = followState; + this.serializationType = Transition.RULE; + this.isEpsilon = true; + } + + matches(symbol, minVocabSymbol, maxVocabSymbol) { + return false; + } +} + diff --git a/runtime/JavaScript/src/antlr4/transition/SetTransition.js b/runtime/JavaScript/src/antlr4/transition/SetTransition.js new file mode 100644 index 0000000000..74244b1c42 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/SetTransition.js @@ -0,0 +1,29 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +// A transition containing a set of values. +import IntervalSet from "../misc/IntervalSet.js"; +import Token from '../Token.js'; +import Transition from "./Transition.js"; + +export default class SetTransition extends Transition { + constructor(target, set) { + super(target); + this.serializationType = Transition.SET; + if (set !==undefined && set !==null) { + this.label = set; + } else { + this.label = new IntervalSet(); + this.label.addOne(Token.INVALID_TYPE); + } + } + + matches(symbol, minVocabSymbol, maxVocabSymbol) { + return this.label.contains(symbol); + } + + toString() { + return this.label.toString(); + } +} diff --git a/runtime/JavaScript/src/antlr4/transition/Transition.js b/runtime/JavaScript/src/antlr4/transition/Transition.js new file mode 100644 index 0000000000..fa79e21a82 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/Transition.js @@ -0,0 +1,73 @@ +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. + * Use of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +/** + * An ATN transition between any two ATN states. Subclasses define + * atom, set, epsilon, action, predicate, rule transitions. + * + *

This is a one way link. It emanates from a state (usually via a list of + * transitions) and has a target state.

+ * + *

Since we never have to change the ATN transitions once we construct it, + * we can fix these transitions as specific classes. The DFA transitions + * on the other hand need to update the labels as it adds transitions to + * the states. We'll use the term Edge for the DFA to distinguish them from + * ATN transitions.

+ */ +export default class Transition { + constructor(target) { + // The target of this transition. + if (target===undefined || target===null) { + throw "target cannot be null."; + } + this.target = target; + // Are we epsilon, action, sempred? + this.isEpsilon = false; + this.label = null; + } +} + +// constants for serialization + +Transition.EPSILON = 1; +Transition.RANGE = 2; +Transition.RULE = 3; +// e.g., {isType(input.LT(1))}? +Transition.PREDICATE = 4; +Transition.ATOM = 5; +Transition.ACTION = 6; +// ~(A|B) or ~atom, wildcard, which convert to next 2 +Transition.SET = 7; +Transition.NOT_SET = 8; +Transition.WILDCARD = 9; +Transition.PRECEDENCE = 10; + +Transition.serializationNames = [ + "INVALID", + "EPSILON", + "RANGE", + "RULE", + "PREDICATE", + "ATOM", + "ACTION", + "SET", + "NOT_SET", + "WILDCARD", + "PRECEDENCE" + ]; + +Transition.serializationTypes = { + EpsilonTransition: Transition.EPSILON, + RangeTransition: Transition.RANGE, + RuleTransition: Transition.RULE, + PredicateTransition: Transition.PREDICATE, + AtomTransition: Transition.ATOM, + ActionTransition: Transition.ACTION, + SetTransition: Transition.SET, + NotSetTransition: Transition.NOT_SET, + WildcardTransition: Transition.WILDCARD, + PrecedencePredicateTransition: Transition.PRECEDENCE + }; + diff --git a/runtime/JavaScript/src/antlr4/transition/WildcardTransition.js b/runtime/JavaScript/src/antlr4/transition/WildcardTransition.js new file mode 100644 index 0000000000..ba8ef08977 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/transition/WildcardTransition.js @@ -0,0 +1,20 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import Transition from "./Transition.js"; + +export default class WildcardTransition extends Transition { + constructor(target) { + super(target); + this.serializationType = Transition.WILDCARD; + } + + matches(symbol, minVocabSymbol, maxVocabSymbol) { + return symbol >= minVocabSymbol && symbol <= maxVocabSymbol; + } + + toString() { + return "."; + } +} diff --git a/runtime/JavaScript/src/antlr4/tree/ErrorNode.js b/runtime/JavaScript/src/antlr4/tree/ErrorNode.js new file mode 100644 index 0000000000..6425145ac0 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/ErrorNode.js @@ -0,0 +1,8 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import TerminalNode from "./TerminalNode.js"; + +export default class ErrorNode extends TerminalNode { +} diff --git a/runtime/JavaScript/src/antlr4/tree/ErrorNodeImpl.js b/runtime/JavaScript/src/antlr4/tree/ErrorNodeImpl.js new file mode 100644 index 0000000000..5d9acf77db --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/ErrorNodeImpl.js @@ -0,0 +1,26 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +/** + * Represents a token that was consumed during resynchronization + * rather than during a valid match operation. For example, + * we will create this kind of a node during single token insertion + * and deletion as well as during "consume until error recovery set" + * upon no viable alternative exceptions. + */ +import TerminalNodeImpl from "./TerminalNodeImpl.js"; + +export default class ErrorNodeImpl extends TerminalNodeImpl { + constructor(token) { + super(token); + } + + isErrorNode() { + return true; + } + + accept(visitor) { + return visitor.visitErrorNode(this); + } +} diff --git a/runtime/JavaScript/src/antlr4/tree/ParseTree.js b/runtime/JavaScript/src/antlr4/tree/ParseTree.js new file mode 100644 index 0000000000..7c49fc73a8 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/ParseTree.js @@ -0,0 +1,8 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import SyntaxTree from "./SyntaxTree.js"; + +export default class ParseTree extends SyntaxTree { +} diff --git a/runtime/JavaScript/src/antlr4/tree/ParseTreeListener.js b/runtime/JavaScript/src/antlr4/tree/ParseTreeListener.js new file mode 100644 index 0000000000..c90a9b6d45 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/ParseTreeListener.js @@ -0,0 +1,17 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default class ParseTreeListener { + visitTerminal(node) { + } + + visitErrorNode(node) { + } + + enterEveryRule(node) { + } + + exitEveryRule(node) { + } +} diff --git a/runtime/JavaScript/src/antlr4/tree/ParseTreeVisitor.js b/runtime/JavaScript/src/antlr4/tree/ParseTreeVisitor.js new file mode 100644 index 0000000000..6b29f762e4 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/ParseTreeVisitor.js @@ -0,0 +1,30 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default class ParseTreeVisitor { + visit(ctx) { + if (Array.isArray(ctx)) { + return ctx.map(function(child) { + return child.accept(this); + }, this); + } else { + return ctx.accept(this); + } + } + + visitChildren(ctx) { + if (ctx.children) { + return this.visit(ctx.children); + } else { + return null; + } + } + + visitTerminal(node) { + } + + visitErrorNode(node) { + } +} + diff --git a/runtime/JavaScript/src/antlr4/tree/ParseTreeWalker.js b/runtime/JavaScript/src/antlr4/tree/ParseTreeWalker.js new file mode 100644 index 0000000000..864707f286 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/ParseTreeWalker.js @@ -0,0 +1,60 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import TerminalNode from "./TerminalNode.js"; +import ErrorNode from "./ErrorNode.js"; + +export default class ParseTreeWalker { + + /** + * Performs a walk on the given parse tree starting at the root and going down recursively + * with depth-first search. On each node, {@link ParseTreeWalker//enterRule} is called before + * recursively walking down into child nodes, then + * {@link ParseTreeWalker//exitRule} is called after the recursive call to wind up. + * @param listener The listener used by the walker to process grammar rules + * @param t The parse tree to be walked on + */ + walk(listener, t) { + const errorNode = t instanceof ErrorNode || + (t.isErrorNode !== undefined && t.isErrorNode()); + if (errorNode) { + listener.visitErrorNode(t); + } else if (t instanceof TerminalNode) { + listener.visitTerminal(t); + } else { + this.enterRule(listener, t); + for (let i = 0; i < t.getChildCount(); i++) { + const child = t.getChild(i); + this.walk(listener, child); + } + this.exitRule(listener, t); + } + } + + /** + * Enters a grammar rule by first triggering the generic event {@link ParseTreeListener//enterEveryRule} + * then by triggering the event specific to the given parse tree node + * @param listener The listener responding to the trigger events + * @param r The grammar rule containing the rule context + */ + enterRule(listener, r) { + const ctx = r.getRuleContext(); + listener.enterEveryRule(ctx); + ctx.enterRule(listener); + } + + /** + * Exits a grammar rule by first triggering the event specific to the given parse tree node + * then by triggering the generic event {@link ParseTreeListener//exitEveryRule} + * @param listener The listener responding to the trigger events + * @param r The grammar rule containing the rule context + */ + exitRule(listener, r) { + const ctx = r.getRuleContext(); + ctx.exitRule(listener); + listener.exitEveryRule(ctx); + } +} + +ParseTreeWalker.DEFAULT = new ParseTreeWalker(); diff --git a/runtime/JavaScript/src/antlr4/tree/RuleNode.js b/runtime/JavaScript/src/antlr4/tree/RuleNode.js new file mode 100644 index 0000000000..bdd354a8d3 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/RuleNode.js @@ -0,0 +1,12 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ParseTree from "./ParseTree.js"; + +export default class RuleNode extends ParseTree { + + getRuleContext(){ + throw new Error("missing interface implementation") + } +} diff --git a/runtime/JavaScript/src/antlr4/tree/SyntaxTree.js b/runtime/JavaScript/src/antlr4/tree/SyntaxTree.js new file mode 100644 index 0000000000..94956165d2 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/SyntaxTree.js @@ -0,0 +1,8 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import Tree from "./Tree.js"; + +export default class SyntaxTree extends Tree { +} diff --git a/runtime/JavaScript/src/antlr4/tree/TerminalNode.js b/runtime/JavaScript/src/antlr4/tree/TerminalNode.js new file mode 100644 index 0000000000..b681ec60ef --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/TerminalNode.js @@ -0,0 +1,8 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import ParseTree from "./ParseTree.js"; + +export default class TerminalNode extends ParseTree { +} diff --git a/runtime/JavaScript/src/antlr4/tree/TerminalNodeImpl.js b/runtime/JavaScript/src/antlr4/tree/TerminalNodeImpl.js new file mode 100644 index 0000000000..5a270e3c20 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/tree/TerminalNodeImpl.js @@ -0,0 +1,60 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import Interval from "../misc/Interval.js"; +import Token from '../Token.js'; +import TerminalNode from "./TerminalNode.js"; + +export default class TerminalNodeImpl extends TerminalNode { + constructor(symbol) { + super(); + this.parentCtx = null; + this.symbol = symbol; + } + + getChild(i) { + return null; + } + + getSymbol() { + return this.symbol; + } + + getParent() { + return this.parentCtx; + } + + getPayload() { + return this.symbol; + } + + getSourceInterval() { + if (this.symbol === null) { + return Interval.INVALID_INTERVAL; + } + const tokenIndex = this.symbol.tokenIndex; + return new Interval(tokenIndex, tokenIndex); + } + + getChildCount() { + return 0; + } + + accept(visitor) { + return visitor.visitTerminal(this); + } + + getText() { + return this.symbol.text; + } + + toString() { + if (this.symbol.type === Token.EOF) { + return ""; + } else { + return this.symbol.text; + } + } +} + diff --git a/runtime/JavaScript/src/antlr4/tree/Tree.js b/runtime/JavaScript/src/antlr4/tree/Tree.js index cd87ef8b0b..4ad672dd12 100644 --- a/runtime/JavaScript/src/antlr4/tree/Tree.js +++ b/runtime/JavaScript/src/antlr4/tree/Tree.js @@ -1,228 +1,11 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const {Token} = require('./../Token'); -const {Interval} = require('./../IntervalSet'); -const INVALID_INTERVAL = new Interval(-1, -2); - /** * The basic notion of a tree has a parent, a payload, and a list of children. * It is the most abstract interface for all the trees used by ANTLR. */ -class Tree {} - -class SyntaxTree extends Tree { - constructor() { - super(); - } -} - -class ParseTree extends SyntaxTree { - constructor() { - super(); - } -} - -class RuleNode extends ParseTree { - constructor() { - super(); - } - - getRuleContext(){ - throw new Error("missing interface implementation") - } -} - -class TerminalNode extends ParseTree { - constructor() { - super(); - } -} - -class ErrorNode extends TerminalNode { - constructor() { - super(); - } -} - -class ParseTreeVisitor { - visit(ctx) { - if (Array.isArray(ctx)) { - return ctx.map(function(child) { - return child.accept(this); - }, this); - } else { - return ctx.accept(this); - } - } - - visitChildren(ctx) { - if (ctx.children) { - return this.visit(ctx.children); - } else { - return null; - } - } - - visitTerminal(node) { - } - - visitErrorNode(node) { - } -} - -class ParseTreeListener { - visitTerminal(node) { - } - - visitErrorNode(node) { - } - - enterEveryRule(node) { - } - - exitEveryRule(node) { - } -} - -class TerminalNodeImpl extends TerminalNode { - constructor(symbol) { - super(); - this.parentCtx = null; - this.symbol = symbol; - } - - getChild(i) { - return null; - } - - getSymbol() { - return this.symbol; - } - - getParent() { - return this.parentCtx; - } - - getPayload() { - return this.symbol; - } - - getSourceInterval() { - if (this.symbol === null) { - return INVALID_INTERVAL; - } - const tokenIndex = this.symbol.tokenIndex; - return new Interval(tokenIndex, tokenIndex); - } - - getChildCount() { - return 0; - } - - accept(visitor) { - return visitor.visitTerminal(this); - } - - getText() { - return this.symbol.text; - } - - toString() { - if (this.symbol.type === Token.EOF) { - return ""; - } else { - return this.symbol.text; - } - } -} - - -/** - * Represents a token that was consumed during resynchronization - * rather than during a valid match operation. For example, - * we will create this kind of a node during single token insertion - * and deletion as well as during "consume until error recovery set" - * upon no viable alternative exceptions. - */ -class ErrorNodeImpl extends TerminalNodeImpl { - constructor(token) { - super(token); - } - - isErrorNode() { - return true; - } - - accept(visitor) { - return visitor.visitErrorNode(this); - } -} - -class ParseTreeWalker { - - /** - * Performs a walk on the given parse tree starting at the root and going down recursively - * with depth-first search. On each node, {@link ParseTreeWalker//enterRule} is called before - * recursively walking down into child nodes, then - * {@link ParseTreeWalker//exitRule} is called after the recursive call to wind up. - * @param listener The listener used by the walker to process grammar rules - * @param t The parse tree to be walked on - */ - walk(listener, t) { - const errorNode = t instanceof ErrorNode || - (t.isErrorNode !== undefined && t.isErrorNode()); - if (errorNode) { - listener.visitErrorNode(t); - } else if (t instanceof TerminalNode) { - listener.visitTerminal(t); - } else { - this.enterRule(listener, t); - for (let i = 0; i < t.getChildCount(); i++) { - const child = t.getChild(i); - this.walk(listener, child); - } - this.exitRule(listener, t); - } - } - - /** - * Enters a grammar rule by first triggering the generic event {@link ParseTreeListener//enterEveryRule} - * then by triggering the event specific to the given parse tree node - * @param listener The listener responding to the trigger events - * @param r The grammar rule containing the rule context - */ - enterRule(listener, r) { - const ctx = r.getRuleContext(); - listener.enterEveryRule(ctx); - ctx.enterRule(listener); - } - - /** - * Exits a grammar rule by first triggering the event specific to the given parse tree node - * then by triggering the generic event {@link ParseTreeListener//exitEveryRule} - * @param listener The listener responding to the trigger events - * @param r The grammar rule containing the rule context - */ - exitRule(listener, r) { - const ctx = r.getRuleContext(); - ctx.exitRule(listener); - listener.exitEveryRule(ctx); - } -} - -ParseTreeWalker.DEFAULT = new ParseTreeWalker(); +export default class Tree {} -module.exports = { - RuleNode, - ErrorNode, - TerminalNode, - ErrorNodeImpl, - TerminalNodeImpl, - ParseTreeListener, - ParseTreeVisitor, - ParseTreeWalker, - INVALID_INTERVAL -} diff --git a/runtime/JavaScript/src/antlr4/tree/Trees.js b/runtime/JavaScript/src/antlr4/tree/Trees.js index 95343abb92..93e6ce1688 100644 --- a/runtime/JavaScript/src/antlr4/tree/Trees.js +++ b/runtime/JavaScript/src/antlr4/tree/Trees.js @@ -1,11 +1,13 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const Utils = require('./../Utils'); -const {Token} = require('./../Token'); -const {ErrorNode, TerminalNode, RuleNode} = require('./Tree'); +import Token from '../Token.js'; +import ErrorNode from './ErrorNode.js'; +import TerminalNode from './TerminalNode.js'; +import RuleNode from './RuleNode.js'; +import escapeWhitespace from "../utils/escapeWhitespace.js"; /** A set of utility routines useful for all kinds of ANTLR trees. */ const Trees = { @@ -21,7 +23,7 @@ const Trees = { ruleNames = recog.ruleNames; } let s = Trees.getNodeText(tree, ruleNames); - s = Utils.escapeWhitespace(s, false); + s = escapeWhitespace(s, false); const c = tree.getChildCount(); if(c===0) { return s; @@ -135,4 +137,4 @@ const Trees = { } } -module.exports = Trees; +export default Trees; diff --git a/runtime/JavaScript/src/antlr4/tree/index.js b/runtime/JavaScript/src/antlr4/tree/index.js index 2ae4c97fd9..73bf8c1abf 100644 --- a/runtime/JavaScript/src/antlr4/tree/index.js +++ b/runtime/JavaScript/src/antlr4/tree/index.js @@ -1,8 +1,14 @@ -/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. +/* Copyright (c) 2012-2022 The ANTLR Project. All rights reserved. * Use of this file is governed by the BSD 3-clause license that * can be found in the LICENSE.txt file in the project root. */ -const Tree = require('./Tree'); -const Trees = require('./Trees'); -module.exports = {...Tree, Trees} +import RuleNode from './RuleNode.js'; +import ErrorNode from './ErrorNode.js'; +import TerminalNode from './TerminalNode.js'; +import ParseTreeListener from './ParseTreeListener.js'; +import ParseTreeVisitor from './ParseTreeVisitor.js'; +import ParseTreeWalker from './ParseTreeWalker.js'; +import { default as Trees } from './Trees.js'; + +export default { Trees, RuleNode, ErrorNode, TerminalNode, ParseTreeListener, ParseTreeVisitor, ParseTreeWalker } diff --git a/runtime/JavaScript/src/antlr4/utils/DoubleDict.js b/runtime/JavaScript/src/antlr4/utils/DoubleDict.js new file mode 100644 index 0000000000..11246688fe --- /dev/null +++ b/runtime/JavaScript/src/antlr4/utils/DoubleDict.js @@ -0,0 +1,28 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import HashMap from "../misc/HashMap.js"; + +export default class DoubleDict { + + constructor(defaultMapCtor) { + this.defaultMapCtor = defaultMapCtor || HashMap; + this.cacheMap = new this.defaultMapCtor(); + } + + get(a, b) { + const d = this.cacheMap.get(a) || null; + return d === null ? null : (d.get(b) || null); + } + + set(a, b, o) { + let d = this.cacheMap.get(a) || null; + if (d === null) { + d = new this.defaultMapCtor(); + this.cacheMap.set(a, d); + } + d.set(b, o); + } + +} diff --git a/runtime/JavaScript/src/antlr4/utils/arrayToString.js b/runtime/JavaScript/src/antlr4/utils/arrayToString.js new file mode 100644 index 0000000000..a6f29227bb --- /dev/null +++ b/runtime/JavaScript/src/antlr4/utils/arrayToString.js @@ -0,0 +1,9 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import valueToString from "./valueToString.js"; + +export default function arrayToString(a) { + return Array.isArray(a) ? ("[" + a.map(valueToString).join(", ") + "]") : "null"; +} diff --git a/runtime/JavaScript/src/antlr4/utils/equalArrays.js b/runtime/JavaScript/src/antlr4/utils/equalArrays.js new file mode 100644 index 0000000000..c4ae6385da --- /dev/null +++ b/runtime/JavaScript/src/antlr4/utils/equalArrays.js @@ -0,0 +1,19 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default function equalArrays(a, b) { + if (!Array.isArray(a) || !Array.isArray(b)) + return false; + if (a === b) + return true; + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) { + if (a[i] === b[i]) + continue; + if (!a[i].equals || !a[i].equals(b[i])) + return false; + } + return true; +} diff --git a/runtime/JavaScript/src/antlr4/utils/escapeWhitespace.js b/runtime/JavaScript/src/antlr4/utils/escapeWhitespace.js new file mode 100644 index 0000000000..5b7b39bee4 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/utils/escapeWhitespace.js @@ -0,0 +1,13 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default function escapeWhitespace(s, escapeSpaces) { + s = s.replace(/\t/g, "\\t") + .replace(/\n/g, "\\n") + .replace(/\r/g, "\\r"); + if (escapeSpaces) { + s = s.replace(/ /g, "\u00B7"); + } + return s; +} diff --git a/runtime/JavaScript/src/antlr4/utils/index.js b/runtime/JavaScript/src/antlr4/utils/index.js new file mode 100644 index 0000000000..0606acf6af --- /dev/null +++ b/runtime/JavaScript/src/antlr4/utils/index.js @@ -0,0 +1,7 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +import arrayToString from "../utils/arrayToString.js"; + +export default { arrayToString }; diff --git a/runtime/JavaScript/src/antlr4/utils/standardEqualsFunction.js b/runtime/JavaScript/src/antlr4/utils/standardEqualsFunction.js new file mode 100644 index 0000000000..3269df835e --- /dev/null +++ b/runtime/JavaScript/src/antlr4/utils/standardEqualsFunction.js @@ -0,0 +1,7 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default function standardEqualsFunction(a, b) { + return a ? a.equals(b) : a===b; +} diff --git a/runtime/JavaScript/src/antlr4/utils/standardHashCodeFunction.js b/runtime/JavaScript/src/antlr4/utils/standardHashCodeFunction.js new file mode 100644 index 0000000000..eb54993862 --- /dev/null +++ b/runtime/JavaScript/src/antlr4/utils/standardHashCodeFunction.js @@ -0,0 +1,7 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default function standardHashCodeFunction(a) { + return a ? a.hashCode() : -1; +} diff --git a/runtime/JavaScript/src/antlr4/utils/stringHashCode.js b/runtime/JavaScript/src/antlr4/utils/stringHashCode.js new file mode 100644 index 0000000000..d4563f9d9f --- /dev/null +++ b/runtime/JavaScript/src/antlr4/utils/stringHashCode.js @@ -0,0 +1,63 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ + +String.prototype.seed = String.prototype.seed || Math.round(Math.random() * Math.pow(2, 32)); + +String.prototype.hashCode = function () { + const key = this.toString(); + let h1b, k1; + + const remainder = key.length & 3; // key.length % 4 + const bytes = key.length - remainder; + let h1 = String.prototype.seed; + const c1 = 0xcc9e2d51; + const c2 = 0x1b873593; + let i = 0; + + while (i < bytes) { + k1 = + ((key.charCodeAt(i) & 0xff)) | + ((key.charCodeAt(++i) & 0xff) << 8) | + ((key.charCodeAt(++i) & 0xff) << 16) | + ((key.charCodeAt(++i) & 0xff) << 24); + ++i; + + k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff; + h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16)); + } + + k1 = 0; + + switch (remainder) { + case 3: + k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16; + // no-break + case 2: + k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8; + // no-break + case 1: + k1 ^= (key.charCodeAt(i) & 0xff); + k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= key.length; + + h1 ^= h1 >>> 16; + h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; +}; diff --git a/runtime/JavaScript/src/antlr4/utils/titleCase.js b/runtime/JavaScript/src/antlr4/utils/titleCase.js new file mode 100644 index 0000000000..42f640fa9d --- /dev/null +++ b/runtime/JavaScript/src/antlr4/utils/titleCase.js @@ -0,0 +1,9 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default function titleCase(str) { + return str.replace(/\w\S*/g, function (txt) { + return txt.charAt(0).toUpperCase() + txt.substr(1); + }); +} diff --git a/runtime/JavaScript/src/antlr4/utils/valueToString.js b/runtime/JavaScript/src/antlr4/utils/valueToString.js new file mode 100644 index 0000000000..854ad6108c --- /dev/null +++ b/runtime/JavaScript/src/antlr4/utils/valueToString.js @@ -0,0 +1,7 @@ +/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved. + * Use is of this file is governed by the BSD 3-clause license that + * can be found in the LICENSE.txt file in the project root. + */ +export default function valueToString(v) { + return v === null ? "null" : v; +} diff --git a/runtime/JavaScript/src/test/TestIntervalSet.test.js b/runtime/JavaScript/src/test/TestIntervalSet.test.js deleted file mode 100644 index 8bdc9ec8f1..0000000000 --- a/runtime/JavaScript/src/test/TestIntervalSet.test.js +++ /dev/null @@ -1,58 +0,0 @@ -import antlr4 from "../antlr4/index.js"; - -it("computes interval set length", () => { - const s1 = new antlr4.IntervalSet(); - s1.addOne(20); - s1.addOne(154); - s1.addRange(169, 171); - expect(s1.length).toEqual(5); -}); - -it("merges simple interval sets", () => { - const s1 = new antlr4.IntervalSet(); - s1.addOne(10); - expect(s1.toString()).toEqual("10"); - const s2 = new antlr4.IntervalSet(); - s2.addOne(12); - expect(s2.toString()).toEqual("12"); - const merged = new antlr4.IntervalSet(); - merged.addSet(s1); - expect(merged.toString()).toEqual("10"); - merged.addSet(s2); - expect(merged.toString()).toEqual("{10, 12}"); - let s3 = new antlr4.IntervalSet(); - s3.addOne(10); - merged.addSet(s3); - expect(merged.toString()).toEqual("{10, 12}"); - s3 = new antlr4.IntervalSet(); - s3.addOne(11); - merged.addSet(s3); - expect(merged.toString()).toEqual("10..12"); - s3 = new antlr4.IntervalSet(); - s3.addOne(12); - merged.addSet(s3); - expect(merged.toString()).toEqual("10..12"); - -}); - -it("merges complex interval sets", () => { - const s1 = new antlr4.IntervalSet(); - s1.addOne(20); - s1.addOne(141); - s1.addOne(144); - s1.addOne(154); - s1.addRange(169, 171); - s1.addOne(173); - expect(s1.toString()).toEqual("{20, 141, 144, 154, 169..171, 173}"); - const s2 = new antlr4.IntervalSet(); - s2.addRange(9, 14); - s2.addOne(53); - s2.addRange(55, 63); - s2.addRange(65, 72); - s2.addRange(74, 117); - s2.addRange(119, 152); - s2.addRange(154, 164); - expect(s2.toString()).toEqual("{9..14, 53, 55..63, 65..72, 74..117, 119..152, 154..164}"); - s1.addSet(s2); - expect(s1.toString()).toEqual("{9..14, 20, 53, 55..63, 65..72, 74..117, 119..152, 154..164, 169..171, 173}"); -}); diff --git a/runtime/JavaScript/webpack.config.js b/runtime/JavaScript/webpack.config.cjs similarity index 68% rename from runtime/JavaScript/webpack.config.js rename to runtime/JavaScript/webpack.config.cjs index 84c5a57aef..f201218200 100644 --- a/runtime/JavaScript/webpack.config.js +++ b/runtime/JavaScript/webpack.config.cjs @@ -1,4 +1,5 @@ const path = require('path'); +const ESLintPlugin = require('eslint-webpack-plugin'); module.exports = { mode: "production", @@ -10,7 +11,7 @@ module.exports = { library: "antlr4", libraryTarget: 'window' }, - node: { + externals: { module: "empty", net: "empty", fs: "empty" @@ -20,9 +21,12 @@ module.exports = { rules: [{ test: /\.js$/, exclude: /node_modules/, - use: { - loader: 'babel-loader', - } + use: [ 'babel-loader' ] }] - } + }, + performance: { + maxAssetSize: 512000, + maxEntrypointSize: 512000 + }, + plugins: [ new ESLintPlugin() ] }; diff --git a/runtime/Python2/setup.py b/runtime/Python2/setup.py index d7f9ece275..e8bab93aba 100644 --- a/runtime/Python2/setup.py +++ b/runtime/Python2/setup.py @@ -1,13 +1,14 @@ from setuptools import setup +v = '4.10' setup( name='antlr4-python2-runtime', - version='4.9.3', + version=v, url='http://www.antlr.org', license='BSD', packages=['antlr4', 'antlr4.atn', 'antlr4.dfa', 'antlr4.tree', 'antlr4.error', 'antlr4.xpath'], package_dir={'': 'src'}, author='Eric Vergnaud, Terence Parr, Sam Harwell', author_email='eric.vergnaud@wanadoo.fr', - description='ANTLR 4.9.3 runtime for Python 2.7.12' -) + description=f'ANTLR {v} runtime for Python 2.7.12' +) \ No newline at end of file diff --git a/runtime/Python2/src/antlr4/Recognizer.py b/runtime/Python2/src/antlr4/Recognizer.py index ea9a8739fd..99462d409b 100644 --- a/runtime/Python2/src/antlr4/Recognizer.py +++ b/runtime/Python2/src/antlr4/Recognizer.py @@ -30,7 +30,7 @@ def extractVersion(self, version): return major, minor def checkVersion(self, toolVersion): - runtimeVersion = "4.9.3" + runtimeVersion = "4.10" rvmajor, rvminor = self.extractVersion(runtimeVersion) tvmajor, tvminor = self.extractVersion(toolVersion) if rvmajor!=tvmajor or rvminor!=tvminor: diff --git a/runtime/Python2/src/antlr4/atn/ATNDeserializer.py b/runtime/Python2/src/antlr4/atn/ATNDeserializer.py index 6f9c0c6cf7..f8bc5133ca 100644 --- a/runtime/Python2/src/antlr4/atn/ATNDeserializer.py +++ b/runtime/Python2/src/antlr4/atn/ATNDeserializer.py @@ -2,7 +2,6 @@ # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. #/ -from uuid import UUID from antlr4.atn.ATN import ATN from antlr4.atn.ATNType import ATNType from antlr4.atn.ATNState import * @@ -10,22 +9,7 @@ from antlr4.atn.LexerAction import * from antlr4.atn.ATNDeserializationOptions import ATNDeserializationOptions -# This is the earliest supported serialized UUID. -BASE_SERIALIZED_UUID = UUID("AADB8D7E-AEEF-4415-AD2B-8204D6CF042E") - -# This UUID indicates the serialized ATN contains two sets of -# IntervalSets, where the second set's values are encoded as -# 32-bit integers to support the full Unicode SMP range up to U+10FFFF. -ADDED_UNICODE_SMP = UUID("59627784-3BE5-417A-B9EB-8131A7286089") - -# This list contains all of the currently supported UUIDs, ordered by when -# the feature first appeared in this branch. -SUPPORTED_UUIDS = [ BASE_SERIALIZED_UUID, ADDED_UNICODE_SMP ] - -SERIALIZED_VERSION = 3 - -# This is the current serialized UUID. -SERIALIZED_UUID = ADDED_UNICODE_SMP +SERIALIZED_VERSION = 4 class ATNDeserializer (object): @@ -37,40 +21,16 @@ def __init__(self, options = None): self.stateFactories = None self.actionFactories = None - # Determines if a particular serialized representation of an ATN supports - # a particular feature, identified by the {@link UUID} used for serializing - # the ATN at the time the feature was first introduced. - # - # @param feature The {@link UUID} marking the first time the feature was - # supported in the serialized ATN. - # @param actualUuid The {@link UUID} of the actual serialized ATN which is - # currently being deserialized. - # @return {@code true} if the {@code actualUuid} value represents a - # serialized ATN at or after the feature identified by {@code feature} was - # introduced; otherwise, {@code false}. - - def isFeatureSupported(self, feature, actualUuid): - idx1 = SUPPORTED_UUIDS.index(feature) - if idx1<0: - return False - idx2 = SUPPORTED_UUIDS.index(actualUuid) - return idx2 >= idx1 - def deserialize(self, data): - self.reset(data) + self.data = data + self.pos = 0 self.checkVersion() - self.checkUUID() atn = self.readATN() self.readStates(atn) self.readRules(atn) self.readModes(atn) sets = [] - # First, read all sets with 16-bit Unicode code points <= U+FFFF. - self.readSets(atn, sets, self.readInt) - # Next, if the ATN was serialized with the Unicode SMP feature, - # deserialize sets with 32-bit arguments <= U+10FFFF. - if self.isFeatureSupported(ADDED_UNICODE_SMP, self.uuid): - self.readSets(atn, sets, self.readInt32) + self.readSets(atn, sets) self.readEdges(atn, sets) self.readDecisions(atn) self.readLexerActions(atn) @@ -83,28 +43,11 @@ def deserialize(self, data): self.verifyATN(atn) return atn - def reset(self, data): - def adjust(c): - v = ord(c) - return v-2 if v>1 else v + 65533 - temp = [ adjust(c) for c in data ] - # don't adjust the first value since that's the version number - temp[0] = ord(data[0]) - self.data = temp - self.pos = 0 - def checkVersion(self): version = self.readInt() if version != SERIALIZED_VERSION: raise Exception("Could not deserialize ATN with version " + str(version) + " (expected " + str(SERIALIZED_VERSION) + ").") - def checkUUID(self): - uuid = self.readUUID() - if not uuid in SUPPORTED_UUIDS: - raise Exception("Could not deserialize ATN with UUID: " + str(uuid) + \ - " (expected " + str(SERIALIZED_UUID) + " or a legacy UUID).", uuid, SERIALIZED_UUID) - self.uuid = uuid - def readATN(self): grammarType = self.readInt() maxTokenType = self.readInt() @@ -121,9 +64,6 @@ def readStates(self, atn): atn.addState(None) continue ruleIndex = self.readInt() - if ruleIndex == 0xFFFF: - ruleIndex = -1 - s = self.stateFactory(stype, ruleIndex) if stype == ATNState.LOOP_END: # special case loopBackStateNumber = self.readInt() @@ -163,9 +103,6 @@ def readRules(self, atn): atn.ruleToStartState[i] = startState if atn.grammarType == ATNType.LEXER: tokenType = self.readInt() - if tokenType == 0xFFFF: - tokenType = Token.EOF - atn.ruleToTokenType[i] = tokenType atn.ruleToStopState = [0] * nrules @@ -181,7 +118,7 @@ def readModes(self, atn): s = self.readInt() atn.modeToStartState.append(atn.states[s]) - def readSets(self, atn, sets, readUnicode): + def readSets(self, atn, sets): m = self.readInt() for i in range(0, m): iset = IntervalSet() @@ -191,8 +128,8 @@ def readSets(self, atn, sets, readUnicode): if containsEof!=0: iset.addOne(-1) for j in range(0, n): - i1 = readUnicode() - i2 = readUnicode() + i1 = self.readInt() + i2 = self.readInt() iset.addRange(Interval(i1, i2 + 1)) # range upper limit is exclusive def readEdges(self, atn, sets): @@ -257,11 +194,7 @@ def readLexerActions(self, atn): for i in range(0, count): actionType = self.readInt() data1 = self.readInt() - if data1 == 0xFFFF: - data1 = -1 data2 = self.readInt() - if data2 == 0xFFFF: - data2 = -1 lexerAction = self.lexerActionFactory(actionType, data1, data2) atn.lexerActions[i] = lexerAction @@ -436,17 +369,6 @@ def readInt32(self): high = self.readInt() return low | (high << 16) - def readLong(self): - low = self.readInt32() - high = self.readInt32() - return (low & 0x00000000FFFFFFFF) | (high << 32) - - def readUUID(self): - low = self.readLong() - high = self.readLong() - allBits = (low & 0xFFFFFFFFFFFFFFFF) | (high << 64) - return UUID(int=allBits) - def edgeFactory(self, atn, type, src, trg, arg1, arg2, arg3, sets): target = atn.states[trg] if self.edgeFactories is None: diff --git a/runtime/Python2/src/antlr4/atn/LexerATNSimulator.py b/runtime/Python2/src/antlr4/atn/LexerATNSimulator.py index 02ed686cbc..a782abf807 100644 --- a/runtime/Python2/src/antlr4/atn/LexerATNSimulator.py +++ b/runtime/Python2/src/antlr4/atn/LexerATNSimulator.py @@ -53,8 +53,6 @@ class LexerATNSimulator(ATNSimulator): ERROR = None - match_calls = 0 - def __init__(self, recog, atn, decisionToDFA, sharedContextCache): super(LexerATNSimulator, self).__init__(atn, sharedContextCache) self.decisionToDFA = decisionToDFA @@ -81,7 +79,6 @@ def copyState(self, simulator ): self.startIndex = simulator.startIndex def match(self, input , mode): - self.match_calls += 1 self.mode = mode mark = input.mark() try: diff --git a/runtime/Python2/src/antlr4/xpath/XPath.py b/runtime/Python2/src/antlr4/xpath/XPath.py index 258dcdbe49..92f5e0dac3 100644 --- a/runtime/Python2/src/antlr4/xpath/XPath.py +++ b/runtime/Python2/src/antlr4/xpath/XPath.py @@ -48,111 +48,30 @@ # Whitespace is not allowed.

# from antlr4 import CommonTokenStream, DFA, PredictionContextCache, Lexer, LexerATNSimulator, ParserRuleContext, TerminalNode -from antlr4.atn.ATNDeserializer import ATNDeserializer from antlr4.InputStream import InputStream +from antlr4.Parser import Parser +from antlr4.RuleContext import RuleContext from antlr4.Token import Token +from antlr4.atn.ATNDeserializer import ATNDeserializer from antlr4.error.ErrorListener import ErrorListener from antlr4.error.Errors import LexerNoViableAltException +from antlr4.tree.Tree import ParseTree from antlr4.tree.Trees import Trees - from io import StringIO +from antlr4.xpath.XPathLexer import XPathLexer -def serializedATN(): - with StringIO() as buf: - buf.write(u"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2") - buf.write(u"\n\64\b\1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7") - buf.write(u"\t\7\4\b\t\b\4\t\t\t\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\5") - buf.write(u"\3\5\3\6\3\6\7\6\37\n\6\f\6\16\6\"\13\6\3\6\3\6\3\7\3") - buf.write(u"\7\5\7(\n\7\3\b\3\b\3\t\3\t\7\t.\n\t\f\t\16\t\61\13\t") - buf.write(u"\3\t\3\t\3/\2\n\3\5\5\6\7\7\t\b\13\t\r\2\17\2\21\n\3") - buf.write(u"\2\4\7\2\62;aa\u00b9\u00b9\u0302\u0371\u2041\u2042\17") - buf.write(u"\2C\\c|\u00c2\u00d8\u00da\u00f8\u00fa\u0301\u0372\u037f") - buf.write(u"\u0381\u2001\u200e\u200f\u2072\u2191\u2c02\u2ff1\u3003") - buf.write(u"\ud801\uf902\ufdd1\ufdf2\uffff\64\2\3\3\2\2\2\2\5\3\2") - buf.write(u"\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\21\3\2\2") - buf.write(u"\2\3\23\3\2\2\2\5\26\3\2\2\2\7\30\3\2\2\2\t\32\3\2\2") - buf.write(u"\2\13\34\3\2\2\2\r\'\3\2\2\2\17)\3\2\2\2\21+\3\2\2\2") - buf.write(u"\23\24\7\61\2\2\24\25\7\61\2\2\25\4\3\2\2\2\26\27\7\61") - buf.write(u"\2\2\27\6\3\2\2\2\30\31\7,\2\2\31\b\3\2\2\2\32\33\7#") - buf.write(u"\2\2\33\n\3\2\2\2\34 \5\17\b\2\35\37\5\r\7\2\36\35\3") - buf.write(u"\2\2\2\37\"\3\2\2\2 \36\3\2\2\2 !\3\2\2\2!#\3\2\2\2\"") - buf.write(u" \3\2\2\2#$\b\6\2\2$\f\3\2\2\2%(\5\17\b\2&(\t\2\2\2\'") - buf.write(u"%\3\2\2\2\'&\3\2\2\2(\16\3\2\2\2)*\t\3\2\2*\20\3\2\2") - buf.write(u"\2+/\7)\2\2,.\13\2\2\2-,\3\2\2\2.\61\3\2\2\2/\60\3\2") - buf.write(u"\2\2/-\3\2\2\2\60\62\3\2\2\2\61/\3\2\2\2\62\63\7)\2\2") - buf.write(u"\63\22\3\2\2\2\6\2 \'/\3\3\6\2") - return buf.getvalue() - - -class XPathLexer(Lexer): - - atn = ATNDeserializer().deserialize(serializedATN()) - - decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] - - - TOKEN_REF = 1 - RULE_REF = 2 - ANYWHERE = 3 - ROOT = 4 - WILDCARD = 5 - BANG = 6 - ID = 7 - STRING = 8 - - modeNames = [ u"DEFAULT_MODE" ] - - literalNames = [ u"", - u"'//'", u"'/'", u"'*'", u"'!'" ] - - symbolicNames = [ u"", - u"TOKEN_REF", u"RULE_REF", u"ANYWHERE", u"ROOT", u"WILDCARD", - u"BANG", u"ID", u"STRING" ] - - ruleNames = [ u"ANYWHERE", u"ROOT", u"WILDCARD", u"BANG", u"ID", u"NameChar", - u"NameStartChar", u"STRING" ] - - grammarFileName = u"XPathLexer.g4" - - def __init__(self, input=None): - super(XPathLexer, self).__init__(input) - self.checkVersion("4.5") - self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) - self._actions = None - self._predicates = None - - - def action(self, localctx, ruleIndex, actionIndex): - if self._actions is None: - actions = dict() - actions[4] = self.ID_action - self._actions = actions - action = self._actions.get(ruleIndex, None) - if action is not None: - action(localctx, actionIndex) - else: - raise Exception("No registered action for:" + str(ruleIndex)) - - def ID_action(self, localctx , actionIndex): - if actionIndex == 0: - char = self.text[0] - if char.isupper(): - self.type = XPathLexer.TOKEN_REF - else: - self.type = XPathLexer.RULE_REF - class XPath(object): WILDCARD = "*" # word not operator/separator NOT = "!" # word for invert operator - def __init__(self, parser, path): + def __init__(self, parser:Parser, path:str): self.parser = parser self.path = path self.elements = self.split(path) - def split(self, path): + def split(self, path:str): input = InputStream(path) lexer = XPathLexer(input) def recover(self, e): @@ -164,40 +83,40 @@ def recover(self, e): try: tokenStream.fill() except LexerNoViableAltException as e: - pos = lexer.getColumn() - msg = "Invalid tokens or characters at index " + str(pos) + " in path '" + path + "'" + pos = lexer.column + msg = "Invalid tokens or characters at index %d in path '%s'" % (pos, path) raise Exception(msg, e) - tokens = tokenStream.getTokens() + tokens = iter(tokenStream.tokens) elements = list() - n = len(tokens) - i=0 - while i < n : - el = tokens[i] - next = None + for el in tokens: + invert = False + anywhere = False + # Check for path separators, if none assume root if el.type in [XPathLexer.ROOT, XPathLexer.ANYWHERE]: - anywhere = el.type == XPathLexer.ANYWHERE - i += 1 - next = tokens[i] - invert = next.type==XPathLexer.BANG - if invert: - i += 1 - next = tokens[i] - pathElement = self.getXPathElement(next, anywhere) - pathElement.invert = invert - elements.append(pathElement) - i += 1 - - elif el.type in [XPathLexer.TOKEN_REF, XPathLexer.RULE_REF, XPathLexer.WILDCARD] : - elements.append( self.getXPathElement(el, False) ) - i += 1 - - elif el.type==Token.EOF : - break - + anywhere = el.type == XPathLexer.ANYWHERE + next_el = next(tokens, None) + if not next_el: + raise Exception('Missing element after %s' % el.getText()) + else: + el = next_el + # Check for bangs + if el.type == XPathLexer.BANG: + invert = True + next_el = next(tokens, None) + if not next_el: + raise Exception('Missing element after %s' % el.getText()) + else: + el = next_el + # Add searched element + if el.type in [XPathLexer.TOKEN_REF, XPathLexer.RULE_REF, XPathLexer.WILDCARD, XPathLexer.STRING]: + element = self.getXPathElement(el, anywhere) + element.invert = invert + elements.append(element) + elif el.type==Token.EOF: + break else: - raise Exception("Unknown path element " + str(el)) - + raise Exception("Unknown path element %s" % lexer.symbolicNames[el.type]) return elements # @@ -205,31 +124,39 @@ def recover(self, e): # element. {@code anywhere} is {@code true} if {@code //} precedes the # word. # - def getXPathElement(self, wordToken, anywhere): + def getXPathElement(self, wordToken:Token, anywhere:bool): if wordToken.type==Token.EOF: raise Exception("Missing path element at end of path") - word = wordToken.text - ttype = self.parser.getTokenType(word) - ruleIndex = self.parser.getRuleIndex(word) + word = wordToken.text if wordToken.type==XPathLexer.WILDCARD : - return XPathWildcardAnywhereElement() if anywhere else XPathWildcardElement() elif wordToken.type in [XPathLexer.TOKEN_REF, XPathLexer.STRING]: + tsource = self.parser.getTokenStream().tokenSource - if ttype==Token.INVALID_TYPE: - raise Exception( word + " at index " + str(wordToken.startIndex) + " isn't a valid token name") + ttype = Token.INVALID_TYPE + if wordToken.type == XPathLexer.TOKEN_REF: + if word in tsource.ruleNames: + ttype = tsource.ruleNames.index(word) + 1 + else: + if word in tsource.literalNames: + ttype = tsource.literalNames.index(word) + + if ttype == Token.INVALID_TYPE: + raise Exception("%s at index %d isn't a valid token name" % (word, wordToken.tokenIndex)) return XPathTokenAnywhereElement(word, ttype) if anywhere else XPathTokenElement(word, ttype) else: + ruleIndex = self.parser.ruleNames.index(word) if word in self.parser.ruleNames else -1 - if ruleIndex==-1: - raise Exception( word + " at index " + str(wordToken.getStartIndex()) + " isn't a valid rule name") + if ruleIndex == -1: + raise Exception("%s at index %d isn't a valid rule name" % (word, wordToken.tokenIndex)) return XPathRuleAnywhereElement(word, ruleIndex) if anywhere else XPathRuleElement(word, ruleIndex) - def findAll(self, tree, xpath, parser): + @staticmethod + def findAll(tree:ParseTree, xpath:str, parser:Parser): p = XPath(parser, xpath) return p.evaluate(tree) @@ -238,37 +165,37 @@ def findAll(self, tree, xpath, parser): # path. The root {@code /} is relative to the node passed to # {@link #evaluate}. # - def evaluate(self, t): + def evaluate(self, t:ParseTree): dummyRoot = ParserRuleContext() dummyRoot.children = [t] # don't set t's parent. work = [dummyRoot] - - for i in range(0, len(self.elements)): - next = set() + for element in self.elements: + work_next = list() for node in work: - if len( node.children) > 0 : + if not isinstance(node, TerminalNode) and node.children: # only try to match next element if it has children # e.g., //func/*/stat might have a token node for which # we can't go looking for stat nodes. - matching = self.elements[i].evaluate(node) - next |= matching - i += 1 - work = next + matching = element.evaluate(node) + + # See issue antlr#370 - Prevents XPath from returning the + # same node multiple times + matching = filter(lambda m: m not in work_next, matching) + + work_next.extend(matching) + work = work_next return work class XPathElement(object): - def __init__(self, nodeName): + def __init__(self, nodeName:str): self.nodeName = nodeName self.invert = False def __str__(self): - return unicode(self) - - def __unicode__(self): return type(self).__name__ + "[" + ("!" if self.invert else "") + self.nodeName + "]" @@ -278,51 +205,51 @@ def __unicode__(self): # class XPathRuleAnywhereElement(XPathElement): - def __init__(self, ruleName, ruleIndex): - super(XPathRuleAnywhereElement, self).__init__(ruleName) + def __init__(self, ruleName:str, ruleIndex:int): + super().__init__(ruleName) self.ruleIndex = ruleIndex - def evaluate(self, t): - return Trees.findAllRuleNodes(t, self.ruleIndex) - + def evaluate(self, t:ParseTree): + # return all ParserRuleContext descendants of t that match ruleIndex (or do not match if inverted) + return filter(lambda c: isinstance(c, ParserRuleContext) and (self.invert ^ (c.getRuleIndex() == self.ruleIndex)), Trees.descendants(t)) class XPathRuleElement(XPathElement): - def __init__(self, ruleName, ruleIndex): - super(XPathRuleElement, self).__init__(ruleName) + def __init__(self, ruleName:str, ruleIndex:int): + super().__init__(ruleName) self.ruleIndex = ruleIndex - def evaluate(self, t): - # return all children of t that match nodeName - return [c for c in Trees.getChildren(t) if isinstance(c, ParserRuleContext) and (c.ruleIndex == self.ruleIndex) == (not self.invert)] + def evaluate(self, t:ParseTree): + # return all ParserRuleContext children of t that match ruleIndex (or do not match if inverted) + return filter(lambda c: isinstance(c, ParserRuleContext) and (self.invert ^ (c.getRuleIndex() == self.ruleIndex)), Trees.getChildren(t)) class XPathTokenAnywhereElement(XPathElement): - def __init__(self, ruleName, tokenType): - super(XPathTokenAnywhereElement, self).__init__(ruleName) + def __init__(self, ruleName:str, tokenType:int): + super().__init__(ruleName) self.tokenType = tokenType - def evaluate(self, t): - return Trees.findAllTokenNodes(t, self.tokenType) - + def evaluate(self, t:ParseTree): + # return all TerminalNode descendants of t that match tokenType (or do not match if inverted) + return filter(lambda c: isinstance(c, TerminalNode) and (self.invert ^ (c.symbol.type == self.tokenType)), Trees.descendants(t)) class XPathTokenElement(XPathElement): - def __init__(self, ruleName, tokenType): - super(XPathTokenElement, self).__init__(ruleName) + def __init__(self, ruleName:str, tokenType:int): + super().__init__(ruleName) self.tokenType = tokenType - def evaluate(self, t): - # return all children of t that match nodeName - return [c for c in Trees.getChildren(t) if isinstance(c, TerminalNode) and (c.symbol.type == self.tokenType) == (not self.invert)] + def evaluate(self, t:ParseTree): + # return all TerminalNode children of t that match tokenType (or do not match if inverted) + return filter(lambda c: isinstance(c, TerminalNode) and (self.invert ^ (c.symbol.type == self.tokenType)), Trees.getChildren(t)) class XPathWildcardAnywhereElement(XPathElement): def __init__(self): - super(XPathWildcardAnywhereElement, self).__init__(XPath.WILDCARD) + super().__init__(XPath.WILDCARD) - def evaluate(self, t): + def evaluate(self, t:ParseTree): if self.invert: return list() # !* is weird but valid (empty) else: @@ -332,10 +259,10 @@ def evaluate(self, t): class XPathWildcardElement(XPathElement): def __init__(self): - super(XPathWildcardElement, self).__init__(XPath.WILDCARD) + super().__init__(XPath.WILDCARD) - def evaluate(self, t): + def evaluate(self, t:ParseTree): if self.invert: return list() # !* is weird but valid (empty) else: diff --git a/runtime/Python2/src/antlr4/xpath/XPathLexer.g4 b/runtime/Python2/src/antlr4/xpath/XPathLexer.g4 new file mode 100644 index 0000000000..c4b1e173df --- /dev/null +++ b/runtime/Python2/src/antlr4/xpath/XPathLexer.g4 @@ -0,0 +1,45 @@ +lexer grammar XPathLexer; + +tokens { TOKEN_REF, RULE_REF } + +ANYWHERE : '//' ; +ROOT : '/' ; +WILDCARD : '*' ; +BANG : '!' ; + +ID : NameStartChar NameChar* + { + char = self.text[0] + if char.isupper(): + self.type = XPathLexer.TOKEN_REF + else: + self.type = XPathLexer.RULE_REF + } + ; + +fragment +NameChar : NameStartChar + | '0'..'9' + | '_' + | '\u00B7' + | '\u0300'..'\u036F' + | '\u203F'..'\u2040' + ; + +fragment +NameStartChar + : 'A'..'Z' | 'a'..'z' + | '\u00C0'..'\u00D6' + | '\u00D8'..'\u00F6' + | '\u00F8'..'\u02FF' + | '\u0370'..'\u037D' + | '\u037F'..'\u1FFF' + | '\u200C'..'\u200D' + | '\u2070'..'\u218F' + | '\u2C00'..'\u2FEF' + | '\u3001'..'\uD7FF' + | '\uF900'..'\uFDCF' + | '\uFDF0'..'\uFFFD' + ; // ignores | ['\u10000-'\uEFFFF] ; + +STRING : '\'' .*? '\'' ; diff --git a/runtime/Python2/src/antlr4/xpath/XPathLexer.py b/runtime/Python2/src/antlr4/xpath/XPathLexer.py new file mode 100644 index 0000000000..cbf3bb9827 --- /dev/null +++ b/runtime/Python2/src/antlr4/xpath/XPathLexer.py @@ -0,0 +1,95 @@ +# Generated from XPathLexer.g4 by ANTLR 4.9.3 +from antlr4 import * +from io import StringIO +import sys +if sys.version_info[1] > 5: + from typing import TextIO +else: + from typing.io import TextIO + + +def serializedATN(): + return [ + 4,0,8,50,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2, + 6,7,6,2,7,7,7,1,0,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,4,1,4,5,4,29, + 8,4,10,4,12,4,32,9,4,1,4,1,4,1,5,1,5,3,5,38,8,5,1,6,1,6,1,7,1,7, + 5,7,44,8,7,10,7,12,7,47,9,7,1,7,1,7,1,45,0,8,1,3,3,4,5,5,7,6,9,7, + 11,0,13,0,15,8,1,0,2,5,0,48,57,95,95,183,183,768,879,8255,8256,13, + 0,65,90,97,122,192,214,216,246,248,767,880,893,895,8191,8204,8205, + 8304,8591,11264,12271,12289,55295,63744,64975,65008,65533,50,0,1, + 1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,15,1,0, + 0,0,1,17,1,0,0,0,3,20,1,0,0,0,5,22,1,0,0,0,7,24,1,0,0,0,9,26,1,0, + 0,0,11,37,1,0,0,0,13,39,1,0,0,0,15,41,1,0,0,0,17,18,5,47,0,0,18, + 19,5,47,0,0,19,2,1,0,0,0,20,21,5,47,0,0,21,4,1,0,0,0,22,23,5,42, + 0,0,23,6,1,0,0,0,24,25,5,33,0,0,25,8,1,0,0,0,26,30,3,13,6,0,27,29, + 3,11,5,0,28,27,1,0,0,0,29,32,1,0,0,0,30,28,1,0,0,0,30,31,1,0,0,0, + 31,33,1,0,0,0,32,30,1,0,0,0,33,34,6,4,0,0,34,10,1,0,0,0,35,38,3, + 13,6,0,36,38,7,0,0,0,37,35,1,0,0,0,37,36,1,0,0,0,38,12,1,0,0,0,39, + 40,7,1,0,0,40,14,1,0,0,0,41,45,5,39,0,0,42,44,9,0,0,0,43,42,1,0, + 0,0,44,47,1,0,0,0,45,46,1,0,0,0,45,43,1,0,0,0,46,48,1,0,0,0,47,45, + 1,0,0,0,48,49,5,39,0,0,49,16,1,0,0,0,4,0,30,37,45,1,1,4,0 + ] + +class XPathLexer(Lexer): + + atn = ATNDeserializer().deserialize(serializedATN()) + + decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ] + + TOKEN_REF = 1 + RULE_REF = 2 + ANYWHERE = 3 + ROOT = 4 + WILDCARD = 5 + BANG = 6 + ID = 7 + STRING = 8 + + channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ] + + modeNames = [ "DEFAULT_MODE" ] + + literalNames = [ "", + "'//'", "'/'", "'*'", "'!'" ] + + symbolicNames = [ "", + "TOKEN_REF", "RULE_REF", "ANYWHERE", "ROOT", "WILDCARD", "BANG", + "ID", "STRING" ] + + ruleNames = [ "ANYWHERE", "ROOT", "WILDCARD", "BANG", "ID", "NameChar", + "NameStartChar", "STRING" ] + + grammarFileName = "XPathLexer.g4" + + def __init__(self, input=None, output:TextIO = sys.stdout): + super().__init__(input, output) + self.checkVersion("4.9.3") + self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache()) + self._actions = None + self._predicates = None + + + def action(self, localctx:RuleContext, ruleIndex:int, actionIndex:int): + if self._actions is None: + actions = dict() + actions[4] = self.ID_action + self._actions = actions + action = self._actions.get(ruleIndex, None) + if action is not None: + action(localctx, actionIndex) + else: + raise Exception("No registered action for:" + str(ruleIndex)) + + + def ID_action(self, localctx:RuleContext , actionIndex:int): + if actionIndex == 0: + + char = self.text[0] + if char.isupper(): + self.type = XPathLexer.TOKEN_REF + else: + self.type = XPathLexer.RULE_REF + + + + diff --git a/runtime/Python3/bin/pygrun.bat b/runtime/Python3/bin/pygrun.bat deleted file mode 100755 index d30af61e80..0000000000 --- a/runtime/Python3/bin/pygrun.bat +++ /dev/null @@ -1,6 +0,0 @@ -@ECHO OFF -IF NOT "%~f0" == "~f0" GOTO :WinNT -@"python.exe"