From cde1868f9caee9b6335fa5988463d173fecde3ae Mon Sep 17 00:00:00 2001 From: Peter Ohm Date: Fri, 15 Nov 2019 13:28:47 -0700 Subject: [PATCH 01/21] MueLu: adding region vector unit-test. Added tests for regionalToComposite and compositeToRegional. --- packages/muelu/test/unit_tests/CMakeLists.txt | 2 +- .../muelu/test/unit_tests/RegionVector.cpp | 381 ++++++++++++++++++ 2 files changed, 382 insertions(+), 1 deletion(-) create mode 100644 packages/muelu/test/unit_tests/RegionVector.cpp diff --git a/packages/muelu/test/unit_tests/CMakeLists.txt b/packages/muelu/test/unit_tests/CMakeLists.txt index 652b851c25e8..26382f402a0f 100644 --- a/packages/muelu/test/unit_tests/CMakeLists.txt +++ b/packages/muelu/test/unit_tests/CMakeLists.txt @@ -195,7 +195,7 @@ IF (${PACKAGE_NAME}_ENABLE_Zoltan AND TPL_ENABLE_MPI) ENDIF() IF (${PACKAGE_NAME}_ENABLE_Experimental AND ${PACKAGE_NAME}_ENABLE_Tpetra AND ${PACKAGE_NAME}_ENABLE_Ifpack2 AND ${PACKAGE_NAME}_ENABLE_Amesos2) - APPEND_SET(SOURCES_REGION RegionMatrix.cpp) + APPEND_SET(SOURCES_REGION RegionMatrix.cpp RegionVector.cpp) ENDIF() IF (${PACKAGE_NAME}_ENABLE_Galeri) #TMP diff --git a/packages/muelu/test/unit_tests/RegionVector.cpp b/packages/muelu/test/unit_tests/RegionVector.cpp new file mode 100644 index 000000000000..e7425d6d24d3 --- /dev/null +++ b/packages/muelu/test/unit_tests/RegionVector.cpp @@ -0,0 +1,381 @@ +// @HEADER +// +// *********************************************************************** +// +// MueLu: A package for multigrid based preconditioning +// Copyright 2012 Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// 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 Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE +// 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. +// +// Questions? Contact +// Jonathan Hu (jhu@sandia.gov) +// Andrey Prokopenko (aprokop@sandia.gov) +// Ray Tuminaro (rstumin@sandia.gov) +// +// *********************************************************************** +// +// @HEADER +#include "Teuchos_UnitTestHarness.hpp" +#include "MueLu_TestHelpers.hpp" +#include "MueLu_Version.hpp" + +#include + +// Region MG headers +#include "SetupRegionUtilities.hpp" +#include "SetupRegionVector_def.hpp" +#include "SetupRegionMatrix_def.hpp" + +namespace MueLuTests { + +TEUCHOS_UNIT_TEST_TEMPLATE_4_DECL(RegionVector, RegionCompositeVector, Scalar, LocalOrdinal, GlobalOrdinal, Node) +{ +# include "MueLu_UseShortNames.hpp" + MUELU_TESTING_SET_OSTREAM; + MUELU_TESTING_LIMIT_SCOPE(Scalar,GlobalOrdinal,Node); + + using TST = Teuchos::ScalarTraits; + using magnitude_type = typename TST::magnitudeType; + using TMT = Teuchos::ScalarTraits; + using real_type = typename TST::coordinateType; + using RealValuedMultiVector = Xpetra::MultiVector; + using test_factory = TestHelpers::TestFactory; + + out << "version: " << MueLu::Version() << std::endl; + + // Get MPI parameter + RCP > comm = TestHelpers::Parameters::getDefaultComm(); + LO numRanks = comm->getSize(); + LO myRank = comm->getRank(); + + GO nx = 5, ny = 5, nz = 1; + Teuchos::CommandLineProcessor &clp = Teuchos::UnitTestRepository::getCLP(); + Galeri::Xpetra::Parameters galeriParameters(clp, nx, ny, nz, "Laplace2D"); + Teuchos::ParameterList galeriList = galeriParameters.GetParameterList(); + std::string matrixType = galeriParameters.GetMatrixType(); + + // Build maps for the problem + const LO numDofsPerNode = 1; + RCP nodeMap = Galeri::Xpetra::CreateMap(TestHelpers::Parameters::getLib(), + "Cartesian2D", comm, galeriList); + RCP dofMap = Xpetra::MapFactory::Build(nodeMap, numDofsPerNode); + + // Build the Xpetra problem + RCP > Pr = + Galeri::Xpetra::BuildProblem(galeriParameters.GetMatrixType(), dofMap, galeriList); + + // Generate the operator + RCP A = Pr->BuildMatrix(); + A->SetFixedBlockSize(numDofsPerNode); + + // Set global geometric data + Array lNodesPerDir(3); + Array gNodesPerDir(3); + Array procsPerDim(3); + gNodesPerDir[0] = galeriList.get("nx"); + gNodesPerDir[1] = galeriList.get("ny"); + gNodesPerDir[2] = 1; + lNodesPerDir[0] = galeriList.get("lnx"); + lNodesPerDir[1] = galeriList.get("lny"); + lNodesPerDir[2] = 1; + procsPerDim[0] = galeriList.get("mx"); + procsPerDim[1] = galeriList.get("my"); + procsPerDim[2] = 1; + + Array boundaryConditions; + int maxRegPerGID = 0; + int numInterfaces = 0; + LO numLocalRegionNodes = 0; + Array sendGIDs; + Array sendPIDs; + Array rNodesPerDim(3); + Array compositeToRegionLIDs(nodeMap->getNodeNumElements()*numDofsPerNode); + Array quasiRegionGIDs; + Array quasiRegionCoordGIDs; + createRegionData(2, false, numDofsPerNode, + gNodesPerDir(), lNodesPerDir(), procsPerDim(), + nodeMap, dofMap, + maxRegPerGID, numLocalRegionNodes, boundaryConditions, + sendGIDs, sendPIDs, numInterfaces, rNodesPerDim, + quasiRegionGIDs, quasiRegionCoordGIDs, compositeToRegionLIDs); + + const int maxRegPerProc = 1; + std::vector > rowMapPerGrp(maxRegPerProc), colMapPerGrp(maxRegPerProc); + rowMapPerGrp[0] = Xpetra::MapFactory::Build(A->getRowMap()->lib(), + Teuchos::OrdinalTraits::invalid(), + quasiRegionGIDs(), + A->getRowMap()->getIndexBase(), + A->getRowMap()->getComm()); + colMapPerGrp[0] = rowMapPerGrp[0]; + + std::vector > revisedRowMapPerGrp(maxRegPerProc), revisedColMapPerGrp(maxRegPerProc); + revisedRowMapPerGrp[0] = Xpetra::MapFactory::Build(A->getRowMap()->lib(), + Teuchos::OrdinalTraits::invalid(), + quasiRegionGIDs.size()*numDofsPerNode, + A->getRowMap()->getIndexBase(), + A->getRowMap()->getComm()); + revisedColMapPerGrp[0] = revisedRowMapPerGrp[0]; + + std::vector > rowImportPerGrp(maxRegPerProc); + std::vector > colImportPerGrp(maxRegPerProc); + rowImportPerGrp[0] = ImportFactory::Build(dofMap, rowMapPerGrp[0]); + colImportPerGrp[0] = ImportFactory::Build(dofMap, colMapPerGrp[0]); + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + { // test compositeToRegional + // Create a composite vector + RCP compVec = VectorFactory::Build(dofMap); + TEUCHOS_ASSERT(!compVec.is_null()); + compVec->putScalar(0.0); + const size_t localLength = compVec->getLocalLength(); + for (size_t k = 0; k < localLength; ++k) { + compVec->replaceLocalValue(k, k + myRank/10.0);// (LO, Scalar) need to fix type of k + } + + // Create a region vector + Array > regVec(maxRegPerProc); + Array > quasiRegVec(maxRegPerProc); + + compositeToRegional(compVec, quasiRegVec, regVec, maxRegPerProc, rowMapPerGrp, revisedRowMapPerGrp, rowImportPerGrp); + + //RCP outF = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout)); + //std::cout<<"compVec:"<describe(*outF, Teuchos::VERB_EXTREME); + //std::cout<<"Quasi:"<describe(*outF, Teuchos::VERB_EXTREME); + //std::cout<<"Reg:"<describe(*outF, Teuchos::VERB_EXTREME); + if(numRanks == 1){ + TEST_EQUALITY(regVec[0]->getLocalLength(), 25); + TEST_EQUALITY(regVec[0]->getGlobalLength(), 25); + TEST_EQUALITY(quasiRegVec[0]->getLocalLength(), 25); + TEST_EQUALITY(quasiRegVec[0]->getGlobalLength(), 25); + ArrayRCP refValues; + Teuchos::ArrayRCP myValues; + refValues.deepCopy(ArrayView({0.0, 1, 2, 3, 4, + 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24})); + for (int j = 0; j < maxRegPerProc; j++) { + myValues = regVec[j]->getData(0); + for(int idx = 0; idx < regVec[j]->getLocalLength(); ++idx) { + TEST_FLOATING_EQUALITY(myValues[idx], refValues[idx], 100*TMT::eps()); + } + myValues = quasiRegVec[j]->getData(0); + for(int idx = 0; idx < quasiRegVec[j]->getLocalLength(); ++idx) { + TEST_FLOATING_EQUALITY(myValues[idx], refValues[idx], 100*TMT::eps()); + } + + } + + } else if(numRanks == 4) { + // All ranks will have the same number of rows/cols/entries + TEST_EQUALITY(regVec[0]->getLocalLength(), 9); + TEST_EQUALITY(regVec[0]->getGlobalLength(), 36); + TEST_EQUALITY(quasiRegVec[0]->getLocalLength(), 9); + TEST_EQUALITY(quasiRegVec[0]->getGlobalLength(), 36); + + ArrayRCP refValues; + Teuchos::ArrayRCP myValues; + if(myRank == 0) { + refValues.deepCopy(ArrayView({0.0, 1, 2, 3, 4, 5, 6, 7, 8})); + + } else if(myRank == 1) { + refValues.deepCopy(ArrayView({2.0, 0.1, 1.1, 5.0, 2.1, 3.1, 8.0, 4.1, 5.1})); + + } else if(myRank == 2) { + refValues.deepCopy(ArrayView({6, 7, 8, 0.2, 1.2, 2.2, 3.2, 4.2, 5.2})); + + } else if(myRank == 3) { + refValues.deepCopy(ArrayView({8, 4.1, 5.1, 2.2, 0.3, 1.3, 5.2, 2.3, 3.3})); + } + // Loop over region matrix data and compare it to ref data + for (int j = 0; j < maxRegPerProc; j++){ + myValues = regVec[j]->getData(0); + for(int idx = 0; idx < regVec[j]->getLocalLength(); ++idx) { + TEST_FLOATING_EQUALITY(myValues[idx], refValues[idx], 100*TMT::eps()); + } + myValues = quasiRegVec[j]->getData(0); + for(int idx = 0; idx < quasiRegVec[j]->getLocalLength(); ++idx) { + TEST_FLOATING_EQUALITY(myValues[idx], refValues[idx], 100*TMT::eps()); + } + } + } + + } +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + { + // Create a region vector + Array > regVec(maxRegPerProc); + for (int j = 0; j < maxRegPerProc; j++) { + regVec[j] = VectorFactory::Build(revisedRowMapPerGrp[j]); + regVec[j]->putScalar( myRank / 10.0 ); + for (size_t k = 0; k < regVec[j]->getLocalLength(); ++k){ + regVec[j]->sumIntoLocalValue(k, k); + } + } + + // Create a composite vector + RCP compVec = VectorFactory::Build(dofMap, true); + + regionalToComposite(regVec, compVec, maxRegPerProc, rowMapPerGrp, rowImportPerGrp, Xpetra::ADD); + + if(numRanks == 1) { + TEST_EQUALITY(compVec->getLocalLength(), 25); + TEST_EQUALITY(compVec->getGlobalLength(), 25); + + ArrayRCP refValues; + Teuchos::ArrayRCP myValues; + refValues.deepCopy(ArrayView({0.0, 1.0, 2.0, 3.0, 4.0, + 5.0, 6.0, 7.0, 8.0, 9.0, + 10.0, 11.0, 12.0, 13.0, 14.0, + 15.0, 16.0, 17.0, 18.0, 19.0, + 20.0, 21.0, 22.0, 23.0, 24.0})); + myValues = compVec->getData(0); + for(int idx = 0; idx < compVec->getLocalLength(); ++idx) { + TEST_FLOATING_EQUALITY(myValues[idx], refValues[idx], 100*TMT::eps()); + } + + } else if(numRanks == 4) { + // All ranks will have the same number of rows/cols/entries + if( myRank == 0){ + TEST_EQUALITY(compVec->getLocalLength(), 9); + TEST_EQUALITY(compVec->getGlobalLength(), 25); + } else if (myRank == 1) { + TEST_EQUALITY(compVec->getLocalLength(), 6); + TEST_EQUALITY(compVec->getGlobalLength(), 25); + } else if (myRank == 2) { + TEST_EQUALITY(compVec->getLocalLength(), 6); + TEST_EQUALITY(compVec->getGlobalLength(), 25); + } else if (myRank == 3) { + TEST_EQUALITY(compVec->getLocalLength(), 4); + TEST_EQUALITY(compVec->getGlobalLength(), 25); + } + + ArrayRCP refValues; + Teuchos::ArrayRCP myValues; + if(myRank == 0) { + refValues.deepCopy(ArrayView({0.0, 1.0, 2.1, 3.0, 4.0, 8.1, 6.2, 8.2, 16.6})); + + } else if(myRank == 1) { + refValues.deepCopy(ArrayView({1.1, 2.1, 4.1, 5.1, 8.4, 10.4})); + + } else if(myRank == 2) { + refValues.deepCopy(ArrayView({3.2, 4.2, 8.5, 6.2, 7.2, 14.5})); + + } else if(myRank == 3) { + refValues.deepCopy(ArrayView({4.3, 5.3, 7.3, 8.3})); + } + // Loop over region matrix data and compare it to ref data + myValues = compVec->getData(0); + for(int idx = 0; idx < compVec->getLocalLength(); ++idx) { + TEST_FLOATING_EQUALITY(myValues[idx], refValues[idx], 100*TMT::eps()); + } + } + } +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + { + // initialize region vector with all ones. + Array > interfaceScaling(maxRegPerProc); + for (int j = 0; j < maxRegPerProc; j++) { + interfaceScaling[j] = VectorFactory::Build(revisedRowMapPerGrp[j]); + interfaceScaling[j]->putScalar(1.0); + } + + // transform to composite layout while adding interface values via the Export() combine mode + RCP compInterfaceScalingSum = VectorFactory::Build(dofMap, true); + regionalToComposite(interfaceScaling, compInterfaceScalingSum, + maxRegPerProc, rowMapPerGrp, rowImportPerGrp, Xpetra::ADD); + + /* transform composite layout back to regional layout. Now, GIDs associated + * with region interface should carry a scaling factor (!= 1). + */ + Array > regVec(maxRegPerProc); + Array > quasiRegInterfaceScaling(maxRegPerProc); + compositeToRegional(compInterfaceScalingSum, quasiRegInterfaceScaling, + interfaceScaling, maxRegPerProc, rowMapPerGrp, + revisedRowMapPerGrp, rowImportPerGrp); + + if(numRanks == 1) { + TEST_EQUALITY(interfaceScaling[0]->getLocalLength(), 25); + TEST_EQUALITY(interfaceScaling[0]->getGlobalLength(), 25); + + // No scaling on one rank, so all values are 1.0 + Teuchos::ArrayRCP myScaling; + for (int j = 0; j < maxRegPerProc; j++){ + myScaling = interfaceScaling[j]->getData(0); + for(int idx = 0; idx < interfaceScaling[j]->getLocalLength(); ++idx) { + TEST_FLOATING_EQUALITY(myScaling[idx], 1.0, 100*TMT::eps()); + } + } + + } else if(numRanks == 4) { + // All ranks will have the same number of rows/cols/entries + TEST_EQUALITY(interfaceScaling[0]->getLocalLength(), 9); + TEST_EQUALITY(interfaceScaling[0]->getGlobalLength(), 36); + + ArrayRCP refValues; + Teuchos::ArrayRCP myScaling; + if(myRank == 0) { + refValues.deepCopy(ArrayView({1, 1, 2, 1, 1, 2, 2, 2, 4})); + + } else if(myRank == 1) { + refValues.deepCopy(ArrayView({2, 1, 1, 2, 1, 1, 4, 2, 2})); + + } else if(myRank == 2) { + refValues.deepCopy(ArrayView({2, 2, 4, 1, 1, 2, 1, 1, 2})); + + } else if(myRank == 3) { + refValues.deepCopy(ArrayView({4, 2, 2, 2, 1, 1, 2, 1, 1})); + } + // Loop over region matrix data and compare it to ref data + for (int j = 0; j < maxRegPerProc; j++){ + myScaling = interfaceScaling[j]->getData(0); + for(int idx = 0; idx < interfaceScaling[j]->getLocalLength(); ++idx) { + TEST_FLOATING_EQUALITY(myScaling[idx], refValues[idx], 100*TMT::eps()); + } + } + } + + } +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + +} // RegionCompositeVector + +# define MUELU_ETI_GROUP(Scalar, LO, GO, Node) \ + TEUCHOS_UNIT_TEST_TEMPLATE_4_INSTANT(RegionVector,RegionCompositeVector,Scalar,LO,GO,Node) + +#include + + +} // namespace MueLuTests From 25570613cf8cb260920bd67ee3f065d16351297f Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Tue, 19 Nov 2019 08:44:14 -0700 Subject: [PATCH 02/21] Automatic snapshot commit from seacas at a34490f Origin repo remote tracking branch: 'origin/master' Origin repo remote repo URL: 'origin = https://github.com/gsjaardema/seacas' At commit: commit a34490f6a901f724f7544a486a1fc9d9464b9207 Author: Greg Sjaardema Date: Tue Nov 19 08:08:36 2019 -0700 Summary: SLICE: Fix incorrect equal cal * Replace case_strcmp with more C++-like str_equal and substr_equal * Use C++11 class member initialization syntax * EPU: Check subcycles < proc count * APREPRO: improve array interactions with other types * EXODUS: Static analyzer fixes * CATCH2: Update 2.9.2 -> 2.10.2 * FMT: Update to current version * PYTHON: minor cleanups in exodus.py and exomerge.py --- .../applications/ejoin/EJ_SystemInterface.C | 26 +- packages/seacas/applications/ejoin/EJoin.C | 6 +- .../seacas/applications/epu/EP_ExodusEntity.h | 89 +- .../applications/epu/EP_SystemInterface.C | 33 +- .../applications/exodiff/ED_SystemInterface.C | 30 +- .../applications/nem_spread/el_exoII_io.C | 3 + .../applications/slice/SL_SystemInterface.C | 18 +- packages/seacas/format.sh | 2 +- .../libraries/aprepro_lib/apr_aprepro.cc | 4 +- .../libraries/aprepro_lib/apr_builtin.cc | 3 +- .../libraries/aprepro_lib/apr_exodus.cc | 2 +- .../libraries/aprepro_lib/apr_parser.cc | 1179 +- .../libraries/aprepro_lib/apr_scanner.cc | 12 +- .../seacas/libraries/aprepro_lib/aprepro.ll | 4 +- .../seacas/libraries/aprepro_lib/aprepro.yy | 104 +- .../libraries/aprepro_lib/aprepro_parser.h | 20 +- .../seacas/libraries/aprepro_lib/stack.hh | 157 + .../seacas/libraries/exodus/src/ex_create.c | 6 +- .../libraries/exodus/src/ex_create_par.c | 8 +- .../seacas/libraries/exodus/src/ex_get_time.c | 13 +- .../seacas/libraries/exodus/src/ex_open.c | 19 +- .../seacas/libraries/exodus/src/ex_open_par.c | 24 +- .../seacas/libraries/exodus/src/ex_put_time.c | 2 - .../seacas/libraries/exodus/src/ex_utils.c | 2 +- .../seacas/libraries/exodus/test/testrd.c | 2 +- .../libraries/exodus/test/testwt-oned.c | 1 + .../seacas/libraries/ioss/src/CMakeLists.txt | 6 +- .../libraries/ioss/src/Ioss_FaceGenerator.C | 56 +- .../libraries/ioss/src/Ioss_FaceGenerator.h | 59 +- .../libraries/ioss/src/Ioss_GroupingEntity.h | 2 +- .../libraries/ioss/src/Ioss_IOFactory.C | 13 +- .../seacas/libraries/ioss/src/Ioss_Utils.C | 32 +- .../seacas/libraries/ioss/src/Ioss_Utils.h | 12 +- .../libraries/ioss/src/Ioss_VariableType.C | 2 +- .../seacas/libraries/ioss/src/Ioss_Version.h | 38 + packages/seacas/libraries/ioss/src/catch.hpp | 26153 ++++++++-------- .../ioss/src/cgns/Iocgns_DecompositionData.C | 7 +- .../libraries/ioss/src/cgns/Iocgns_Utils.C | 2 +- .../ioss/src/exo_fpp/Iofx_DatabaseIO.C | 2 +- .../ioss/src/exo_par/Iopx_DatabaseIO.C | 2 +- .../ioss/src/exodus/Ioex_DatabaseIO.C | 2 +- .../ioss/src/exodus/Ioex_Internals.h | 86 +- .../ioss/src/exodus/Ioex_SuperElement.C | 10 +- .../libraries/ioss/src/exodus/Ioex_Utils.C | 3 +- .../seacas/libraries/ioss/src/fmt/chrono.h | 1129 +- .../seacas/libraries/ioss/src/fmt/color.h | 795 +- .../seacas/libraries/ioss/src/fmt/compile.h | 730 +- packages/seacas/libraries/ioss/src/fmt/core.h | 112 +- .../libraries/ioss/src/fmt/format-inl.h | 1969 +- .../seacas/libraries/ioss/src/fmt/format.h | 5090 +-- .../seacas/libraries/ioss/src/fmt/ostream.h | 198 +- .../seacas/libraries/ioss/src/fmt/printf.h | 657 +- .../seacas/libraries/ioss/src/fmt/ranges.h | 403 +- .../ioss/src/fmt/safe-duration-cast.h | 445 +- .../libraries/ioss/src/hash/bhopscotch_map.h | 24 +- .../libraries/ioss/src/hash/bhopscotch_set.h | 22 +- .../libraries/ioss/src/hash/hopscotch_hash.h | 2 +- .../libraries/ioss/src/hash/hopscotch_map.h | 4 +- .../libraries/ioss/src/hash/hopscotch_set.h | 4 +- .../libraries/ioss/src/hash/robin_set.h | 6 +- .../ioss/src/heartbeat/Iohb_DatabaseIO.C | 14 +- .../libraries/ioss/src/main/CMakeLists.txt | 2 +- .../ioss/src/main/cth_pressure_map.C | 14 +- .../libraries/ioss/src/main/io_shell_ts.C | 6 +- .../libraries/ioss/src/main/shell_to_hex.C | 6 +- .../ioss/src/pamgen/Iopg_DatabaseIO.C | 2 +- .../libraries/ioss/src/utest/Utst_utils.C | 35 + .../seacas/libraries/suplib_cpp/GetLongOpt.C | 44 +- .../seacas/libraries/suplib_cpp/fmt/chrono.h | 1129 +- .../seacas/libraries/suplib_cpp/fmt/color.h | 795 +- .../seacas/libraries/suplib_cpp/fmt/compile.h | 730 +- .../seacas/libraries/suplib_cpp/fmt/core.h | 112 +- .../libraries/suplib_cpp/fmt/format-inl.h | 1969 +- .../seacas/libraries/suplib_cpp/fmt/format.h | 5090 +-- .../seacas/libraries/suplib_cpp/fmt/ostream.h | 198 +- .../seacas/libraries/suplib_cpp/fmt/printf.h | 657 +- .../seacas/libraries/suplib_cpp/fmt/ranges.h | 403 +- .../suplib_cpp/fmt/safe-duration-cast.h | 445 +- packages/seacas/scripts/exodus3.in.py | 4 +- packages/seacas/scripts/exomerge2.py | 14 +- packages/seacas/scripts/exomerge3.py | 94 +- 81 files changed, 27593 insertions(+), 24016 deletions(-) create mode 100644 packages/seacas/libraries/aprepro_lib/stack.hh create mode 100644 packages/seacas/libraries/ioss/src/Ioss_Version.h diff --git a/packages/seacas/applications/ejoin/EJ_SystemInterface.C b/packages/seacas/applications/ejoin/EJ_SystemInterface.C index a2f886f162a7..d16d1891493a 100644 --- a/packages/seacas/applications/ejoin/EJ_SystemInterface.C +++ b/packages/seacas/applications/ejoin/EJ_SystemInterface.C @@ -15,19 +15,13 @@ #include // for vector namespace { - int case_strcmp(const std::string &s1, const std::string &s2) + bool str_equal(const std::string &s1, const std::string &s2) { - const char *c1 = s1.c_str(); - const char *c2 = s2.c_str(); - for (;; c1++, c2++) { - if (std::tolower(*c1) != std::tolower(*c2)) { - return (std::tolower(*c1) - std::tolower(*c2)); - } - if (*c1 == '\0') { - return 0; - } - } + return (s1.size() == s2.size()) && + std::equal(s1.begin(), s1.end(), s2.begin(), + [](char a, char b) { return std::tolower(a) == std::tolower(b); }); } + void parse_variable_names(const char *tokens, StringIdVector *variable_list); void parse_variable_names(const char *tokens, StringIdVector *variable_list); void parse_offset(const char *tokens, vector3d *offset); @@ -120,8 +114,8 @@ void SystemInterface::enroll_options() options_.enroll( "block_prefix", GetLongOption::MandatoryValue, - "Prefix used on the input block names of second and subsequent meshes to make them" - " unique. Default is 'p'. Example: block1, p1_block1, p2_block1.", + "Prefix used on the input block names of second and subsequent meshes to make them\n" + "\t\tunique. Default is 'p'. Example: block1, p1_block1, p2_block1.", "p"); options_.enroll("offset", GetLongOption::MandatoryValue, @@ -319,7 +313,7 @@ bool SystemInterface::parse_options(int argc, char **argv) { const char *temp = options_.retrieve("omit_nodesets"); if (temp != nullptr) { - if (case_strcmp("ALL", temp) == 0) { + if (str_equal("ALL", temp)) { omitNodesets_ = true; } else { @@ -334,7 +328,7 @@ bool SystemInterface::parse_options(int argc, char **argv) { const char *temp = options_.retrieve("omit_sidesets"); if (temp != nullptr) { - if (case_strcmp("ALL", temp) == 0) { + if (str_equal("ALL", temp)) { omitSidesets_ = true; } else { @@ -508,7 +502,7 @@ void SystemInterface::parse_step_option(const char *tokens) stepMax_ = abs(vals[1]); stepInterval_ = abs(vals[2]); } - else if (case_strcmp("LAST", tokens) == 0) { + else if (str_equal("LAST", tokens)) { stepMin_ = stepMax_ = -1; } else { diff --git a/packages/seacas/applications/ejoin/EJoin.C b/packages/seacas/applications/ejoin/EJoin.C index 8d62acb0d570..f183cdbb3074 100644 --- a/packages/seacas/applications/ejoin/EJoin.C +++ b/packages/seacas/applications/ejoin/EJoin.C @@ -1284,8 +1284,7 @@ namespace { continue; } - if (field_name != "ids" && (prefix.empty() || std::strncmp(prefix.c_str(), field_name.c_str(), - prefix.length()) == 0)) { + if (field_name != "ids" && Ioss::Utils::substr_equal(prefix, field_name)) { if (oge->field_exists(field_name)) { transfer_field_data_internal(ige, oge, field_name); } @@ -1471,8 +1470,7 @@ namespace { // whose names begin with the prefix for (const auto &field_name : fields) { if (field_name != "ids" && !oge->field_exists(field_name) && - (prefix.empty() || - std::strncmp(prefix.c_str(), field_name.c_str(), prefix.length()) == 0)) { + Ioss::Utils::substr_equal(prefix, field_name)) { // If the field does not already exist, add it to the output node block Ioss::Field field = ige->get_field(field_name); oge->field_add(field); diff --git a/packages/seacas/applications/epu/EP_ExodusEntity.h b/packages/seacas/applications/epu/EP_ExodusEntity.h index 27b6bfc4c671..b4584c0440dd 100644 --- a/packages/seacas/applications/epu/EP_ExodusEntity.h +++ b/packages/seacas/applications/epu/EP_ExodusEntity.h @@ -52,11 +52,7 @@ namespace Excn { class Mesh { public: - Mesh() - : dimensionality(0), nodeCount(0), elementCount(0), blockCount(0), nodesetCount(0), - sidesetCount(0), needNodeMap(true), needElementMap(true) - { - } + Mesh() = default; size_t count(ObjectType type) const { @@ -73,25 +69,20 @@ namespace Excn { IntVector truthTable[3]; std::string title; - int dimensionality; - int64_t nodeCount; - int64_t elementCount; - int blockCount; - int nodesetCount; - int sidesetCount; - bool needNodeMap; - bool needElementMap; + int dimensionality{0}; + int64_t nodeCount{0}; + int64_t elementCount{0}; + int blockCount{0}; + int nodesetCount{0}; + int sidesetCount{0}; + bool needNodeMap{true}; + bool needElementMap{true}; }; class Block { public: - Block() - : name_(""), id(0), elementCount(0), nodesPerElement(0), attributeCount(0), offset_(0), - position_(0) - { - copy_string(elType, ""); - } + Block() { copy_string(elType, ""); } Block(const Block &other) : name_(other.name_), id(other.id), elementCount(other.elementCount), @@ -106,14 +97,14 @@ namespace Excn { size_t entity_count() const { return elementCount; } char elType[MAX_STR_LENGTH + 1]{}; - std::string name_; + std::string name_{""}; std::vector attributeNames; - int64_t id; - int64_t elementCount; - int nodesPerElement; - int attributeCount; - int64_t offset_; - int position_; + int64_t id{0}; + int64_t elementCount{0}; + int nodesPerElement{0}; + int attributeCount{0}; + int64_t offset_{0}; + int position_{0}; Block &operator=(const Block &other) { @@ -133,14 +124,14 @@ namespace Excn { template class NodeSet { public: - NodeSet() : id(0), nodeCount(0), dfCount(0), offset_(0), position_(-1), name_("") {} + NodeSet() = default; - ex_entity_id id; - int64_t nodeCount; - int64_t dfCount; - int64_t offset_; - int position_; - std::string name_; + ex_entity_id id{0}; + int64_t nodeCount{0}; + int64_t dfCount{0}; + int64_t offset_{0}; + int position_{-1}; + std::string name_{""}; std::vector nodeSetNodes; std::vector nodeOrderMap; @@ -193,39 +184,35 @@ namespace Excn { class CommunicationMap { public: - CommunicationMap() : id(0), entityCount(0), type('U') {} + CommunicationMap() = default; CommunicationMap(int the_id, int64_t count, char the_type) : id(the_id), entityCount(count), type(the_type) { } - int64_t id; - int64_t entityCount; - char type; // 'n' for node, 'e' for element + int64_t id{0}; + int64_t entityCount{0}; + char type{'U'}; // 'n' for node, 'e' for element }; class CommunicationMetaData { public: - CommunicationMetaData() - : processorId(0), processorCount(0), globalNodes(0), globalElements(0), nodesInternal(0), - nodesBorder(0), nodesExternal(0), elementsInternal(0), elementsBorder(0) - { - } + CommunicationMetaData() = default; CommunicationMetaData(const CommunicationMetaData &) = delete; CommunicationMetaData &operator=(const CommunicationMetaData &other) = delete; std::vector nodeMap; std::vector elementMap; - int processorId; - int processorCount; - int64_t globalNodes; - int64_t globalElements; - int64_t nodesInternal; - int64_t nodesBorder; - int64_t nodesExternal; - int64_t elementsInternal; - int64_t elementsBorder; + int processorId{0}; + int processorCount{0}; + int64_t globalNodes{0}; + int64_t globalElements{0}; + int64_t nodesInternal{0}; + int64_t nodesBorder{0}; + int64_t nodesExternal{0}; + int64_t elementsInternal{0}; + int64_t elementsBorder{0}; }; } // namespace Excn #endif /* SEACAS_ExodusEntity_H */ diff --git a/packages/seacas/applications/epu/EP_SystemInterface.C b/packages/seacas/applications/epu/EP_SystemInterface.C index 0653238530a1..f27dc138ef79 100644 --- a/packages/seacas/applications/epu/EP_SystemInterface.C +++ b/packages/seacas/applications/epu/EP_SystemInterface.C @@ -51,19 +51,13 @@ #include // for vector namespace { - int case_strcmp(const std::string &s1, const std::string &s2) + bool str_equal(const std::string &s1, const std::string &s2) { - const char *c1 = s1.c_str(); - const char *c2 = s2.c_str(); - for (;; c1++, c2++) { - if (std::tolower(*c1) != std::tolower(*c2)) { - return (std::tolower(*c1) - std::tolower(*c2)); - } - if (*c1 == '\0') { - return 0; - } - } + return (s1.size() == s2.size()) && + std::equal(s1.begin(), s1.end(), s2.begin(), + [](char a, char b) { return std::tolower(a) == std::tolower(b); }); } + void parse_variable_names(const char *tokens, Excn::StringIdVector *variable_list); } // namespace @@ -163,7 +157,7 @@ void Excn::SystemInterface::enroll_options() options_.enroll("join_subcycles", GetLongOption::NoValue, "If -subcycle is specified, then after the subcycle files are processed,\n" - "\t\turn epu one more time and join the subcycle files into a single file.", + "\t\trun epu one more time and join the subcycle files into a single file.", nullptr); options_.enroll("keep_temporary", GetLongOption::NoValue, @@ -507,6 +501,19 @@ bool Excn::SystemInterface::parse_options(int argc, char **argv) else { throw std::runtime_error("\nERROR: (EPU) basename not specified\n"); } + + // Check that subcycle count does not match processor count -- + // in that case the existing files will be overwritten. + if (processorCount_ <= subcycle_) { + if (myRank_ == 0) { + fmt::print(stderr, + "\nERROR: (EPU) Invalid subcycle count specified: '{}'." + "\n Must be less than processor count '{}'.\n\n", + subcycle_, processorCount_); + } + return false; + } + return true; } @@ -581,7 +588,7 @@ void Excn::SystemInterface::parse_step_option(const char *tokens) stepMax_ = abs(vals[1]); stepInterval_ = abs(vals[2]); } - else if (case_strcmp("LAST", tokens) == 0) { + else if (str_equal("LAST", tokens)) { stepMin_ = stepMax_ = -1; } else { diff --git a/packages/seacas/applications/exodiff/ED_SystemInterface.C b/packages/seacas/applications/exodiff/ED_SystemInterface.C index c005c11cd929..3a4f0d12157a 100644 --- a/packages/seacas/applications/exodiff/ED_SystemInterface.C +++ b/packages/seacas/applications/exodiff/ED_SystemInterface.C @@ -30,19 +30,13 @@ namespace { Tolerance &def_tol, std::vector &names, std::vector &toler, int max_names); - int case_strcmp(const std::string &s1, const std::string &s2) + bool str_equal(const std::string &s1, const std::string &s2) { - const char *c1 = s1.c_str(); - const char *c2 = s2.c_str(); - for (;; c1++, c2++) { - if (std::tolower(*c1) != std::tolower(*c2)) { - return (std::tolower(*c1) - std::tolower(*c2)); - } - if (*c1 == '\0') { - return 0; - } - } + return (s1.size() == s2.size()) && + std::equal(s1.begin(), s1.end(), s2.begin(), + [](char a, char b) { return std::tolower(a) == std::tolower(b); }); } + void file_help(); void tolerance_help(); @@ -377,7 +371,7 @@ void SystemInterface::enroll_options() nullptr); options_.enroll("short", GetLongOption::NoValue, "Short block type compare. Forces element block type strings to\n" - "\t\the compared only up to the shortest string length. For example,\n" + "\t\tbe compared only up to the shortest string length. For example,\n" "\t\t\"HEX\" and \"HEX8\" will be considered the same. (default)", nullptr); options_.enroll("no_short", GetLongOption::NoValue, @@ -409,7 +403,7 @@ void SystemInterface::enroll_options() "True if forcing the use of 64-bit integers for the output file", nullptr); options_.enroll("nosymmetric_name_check", GetLongOption::NoValue, "No symmetric variable name checking. By default, a warning will\n" - "\t\the produced if a name that is not to be excluded is contained\n" + "\t\tbe produced if a name that is not to be excluded is contained\n" "\t\tin the second file given on the command line but not the first.\n" "\t\tThis \"symmetric\" check can be turned off with this option.", nullptr); @@ -512,13 +506,13 @@ bool SystemInterface::parse_options(int argc, char **argv) { const char *temp = options_.retrieve("help"); if (temp != nullptr) { - if ((case_strcmp("usage", temp) == 0) || (case_strcmp("all", temp) == 0)) { + if ((str_equal("usage", temp)) || (str_equal("all", temp))) { options_.usage(); } - if ((case_strcmp("file", temp) == 0) || (case_strcmp("all", temp) == 0)) { + if ((str_equal("file", temp)) || (str_equal("all", temp))) { file_help(); } - if ((case_strcmp("tolerance", temp) == 0) || (case_strcmp("all", temp) == 0)) { + if ((str_equal("tolerance", temp)) || (str_equal("all", temp))) { tolerance_help(); } fmt::print("\n\t\tCan also set options via EXODIFF_OPTIONS environment variable.\n"); @@ -659,7 +653,7 @@ bool SystemInterface::parse_options(int argc, char **argv) // (1-based) or 'last' std::vector tokens = SLIB::tokenize(temp, ":"); if (tokens.size() == 2) { - if (case_strcmp(tokens[0], "last") == 0) { + if (str_equal(tokens[0], "last")) { explicit_steps.first = -1; } else { @@ -667,7 +661,7 @@ bool SystemInterface::parse_options(int argc, char **argv) explicit_steps.first = std::stoi(tokens[0]); } - if (case_strcmp(tokens[1], "last") == 0) { + if (str_equal(tokens[1], "last")) { explicit_steps.second = -1; } else { diff --git a/packages/seacas/applications/nem_spread/el_exoII_io.C b/packages/seacas/applications/nem_spread/el_exoII_io.C index d4f5edec7ceb..e33f954cb558 100644 --- a/packages/seacas/applications/nem_spread/el_exoII_io.C +++ b/packages/seacas/applications/nem_spread/el_exoII_io.C @@ -1797,6 +1797,9 @@ void NemSpread::find_elem_block(INT *proc_elem_blk, int iproc, int /*pro * the global element block number. * (Global int vector of length globals.Num_Elem_Blk) */ + if (globals.Num_Elem_Blk == 0) { + return; + } /* Boolean vector of length globals.Num_Elem_Blk If the i'th element block exists on the current processor, the i'th entry diff --git a/packages/seacas/applications/slice/SL_SystemInterface.C b/packages/seacas/applications/slice/SL_SystemInterface.C index 0733e9542395..afe2a63c741e 100644 --- a/packages/seacas/applications/slice/SL_SystemInterface.C +++ b/packages/seacas/applications/slice/SL_SystemInterface.C @@ -53,19 +53,13 @@ #endif namespace { - int case_strcmp(const std::string &s1, const std::string &s2) + bool str_equal(const std::string &s1, const std::string &s2) { - const char *c1 = s1.c_str(); - const char *c2 = s2.c_str(); - for (;; c1++, c2++) { - if (std::tolower(*c1) != std::tolower(*c2)) { - return (std::tolower(*c1) - std::tolower(*c2)); - } - if (*c1 == '\0') { - return 0; - } - } + return (s1.size() == s2.size()) && + std::equal(s1.begin(), s1.end(), s2.begin(), + [](char a, char b) { return std::tolower(a) == std::tolower(b); }); } + #if 0 void parse_variable_names(const char *tokens, StringIdVector *variable_list); void parse_integer_list(const char *tokens, std::vector *list); @@ -373,7 +367,7 @@ void SystemInterface::parse_step_option(const char *tokens) stepMax_ = abs(vals[1]); stepInterval_ = abs(vals[2]); } - else if (case_strcmp("LAST", tokens) == 0) { + else if (str_equal("LAST", tokens)) { stepMin_ = stepMax_ = -1; } else { diff --git a/packages/seacas/format.sh b/packages/seacas/format.sh index 345c69bdb72b..b680144c2757 100755 --- a/packages/seacas/format.sh +++ b/packages/seacas/format.sh @@ -1,5 +1,5 @@ #!/bin/sh -for i in $(ls *.[cCh]); do +for i in $(ls ./*.[cCh]); do echo $i clang-format -style=file $i > tmp mv tmp $i diff --git a/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc b/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc index 7afc2a79186d..921727a4cd0e 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_aprepro.cc @@ -51,7 +51,7 @@ namespace { const unsigned int HASHSIZE = 5939; - const char * version_string = "5.12 (2019/08/21)"; + const char * version_string = "5.13 (2019/10/17)"; void output_copyright(); @@ -520,7 +520,7 @@ namespace SEAMS { << " --comment=char or -c=char: Change comment character to 'char' \n" << " --copyright or -C: Print copyright message \n" << " --keep_history or -k: Keep a history of aprepro substitutions.\n" - << " (not for general interactive use) \n" + << " (not for general interactive use) \n" << " --quiet or -q: (deprecated, option is ignored) \n" << " var=val: Assign value 'val' to variable 'var' \n" << " Use var=\\\"sval\\\" for a string variable\n\n" diff --git a/packages/seacas/libraries/aprepro_lib/apr_builtin.cc b/packages/seacas/libraries/aprepro_lib/apr_builtin.cc index 8152bf5465ac..6005dd21e249 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_builtin.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_builtin.cc @@ -1064,6 +1064,7 @@ namespace SEAMS { } } assert(rows - rows_to_skip == (size_t)array_data->rows); + delete file; return array_data; } @@ -1111,9 +1112,9 @@ namespace SEAMS { } } assert((int)rows == array_data->rows); + delete file; return array_data; } - return nullptr; } diff --git a/packages/seacas/libraries/aprepro_lib/apr_exodus.cc b/packages/seacas/libraries/aprepro_lib/apr_exodus.cc index fc094de21b39..4474137c2eb7 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_exodus.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_exodus.cc @@ -257,7 +257,7 @@ namespace SEAMS { int64_t idx = 0; for (int64_t i = 0; i < num_elemblks; i++) { - ex_get_block(exoid, EX_ELEM_BLOCK, ids[i], type, &nel, &nnel, 0, 0, &natr); + ex_get_block(exoid, EX_ELEM_BLOCK, ids[i], type, &nel, &nnel, nullptr, nullptr, &natr); array_data->data[i] = ids[i]; array_block_info->data[idx++] = ids[i]; array_block_info->data[idx++] = nel; diff --git a/packages/seacas/libraries/aprepro_lib/apr_parser.cc b/packages/seacas/libraries/aprepro_lib/apr_parser.cc index 3f129a5788d0..3b17fd46d051 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_parser.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_parser.cc @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.3.2. +// A Bison parser, made by GNU Bison 3.4. // Skeleton implementation for Bison LALR(1) parsers in C++ @@ -37,7 +37,7 @@ #define yylex SEAMSlex // First part of user prologue. -#line 33 "aprepro.yy" // lalr1.cc:429 +#line 33 "aprepro.yy" #include "apr_array.h" #include "apr_util.h" @@ -67,12 +67,12 @@ namespace SEAMS { extern bool echo; } -#line 74 "apr_parser.cc" // lalr1.cc:429 +#line 74 "apr_parser.cc" #include "aprepro_parser.h" // Second part of user prologue. -#line 130 "aprepro.yy" // lalr1.cc:434 +#line 130 "aprepro.yy" #include "apr_scanner.h" #include "aprepro.h" @@ -83,7 +83,7 @@ namespace SEAMS { #undef yylex #define yylex aprepro.lexer->lex -#line 92 "apr_parser.cc" // lalr1.cc:434 +#line 93 "apr_parser.cc" #ifndef YY_ #if defined YYENABLE_NLS && YYENABLE_NLS @@ -158,7 +158,7 @@ namespace SEAMS { #define YYRECOVERING() (!!yyerrstatus_) namespace SEAMS { -#line 168 "apr_parser.cc" // lalr1.cc:510 +#line 169 "apr_parser.cc" /* Return YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is @@ -524,16 +524,16 @@ namespace SEAMS { { switch (yyn) { case 4: -#line 149 "aprepro.yy" // lalr1.cc:919 +#line 149 "aprepro.yy" { if (echo) aprepro.lexer->LexerOutput("\n", 1); } -#line 636 "apr_parser.cc" // lalr1.cc:919 +#line 638 "apr_parser.cc" break; case 5: -#line 150 "aprepro.yy" // lalr1.cc:919 +#line 150 "aprepro.yy" { if (echo) { static char tmpstr[512]; @@ -542,202 +542,202 @@ namespace SEAMS { aprepro.lexer->LexerOutput(tmpstr, len); } } -#line 648 "apr_parser.cc" // lalr1.cc:919 +#line 650 "apr_parser.cc" break; case 6: -#line 157 "aprepro.yy" // lalr1.cc:919 +#line 157 "aprepro.yy" { if (echo && (yystack_[1].value.string) != NULL) { aprepro.lexer->LexerOutput((yystack_[1].value.string), strlen((yystack_[1].value.string))); } } -#line 657 "apr_parser.cc" // lalr1.cc:919 +#line 659 "apr_parser.cc" break; case 7: -#line 161 "aprepro.yy" // lalr1.cc:919 +#line 161 "aprepro.yy" { } -#line 663 "apr_parser.cc" // lalr1.cc:919 +#line 665 "apr_parser.cc" break; case 8: -#line 162 "aprepro.yy" // lalr1.cc:919 +#line 162 "aprepro.yy" { } -#line 669 "apr_parser.cc" // lalr1.cc:919 +#line 671 "apr_parser.cc" break; case 9: -#line 163 "aprepro.yy" // lalr1.cc:919 +#line 163 "aprepro.yy" { yyerrok; } -#line 675 "apr_parser.cc" // lalr1.cc:919 +#line 677 "apr_parser.cc" break; case 10: -#line 166 "aprepro.yy" // lalr1.cc:919 +#line 166 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) < (yystack_[0].value.val); } -#line 681 "apr_parser.cc" // lalr1.cc:919 +#line 683 "apr_parser.cc" break; case 11: -#line 167 "aprepro.yy" // lalr1.cc:919 +#line 167 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) > (yystack_[0].value.val); } -#line 687 "apr_parser.cc" // lalr1.cc:919 +#line 689 "apr_parser.cc" break; case 12: -#line 168 "aprepro.yy" // lalr1.cc:919 +#line 168 "aprepro.yy" { (yylhs.value.val) = !((yystack_[0].value.val)); } -#line 693 "apr_parser.cc" // lalr1.cc:919 +#line 695 "apr_parser.cc" break; case 13: -#line 169 "aprepro.yy" // lalr1.cc:919 +#line 169 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) <= (yystack_[0].value.val); } -#line 699 "apr_parser.cc" // lalr1.cc:919 +#line 701 "apr_parser.cc" break; case 14: -#line 170 "aprepro.yy" // lalr1.cc:919 +#line 170 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) >= (yystack_[0].value.val); } -#line 705 "apr_parser.cc" // lalr1.cc:919 +#line 707 "apr_parser.cc" break; case 15: -#line 171 "aprepro.yy" // lalr1.cc:919 +#line 171 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) == (yystack_[0].value.val); } -#line 711 "apr_parser.cc" // lalr1.cc:919 +#line 713 "apr_parser.cc" break; case 16: -#line 172 "aprepro.yy" // lalr1.cc:919 +#line 172 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) != (yystack_[0].value.val); } -#line 717 "apr_parser.cc" // lalr1.cc:919 +#line 719 "apr_parser.cc" break; case 17: -#line 173 "aprepro.yy" // lalr1.cc:919 +#line 173 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) || (yystack_[0].value.val); } -#line 723 "apr_parser.cc" // lalr1.cc:919 +#line 725 "apr_parser.cc" break; case 18: -#line 174 "aprepro.yy" // lalr1.cc:919 +#line 174 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) && (yystack_[0].value.val); } -#line 729 "apr_parser.cc" // lalr1.cc:919 +#line 731 "apr_parser.cc" break; case 19: -#line 175 "aprepro.yy" // lalr1.cc:919 +#line 175 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) || (yystack_[0].value.val); } -#line 735 "apr_parser.cc" // lalr1.cc:919 +#line 737 "apr_parser.cc" break; case 20: -#line 176 "aprepro.yy" // lalr1.cc:919 +#line 176 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) && (yystack_[0].value.val); } -#line 741 "apr_parser.cc" // lalr1.cc:919 +#line 743 "apr_parser.cc" break; case 21: -#line 177 "aprepro.yy" // lalr1.cc:919 +#line 177 "aprepro.yy" { (yylhs.value.val) = (yystack_[1].value.val); } -#line 747 "apr_parser.cc" // lalr1.cc:919 +#line 749 "apr_parser.cc" break; case 22: -#line 180 "aprepro.yy" // lalr1.cc:919 +#line 180 "aprepro.yy" { (yylhs.value.val) = (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) < 0 ? 1 : 0); } -#line 753 "apr_parser.cc" // lalr1.cc:919 +#line 755 "apr_parser.cc" break; case 23: -#line 181 "aprepro.yy" // lalr1.cc:919 +#line 181 "aprepro.yy" { (yylhs.value.val) = (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) > 0 ? 1 : 0); } -#line 759 "apr_parser.cc" // lalr1.cc:919 +#line 761 "apr_parser.cc" break; case 24: -#line 182 "aprepro.yy" // lalr1.cc:919 +#line 182 "aprepro.yy" { (yylhs.value.val) = (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) <= 0 ? 1 : 0); } -#line 765 "apr_parser.cc" // lalr1.cc:919 +#line 767 "apr_parser.cc" break; case 25: -#line 183 "aprepro.yy" // lalr1.cc:919 +#line 183 "aprepro.yy" { (yylhs.value.val) = (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) >= 0 ? 1 : 0); } -#line 771 "apr_parser.cc" // lalr1.cc:919 +#line 773 "apr_parser.cc" break; case 26: -#line 184 "aprepro.yy" // lalr1.cc:919 +#line 184 "aprepro.yy" { (yylhs.value.val) = (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) == 0 ? 1 : 0); } -#line 777 "apr_parser.cc" // lalr1.cc:919 +#line 779 "apr_parser.cc" break; case 27: -#line 185 "aprepro.yy" // lalr1.cc:919 +#line 185 "aprepro.yy" { (yylhs.value.val) = (strcmp((yystack_[2].value.string), (yystack_[0].value.string)) != 0 ? 1 : 0); } -#line 783 "apr_parser.cc" // lalr1.cc:919 +#line 785 "apr_parser.cc" break; case 28: -#line 187 "aprepro.yy" // lalr1.cc:919 +#line 187 "aprepro.yy" { (yylhs.value.arrval) = (yystack_[0].value.tptr)->value.avar; } -#line 789 "apr_parser.cc" // lalr1.cc:919 +#line 791 "apr_parser.cc" break; case 29: -#line 188 "aprepro.yy" // lalr1.cc:919 +#line 188 "aprepro.yy" { if (arg_check((yystack_[3].value.tptr), (yystack_[3].value.tptr)->value.arrfnct_c == NULL)) @@ -746,11 +746,11 @@ namespace SEAMS { else yyerrok; } -#line 800 "apr_parser.cc" // lalr1.cc:919 +#line 802 "apr_parser.cc" break; case 30: -#line 194 "aprepro.yy" // lalr1.cc:919 +#line 194 "aprepro.yy" { if (arg_check((yystack_[5].value.tptr), (yystack_[5].value.tptr)->value.arrfnct_cd == NULL)) @@ -759,11 +759,11 @@ namespace SEAMS { else yyerrok; } -#line 811 "apr_parser.cc" // lalr1.cc:919 +#line 813 "apr_parser.cc" break; case 31: -#line 200 "aprepro.yy" // lalr1.cc:919 +#line 200 "aprepro.yy" { if (arg_check((yystack_[5].value.tptr), (yystack_[5].value.tptr)->value.arrfnct_cc == NULL)) @@ -772,11 +772,11 @@ namespace SEAMS { else yyerrok; } -#line 822 "apr_parser.cc" // lalr1.cc:919 +#line 824 "apr_parser.cc" break; case 32: -#line 206 "aprepro.yy" // lalr1.cc:919 +#line 206 "aprepro.yy" { if (arg_check((yystack_[7].value.tptr), (yystack_[7].value.tptr)->value.arrfnct_ddd == NULL)) @@ -785,11 +785,11 @@ namespace SEAMS { else yyerrok; } -#line 833 "apr_parser.cc" // lalr1.cc:919 +#line 835 "apr_parser.cc" break; case 33: -#line 212 "aprepro.yy" // lalr1.cc:919 +#line 212 "aprepro.yy" { if (arg_check((yystack_[5].value.tptr), (yystack_[5].value.tptr)->value.arrfnct_dd == NULL)) @@ -798,11 +798,11 @@ namespace SEAMS { else yyerrok; } -#line 844 "apr_parser.cc" // lalr1.cc:919 +#line 846 "apr_parser.cc" break; case 34: -#line 218 "aprepro.yy" // lalr1.cc:919 +#line 218 "aprepro.yy" { if (arg_check((yystack_[3].value.tptr), (yystack_[3].value.tptr)->value.arrfnct_d == NULL)) @@ -811,11 +811,11 @@ namespace SEAMS { else yyerrok; } -#line 855 "apr_parser.cc" // lalr1.cc:919 +#line 857 "apr_parser.cc" break; case 35: -#line 224 "aprepro.yy" // lalr1.cc:919 +#line 224 "aprepro.yy" { if (arg_check((yystack_[3].value.tptr), (yystack_[3].value.tptr)->value.arrfnct_a == NULL)) @@ -824,33 +824,55 @@ namespace SEAMS { else yyerrok; } -#line 866 "apr_parser.cc" // lalr1.cc:919 +#line 868 "apr_parser.cc" break; case 36: -#line 230 "aprepro.yy" // lalr1.cc:919 +#line 230 "aprepro.yy" { - (yylhs.value.arrval) = (yystack_[0].value.arrval); - delete (yystack_[2].value.tptr)->value.avar; + (yylhs.value.arrval) = (yystack_[0].value.arrval); (yystack_[2].value.tptr)->value.avar = (yystack_[0].value.arrval); redefined_warning(aprepro, (yystack_[2].value.tptr)); set_type(aprepro, (yystack_[2].value.tptr), token::AVAR); } -#line 874 "apr_parser.cc" // lalr1.cc:919 +#line 877 "apr_parser.cc" break; case 37: -#line 233 "aprepro.yy" // lalr1.cc:919 +#line 234 "aprepro.yy" { (yylhs.value.arrval) = (yystack_[0].value.arrval); (yystack_[2].value.tptr)->value.avar = (yystack_[0].value.arrval); + redefined_warning(aprepro, (yystack_[2].value.tptr)); set_type(aprepro, (yystack_[2].value.tptr), token::AVAR); } -#line 881 "apr_parser.cc" // lalr1.cc:919 +#line 886 "apr_parser.cc" break; case 38: -#line 235 "aprepro.yy" // lalr1.cc:919 +#line 238 "aprepro.yy" + { + (yylhs.value.arrval) = (yystack_[0].value.arrval); + delete (yystack_[2].value.tptr)->value.avar; + (yystack_[2].value.tptr)->value.avar = (yystack_[0].value.arrval); + redefined_warning(aprepro, (yystack_[2].value.tptr)); + set_type(aprepro, (yystack_[2].value.tptr), token::AVAR); + } +#line 894 "apr_parser.cc" + break; + + case 39: +#line 241 "aprepro.yy" + { + (yylhs.value.arrval) = (yystack_[0].value.arrval); + (yystack_[2].value.tptr)->value.avar = (yystack_[0].value.arrval); + set_type(aprepro, (yystack_[2].value.tptr), token::AVAR); + } +#line 901 "apr_parser.cc" + break; + + case 40: +#line 243 "aprepro.yy" { if ((yystack_[2].value.arrval)->cols == (yystack_[0].value.arrval)->cols && (yystack_[2].value.arrval)->rows == (yystack_[0].value.arrval)->rows) { @@ -862,19 +884,19 @@ namespace SEAMS { yyerrok; } } -#line 894 "apr_parser.cc" // lalr1.cc:919 +#line 914 "apr_parser.cc" break; - case 39: -#line 243 "aprepro.yy" // lalr1.cc:919 + case 41: +#line 251 "aprepro.yy" { (yylhs.value.arrval) = array_scale((yystack_[0].value.arrval), -1.0); } -#line 900 "apr_parser.cc" // lalr1.cc:919 +#line 920 "apr_parser.cc" break; - case 40: -#line 245 "aprepro.yy" // lalr1.cc:919 + case 42: +#line 253 "aprepro.yy" { if ((yystack_[2].value.arrval)->cols == (yystack_[0].value.arrval)->cols && (yystack_[2].value.arrval)->rows == (yystack_[0].value.arrval)->rows) { @@ -886,36 +908,36 @@ namespace SEAMS { yyerrok; } } -#line 913 "apr_parser.cc" // lalr1.cc:919 +#line 933 "apr_parser.cc" break; - case 41: -#line 253 "aprepro.yy" // lalr1.cc:919 + case 43: +#line 261 "aprepro.yy" { (yylhs.value.arrval) = array_scale((yystack_[2].value.arrval), (yystack_[0].value.val)); } -#line 919 "apr_parser.cc" // lalr1.cc:919 +#line 939 "apr_parser.cc" break; - case 42: -#line 254 "aprepro.yy" // lalr1.cc:919 + case 44: +#line 262 "aprepro.yy" { (yylhs.value.arrval) = array_scale((yystack_[2].value.arrval), 1.0 / (yystack_[0].value.val)); } -#line 925 "apr_parser.cc" // lalr1.cc:919 +#line 945 "apr_parser.cc" break; - case 43: -#line 255 "aprepro.yy" // lalr1.cc:919 + case 45: +#line 263 "aprepro.yy" { (yylhs.value.arrval) = array_scale((yystack_[0].value.arrval), (yystack_[2].value.val)); } -#line 931 "apr_parser.cc" // lalr1.cc:919 +#line 951 "apr_parser.cc" break; - case 44: -#line 256 "aprepro.yy" // lalr1.cc:919 + case 46: +#line 264 "aprepro.yy" { if ((yystack_[2].value.arrval)->cols == (yystack_[0].value.arrval)->rows) { (yylhs.value.arrval) = @@ -927,84 +949,96 @@ namespace SEAMS { yyerrok; } } -#line 944 "apr_parser.cc" // lalr1.cc:919 +#line 964 "apr_parser.cc" break; - case 45: -#line 265 "aprepro.yy" // lalr1.cc:919 + case 47: +#line 273 "aprepro.yy" { (yylhs.value.string) = (yystack_[0].value.string); } -#line 950 "apr_parser.cc" // lalr1.cc:919 +#line 970 "apr_parser.cc" break; - case 46: -#line 266 "aprepro.yy" // lalr1.cc:919 + case 48: +#line 274 "aprepro.yy" { (yylhs.value.string) = (char *)(yystack_[0].value.tptr)->value.svar.c_str(); } -#line 956 "apr_parser.cc" // lalr1.cc:919 +#line 976 "apr_parser.cc" break; - case 47: -#line 267 "aprepro.yy" // lalr1.cc:919 + case 49: +#line 275 "aprepro.yy" { (yylhs.value.string) = (char *)(yystack_[0].value.tptr)->value.svar.c_str(); } -#line 962 "apr_parser.cc" // lalr1.cc:919 +#line 982 "apr_parser.cc" break; - case 48: -#line 268 "aprepro.yy" // lalr1.cc:919 + case 50: +#line 276 "aprepro.yy" { (yylhs.value.string) = (yystack_[0].value.string); (yystack_[2].value.tptr)->value.svar = (yystack_[0].value.string); set_type(aprepro, (yystack_[2].value.tptr), Parser::token::SVAR); } -#line 969 "apr_parser.cc" // lalr1.cc:919 +#line 989 "apr_parser.cc" break; - case 49: -#line 270 "aprepro.yy" // lalr1.cc:919 + case 51: +#line 278 "aprepro.yy" { (yylhs.value.string) = (yystack_[0].value.string); (yystack_[2].value.tptr)->value.svar = (yystack_[0].value.string); redefined_warning(aprepro, (yystack_[2].value.tptr)); } -#line 977 "apr_parser.cc" // lalr1.cc:919 +#line 997 "apr_parser.cc" break; - case 50: -#line 273 "aprepro.yy" // lalr1.cc:919 + case 52: +#line 281 "aprepro.yy" { (yylhs.value.string) = (yystack_[0].value.string); (yystack_[2].value.tptr)->value.svar = (yystack_[0].value.string); redefined_warning(aprepro, (yystack_[2].value.tptr)); set_type(aprepro, (yystack_[2].value.tptr), token::SVAR); } -#line 986 "apr_parser.cc" // lalr1.cc:919 +#line 1006 "apr_parser.cc" break; - case 51: -#line 277 "aprepro.yy" // lalr1.cc:919 + case 53: +#line 285 "aprepro.yy" + { + (yylhs.value.string) = (yystack_[0].value.string); + delete (yystack_[2].value.tptr)->value.avar; + (yystack_[2].value.tptr)->value.svar = (yystack_[0].value.string); + redefined_warning(aprepro, (yystack_[2].value.tptr)); + set_type(aprepro, (yystack_[2].value.tptr), token::SVAR); + } +#line 1016 "apr_parser.cc" + break; + + case 54: +#line 290 "aprepro.yy" { (yylhs.value.string) = (char *)(yystack_[2].value.tptr)->value.svar.c_str(); immutable_modify(aprepro, (yystack_[2].value.tptr)); } -#line 992 "apr_parser.cc" // lalr1.cc:919 +#line 1022 "apr_parser.cc" break; - case 52: -#line 278 "aprepro.yy" // lalr1.cc:919 + case 55: +#line 291 "aprepro.yy" { immutable_modify(aprepro, (yystack_[2].value.tptr)); YYERROR; } -#line 998 "apr_parser.cc" // lalr1.cc:919 +#line 1028 "apr_parser.cc" break; - case 53: -#line 279 "aprepro.yy" // lalr1.cc:919 + case 56: +#line 292 "aprepro.yy" { if (arg_check((yystack_[3].value.tptr), (yystack_[3].value.tptr)->value.strfnct_c == NULL)) @@ -1013,11 +1047,11 @@ namespace SEAMS { else (yylhs.value.string) = (char *)""; } -#line 1009 "apr_parser.cc" // lalr1.cc:919 +#line 1039 "apr_parser.cc" break; - case 54: -#line 285 "aprepro.yy" // lalr1.cc:919 + case 57: +#line 298 "aprepro.yy" { if (arg_check((yystack_[2].value.tptr), (yystack_[2].value.tptr)->value.strfnct == NULL)) @@ -1025,11 +1059,11 @@ namespace SEAMS { else (yylhs.value.string) = (char *)""; } -#line 1020 "apr_parser.cc" // lalr1.cc:919 +#line 1050 "apr_parser.cc" break; - case 55: -#line 291 "aprepro.yy" // lalr1.cc:919 + case 58: +#line 304 "aprepro.yy" { if (arg_check((yystack_[3].value.tptr), (yystack_[3].value.tptr)->value.strfnct_d == NULL)) @@ -1038,11 +1072,11 @@ namespace SEAMS { else (yylhs.value.string) = (char *)""; } -#line 1031 "apr_parser.cc" // lalr1.cc:919 +#line 1061 "apr_parser.cc" break; - case 56: -#line 297 "aprepro.yy" // lalr1.cc:919 + case 59: +#line 310 "aprepro.yy" { if (arg_check((yystack_[3].value.tptr), (yystack_[3].value.tptr)->value.strfnct_a == NULL)) @@ -1051,20 +1085,20 @@ namespace SEAMS { else (yylhs.value.string) = (char *)""; } -#line 1042 "apr_parser.cc" // lalr1.cc:919 +#line 1072 "apr_parser.cc" break; - case 57: -#line 303 "aprepro.yy" // lalr1.cc:919 + case 60: +#line 316 "aprepro.yy" { concat_string((yystack_[2].value.string), (yystack_[0].value.string), &(yylhs.value.string)); } -#line 1048 "apr_parser.cc" // lalr1.cc:919 +#line 1078 "apr_parser.cc" break; - case 58: -#line 304 "aprepro.yy" // lalr1.cc:919 + case 61: +#line 317 "aprepro.yy" { if (arg_check((yystack_[5].value.tptr), (yystack_[5].value.tptr)->value.strfnct_dd == NULL)) @@ -1073,11 +1107,11 @@ namespace SEAMS { else (yylhs.value.string) = (char *)""; } -#line 1059 "apr_parser.cc" // lalr1.cc:919 +#line 1089 "apr_parser.cc" break; - case 59: -#line 310 "aprepro.yy" // lalr1.cc:919 + case 62: +#line 323 "aprepro.yy" { if (arg_check((yystack_[11].value.tptr), (yystack_[11].value.tptr)->value.strfnct_dcccc == NULL)) @@ -1087,11 +1121,11 @@ namespace SEAMS { else (yylhs.value.string) = (char *)""; } -#line 1070 "apr_parser.cc" // lalr1.cc:919 +#line 1100 "apr_parser.cc" break; - case 60: -#line 316 "aprepro.yy" // lalr1.cc:919 + case 63: +#line 329 "aprepro.yy" { if (arg_check((yystack_[7].value.tptr), (yystack_[7].value.tptr)->value.strfnct_dcc == NULL)) @@ -1100,11 +1134,11 @@ namespace SEAMS { else (yylhs.value.string) = (char *)""; } -#line 1081 "apr_parser.cc" // lalr1.cc:919 +#line 1111 "apr_parser.cc" break; - case 61: -#line 322 "aprepro.yy" // lalr1.cc:919 + case 64: +#line 335 "aprepro.yy" { if (arg_check((yystack_[7].value.tptr), (yystack_[7].value.tptr)->value.strfnct_ccc == NULL)) @@ -1114,11 +1148,11 @@ namespace SEAMS { else (yylhs.value.string) = (char *)""; } -#line 1092 "apr_parser.cc" // lalr1.cc:919 +#line 1122 "apr_parser.cc" break; - case 62: -#line 328 "aprepro.yy" // lalr1.cc:919 + case 65: +#line 341 "aprepro.yy" { if (arg_check((yystack_[5].value.tptr), (yystack_[5].value.tptr)->value.strfnct_cc == NULL)) @@ -1127,149 +1161,161 @@ namespace SEAMS { else (yylhs.value.string) = (char *)""; } -#line 1103 "apr_parser.cc" // lalr1.cc:919 +#line 1133 "apr_parser.cc" break; - case 63: -#line 334 "aprepro.yy" // lalr1.cc:919 + case 66: +#line 347 "aprepro.yy" { (yylhs.value.string) = ((yystack_[4].value.val)) ? ((yystack_[2].value.string)) : ((yystack_[0].value.string)); } -#line 1109 "apr_parser.cc" // lalr1.cc:919 +#line 1139 "apr_parser.cc" break; - case 64: -#line 336 "aprepro.yy" // lalr1.cc:919 + case 67: +#line 349 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.val); } -#line 1115 "apr_parser.cc" // lalr1.cc:919 +#line 1145 "apr_parser.cc" break; - case 65: -#line 337 "aprepro.yy" // lalr1.cc:919 + case 68: +#line 350 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.val) + 1; } -#line 1121 "apr_parser.cc" // lalr1.cc:919 +#line 1151 "apr_parser.cc" break; - case 66: -#line 338 "aprepro.yy" // lalr1.cc:919 + case 69: +#line 351 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.val) - 1; } -#line 1127 "apr_parser.cc" // lalr1.cc:919 +#line 1157 "apr_parser.cc" break; - case 67: -#line 339 "aprepro.yy" // lalr1.cc:919 + case 70: +#line 352 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.tptr)->value.var; } -#line 1133 "apr_parser.cc" // lalr1.cc:919 +#line 1163 "apr_parser.cc" break; - case 68: -#line 340 "aprepro.yy" // lalr1.cc:919 + case 71: +#line 353 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.tptr)->value.var; } -#line 1139 "apr_parser.cc" // lalr1.cc:919 +#line 1169 "apr_parser.cc" break; - case 69: -#line 341 "aprepro.yy" // lalr1.cc:919 + case 72: +#line 354 "aprepro.yy" { (yylhs.value.val) = ++((yystack_[0].value.tptr)->value.var); } -#line 1145 "apr_parser.cc" // lalr1.cc:919 +#line 1175 "apr_parser.cc" break; - case 70: -#line 342 "aprepro.yy" // lalr1.cc:919 + case 73: +#line 355 "aprepro.yy" { (yylhs.value.val) = --((yystack_[0].value.tptr)->value.var); } -#line 1151 "apr_parser.cc" // lalr1.cc:919 +#line 1181 "apr_parser.cc" break; - case 71: -#line 343 "aprepro.yy" // lalr1.cc:919 + case 74: +#line 356 "aprepro.yy" { (yylhs.value.val) = ((yystack_[1].value.tptr)->value.var)++; } -#line 1157 "apr_parser.cc" // lalr1.cc:919 +#line 1187 "apr_parser.cc" break; - case 72: -#line 344 "aprepro.yy" // lalr1.cc:919 + case 75: +#line 357 "aprepro.yy" { (yylhs.value.val) = ((yystack_[1].value.tptr)->value.var)--; } -#line 1163 "apr_parser.cc" // lalr1.cc:919 +#line 1193 "apr_parser.cc" break; - case 73: -#line 345 "aprepro.yy" // lalr1.cc:919 + case 76: +#line 358 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.val); (yystack_[2].value.tptr)->value.var = (yystack_[0].value.val); redefined_warning(aprepro, (yystack_[2].value.tptr)); } -#line 1170 "apr_parser.cc" // lalr1.cc:919 +#line 1200 "apr_parser.cc" break; - case 74: -#line 347 "aprepro.yy" // lalr1.cc:919 + case 77: +#line 360 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.val); (yystack_[2].value.tptr)->value.var = (yystack_[0].value.val); redefined_warning(aprepro, (yystack_[2].value.tptr)); set_type(aprepro, (yystack_[2].value.tptr), token::VAR); } -#line 1178 "apr_parser.cc" // lalr1.cc:919 +#line 1208 "apr_parser.cc" break; - case 75: -#line 350 "aprepro.yy" // lalr1.cc:919 + case 78: +#line 363 "aprepro.yy" + { + (yylhs.value.val) = (yystack_[0].value.val); + delete (yystack_[2].value.tptr)->value.avar; + (yystack_[2].value.tptr)->value.var = (yystack_[0].value.val); + redefined_warning(aprepro, (yystack_[2].value.tptr)); + set_type(aprepro, (yystack_[2].value.tptr), token::VAR); + } +#line 1218 "apr_parser.cc" + break; + + case 79: +#line 368 "aprepro.yy" { (yystack_[2].value.tptr)->value.var += (yystack_[0].value.val); (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; } -#line 1184 "apr_parser.cc" // lalr1.cc:919 +#line 1224 "apr_parser.cc" break; - case 76: -#line 351 "aprepro.yy" // lalr1.cc:919 + case 80: +#line 369 "aprepro.yy" { (yystack_[2].value.tptr)->value.var -= (yystack_[0].value.val); (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; } -#line 1190 "apr_parser.cc" // lalr1.cc:919 +#line 1230 "apr_parser.cc" break; - case 77: -#line 352 "aprepro.yy" // lalr1.cc:919 + case 81: +#line 370 "aprepro.yy" { (yystack_[2].value.tptr)->value.var *= (yystack_[0].value.val); (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; } -#line 1196 "apr_parser.cc" // lalr1.cc:919 +#line 1236 "apr_parser.cc" break; - case 78: -#line 353 "aprepro.yy" // lalr1.cc:919 + case 82: +#line 371 "aprepro.yy" { (yystack_[2].value.tptr)->value.var /= (yystack_[0].value.val); (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; } -#line 1202 "apr_parser.cc" // lalr1.cc:919 +#line 1242 "apr_parser.cc" break; - case 79: -#line 354 "aprepro.yy" // lalr1.cc:919 + case 83: +#line 372 "aprepro.yy" { reset_error(); (yystack_[2].value.tptr)->value.var = @@ -1277,213 +1323,213 @@ namespace SEAMS { (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; SEAMS::math_error(aprepro, "Power"); } -#line 1212 "apr_parser.cc" // lalr1.cc:919 +#line 1252 "apr_parser.cc" break; - case 80: -#line 359 "aprepro.yy" // lalr1.cc:919 + case 84: +#line 377 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.tptr)->value.var; immutable_modify(aprepro, (yystack_[0].value.tptr)); } -#line 1218 "apr_parser.cc" // lalr1.cc:919 +#line 1258 "apr_parser.cc" break; - case 81: -#line 360 "aprepro.yy" // lalr1.cc:919 + case 85: +#line 378 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.tptr)->value.var; immutable_modify(aprepro, (yystack_[0].value.tptr)); } -#line 1224 "apr_parser.cc" // lalr1.cc:919 +#line 1264 "apr_parser.cc" break; - case 82: -#line 361 "aprepro.yy" // lalr1.cc:919 + case 86: +#line 379 "aprepro.yy" { (yylhs.value.val) = (yystack_[1].value.tptr)->value.var; immutable_modify(aprepro, (yystack_[1].value.tptr)); } -#line 1230 "apr_parser.cc" // lalr1.cc:919 +#line 1270 "apr_parser.cc" break; - case 83: -#line 362 "aprepro.yy" // lalr1.cc:919 + case 87: +#line 380 "aprepro.yy" { (yylhs.value.val) = (yystack_[1].value.tptr)->value.var; immutable_modify(aprepro, (yystack_[1].value.tptr)); } -#line 1236 "apr_parser.cc" // lalr1.cc:919 +#line 1276 "apr_parser.cc" break; - case 84: -#line 363 "aprepro.yy" // lalr1.cc:919 + case 88: +#line 381 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; immutable_modify(aprepro, (yystack_[2].value.tptr)); } -#line 1242 "apr_parser.cc" // lalr1.cc:919 +#line 1282 "apr_parser.cc" break; - case 85: -#line 364 "aprepro.yy" // lalr1.cc:919 + case 89: +#line 382 "aprepro.yy" { immutable_modify(aprepro, (yystack_[2].value.tptr)); YYERROR; } -#line 1248 "apr_parser.cc" // lalr1.cc:919 +#line 1288 "apr_parser.cc" break; - case 86: -#line 365 "aprepro.yy" // lalr1.cc:919 + case 90: +#line 383 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; immutable_modify(aprepro, (yystack_[2].value.tptr)); } -#line 1254 "apr_parser.cc" // lalr1.cc:919 +#line 1294 "apr_parser.cc" break; - case 87: -#line 366 "aprepro.yy" // lalr1.cc:919 + case 91: +#line 384 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; immutable_modify(aprepro, (yystack_[2].value.tptr)); } -#line 1260 "apr_parser.cc" // lalr1.cc:919 +#line 1300 "apr_parser.cc" break; - case 88: -#line 367 "aprepro.yy" // lalr1.cc:919 + case 92: +#line 385 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; immutable_modify(aprepro, (yystack_[2].value.tptr)); } -#line 1266 "apr_parser.cc" // lalr1.cc:919 +#line 1306 "apr_parser.cc" break; - case 89: -#line 368 "aprepro.yy" // lalr1.cc:919 + case 93: +#line 386 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; immutable_modify(aprepro, (yystack_[2].value.tptr)); } -#line 1272 "apr_parser.cc" // lalr1.cc:919 +#line 1312 "apr_parser.cc" break; - case 90: -#line 369 "aprepro.yy" // lalr1.cc:919 + case 94: +#line 387 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; immutable_modify(aprepro, (yystack_[2].value.tptr)); } -#line 1278 "apr_parser.cc" // lalr1.cc:919 +#line 1318 "apr_parser.cc" break; - case 91: -#line 371 "aprepro.yy" // lalr1.cc:919 + case 95: +#line 389 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.tptr)->value.var; undefined_error(aprepro, (yystack_[0].value.tptr)->name); } -#line 1285 "apr_parser.cc" // lalr1.cc:919 +#line 1325 "apr_parser.cc" break; - case 92: -#line 373 "aprepro.yy" // lalr1.cc:919 + case 96: +#line 391 "aprepro.yy" { (yylhs.value.val) = ++((yystack_[0].value.tptr)->value.var); set_type(aprepro, (yystack_[0].value.tptr), token::VAR); undefined_error(aprepro, (yystack_[0].value.tptr)->name); } -#line 1293 "apr_parser.cc" // lalr1.cc:919 +#line 1333 "apr_parser.cc" break; - case 93: -#line 376 "aprepro.yy" // lalr1.cc:919 + case 97: +#line 394 "aprepro.yy" { (yylhs.value.val) = --((yystack_[0].value.tptr)->value.var); set_type(aprepro, (yystack_[0].value.tptr), token::VAR); undefined_error(aprepro, (yystack_[0].value.tptr)->name); } -#line 1301 "apr_parser.cc" // lalr1.cc:919 +#line 1341 "apr_parser.cc" break; - case 94: -#line 379 "aprepro.yy" // lalr1.cc:919 + case 98: +#line 397 "aprepro.yy" { (yylhs.value.val) = ((yystack_[1].value.tptr)->value.var)++; set_type(aprepro, (yystack_[1].value.tptr), token::VAR); undefined_error(aprepro, (yystack_[1].value.tptr)->name); } -#line 1309 "apr_parser.cc" // lalr1.cc:919 +#line 1349 "apr_parser.cc" break; - case 95: -#line 382 "aprepro.yy" // lalr1.cc:919 + case 99: +#line 400 "aprepro.yy" { (yylhs.value.val) = ((yystack_[1].value.tptr)->value.var)--; set_type(aprepro, (yystack_[1].value.tptr), token::VAR); undefined_error(aprepro, (yystack_[1].value.tptr)->name); } -#line 1317 "apr_parser.cc" // lalr1.cc:919 +#line 1357 "apr_parser.cc" break; - case 96: -#line 385 "aprepro.yy" // lalr1.cc:919 + case 100: +#line 403 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.val); (yystack_[2].value.tptr)->value.var = (yystack_[0].value.val); set_type(aprepro, (yystack_[2].value.tptr), token::VAR); } -#line 1324 "apr_parser.cc" // lalr1.cc:919 +#line 1364 "apr_parser.cc" break; - case 97: -#line 387 "aprepro.yy" // lalr1.cc:919 + case 101: +#line 405 "aprepro.yy" { (yystack_[2].value.tptr)->value.var += (yystack_[0].value.val); (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; set_type(aprepro, (yystack_[2].value.tptr), token::VAR); undefined_error(aprepro, (yystack_[2].value.tptr)->name); } -#line 1332 "apr_parser.cc" // lalr1.cc:919 +#line 1372 "apr_parser.cc" break; - case 98: -#line 390 "aprepro.yy" // lalr1.cc:919 + case 102: +#line 408 "aprepro.yy" { (yystack_[2].value.tptr)->value.var -= (yystack_[0].value.val); (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; set_type(aprepro, (yystack_[2].value.tptr), token::VAR); undefined_error(aprepro, (yystack_[2].value.tptr)->name); } -#line 1340 "apr_parser.cc" // lalr1.cc:919 +#line 1380 "apr_parser.cc" break; - case 99: -#line 393 "aprepro.yy" // lalr1.cc:919 + case 103: +#line 411 "aprepro.yy" { (yystack_[2].value.tptr)->value.var *= (yystack_[0].value.val); (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; set_type(aprepro, (yystack_[2].value.tptr), token::VAR); undefined_error(aprepro, (yystack_[2].value.tptr)->name); } -#line 1348 "apr_parser.cc" // lalr1.cc:919 +#line 1388 "apr_parser.cc" break; - case 100: -#line 396 "aprepro.yy" // lalr1.cc:919 + case 104: +#line 414 "aprepro.yy" { (yystack_[2].value.tptr)->value.var /= (yystack_[0].value.val); (yylhs.value.val) = (yystack_[2].value.tptr)->value.var; set_type(aprepro, (yystack_[2].value.tptr), token::VAR); undefined_error(aprepro, (yystack_[2].value.tptr)->name); } -#line 1356 "apr_parser.cc" // lalr1.cc:919 +#line 1396 "apr_parser.cc" break; - case 101: -#line 399 "aprepro.yy" // lalr1.cc:919 + case 105: +#line 417 "aprepro.yy" { reset_error(); (yystack_[2].value.tptr)->value.var = @@ -1493,11 +1539,11 @@ namespace SEAMS { SEAMS::math_error(aprepro, "Power"); undefined_error(aprepro, (yystack_[2].value.tptr)->name); } -#line 1367 "apr_parser.cc" // lalr1.cc:919 +#line 1407 "apr_parser.cc" break; - case 102: -#line 406 "aprepro.yy" // lalr1.cc:919 + case 106: +#line 424 "aprepro.yy" { if (arg_check((yystack_[2].value.tptr), (yystack_[2].value.tptr)->value.fnctptr == NULL)) @@ -1505,11 +1551,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1378 "apr_parser.cc" // lalr1.cc:919 +#line 1418 "apr_parser.cc" break; - case 103: -#line 413 "aprepro.yy" // lalr1.cc:919 + case 107: +#line 431 "aprepro.yy" { if (arg_check((yystack_[3].value.tptr), (yystack_[3].value.tptr)->value.fnctptr_d == NULL)) @@ -1518,11 +1564,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1389 "apr_parser.cc" // lalr1.cc:919 +#line 1429 "apr_parser.cc" break; - case 104: -#line 420 "aprepro.yy" // lalr1.cc:919 + case 108: +#line 438 "aprepro.yy" { if (arg_check((yystack_[3].value.tptr), (yystack_[3].value.tptr)->value.fnctptr_c == NULL)) @@ -1531,11 +1577,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1400 "apr_parser.cc" // lalr1.cc:919 +#line 1440 "apr_parser.cc" break; - case 105: -#line 427 "aprepro.yy" // lalr1.cc:919 + case 109: +#line 445 "aprepro.yy" { if (arg_check((yystack_[3].value.tptr), (yystack_[3].value.tptr)->value.fnctptr_a == NULL)) @@ -1544,11 +1590,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1411 "apr_parser.cc" // lalr1.cc:919 +#line 1451 "apr_parser.cc" break; - case 106: -#line 434 "aprepro.yy" // lalr1.cc:919 + case 110: +#line 452 "aprepro.yy" { if (arg_check((yystack_[5].value.tptr), (yystack_[5].value.tptr)->value.fnctptr_cd == NULL)) @@ -1557,11 +1603,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1422 "apr_parser.cc" // lalr1.cc:919 +#line 1462 "apr_parser.cc" break; - case 107: -#line 441 "aprepro.yy" // lalr1.cc:919 + case 111: +#line 459 "aprepro.yy" { if (arg_check((yystack_[5].value.tptr), (yystack_[5].value.tptr)->value.fnctptr_dc == NULL)) @@ -1570,11 +1616,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1433 "apr_parser.cc" // lalr1.cc:919 +#line 1473 "apr_parser.cc" break; - case 108: -#line 448 "aprepro.yy" // lalr1.cc:919 + case 112: +#line 466 "aprepro.yy" { if (arg_check((yystack_[5].value.tptr), (yystack_[5].value.tptr)->value.fnctptr_cc == NULL)) @@ -1583,11 +1629,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1444 "apr_parser.cc" // lalr1.cc:919 +#line 1484 "apr_parser.cc" break; - case 109: -#line 455 "aprepro.yy" // lalr1.cc:919 + case 113: +#line 473 "aprepro.yy" { if (arg_check((yystack_[7].value.tptr), (yystack_[7].value.tptr)->value.fnctptr_ccc == NULL)) @@ -1597,11 +1643,11 @@ namespace SEAMS { else yyerrok; } -#line 1455 "apr_parser.cc" // lalr1.cc:919 +#line 1495 "apr_parser.cc" break; - case 110: -#line 462 "aprepro.yy" // lalr1.cc:919 + case 114: +#line 480 "aprepro.yy" { if (arg_check((yystack_[5].value.tptr), (yystack_[5].value.tptr)->value.fnctptr_dd == NULL)) @@ -1610,11 +1656,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1466 "apr_parser.cc" // lalr1.cc:919 +#line 1506 "apr_parser.cc" break; - case 111: -#line 468 "aprepro.yy" // lalr1.cc:919 + case 115: +#line 486 "aprepro.yy" { if (arg_check((yystack_[7].value.tptr), (yystack_[7].value.tptr)->value.fnctptr_ddd == NULL)) @@ -1623,11 +1669,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1477 "apr_parser.cc" // lalr1.cc:919 +#line 1517 "apr_parser.cc" break; - case 112: -#line 474 "aprepro.yy" // lalr1.cc:919 + case 116: +#line 492 "aprepro.yy" { if (arg_check((yystack_[7].value.tptr), (yystack_[7].value.tptr)->value.fnctptr_ccd == NULL)) @@ -1636,11 +1682,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1488 "apr_parser.cc" // lalr1.cc:919 +#line 1528 "apr_parser.cc" break; - case 113: -#line 480 "aprepro.yy" // lalr1.cc:919 + case 117: +#line 498 "aprepro.yy" { if (arg_check((yystack_[9].value.tptr), (yystack_[9].value.tptr)->value.fnctptr_dddd == NULL)) @@ -1650,11 +1696,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1499 "apr_parser.cc" // lalr1.cc:919 +#line 1539 "apr_parser.cc" break; - case 114: -#line 486 "aprepro.yy" // lalr1.cc:919 + case 118: +#line 504 "aprepro.yy" { if (arg_check((yystack_[9].value.tptr), (yystack_[9].value.tptr)->value.fnctptr_dddd == NULL)) @@ -1664,11 +1710,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1510 "apr_parser.cc" // lalr1.cc:919 +#line 1550 "apr_parser.cc" break; - case 115: -#line 492 "aprepro.yy" // lalr1.cc:919 + case 119: +#line 510 "aprepro.yy" { if (arg_check((yystack_[11].value.tptr), (yystack_[11].value.tptr)->value.fnctptr_ddddc == NULL)) @@ -1678,11 +1724,11 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1521 "apr_parser.cc" // lalr1.cc:919 +#line 1561 "apr_parser.cc" break; - case 116: -#line 498 "aprepro.yy" // lalr1.cc:919 + case 120: +#line 516 "aprepro.yy" { if (arg_check((yystack_[13].value.tptr), (yystack_[13].value.tptr)->value.fnctptr_dddddd == NULL)) @@ -1692,35 +1738,35 @@ namespace SEAMS { else (yylhs.value.val) = 0.0; } -#line 1532 "apr_parser.cc" // lalr1.cc:919 +#line 1572 "apr_parser.cc" break; - case 117: -#line 504 "aprepro.yy" // lalr1.cc:919 + case 121: +#line 522 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) + (yystack_[0].value.val); } -#line 1538 "apr_parser.cc" // lalr1.cc:919 +#line 1578 "apr_parser.cc" break; - case 118: -#line 505 "aprepro.yy" // lalr1.cc:919 + case 122: +#line 523 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) - (yystack_[0].value.val); } -#line 1544 "apr_parser.cc" // lalr1.cc:919 +#line 1584 "apr_parser.cc" break; - case 119: -#line 506 "aprepro.yy" // lalr1.cc:919 + case 123: +#line 524 "aprepro.yy" { (yylhs.value.val) = (yystack_[2].value.val) * (yystack_[0].value.val); } -#line 1550 "apr_parser.cc" // lalr1.cc:919 +#line 1590 "apr_parser.cc" break; - case 120: -#line 507 "aprepro.yy" // lalr1.cc:919 + case 124: +#line 525 "aprepro.yy" { if ((yystack_[0].value.val) == 0.) { yyerror(aprepro, "Zero divisor"); @@ -1729,11 +1775,11 @@ namespace SEAMS { else (yylhs.value.val) = (yystack_[2].value.val) / (yystack_[0].value.val); } -#line 1562 "apr_parser.cc" // lalr1.cc:919 +#line 1602 "apr_parser.cc" break; - case 121: -#line 514 "aprepro.yy" // lalr1.cc:919 + case 125: +#line 532 "aprepro.yy" { if ((yystack_[0].value.val) == 0.) { yyerror(aprepro, "Zero divisor"); @@ -1742,45 +1788,45 @@ namespace SEAMS { else (yylhs.value.val) = (int)(yystack_[2].value.val) % (int)(yystack_[0].value.val); } -#line 1574 "apr_parser.cc" // lalr1.cc:919 +#line 1614 "apr_parser.cc" break; - case 122: -#line 521 "aprepro.yy" // lalr1.cc:919 + case 126: +#line 539 "aprepro.yy" { (yylhs.value.val) = -(yystack_[0].value.val); } -#line 1580 "apr_parser.cc" // lalr1.cc:919 +#line 1620 "apr_parser.cc" break; - case 123: -#line 522 "aprepro.yy" // lalr1.cc:919 + case 127: +#line 540 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.val); } -#line 1586 "apr_parser.cc" // lalr1.cc:919 +#line 1626 "apr_parser.cc" break; - case 124: -#line 523 "aprepro.yy" // lalr1.cc:919 + case 128: +#line 541 "aprepro.yy" { reset_error(); (yylhs.value.val) = std::pow((yystack_[2].value.val), (yystack_[0].value.val)); SEAMS::math_error(aprepro, "Power"); } -#line 1594 "apr_parser.cc" // lalr1.cc:919 +#line 1634 "apr_parser.cc" break; - case 125: -#line 526 "aprepro.yy" // lalr1.cc:919 + case 129: +#line 544 "aprepro.yy" { (yylhs.value.val) = (yystack_[1].value.val); } -#line 1600 "apr_parser.cc" // lalr1.cc:919 +#line 1640 "apr_parser.cc" break; - case 126: -#line 527 "aprepro.yy" // lalr1.cc:919 + case 130: +#line 545 "aprepro.yy" { reset_error(); (yylhs.value.val) = @@ -1788,46 +1834,46 @@ namespace SEAMS { : floor((yystack_[1].value.val))); SEAMS::math_error(aprepro, "floor (int)"); } -#line 1608 "apr_parser.cc" // lalr1.cc:919 +#line 1648 "apr_parser.cc" break; - case 127: -#line 530 "aprepro.yy" // lalr1.cc:919 + case 131: +#line 548 "aprepro.yy" { (yylhs.value.val) = ((yystack_[0].value.val)) ? 1 : 0; } -#line 1614 "apr_parser.cc" // lalr1.cc:919 +#line 1654 "apr_parser.cc" break; - case 128: -#line 531 "aprepro.yy" // lalr1.cc:919 + case 132: +#line 549 "aprepro.yy" { (yylhs.value.val) = ((yystack_[4].value.val)) ? ((yystack_[2].value.val)) : ((yystack_[0].value.val)); } -#line 1620 "apr_parser.cc" // lalr1.cc:919 +#line 1660 "apr_parser.cc" break; - case 129: -#line 532 "aprepro.yy" // lalr1.cc:919 + case 133: +#line 550 "aprepro.yy" { (yylhs.value.val) = array_value((yystack_[3].value.tptr)->value.avar, (yystack_[1].value.val), 0); } -#line 1626 "apr_parser.cc" // lalr1.cc:919 +#line 1666 "apr_parser.cc" break; - case 130: -#line 533 "aprepro.yy" // lalr1.cc:919 + case 134: +#line 551 "aprepro.yy" { (yylhs.value.val) = array_value((yystack_[5].value.tptr)->value.avar, (yystack_[3].value.val), (yystack_[1].value.val)); } -#line 1632 "apr_parser.cc" // lalr1.cc:919 +#line 1672 "apr_parser.cc" break; - case 131: -#line 535 "aprepro.yy" // lalr1.cc:919 + case 135: +#line 553 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.val); array *arr = (yystack_[5].value.tptr)->value.avar; @@ -1850,11 +1896,11 @@ namespace SEAMS { yyerrok; } } -#line 1658 "apr_parser.cc" // lalr1.cc:919 +#line 1698 "apr_parser.cc" break; - case 132: -#line 557 "aprepro.yy" // lalr1.cc:919 + case 136: +#line 575 "aprepro.yy" { (yylhs.value.val) = (yystack_[0].value.val); array *arr = (yystack_[7].value.tptr)->value.avar; @@ -1875,10 +1921,11 @@ namespace SEAMS { yyerrok; } } -#line 1682 "apr_parser.cc" // lalr1.cc:919 +#line 1722 "apr_parser.cc" break; -#line 1686 "apr_parser.cc" // lalr1.cc:919 +#line 1726 "apr_parser.cc" + default: break; } } @@ -2116,216 +2163,219 @@ namespace SEAMS { const signed char Parser::yytable_ninf_ = -1; const short Parser::yypact_[] = { - -34, 2, -34, -3, 289, -34, -34, -34, -34, -34, -13, 296, 4, 600, 28, - 45, 44, 46, 53, 405, 405, -34, 405, 360, 405, 111, 179, 48, -16, 38, - 1126, 360, 405, 405, 405, 405, 405, -34, -34, 405, 405, 405, 405, 405, 405, - -34, -34, 405, 405, 405, 405, 405, 405, 405, -34, -34, 405, 405, 360, 209, - 345, 360, 630, 52, 405, 93, 1174, 864, 1078, 18, -34, 18, 18, -34, -34, - -34, -34, -34, -34, -34, -34, 405, 405, 405, -34, 360, 360, 405, 360, -34, - 405, 405, 405, 405, 405, 405, 405, -34, 405, 405, 405, 405, 405, 405, 405, - 405, 405, 405, 405, 360, 405, 405, -33, 1174, 1193, 1209, 1209, 1209, 1209, 1209, - 1174, 1209, 1209, 1209, 1209, 1209, 1209, 1174, 1209, 1174, 1209, 1209, 1209, 1209, 1209, - 1209, 1174, 1209, 599, -33, 1193, -34, 50, 99, 629, -34, 154, 229, 659, 230, - 421, 689, 405, 18, -34, -34, 405, -34, 1140, 1160, 49, 1209, -34, 1, 1, - 1225, -34, 1225, 39, 39, 39, 39, 39, 39, -34, 1240, 1254, 340, 340, 340, - 340, 340, 340, 190, 190, 18, -34, 18, 18, 18, 405, 70, -34, 405, -34, - 405, -34, -34, 405, -34, 405, -34, -34, 405, -34, 405, -34, 1209, 18, 405, - 405, 1103, 405, 431, 891, 484, 570, 456, 131, 918, 490, 945, 719, 1174, 1209, - 71, 1209, 405, -34, -34, -34, 405, -34, 405, 405, -34, 405, -34, -34, -34, - 405, -34, 405, 512, 972, 749, 808, 518, 462, 999, 1209, -34, -34, 405, -34, - 405, -34, 405, -34, -34, 779, 1026, 391, 405, -34, -34, 405, 540, 837, 546, - -34, 405, -34, 1053, -34}; + -34, 2, -34, -3, 305, -34, -34, -34, -34, -34, -13, 68, 4, 312, 28, 47, + 53, 62, 67, 421, 421, -34, 421, 376, 421, 55, 181, 50, -16, 39, 1142, 376, + 421, 421, 421, 421, 421, -34, -34, 376, 421, 421, 421, 421, 421, -34, -34, 376, + 421, 421, 421, 421, 421, 421, -34, -34, 421, 421, 376, 221, 361, 376, 616, 646, + 95, 48, 421, 107, 1190, 880, 1094, 82, -34, 82, 82, -34, -34, -34, -34, -34, + -34, -34, -34, 421, 421, 421, -34, 376, 376, 421, 376, -34, 421, 421, 421, 421, + 421, 421, 421, -34, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, 376, + 421, 421, -33, 1190, 1209, 1225, 1225, 1225, 1225, 1225, -33, 1190, 1209, 1225, 1225, 1225, + 1225, 1225, -33, 1190, 1209, 1190, 1225, 1225, 1225, 1225, 1225, 1225, 1190, 1225, 615, -33, + 1190, 1209, -34, 72, 240, 645, -34, 262, 248, 675, 288, 437, 705, 421, 421, 421, + 421, 82, -34, -34, 421, -34, 1156, 1176, 97, 1225, -34, 1, 1209, 1, 1241, -34, + 1241, 81, 81, 81, 81, 81, 81, -34, 1256, 1270, 80, 80, 80, 80, 80, 80, + 161, 161, 82, -34, 82, 82, 82, 421, 108, -34, 421, -34, 421, -34, -34, 421, + -34, 421, -34, -34, 421, -34, 421, -34, 1225, 1225, 1225, 1225, 82, 421, 421, 1119, + 421, 447, 907, 500, 586, 472, 137, 934, 506, 961, 735, 1190, 1225, 109, 1225, 421, + -34, -34, -34, 421, -34, 421, 421, -34, 421, -34, -34, -34, 421, -34, 421, 528, + 988, 765, 824, 534, 478, 1015, 1225, -34, -34, 421, -34, 421, -34, 421, -34, -34, + 795, 1042, 407, 421, -34, -34, 421, 556, 853, 562, -34, 421, -34, 1069, -34}; const unsigned char Parser::yydefact_[] = { - 2, 0, 1, 0, 0, 4, 3, 9, 64, 45, 91, 67, 46, 68, 47, 28, 0, 0, 0, - 0, 0, 8, 0, 0, 0, 0, 0, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, - 95, 0, 0, 0, 0, 0, 0, 71, 72, 0, 0, 0, 0, 0, 0, 0, 82, 83, 0, - 0, 0, 0, 0, 0, 91, 0, 0, 127, 0, 0, 0, 123, 39, 122, 12, 65, 92, 69, - 80, 66, 93, 70, 81, 0, 0, 0, 7, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 48, - 96, 97, 98, 99, 100, 101, 50, 73, 75, 76, 77, 78, 79, 49, 74, 52, 84, 86, 87, - 88, 89, 90, 51, 85, 0, 36, 0, 102, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, - 0, 122, 21, 125, 0, 126, 0, 0, 19, 0, 20, 38, 40, 42, 44, 41, 22, 23, 24, - 25, 26, 27, 57, 17, 18, 10, 11, 13, 14, 15, 16, 117, 118, 120, 43, 119, 121, 124, - 0, 129, 105, 0, 104, 0, 103, 56, 0, 53, 0, 55, 35, 0, 29, 0, 34, 96, 119, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 128, 130, 131, 0, - 108, 106, 107, 0, 110, 0, 0, 62, 0, 58, 31, 30, 0, 33, 0, 0, 0, 0, 0, - 0, 0, 0, 132, 109, 112, 0, 111, 0, 61, 0, 60, 32, 0, 0, 0, 0, 114, 113, - 0, 0, 0, 0, 115, 0, 59, 0, 116}; - - const signed char Parser::yypgoto_[] = {-34, -34, -34, -18, 95, 81, -4}; - - const short Parser::yydefgoto_[] = {-1, 1, 6, 27, 28, 66, 161}; + 2, 0, 1, 0, 0, 4, 3, 9, 67, 47, 95, 70, 48, 71, 49, 28, 0, 0, + 0, 0, 0, 8, 0, 0, 0, 0, 0, 131, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 98, 99, 0, 0, 0, 0, 0, 0, 74, 75, 0, 0, 0, 0, 0, 0, 0, + 86, 87, 0, 0, 0, 0, 0, 0, 95, 70, 48, 0, 0, 131, 0, 0, 0, 127, + 41, 126, 12, 68, 96, 72, 84, 69, 97, 73, 85, 0, 0, 0, 7, 0, 0, 0, + 0, 6, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 39, 50, 100, 101, 102, 103, 104, 105, 37, 52, 76, 79, + 80, 81, 82, 83, 36, 51, 77, 55, 88, 90, 91, 92, 93, 94, 54, 89, 0, 38, + 53, 78, 106, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126, + 21, 129, 0, 130, 0, 0, 19, 0, 20, 40, 0, 42, 44, 46, 43, 22, 23, 24, + 25, 26, 27, 60, 17, 18, 10, 11, 13, 14, 15, 16, 121, 122, 124, 45, 123, 125, + 128, 0, 133, 109, 0, 108, 0, 107, 59, 0, 56, 0, 58, 35, 0, 29, 0, 34, + 100, 76, 77, 78, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 66, 132, 134, 135, 0, 112, 110, 111, 0, 114, 0, 0, 65, 0, 61, 31, 30, + 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 136, 113, 116, 0, 115, 0, 64, 0, + 63, 32, 0, 0, 0, 0, 118, 117, 0, 0, 0, 0, 119, 0, 62, 0, 120}; + + const signed char Parser::yypgoto_[] = {-34, -34, -34, -18, 103, 85, -4}; + + const short Parser::yydefgoto_[] = {-1, 1, 6, 27, 28, 68, 169}; const unsigned short Parser::yytable_[] = { - 30, 65, 2, 3, 84, 85, 86, 87, 88, 31, 32, 33, 34, 35, 36, 67, 68, 7, 69, - 71, 72, 4, 85, 86, 87, 88, 47, 114, 115, 116, 117, 118, 119, 37, 38, 121, 122, 123, - 124, 125, 126, 87, 88, 128, 130, 131, 132, 133, 134, 135, 56, 5, 137, 138, 140, 144, 148, - 151, 89, 59, 153, 60, 57, 111, 160, 162, 192, 58, 61, 57, 90, 91, 92, 93, 94, 95, - 81, 159, 82, 83, 83, 140, 140, 165, 167, 29, 96, 96, 85, 86, 87, 88, 212, 242, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 187, 188, 189, 0, 154, 0, 0, 113, 193, - 73, 194, 74, 75, 70, 76, 120, 81, 0, 82, 83, 0, 112, 0, 127, 129, 0, 90, 91, - 92, 93, 94, 95, 136, 0, 0, 143, 147, 150, 0, 0, 236, 0, 96, 207, 0, 0, 0, - 208, 139, 142, 146, 149, 0, 0, 0, 0, 0, 158, 90, 91, 92, 93, 94, 95, 0, 197, - 168, 169, 170, 171, 172, 173, 174, 0, 96, 163, 164, 77, 166, 78, 79, 211, 80, 0, 214, - 0, 216, 85, 86, 87, 88, 219, 0, 0, 221, 0, 222, 0, 0, 186, 0, 224, 0, 226, - 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 244, 19, 141, 20, 245, - 0, 246, 108, 156, 110, 113, 0, 111, 249, 0, 250, 0, 0, 0, 0, 198, 0, 199, 202, - 22, 23, 260, 0, 261, 0, 24, 0, 25, 26, 0, 0, 268, 0, 90, 91, 92, 93, 94, - 95, 273, 85, 86, 87, 88, 0, 0, 213, 0, 215, 96, 0, 217, 0, 218, 0, 0, 220, - 0, 0, 0, 0, 0, 223, 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, - 19, 0, 20, 0, 243, 21, 0, 0, 0, 0, 0, 247, 0, 248, 39, 40, 41, 42, 43, - 44, 0, 0, 0, 22, 23, 0, 0, 0, 0, 24, 0, 25, 26, 0, 262, 0, 0, 0, - 45, 46, 267, 0, 0, 269, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 19, - 145, 20, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 19, 0, 20, 106, 107, - 108, 156, 110, 22, 23, 111, 0, 0, 0, 24, 0, 25, 26, 0, 0, 0, 0, 0, 22, - 23, 0, 0, 0, 0, 24, 266, 25, 26, 8, 9, 62, 11, 12, 13, 14, 63, 16, 17, - 0, 0, 19, 0, 20, 90, 91, 92, 93, 94, 95, 0, 0, 0, 0, 0, 0, 203, 0, - 204, 0, 96, 0, 0, 0, 22, 64, 227, 0, 228, 0, 24, 0, 25, 26, 90, 91, 92, - 93, 94, 95, 0, 0, 0, 0, 90, 91, 92, 93, 94, 95, 96, 234, 0, 235, 0, 0, - 0, 257, 0, 258, 96, 0, 0, 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, 95, - 90, 91, 92, 93, 94, 95, 230, 0, 0, 0, 96, 0, 238, 0, 0, 0, 96, 0, 0, - 0, 0, 0, 90, 91, 92, 93, 94, 95, 90, 91, 92, 93, 94, 95, 251, 0, 0, 0, - 96, 0, 256, 0, 0, 0, 96, 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, 95, 90, - 91, 92, 93, 94, 95, 270, 0, 0, 0, 96, 0, 272, 0, 0, 0, 96, 0, 0, 0, - 0, 0, 90, 91, 92, 93, 94, 95, 90, 91, 92, 93, 94, 95, 231, 0, 232, 0, 96, - 0, 0, 233, 0, 0, 96, 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 156, 110, 190, 0, 111, 0, 191, 0, 0, 0, 0, 48, 49, 50, 51, 52, - 53, 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, 0, 195, 111, 196, - 54, 55, 0, 0, 0, 0, 152, 32, 33, 34, 35, 36, 0, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 0, 200, 111, 201, 37, 38, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, - 205, 111, 206, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 0, 240, 111, 241, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 156, 110, 0, 253, 111, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, 0, 263, 111, 264, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 156, 110, 255, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, 271, 0, 111, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 156, 110, 155, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, 229, 0, 111, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 156, 110, 237, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, 239, 0, 111, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, - 252, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 156, 110, 259, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, 265, 0, 111, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 156, 110, 274, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, 157, 0, 111, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, - 225, 0, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 156, 110, 97, 0, 111, 0, 0, 0, 0, 0, 0, 0, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 209, 0, 111, 90, 91, 92, 93, 94, 95, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 210, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 156, 110, 0, 0, 111, 90, 91, 92, 93, 94, 95, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 96, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 0, 0, 111, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, 0, 0, - 111, 98, 99, 100, 101, 102, 103, 104, 105, 0, 0, 0, 0, 110, 0, 0, 111, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 156, 110, 0, 0, 111, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 156, 110, 0, 0, 111}; + 30, 67, 2, 3, 86, 87, 88, 89, 90, 31, 32, 33, 34, 35, 36, 69, 70, 7, 71, + 73, 74, 4, 87, 88, 89, 90, 47, 116, 117, 118, 119, 120, 121, 37, 38, 124, 125, 126, + 127, 128, 129, 89, 90, 132, 134, 135, 136, 137, 138, 139, 56, 5, 141, 142, 145, 149, 153, + 156, 75, 91, 76, 77, 161, 78, 57, 57, 168, 170, 59, 58, 160, 92, 93, 94, 95, 96, + 97, 60, 83, 167, 84, 85, 61, 172, 172, 174, 176, 98, 201, 29, 39, 40, 41, 42, 43, + 44, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 196, 197, 198, 87, 88, 89, 90, + 45, 46, 115, 159, 108, 109, 110, 164, 112, 162, 123, 113, 72, 113, 85, 98, 224, 254, 131, + 133, 114, 83, 0, 84, 85, 0, 0, 140, 122, 144, 148, 152, 155, 0, 0, 0, 130, 248, + 0, 216, 217, 218, 219, 0, 0, 0, 220, 143, 147, 151, 154, 0, 0, 0, 166, 92, 93, + 94, 95, 96, 97, 0, 0, 177, 178, 179, 180, 181, 182, 183, 79, 98, 80, 81, 0, 82, + 171, 173, 0, 175, 0, 223, 0, 0, 226, 0, 228, 110, 164, 112, 0, 231, 113, 0, 233, + 0, 234, 0, 0, 0, 195, 0, 0, 0, 236, 0, 238, 0, 0, 0, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 256, 19, 146, 20, 257, 0, 258, 115, 123, 131, 144, 0, + 0, 261, 0, 262, 0, 0, 0, 202, 0, 203, 0, 0, 22, 23, 272, 207, 273, 208, 24, + 0, 25, 26, 0, 0, 280, 92, 93, 94, 95, 96, 97, 206, 285, 92, 93, 94, 95, 96, + 97, 0, 225, 98, 227, 0, 0, 229, 0, 230, 0, 98, 232, 0, 0, 87, 88, 89, 90, + 211, 0, 235, 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 19, 0, 20, + 0, 255, 21, 87, 88, 89, 90, 0, 259, 0, 260, 48, 49, 50, 51, 52, 53, 0, 0, + 0, 22, 23, 0, 0, 0, 0, 24, 0, 25, 26, 0, 274, 0, 0, 0, 54, 55, 279, + 0, 0, 281, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 19, 150, 20, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 0, 19, 0, 20, 0, 0, 0, 0, 0, + 22, 23, 0, 0, 0, 0, 24, 0, 25, 26, 0, 0, 0, 0, 0, 22, 23, 0, 0, + 0, 0, 24, 278, 25, 26, 8, 9, 62, 63, 64, 13, 14, 65, 16, 17, 0, 0, 19, + 0, 20, 92, 93, 94, 95, 96, 97, 0, 0, 0, 0, 0, 0, 212, 0, 213, 0, 98, + 0, 0, 0, 22, 66, 239, 0, 240, 0, 24, 0, 25, 26, 92, 93, 94, 95, 96, 97, + 0, 0, 0, 0, 92, 93, 94, 95, 96, 97, 98, 246, 0, 247, 0, 0, 0, 269, 0, + 270, 98, 0, 0, 0, 0, 0, 0, 0, 0, 92, 93, 94, 95, 96, 97, 92, 93, 94, + 95, 96, 97, 242, 0, 0, 0, 98, 0, 250, 0, 0, 0, 98, 0, 0, 0, 0, 0, + 92, 93, 94, 95, 96, 97, 92, 93, 94, 95, 96, 97, 263, 0, 0, 0, 98, 0, 268, + 0, 0, 0, 98, 0, 0, 0, 0, 0, 92, 93, 94, 95, 96, 97, 92, 93, 94, 95, + 96, 97, 282, 0, 0, 0, 98, 0, 284, 0, 0, 0, 98, 0, 0, 0, 0, 0, 92, + 93, 94, 95, 96, 97, 92, 93, 94, 95, 96, 97, 243, 0, 244, 0, 98, 0, 0, 245, + 0, 0, 98, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 164, 112, 199, 0, 113, 0, 200, 0, 0, 0, 0, 157, 32, 33, 34, 35, 36, 0, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, 0, 204, 113, 205, 37, 38, 0, + 0, 0, 0, 158, 40, 41, 42, 43, 44, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 0, 209, 113, 210, 45, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 0, 214, 113, 215, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 0, 252, 113, 253, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, 0, + 265, 113, 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, 0, 275, 113, 276, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 164, 112, 267, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, 283, 0, 113, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 164, 112, 163, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, 241, 0, 113, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, + 249, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 164, 112, 251, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, 264, 0, 113, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 164, 112, 271, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, 277, 0, 113, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 164, 112, 286, 0, 113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, 165, 0, 113, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, 237, 0, 113, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 164, 112, 99, 0, 113, 0, 0, 0, 0, 0, 0, 0, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 221, 0, 113, 92, 93, 94, 95, 96, 97, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 98, 222, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 164, 112, 0, 0, 113, 92, 93, 94, 95, 96, 97, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 98, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 0, 0, + 113, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 164, 112, 0, 0, 113, 100, 101, + 102, 103, 104, 105, 106, 107, 0, 0, 0, 0, 112, 0, 0, 113, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 164, 112, 0, 0, 113, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 164, 112, 0, 0, 113}; const short Parser::yycheck_[] = { - 4, 19, 0, 1, 20, 38, 39, 40, 41, 22, 23, 24, 25, 26, 27, 19, 20, 20, 22, - 23, 24, 19, 38, 39, 40, 41, 22, 31, 32, 33, 34, 35, 36, 46, 47, 39, 40, 41, - 42, 43, 44, 40, 41, 47, 48, 49, 50, 51, 52, 53, 22, 49, 56, 57, 58, 59, 60, - 61, 20, 15, 64, 15, 17, 45, 82, 83, 16, 22, 15, 17, 32, 33, 34, 35, 36, 37, - 28, 81, 30, 31, 31, 85, 86, 87, 88, 4, 48, 48, 38, 39, 40, 41, 22, 22, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 16, -1, -1, 31, 14, - 3, 16, 5, 6, 23, 8, 39, 28, -1, 30, 31, -1, 31, -1, 47, 48, -1, 32, 33, - 34, 35, 36, 37, 56, -1, -1, 59, 60, 61, -1, -1, 14, -1, 48, 152, -1, -1, -1, - 156, 58, 59, 60, 61, -1, -1, -1, -1, -1, 81, 32, 33, 34, 35, 36, 37, -1, 16, - 90, 91, 92, 93, 94, 95, 96, -1, 48, 85, 86, 3, 88, 5, 6, 190, 8, -1, 193, - -1, 195, 38, 39, 40, 41, 200, -1, -1, 203, -1, 205, -1, -1, 109, -1, 210, -1, 212, - -1, -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 227, 15, 16, 17, 231, - -1, 233, 40, 41, 42, 152, -1, 45, 240, -1, 242, -1, -1, -1, -1, 14, -1, 16, 16, - 38, 39, 253, -1, 255, -1, 44, -1, 46, 47, -1, -1, 263, -1, 32, 33, 34, 35, 36, - 37, 271, 38, 39, 40, 41, -1, -1, 193, -1, 195, 48, -1, 198, -1, 200, -1, -1, 203, - -1, -1, -1, -1, -1, 209, -1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, - 15, -1, 17, -1, 227, 20, -1, -1, -1, -1, -1, 234, -1, 236, 22, 23, 24, 25, 26, - 27, -1, -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, -1, 257, -1, -1, -1, - 46, 47, 263, -1, -1, 266, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, 15, - 16, 17, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, 15, -1, 17, 38, 39, - 40, 41, 42, 38, 39, 45, -1, -1, -1, 44, -1, 46, 47, -1, -1, -1, -1, -1, 38, - 39, -1, -1, -1, -1, 44, 14, 46, 47, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - -1, -1, 15, -1, 17, 32, 33, 34, 35, 36, 37, -1, -1, -1, -1, -1, -1, 14, -1, - 16, -1, 48, -1, -1, -1, 38, 39, 14, -1, 16, -1, 44, -1, 46, 47, 32, 33, 34, - 35, 36, 37, -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, 48, 14, -1, 16, -1, -1, - -1, 14, -1, 16, 48, -1, -1, -1, -1, -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, - 32, 33, 34, 35, 36, 37, 16, -1, -1, -1, 48, -1, 16, -1, -1, -1, 48, -1, -1, - -1, -1, -1, 32, 33, 34, 35, 36, 37, 32, 33, 34, 35, 36, 37, 16, -1, -1, -1, - 48, -1, 16, -1, -1, -1, 48, -1, -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, 32, - 33, 34, 35, 36, 37, 16, -1, -1, -1, 48, -1, 16, -1, -1, -1, 48, -1, -1, -1, - -1, -1, 32, 33, 34, 35, 36, 37, 32, 33, 34, 35, 36, 37, 14, -1, 16, -1, 48, - -1, -1, 21, -1, -1, 48, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 14, -1, 45, -1, 18, -1, -1, -1, -1, 22, 23, 24, 25, 26, - 27, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, - 46, 47, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, -1, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, 46, 47, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, - 14, 45, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, -1, 14, 45, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 14, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 14, -1, 45, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 18, -1, 45, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 18, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 20, -1, 45, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 29, -1, 45, 32, 33, 34, 35, 36, 37, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, -1, -1, 45, 32, 33, 34, 35, 36, 37, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 48, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, -1, -1, 45, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, -1, - 45, 30, 31, 32, 33, 34, 35, 36, 37, -1, -1, -1, -1, 42, -1, -1, 45, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, -1, 45, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, -1, -1, 45}; + 4, 19, 0, 1, 20, 38, 39, 40, 41, 22, 23, 24, 25, 26, 27, 19, 20, 20, 22, + 23, 24, 19, 38, 39, 40, 41, 22, 31, 32, 33, 34, 35, 36, 46, 47, 39, 40, 41, + 42, 43, 44, 40, 41, 47, 48, 49, 50, 51, 52, 53, 22, 49, 56, 57, 58, 59, 60, + 61, 3, 20, 5, 6, 66, 8, 17, 17, 84, 85, 15, 22, 22, 32, 33, 34, 35, 36, + 37, 15, 28, 83, 30, 31, 15, 87, 88, 89, 90, 48, 16, 4, 22, 23, 24, 25, 26, + 27, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 38, 39, 40, 41, + 46, 47, 31, 22, 38, 39, 40, 41, 42, 16, 39, 45, 23, 45, 31, 48, 22, 22, 47, + 48, 31, 28, -1, 30, 31, -1, -1, 56, 39, 58, 59, 60, 61, -1, -1, -1, 47, 14, + -1, 157, 158, 159, 160, -1, -1, -1, 164, 58, 59, 60, 61, -1, -1, -1, 83, 32, 33, + 34, 35, 36, 37, -1, -1, 92, 93, 94, 95, 96, 97, 98, 3, 48, 5, 6, -1, 8, + 87, 88, -1, 90, -1, 199, -1, -1, 202, -1, 204, 40, 41, 42, -1, 209, 45, -1, 212, + -1, 214, -1, -1, -1, 111, -1, -1, -1, 222, -1, 224, -1, -1, -1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 239, 15, 16, 17, 243, -1, 245, 157, 158, 159, 160, -1, + -1, 252, -1, 254, -1, -1, -1, 14, -1, 16, -1, -1, 38, 39, 265, 14, 267, 16, 44, + -1, 46, 47, -1, -1, 275, 32, 33, 34, 35, 36, 37, 16, 283, 32, 33, 34, 35, 36, + 37, -1, 202, 48, 204, -1, -1, 207, -1, 209, -1, 48, 212, -1, -1, 38, 39, 40, 41, + 16, -1, 221, -1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, 15, -1, 17, + -1, 239, 20, 38, 39, 40, 41, -1, 246, -1, 248, 22, 23, 24, 25, 26, 27, -1, -1, + -1, 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, -1, 269, -1, -1, -1, 46, 47, 275, + -1, -1, 278, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, 15, 16, 17, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, 15, -1, 17, -1, -1, -1, -1, -1, + 38, 39, -1, -1, -1, -1, 44, -1, 46, 47, -1, -1, -1, -1, -1, 38, 39, -1, -1, + -1, -1, 44, 14, 46, 47, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, 15, + -1, 17, 32, 33, 34, 35, 36, 37, -1, -1, -1, -1, -1, -1, 14, -1, 16, -1, 48, + -1, -1, -1, 38, 39, 14, -1, 16, -1, 44, -1, 46, 47, 32, 33, 34, 35, 36, 37, + -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, 48, 14, -1, 16, -1, -1, -1, 14, -1, + 16, 48, -1, -1, -1, -1, -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, 32, 33, 34, + 35, 36, 37, 16, -1, -1, -1, 48, -1, 16, -1, -1, -1, 48, -1, -1, -1, -1, -1, + 32, 33, 34, 35, 36, 37, 32, 33, 34, 35, 36, 37, 16, -1, -1, -1, 48, -1, 16, + -1, -1, -1, 48, -1, -1, -1, -1, -1, 32, 33, 34, 35, 36, 37, 32, 33, 34, 35, + 36, 37, 16, -1, -1, -1, 48, -1, 16, -1, -1, -1, 48, -1, -1, -1, -1, -1, 32, + 33, 34, 35, 36, 37, 32, 33, 34, 35, 36, 37, 14, -1, 16, -1, 48, -1, -1, 21, + -1, -1, 48, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 14, -1, 45, -1, 18, -1, -1, -1, -1, 22, 23, 24, 25, 26, 27, -1, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, 46, 47, -1, + -1, -1, -1, 22, 23, 24, 25, 26, 27, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, -1, 14, 45, 16, 46, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, + 14, 45, 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, 14, 45, 16, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 14, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 14, -1, 45, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 16, -1, 45, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 16, -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 18, -1, 45, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 18, -1, 45, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 20, -1, 45, -1, -1, -1, -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 29, -1, 45, 32, 33, 34, 35, 36, 37, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 48, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, -1, -1, 45, 32, 33, 34, 35, 36, 37, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 48, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, -1, + 45, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, -1, -1, 45, 30, 31, + 32, 33, 34, 35, 36, 37, -1, -1, -1, -1, 42, -1, -1, 45, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, -1, -1, 45, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, -1, -1, 45}; const unsigned char Parser::yystos_[] = { 0, 51, 0, 1, 19, 49, 52, 20, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 17, 20, 38, 39, 44, 46, 47, 53, 54, 55, 56, 22, 23, 24, 25, 26, 27, 46, 47, 22, 23, 24, 25, 26, 27, 46, - 47, 22, 22, 23, 24, 25, 26, 27, 46, 47, 22, 17, 22, 15, 15, 15, 5, 10, 39, 53, 55, 56, 56, - 56, 54, 56, 56, 3, 5, 6, 8, 3, 5, 6, 8, 28, 30, 31, 20, 38, 39, 40, 41, 20, 32, 33, - 34, 35, 36, 37, 48, 20, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 54, 55, 56, - 56, 56, 56, 56, 56, 55, 56, 56, 56, 56, 56, 56, 55, 56, 55, 56, 56, 56, 56, 56, 56, 55, 56, - 56, 54, 56, 16, 54, 55, 56, 16, 54, 55, 56, 54, 55, 56, 22, 56, 16, 16, 41, 18, 55, 56, 53, - 56, 53, 54, 54, 56, 54, 56, 55, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 54, 56, 56, 56, 14, 18, 16, 14, 16, 14, 16, 16, 14, 16, 14, 16, 16, 14, 16, 14, 16, - 56, 56, 29, 29, 56, 22, 55, 56, 55, 56, 55, 55, 56, 55, 56, 56, 55, 56, 18, 56, 14, 16, 16, - 16, 14, 16, 21, 14, 16, 14, 16, 16, 16, 14, 16, 22, 55, 56, 56, 56, 55, 55, 56, 56, 16, 16, - 14, 16, 14, 16, 14, 16, 16, 56, 56, 55, 14, 16, 16, 14, 55, 56, 55, 16, 14, 16, 56, 16}; + 47, 22, 22, 23, 24, 25, 26, 27, 46, 47, 22, 17, 22, 15, 15, 15, 5, 6, 7, 10, 39, 53, 55, + 56, 56, 56, 54, 56, 56, 3, 5, 6, 8, 3, 5, 6, 8, 28, 30, 31, 20, 38, 39, 40, 41, 20, + 32, 33, 34, 35, 36, 37, 48, 20, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 54, + 55, 56, 56, 56, 56, 56, 56, 54, 55, 56, 56, 56, 56, 56, 56, 54, 55, 56, 55, 56, 56, 56, 56, + 56, 56, 55, 56, 56, 54, 55, 56, 16, 54, 55, 56, 16, 54, 55, 56, 54, 55, 56, 22, 22, 22, 22, + 56, 16, 16, 41, 18, 55, 56, 53, 56, 53, 54, 56, 54, 56, 54, 56, 55, 55, 55, 55, 55, 55, 55, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 54, 56, 56, 56, 14, 18, 16, 14, 16, 14, 16, 16, + 14, 16, 14, 16, 16, 14, 16, 14, 16, 56, 56, 56, 56, 56, 29, 29, 56, 22, 55, 56, 55, 56, 55, + 55, 56, 55, 56, 56, 55, 56, 18, 56, 14, 16, 16, 16, 14, 16, 21, 14, 16, 14, 16, 16, 16, 14, + 16, 22, 55, 56, 56, 56, 55, 55, 56, 56, 16, 16, 14, 16, 14, 16, 14, 16, 16, 56, 56, 55, 14, + 16, 16, 14, 55, 56, 55, 16, 14, 16, 56, 16}; const unsigned char Parser::yyr1_[] = { 0, 50, 51, 51, 52, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, + 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, + 54, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56}; + 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56}; const unsigned char Parser::yyr2_[] = { - 0, 2, 0, 2, 1, 3, 3, 3, 2, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 1, 4, 6, 6, 8, 6, 4, 4, 3, 3, 3, 2, 3, 3, 3, 3, 3, 1, 1, 1, 3, 3, 3, 3, 3, 4, - 3, 4, 4, 3, 6, 12, 8, 8, 6, 5, 1, 2, 2, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 2, - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 6, 6, + 0, 2, 0, 2, 1, 3, 3, 3, 2, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 1, 4, 6, 6, 8, 6, 4, 4, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 1, 1, 1, 3, 3, 3, 3, 3, 3, + 4, 3, 4, 4, 3, 6, 12, 8, 8, 6, 5, 1, 2, 2, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 6, 6, 6, 8, 6, 8, 8, 10, 10, 12, 14, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 1, 5, 4, 6, 6, 8}; // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. @@ -2391,14 +2441,14 @@ namespace SEAMS { #if SEAMSDEBUG const unsigned short Parser::yyrline_[] = { - 0, 145, 145, 146, 149, 150, 157, 161, 162, 163, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 180, 181, 182, 183, 184, 185, 187, 188, 194, 200, 206, 212, - 218, 224, 230, 233, 235, 243, 245, 253, 254, 255, 256, 265, 266, 267, 268, 270, 273, - 277, 278, 279, 285, 291, 297, 303, 304, 310, 316, 322, 328, 334, 336, 337, 338, 339, - 340, 341, 342, 343, 344, 345, 347, 350, 351, 352, 353, 354, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 371, 373, 376, 379, 382, 385, 387, 390, 393, 396, 399, - 406, 413, 420, 427, 434, 441, 448, 455, 462, 468, 474, 480, 486, 492, 498, 504, 505, - 506, 507, 514, 521, 522, 523, 526, 527, 530, 531, 532, 533, 534, 556}; + 0, 145, 145, 146, 149, 150, 157, 161, 162, 163, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 180, 181, 182, 183, 184, 185, 187, 188, 194, 200, 206, 212, 218, 224, + 230, 234, 238, 241, 243, 251, 253, 261, 262, 263, 264, 273, 274, 275, 276, 278, 281, 285, + 290, 291, 292, 298, 304, 310, 316, 317, 323, 329, 335, 341, 347, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 360, 363, 368, 369, 370, 371, 372, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 389, 391, 394, 397, 400, 403, 405, 408, 411, 414, 417, 424, 431, + 438, 445, 452, 459, 466, 473, 480, 486, 492, 498, 504, 510, 516, 522, 523, 524, 525, 532, + 539, 540, 541, 544, 545, 548, 549, 550, 551, 552, 574}; // Print the state stack on the debug stream. void Parser::yystack_print_() @@ -2453,7 +2503,8 @@ namespace SEAMS { } } // namespace SEAMS -#line 2494 "apr_parser.cc" // lalr1.cc:1242 -#line 579 "aprepro.yy" // lalr1.cc:1243 +#line 2541 "apr_parser.cc" + +#line 597 "aprepro.yy" void SEAMS::Parser::error(const std::string &m) { aprepro.error(m); } diff --git a/packages/seacas/libraries/aprepro_lib/apr_scanner.cc b/packages/seacas/libraries/aprepro_lib/apr_scanner.cc index 8fc93a4d3108..4b27323fd02f 100644 --- a/packages/seacas/libraries/aprepro_lib/apr_scanner.cc +++ b/packages/seacas/libraries/aprepro_lib/apr_scanner.cc @@ -2312,7 +2312,7 @@ yyFlexLexer::yyFlexLexer(std::istream *arg_yyin, std::ostream *arg_yyout) { yyin = arg_yyin; yyout = arg_yyout; - yy_c_buf_p = 0; + yy_c_buf_p = nullptr; yy_init = 0; yy_start = 0; yy_flex_debug = 0; @@ -2328,11 +2328,11 @@ yyFlexLexer::yyFlexLexer(std::istream *arg_yyin, std::ostream *arg_yyout) yy_start_stack_ptr = yy_start_stack_depth = 0; yy_start_stack = NULL; - yy_buffer_stack = 0; + yy_buffer_stack = nullptr; yy_buffer_stack_top = 0; yy_buffer_stack_max = 0; - yy_state_buf = 0; + yy_state_buf = nullptr; } /* The contents of this function are C++ specific, so the () macro is not used. @@ -2469,7 +2469,7 @@ int yyFlexLexer::yy_get_next_buffer() } else /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + b->yy_ch_buf = nullptr; if (!b->yy_ch_buf) YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); @@ -3175,9 +3175,9 @@ namespace SEAMS { { std::fstream *yytmp = nullptr; if (must_exist) - yytmp = aprepro.open_file(filename.c_str(), "r"); + yytmp = aprepro.open_file(filename, "r"); else - yytmp = aprepro.check_open_file(filename.c_str(), "r"); + yytmp = aprepro.check_open_file(filename, "r"); if (yytmp) { if (yyin && !yy_init) { diff --git a/packages/seacas/libraries/aprepro_lib/aprepro.ll b/packages/seacas/libraries/aprepro_lib/aprepro.ll index b8ee0e7a9778..450c11ff603e 100644 --- a/packages/seacas/libraries/aprepro_lib/aprepro.ll +++ b/packages/seacas/libraries/aprepro_lib/aprepro.ll @@ -717,9 +717,9 @@ integer {D}+({E})? { std::fstream *yytmp = nullptr; if (must_exist) - yytmp = aprepro.open_file(filename.c_str(), "r"); + yytmp = aprepro.open_file(filename, "r"); else - yytmp = aprepro.check_open_file(filename.c_str(), "r"); + yytmp = aprepro.check_open_file(filename, "r"); if (yytmp) { if (yyin && !yy_init) { diff --git a/packages/seacas/libraries/aprepro_lib/aprepro.yy b/packages/seacas/libraries/aprepro_lib/aprepro.yy index f6b9bb67e940..425ed7765dd2 100644 --- a/packages/seacas/libraries/aprepro_lib/aprepro.yy +++ b/packages/seacas/libraries/aprepro_lib/aprepro.yy @@ -1,23 +1,23 @@ // Copyright (c) 2014-2017 National Technology & Engineering Solutions // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with // NTESS, the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: -// +// // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. -// +// // * 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. -// +// with the distribution. +// // * Neither the name of NTESS 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 @@ -29,7 +29,7 @@ // 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 "aprepro.h" #include "apr_util.h" @@ -104,12 +104,12 @@ namespace SEAMS { %token FNCT %token SFNCT %token AFNCT -%type exp -%type aexp +%type exp +%type aexp %type bool %type sexp -%token END 0 "end of file" +%token END 0 "end of file" %token COMMA LPAR RPAR LBRACK RBRACK LBRACE RBRACE SEMI /* Precedence (Lowest to Highest) and associativity */ %right EQUAL @@ -227,26 +227,34 @@ aexp: AVAR { $$ = $1->value.avar;} else yyerrok; } - | AVAR EQUAL aexp { $$ = $3; delete $1->value.avar; $1->value.avar = $3; + | SVAR EQUAL aexp { $$ = $3; + $1->value.avar = $3; + redefined_warning(aprepro, $1); + set_type(aprepro, $1, token::AVAR); } + | VAR EQUAL aexp { $$ = $3; + $1->value.avar= $3; + redefined_warning(aprepro, $1); + set_type(aprepro, $1, token::AVAR); } + | AVAR EQUAL aexp { $$ = $3; delete $1->value.avar; $1->value.avar = $3; redefined_warning(aprepro, $1); set_type(aprepro, $1, token::AVAR); } - | UNDVAR EQUAL aexp { $$ = $3; $1->value.avar = $3; + | UNDVAR EQUAL aexp { $$ = $3; $1->value.avar = $3; set_type(aprepro, $1, token::AVAR); } | aexp PLU aexp { if ($1->cols == $3->cols && $1->rows == $3->rows ) { - $$ = array_add($1, $3); + $$ = array_add($1, $3); } else { - yyerror(aprepro, "Arrays do not have same row and column count"); + yyerror(aprepro, "Arrays do not have same row and column count"); yyerrok; } } | SUB aexp %prec UNARY { $$ = array_scale($2, -1.0); } | aexp SUB aexp { if ($1->cols == $3->cols && $1->rows == $3->rows ) { - $$ = array_sub($1, $3); + $$ = array_sub($1, $3); } else { - yyerror(aprepro, "Arrays do not have same row and column count"); + yyerror(aprepro, "Arrays do not have same row and column count"); yyerrok; } } @@ -257,7 +265,7 @@ aexp: AVAR { $$ = $1->value.avar;} $$ = array_mult($1, $3); } else { - yyerror(aprepro, "Column count of first array does not match row count of second array"); + yyerror(aprepro, "Column count of first array does not match row count of second array"); yyerrok; } } @@ -267,12 +275,17 @@ sexp: QSTRING { $$ = $1; } | IMMSVAR { $$ = (char*)$1->value.svar.c_str(); } | UNDVAR EQUAL sexp { $$ = $3; $1->value.svar = $3; set_type(aprepro, $1, Parser::token::SVAR); } - | SVAR EQUAL sexp { $$ = $3; + | SVAR EQUAL sexp { $$ = $3; $1->value.svar = $3; redefined_warning(aprepro, $1); } - | VAR EQUAL sexp { $$ = $3; + | VAR EQUAL sexp { $$ = $3; + $1->value.svar= $3; + redefined_warning(aprepro, $1); + set_type(aprepro, $1, token::SVAR); } + | AVAR EQUAL sexp { $$ = $3; + delete $1->value.avar; $1->value.svar= $3; - redefined_warning(aprepro, $1); + redefined_warning(aprepro, $1); set_type(aprepro, $1, token::SVAR); } | IMMSVAR EQUAL sexp { $$ = (char*)$1->value.svar.c_str(); immutable_modify(aprepro, $1); } | IMMVAR EQUAL sexp { immutable_modify(aprepro, $1); YYERROR; } @@ -345,15 +358,20 @@ exp: NUM { $$ = $1; } | VAR EQUAL exp { $$ = $3; $1->value.var = $3; redefined_warning(aprepro, $1); } | SVAR EQUAL exp { $$ = $3; $1->value.var = $3; - redefined_warning(aprepro, $1); + redefined_warning(aprepro, $1); set_type(aprepro, $1, token::VAR); } + | AVAR EQUAL exp { $$ = $3; + delete $1->value.avar; + $1->value.var= $3; + redefined_warning(aprepro, $1); + set_type(aprepro, $1, token::VAR); } | VAR EQ_PLUS exp { $1->value.var += $3; $$ = $1->value.var; } | VAR EQ_MINUS exp { $1->value.var -= $3; $$ = $1->value.var; } | VAR EQ_TIME exp { $1->value.var *= $3; $$ = $1->value.var; } | VAR EQ_DIV exp { $1->value.var /= $3; $$ = $1->value.var; } | VAR EQ_POW exp { reset_error(); - $1->value.var = std::pow($1->value.var,$3); - $$ = $1->value.var; + $1->value.var = std::pow($1->value.var,$3); + $$ = $1->value.var; SEAMS::math_error(aprepro, "Power"); } | INC IMMVAR { $$ = $2->value.var; immutable_modify(aprepro, $2); } @@ -370,35 +388,35 @@ exp: NUM { $$ = $1; } | UNDVAR { $$ = $1->value.var; undefined_error(aprepro, $1->name); } - | INC UNDVAR { $$ = ++($2->value.var); + | INC UNDVAR { $$ = ++($2->value.var); set_type(aprepro, $2, token::VAR); undefined_error(aprepro, $2->name); } - | DEC UNDVAR { $$ = --($2->value.var); + | DEC UNDVAR { $$ = --($2->value.var); set_type(aprepro, $2, token::VAR); undefined_error(aprepro, $2->name); } - | UNDVAR INC { $$ = ($1->value.var)++; + | UNDVAR INC { $$ = ($1->value.var)++; set_type(aprepro, $1, token::VAR); undefined_error(aprepro, $1->name); } - | UNDVAR DEC { $$ = ($1->value.var)--; + | UNDVAR DEC { $$ = ($1->value.var)--; set_type(aprepro, $1, token::VAR); undefined_error(aprepro, $1->name); } | UNDVAR EQUAL exp { $$ = $3; $1->value.var = $3; set_type(aprepro, $1, token::VAR); } - | UNDVAR EQ_PLUS exp { $1->value.var += $3; $$ = $1->value.var; + | UNDVAR EQ_PLUS exp { $1->value.var += $3; $$ = $1->value.var; set_type(aprepro, $1, token::VAR); undefined_error(aprepro, $1->name); } - | UNDVAR EQ_MINUS exp { $1->value.var -= $3; $$ = $1->value.var; + | UNDVAR EQ_MINUS exp { $1->value.var -= $3; $$ = $1->value.var; set_type(aprepro, $1, token::VAR); undefined_error(aprepro, $1->name); } - | UNDVAR EQ_TIME exp { $1->value.var *= $3; $$ = $1->value.var; + | UNDVAR EQ_TIME exp { $1->value.var *= $3; $$ = $1->value.var; set_type(aprepro, $1, token::VAR); undefined_error(aprepro, $1->name); } - | UNDVAR EQ_DIV exp { $1->value.var /= $3; $$ = $1->value.var; + | UNDVAR EQ_DIV exp { $1->value.var /= $3; $$ = $1->value.var; set_type(aprepro, $1, token::VAR); undefined_error(aprepro, $1->name); } | UNDVAR EQ_POW exp { reset_error(); - $1->value.var = std::pow($1->value.var,$3); - $$ = $1->value.var; + $1->value.var = std::pow($1->value.var,$3); + $$ = $1->value.var; set_type(aprepro, $1, token::VAR); SEAMS::math_error(aprepro, "Power"); undefined_error(aprepro, $1->name); } @@ -406,7 +424,7 @@ exp: NUM { $$ = $1; } | FNCT LPAR RPAR { if (arg_check($1, $1->value.fnctptr == NULL)) $$ = (*($1->value.fnctptr))(); - else + else $$ = 0.0; } @@ -436,7 +454,7 @@ exp: NUM { $$ = $1; } $$ = (*($1->value.fnctptr_cd))($3, $5); else $$ = 0.0; - } + } | FNCT LPAR exp COMMA sexp RPAR { if (arg_check($1, $1->value.fnctptr_dc == NULL)) @@ -506,7 +524,7 @@ exp: NUM { $$ = $1; } | exp TIM exp { $$ = $1 * $3; } | exp DIV exp { if ($3 == 0.) { - yyerror(aprepro, "Zero divisor"); + yyerror(aprepro, "Zero divisor"); yyerrok; } else @@ -517,11 +535,11 @@ exp: NUM { $$ = $1; } yyerrok; } else - $$ = (int)$1 % (int)$3; } + $$ = (int)$1 % (int)$3; } | SUB exp %prec UNARY { $$ = -$2; } | PLU exp %prec UNARY { $$ = $2; } | exp POW exp { reset_error(); - $$ = std::pow($1, $3); + $$ = std::pow($1, $3); SEAMS::math_error(aprepro, "Power"); } | LPAR exp RPAR { $$ = $2; } | LBRACK exp RBRACK { reset_error(); @@ -531,12 +549,12 @@ exp: NUM { $$ = $1; } | bool QUEST exp COLON exp { $$ = ($1) ? ($3) : ($5); } | AVAR LBRACK exp RBRACK { $$ = array_value($1->value.avar, $3, 0); } | AVAR LBRACK exp COMMA exp RBRACK { $$ = array_value($1->value.avar, $3, $5); } - | AVAR LBRACK exp RBRACK EQUAL exp + | AVAR LBRACK exp RBRACK EQUAL exp { $$ = $6; array *arr = $1->value.avar; int cols = arr->cols; if (cols > 1) { - yyerror(aprepro, "Cannot use [index] array access with multi-column array"); + yyerror(aprepro, "Cannot use [index] array access with multi-column array"); yyerrok; } int rows = arr->rows; @@ -549,11 +567,11 @@ exp: NUM { $$ = $1; } $1->value.avar->data[offset] = $6; } else { - yyerror(aprepro, "Row or Column index out of range"); + yyerror(aprepro, "Row or Column index out of range"); yyerrok; } } - | AVAR LBRACK exp COMMA exp RBRACK EQUAL exp + | AVAR LBRACK exp COMMA exp RBRACK EQUAL exp { $$ = $8; array *arr = $1->value.avar; int cols = arr->cols; @@ -569,7 +587,7 @@ exp: NUM { $$ = $1; } $1->value.avar->data[offset] = $8; } else { - yyerror(aprepro, "Row or Column index out of range"); + yyerror(aprepro, "Row or Column index out of range"); yyerrok; } } diff --git a/packages/seacas/libraries/aprepro_lib/aprepro_parser.h b/packages/seacas/libraries/aprepro_lib/aprepro_parser.h index ed831cd564fe..437a05b196f2 100644 --- a/packages/seacas/libraries/aprepro_lib/aprepro_parser.h +++ b/packages/seacas/libraries/aprepro_lib/aprepro_parser.h @@ -1,4 +1,4 @@ -// A Bison parser, made by GNU Bison 3.3.2. +// A Bison parser, made by GNU Bison 3.4. // Skeleton interface for Bison LALR(1) parsers in C++ @@ -153,7 +153,7 @@ #endif /* ! defined SEAMSDEBUG */ namespace SEAMS { -#line 165 "aprepro_parser.h" // lalr1.cc:417 +#line 164 "aprepro_parser.h" /// A Bison parser. class Parser @@ -162,14 +162,14 @@ namespace SEAMS { #ifndef SEAMSSTYPE /// Symbol semantic values. union semantic_type { -#line 89 "aprepro.yy" // lalr1.cc:417 +#line 89 "aprepro.yy" - double val; /* For returning numbers. */ - struct symrec *tptr; /* For returning symbol-table pointers */ - char * string; /* For returning quoted strings */ + double val; /* For returning numbers. */ + struct symrec *tptr; /* For returning symbol-table pointers */ + char * string; /* For returning quoted strings */ struct array * arrval; /* For returning arrays */ -#line 184 "aprepro_parser.h" // lalr1.cc:417 +#line 184 "aprepro_parser.h" }; #else typedef SEAMSSTYPE semantic_type; @@ -378,7 +378,7 @@ namespace SEAMS { void error(const syntax_error &err); private: - /// This class is not copyable. + /// This class is not copiable. Parser(const Parser &); Parser &operator=(const Parser &); @@ -631,7 +631,7 @@ namespace SEAMS { /// Constants. enum { yyeof_ = 0, - yylast_ = 1299, ///< Last index in yytable_. + yylast_ = 1315, ///< Last index in yytable_. yynnts_ = 7, ///< Number of nonterminal symbols. yyfinal_ = 2, ///< Termination state number. yyterror_ = 1, @@ -644,6 +644,6 @@ namespace SEAMS { }; } // namespace SEAMS -#line 728 "aprepro_parser.h" // lalr1.cc:417 +#line 728 "aprepro_parser.h" #endif // !YY_SEAMS_APREPRO_PARSER_H_INCLUDED diff --git a/packages/seacas/libraries/aprepro_lib/stack.hh b/packages/seacas/libraries/aprepro_lib/stack.hh new file mode 100644 index 000000000000..b9361d62c6cb --- /dev/null +++ b/packages/seacas/libraries/aprepro_lib/stack.hh @@ -0,0 +1,157 @@ +// A Bison parser, made by GNU Bison 3.0.4. + +// Stack handling for Bison parsers in C++ + +// Copyright (C) 2002-2015 Free Software Foundation, Inc. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// As a special exception, you may create a larger work that contains +// part or all of the Bison parser skeleton and distribute that work +// under terms of your choice, so long as that work isn't itself a +// parser generator using the skeleton or a modified version thereof +// as a parser skeleton. Alternatively, if you modify or redistribute +// the parser skeleton itself, you may (at your option) remove this +// special exception, which will cause the skeleton and the resulting +// Bison output files to be licensed under the GNU General Public +// License without this special exception. + +// This special exception was added by the Free Software Foundation in +// version 2.2 of Bison. + +/** + ** \file stack.hh + ** Define the SEAMS::stack class. + */ + +#ifndef YY_SEAMS_STACK_HH_INCLUDED +# define YY_SEAMS_STACK_HH_INCLUDED + +# include + + +namespace SEAMS { +#line 46 "stack.hh" // stack.hh:132 + template > + class stack + { + public: + // Hide our reversed order. + typedef typename S::reverse_iterator iterator; + typedef typename S::const_reverse_iterator const_iterator; + + stack () + : seq_ () + { + seq_.reserve (200); + } + + stack (unsigned int n) + : seq_ (n) + {} + + inline + T& + operator[] (unsigned int i) + { + return seq_[seq_.size () - 1 - i]; + } + + inline + const T& + operator[] (unsigned int i) const + { + return seq_[seq_.size () - 1 - i]; + } + + /// Steal the contents of \a t. + /// + /// Close to move-semantics. + inline + void + push (T& t) + { + seq_.push_back (T()); + operator[](0).move (t); + } + + inline + void + pop (unsigned int n = 1) + { + for (; n; --n) + seq_.pop_back (); + } + + void + clear () + { + seq_.clear (); + } + + inline + typename S::size_type + size () const + { + return seq_.size (); + } + + inline + const_iterator + begin () const + { + return seq_.rbegin (); + } + + inline + const_iterator + end () const + { + return seq_.rend (); + } + + private: + stack (const stack&); + stack& operator= (const stack&); + /// The wrapped container. + S seq_; + }; + + /// Present a slice of the top of a stack. + template > + class slice + { + public: + slice (const S& stack, unsigned int range) + : stack_ (stack) + , range_ (range) + {} + + inline + const T& + operator [] (unsigned int i) const + { + return stack_[range_ - i]; + } + + private: + const S& stack_; + unsigned int range_; + }; + + +} // SEAMS +#line 156 "stack.hh" // stack.hh:132 + +#endif // !YY_SEAMS_STACK_HH_INCLUDED diff --git a/packages/seacas/libraries/exodus/src/ex_create.c b/packages/seacas/libraries/exodus/src/ex_create.c index d4ca842e766e..2c93ecbf81a2 100644 --- a/packages/seacas/libraries/exodus/src/ex_create.c +++ b/packages/seacas/libraries/exodus/src/ex_create.c @@ -159,8 +159,8 @@ exoid = ex_create ("test.exo" \comment{filename path} */ int ex_create_int(const char *path, int cmode, int *comp_ws, int *io_ws, int run_version) { - int exoid; - int status; + int exoid = 0; + int status = 0; char errmsg[MAX_ERR_LENGTH]; int nc_mode = 0; @@ -185,7 +185,7 @@ int ex_create_int(const char *path, int cmode, int *comp_ws, int *io_ws, int run snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: file create failed for %s", path); } #endif - ex_err_fn(exoid, __func__, errmsg, status); + ex_err(__func__, errmsg, status); EX_FUNC_LEAVE(EX_FATAL); } diff --git a/packages/seacas/libraries/exodus/src/ex_create_par.c b/packages/seacas/libraries/exodus/src/ex_create_par.c index 7cf797c6c138..8d5d6734f0ad 100644 --- a/packages/seacas/libraries/exodus/src/ex_create_par.c +++ b/packages/seacas/libraries/exodus/src/ex_create_par.c @@ -165,8 +165,8 @@ exoid = ex_create ("test.exo" \comment{filename path} int ex_create_par_int(const char *path, int cmode, int *comp_ws, int *io_ws, MPI_Comm comm, MPI_Info info, int run_version) { - int exoid; - int status; + int exoid = -1; + int status = 0; char errmsg[MAX_ERR_LENGTH]; int nc_mode = 0; @@ -181,7 +181,7 @@ int ex_create_par_int(const char *path, int cmode, int *comp_ws, int *io_ws, MPI "EXODUS: ERROR: Parallel output requires the netcdf-4 and/or " "pnetcdf library format, but this netcdf library does not " "support either.\n"); - ex_err_fn(exoid, __func__, errmsg, EX_BADPARAM); + ex_err(__func__, errmsg, EX_BADPARAM); EX_FUNC_LEAVE(EX_FATAL); #endif @@ -201,7 +201,7 @@ int ex_create_par_int(const char *path, int cmode, int *comp_ws, int *io_ws, MPI snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: file create failed for %s", path); } #endif - ex_err_fn(exoid, __func__, errmsg, status); + ex_err(__func__, errmsg, status); EX_FUNC_LEAVE(EX_FATAL); } diff --git a/packages/seacas/libraries/exodus/src/ex_get_time.c b/packages/seacas/libraries/exodus/src/ex_get_time.c index 78bb3d1bb2ae..0bc5aa7ee395 100644 --- a/packages/seacas/libraries/exodus/src/ex_get_time.c +++ b/packages/seacas/libraries/exodus/src/ex_get_time.c @@ -85,7 +85,12 @@ int ex_get_time(int exoid, int time_step, void *time_value) struct ex__file_item *file = NULL; EX_FUNC_ENTER(); - ex__check_valid_file_id(exoid, __func__); + + file = ex__find_file_item(exoid); + if (!file) { + snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: unknown file id %d.", exoid); + ex_err_fn(exoid, __func__, errmsg, EX_BADFILEID); + } int num_time_steps = ex_inquire_int(exoid, EX_INQ_TIME); @@ -112,12 +117,6 @@ int ex_get_time(int exoid, int time_step, void *time_value) EX_FUNC_LEAVE(EX_FATAL); } - file = ex__find_file_item(exoid); - if (!file) { - snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: unknown file id %d.", exoid); - ex_err_fn(exoid, __func__, errmsg, EX_BADFILEID); - } - varid = file->time_varid; if (varid < 0) { /* inquire previously defined variable */ diff --git a/packages/seacas/libraries/exodus/src/ex_open.c b/packages/seacas/libraries/exodus/src/ex_open.c index ec6603432b8c..f3b760c3f0c5 100644 --- a/packages/seacas/libraries/exodus/src/ex_open.c +++ b/packages/seacas/libraries/exodus/src/ex_open.c @@ -129,19 +129,20 @@ exoid = ex_open ("test.exo", \co{filename path} int ex_open_int(const char *path, int mode, int *comp_ws, int *io_ws, float *version, int run_version) { - int exoid = -1; - int status, stat_att, stat_dim; - nc_type att_type = NC_NAT; - size_t att_len = 0; - int old_fill; - int file_wordsize; - int dim_str_name; - int int64_status = 0; - int nc_mode = 0; + int exoid = -1; + int status = 0, stat_att = 0, stat_dim = 0; + nc_type att_type = NC_NAT; + size_t att_len = 0; + int old_fill = 0; + int file_wordsize = 0; + int dim_str_name = 0; + int int64_status = 0; + int nc_mode = 0; char errmsg[MAX_ERR_LENGTH]; EX_FUNC_ENTER(); + *version = 0.0f; /* set error handling mode to no messages, non-fatal errors */ ex_opts(exoptval); /* call required to set ncopts first time through */ diff --git a/packages/seacas/libraries/exodus/src/ex_open_par.c b/packages/seacas/libraries/exodus/src/ex_open_par.c index bc5a9886f3af..b2faa22c2948 100644 --- a/packages/seacas/libraries/exodus/src/ex_open_par.c +++ b/packages/seacas/libraries/exodus/src/ex_open_par.c @@ -147,18 +147,18 @@ struct ncvar /* variable */ int ex_open_par_int(const char *path, int mode, int *comp_ws, int *io_ws, float *version, MPI_Comm comm, MPI_Info info, int run_version) { - int exoid; - int status, stat_att, stat_dim; - nc_type att_type = NC_NAT; - size_t att_len = 0; - int nc_mode = 0; - int old_fill; - int file_wordsize; - int dim_str_name; - int int64_status = 0; - int is_hdf5 = 0; - int is_pnetcdf = 0; - int in_redef = 0; + int exoid = -1; + int status = 0, stat_att = 0, stat_dim = 0; + nc_type att_type = NC_NAT; + size_t att_len = 0; + int nc_mode = 0; + int old_fill = 0; + int file_wordsize = 0; + int dim_str_name = 0; + int int64_status = 0; + int is_hdf5 = 0; + int is_pnetcdf = 0; + int in_redef = 0; char errmsg[MAX_ERR_LENGTH]; diff --git a/packages/seacas/libraries/exodus/src/ex_put_time.c b/packages/seacas/libraries/exodus/src/ex_put_time.c index da58bde0ad86..64d5e8ae18f0 100644 --- a/packages/seacas/libraries/exodus/src/ex_put_time.c +++ b/packages/seacas/libraries/exodus/src/ex_put_time.c @@ -85,8 +85,6 @@ int ex_put_time(int exoid, int time_step, const void *time_value) EX_FUNC_ENTER(); - ex__check_valid_file_id(exoid, __func__); - file = ex__find_file_item(exoid); if (!file) { snprintf(errmsg, MAX_ERR_LENGTH, "ERROR: unknown file id %d.", exoid); diff --git a/packages/seacas/libraries/exodus/src/ex_utils.c b/packages/seacas/libraries/exodus/src/ex_utils.c index 5ec076a493a5..d094758394ff 100644 --- a/packages/seacas/libraries/exodus/src/ex_utils.c +++ b/packages/seacas/libraries/exodus/src/ex_utils.c @@ -2035,7 +2035,7 @@ int ex__populate_header(int exoid, const char *path, int my_mode, int is_paralle char errmsg[MAX_ERR_LENGTH]; int int64_status = my_mode & (EX_ALL_INT64_DB | EX_ALL_INT64_API); - int format; + int format = 0; int mode; /* turn off automatic filling of netCDF variables */ diff --git a/packages/seacas/libraries/exodus/test/testrd.c b/packages/seacas/libraries/exodus/test/testrd.c index 59c20ffc95cd..02b3c52a5934 100644 --- a/packages/seacas/libraries/exodus/test/testrd.c +++ b/packages/seacas/libraries/exodus/test/testrd.c @@ -1146,9 +1146,9 @@ int main(int argc, char **argv) free(var_values); } - free(num_elem_per_set); free(ids); } + free(num_elem_per_set); /* read a nodeset variable at one time step */ diff --git a/packages/seacas/libraries/exodus/test/testwt-oned.c b/packages/seacas/libraries/exodus/test/testwt-oned.c index 8acf0b4dc97d..7270adde27a9 100644 --- a/packages/seacas/libraries/exodus/test/testwt-oned.c +++ b/packages/seacas/libraries/exodus/test/testwt-oned.c @@ -178,6 +178,7 @@ int main(int argc, char **argv) /* Circle */ connect[0] = 5; EXCHECK(ex_put_conn(exoid, EX_ELEM_BLOCK, ebids[2], connect, NULL, NULL)); + free(connect); /* write element block attributes */ for (i = 0; i < num_elem; i++) { diff --git a/packages/seacas/libraries/ioss/src/CMakeLists.txt b/packages/seacas/libraries/ioss/src/CMakeLists.txt index 157ce121d42d..db7749853c01 100644 --- a/packages/seacas/libraries/ioss/src/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/CMakeLists.txt @@ -112,14 +112,14 @@ IF (TPL_ENABLE_ADIOS2) ADD_SUBDIRECTORY(adios) ENDIF() +IF (NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") +ADD_SUBDIRECTORY(visualization) +ENDIF() ADD_SUBDIRECTORY(generated) ADD_SUBDIRECTORY(gen_struc) ADD_SUBDIRECTORY(heartbeat) ADD_SUBDIRECTORY(transform) ADD_SUBDIRECTORY(init) ADD_SUBDIRECTORY(main) -IF (NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") -ADD_SUBDIRECTORY(visualization) -ENDIF() TRIBITS_ADD_TEST_DIRECTORIES(utest) diff --git a/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C b/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C index 11f66137debf..8c681356b77d 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C +++ b/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C @@ -54,15 +54,14 @@ #define USE_MURMUR //#define USE_RANDOM +#define DO_TIMING 1 + #if defined(__GNUC__) && __GNUC__ >= 7 && !__INTEL_COMPILER #define FALL_THROUGH [[gnu::fallthrough]] #else #define FALL_THROUGH ((void)0) #endif /* __GNUC__ >= 7 */ -size_t Ioss::FaceGenerator::fequal = 0; -size_t Ioss::FaceGenerator::secondary = 0; - namespace { template void generate_index(std::vector &index) { @@ -207,7 +206,7 @@ namespace { if (face.elementCount_ == 1) { // On 'boundary' -- try to determine whether on processor or exterior // boundary - int face_node_count = 0; + int face_node_count = 0; for (auto &gnode : face.connectivity_) { if (gnode > 0) { auto node = region.get_database()->node_global_to_local(gnode, true) - 1; @@ -221,11 +220,11 @@ namespace { } } } - for (size_t i=0; i < proc_count; i++) { - if (shared_nodes[i] == face_node_count) { + for (size_t i = 0; i < proc_count; i++) { + if (shared_nodes[i] == face_node_count) { potential_count[i]++; } - shared_nodes[i] = 0; // Reset for next trip through face.connectivity_ loop + shared_nodes[i] = 0; // Reset for next trip through face.connectivity_ loop } } } @@ -240,7 +239,7 @@ namespace { if (face.elementCount_ == 1) { // On 'boundary' -- try to determine whether on processor or exterior // boundary - int face_node_count = 0; + int face_node_count = 0; for (auto &gnode : face.connectivity_) { if (gnode > 0) { auto node = region.get_database()->node_global_to_local(gnode, true) - 1; @@ -254,8 +253,8 @@ namespace { } } } - for (size_t i=0; i < proc_count; i++) { - if (shared_nodes[i] == face_node_count) { + for (size_t i = 0; i < proc_count; i++) { + if (shared_nodes[i] == face_node_count) { size_t offset = potential_offset[i]; potential_faces[6 * offset + 0] = face.hashId_; potential_faces[6 * offset + 1] = face.connectivity_[0]; @@ -266,7 +265,7 @@ namespace { assert(face.elementCount_ == 1); potential_offset[i]++; } - shared_nodes[i] = 0; // Reset for next trip through face.connectivity_ loop + shared_nodes[i] = 0; // Reset for next trip through face.connectivity_ loop } } } @@ -356,13 +355,18 @@ namespace Ioss { nb->get_field_data("ids", ids); // Convert ids into hashed-ids - // auto starth = std::chrono::high_resolution_clock::now(); +#if DO_TIMING + auto starth = std::chrono::high_resolution_clock::now(); +#endif std::vector hash_ids; hash_ids.reserve(ids.size()); for (auto id : ids) { hash_ids.push_back(id_hash(id)); } - // auto endh = std::chrono::high_resolution_clock::now(); + +#if DO_TIMING + auto endh = std::chrono::high_resolution_clock::now(); +#endif const Ioss::ElementBlockContainer &ebs = region_.get_element_blocks(); for (auto eb : ebs) { @@ -373,15 +377,16 @@ namespace Ioss { internal_generate_faces(eb, faces_[name], ids, hash_ids, (INT)0); } - // auto endf = std::chrono::high_resolution_clock::now(); +#if DO_TIMING + auto endf = std::chrono::high_resolution_clock::now(); +#endif size_t face_count = 0; for (auto eb : ebs) { resolve_parallel_faces(region_, faces_[eb->name()], hash_ids, (INT)0); face_count += faces_[eb->name()].size(); } - // auto endp = std::chrono::high_resolution_clock::now(); - -#if 0 +#if DO_TIMING + auto endp = std::chrono::high_resolution_clock::now(); auto diffh = endh - starth; auto difff = endf - endh; fmt::print("Node ID hash time: \t{} ms\t{} nodes/second\n" @@ -413,13 +418,17 @@ namespace Ioss { nb->get_field_data("ids", ids); // Convert ids into hashed-ids - // auto starth = std::chrono::high_resolution_clock::now(); +#if DO_TIMING + auto starth = std::chrono::high_resolution_clock::now(); +#endif std::vector hash_ids; hash_ids.reserve(ids.size()); for (auto id : ids) { hash_ids.push_back(id_hash(id)); } - // auto endh = std::chrono::high_resolution_clock::now(); +#if DO_TIMING + auto endh = std::chrono::high_resolution_clock::now(); +#endif auto & my_faces = faces_["ALL"]; size_t numel = region_.get_property("element_count").get_int(); @@ -431,12 +440,13 @@ namespace Ioss { internal_generate_faces(eb, my_faces, ids, hash_ids, (INT)0); } - // auto endf = std::chrono::high_resolution_clock::now(); +#if DO_TIMING + auto endf = std::chrono::high_resolution_clock::now(); +#endif resolve_parallel_faces(region_, my_faces, hash_ids, (INT)0); - // auto endp = std::chrono::high_resolution_clock::now(); - -#if 0 +#if DO_TIMING + auto endp = std::chrono::high_resolution_clock::now(); auto diffh = endh - starth; auto difff = endf - endh; fmt::print("Node ID hash time: \t{} ms\t{} nodes/second\n" diff --git a/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.h b/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.h index 814bee2046a5..a52320bfccb1 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.h +++ b/packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.h @@ -49,7 +49,6 @@ #include - namespace Ioss { class Region; @@ -66,6 +65,7 @@ namespace Ioss { } size_t hashId_{0}; + // NOTE: Not used at all by `Face` or `FaceGenerator` class, but are used by // skinner to give a consistent element id in cases where there // is a hash collision (face.id). @@ -79,9 +79,8 @@ namespace Ioss { // you could recover element_id and local_face and then set up // parallel communication maps. May need to save the proc it is // shared with also (which is available in git history) - - mutable size_t element[2]{}; - mutable int elementCount_{0}; // Should be max of 2 solid elements... + mutable size_t element[2]{}; + mutable int elementCount_{0}; // Should be max of 2 solid elements... std::array connectivity_{}; }; @@ -90,25 +89,7 @@ namespace Ioss { size_t operator()(const Face &face) const { return face.hashId_; } }; - struct FaceEqual - { - bool operator()(const Face &left, const Face &right) const - { - if (left.hashId_ != right.hashId_) { - return false; - } - // Hash (hashId_) is equal - // Check whether same vertices (can be in different order) - for (auto lvert : left.connectivity_) { - if (std::find(right.connectivity_.cbegin(), right.connectivity_.cend(), lvert) == - right.connectivity_.cend()) { - // Not found, therefore not the same. - return false; - } - } - return true; - } - }; + struct FaceEqual; #if defined USE_STD using FaceUnorderedSet = std::unordered_set; @@ -123,17 +104,11 @@ namespace Ioss { { public: explicit FaceGenerator(Ioss::Region ®ion); - ~FaceGenerator() - { - std::cout << "FaceEqual Calls: " << fequal << "\t" << secondary << "\n"; - } + ~FaceGenerator() = default; template void generate_faces(INT /*dummy*/, bool block_by_block = false); FaceUnorderedSet & faces(const std::string &name = "ALL") { return faces_[name]; } - static size_t fequal; - static size_t secondary; - private: template void generate_block_faces(INT /*dummy*/); template void generate_model_faces(INT /*dummy*/); @@ -141,6 +116,30 @@ namespace Ioss { std::map faces_; }; + struct FaceEqual + { + bool operator()(const Face &left, const Face &right) const + { + if (left.hashId_ != right.hashId_) { + return false; + } + // Hash (hashId_) is equal + // Check whether same vertices (can be in different order) + // Most (All?) of the time, there are no hashId_ collisions, so this test will not + // find a difference and the function will return 'true' + // However, for some reason, removing this check does not change the execution time + // appreiciably... + for (auto lvert : left.connectivity_) { + if (std::find(right.connectivity_.cbegin(), right.connectivity_.cend(), lvert) == + right.connectivity_.cend()) { + // Not found, therefore not the same. + return false; + } + } + return true; + } + }; + } // namespace Ioss #endif diff --git a/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h b/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h index 44545451e030..543a9f9bc1f5 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h +++ b/packages/seacas/libraries/ioss/src/Ioss_GroupingEntity.h @@ -467,7 +467,7 @@ int64_t Ioss::GroupingEntity::get_field_data(const std::string &field_name, data.resize(field.raw_count() * field.raw_storage()->component_count()); size_t data_size = data.size() * sizeof(T); - auto retval = internal_get_field_data(field, TOPTR(data), data_size); + auto retval = internal_get_field_data(field, TOPTR(data), data_size); // At this point, transform the field if specified... if (retval >= 0) { diff --git a/packages/seacas/libraries/ioss/src/Ioss_IOFactory.C b/packages/seacas/libraries/ioss/src/Ioss_IOFactory.C index 8f2753a151ca..f63dea1da9b1 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_IOFactory.C +++ b/packages/seacas/libraries/ioss/src/Ioss_IOFactory.C @@ -34,7 +34,8 @@ #include #include #include // for IOSS_ERROR -#include // for nullptr +#include +#include // for nullptr #include #include // for _Rb_tree_iterator, etc #include // for basic_ostream, etc @@ -105,11 +106,8 @@ Ioss::DatabaseIO *Ioss::IOFactory::create(const std::string &type, const std::st fmt::print(errmsg, "ERROR: The database type '{}' is not supported.\n", type); Ioss::NameList db_types; describe__(registry(), &db_types); - fmt::print(errmsg, "\nSupported database types:\n\t"); - for (Ioss::NameList::const_iterator IF = db_types.begin(); IF != db_types.end(); ++IF) { - fmt::print(errmsg, "{} ", *IF); - } - fmt::print(errmsg, "\n\n"); + fmt::print(errmsg, "\nSupported database types:\n\t{}\n\n", + fmt::join(db_types.begin(), db_types.end(), " ")); IOSS_ERROR(errmsg); } } @@ -136,9 +134,10 @@ int Ioss::IOFactory::describe(NameList *names) void Ioss::IOFactory::show_configuration() { + fmt::print(stderr, "\nIOSS Library Version '{}'\n\n", Ioss::Version()); NameList db_types; describe(&db_types); - fmt::print(stderr, "\nSupported database types:\n\t"); + fmt::print(stderr, "Supported database types:\n\t"); for (const auto &db_type : db_types) { fmt::print(stderr, "{} ", db_type); } diff --git a/packages/seacas/libraries/ioss/src/Ioss_Utils.C b/packages/seacas/libraries/ioss/src/Ioss_Utils.C index f5a11f4c3151..f7595b40d6e9 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Utils.C +++ b/packages/seacas/libraries/ioss/src/Ioss_Utils.C @@ -444,7 +444,7 @@ std::string Ioss::Utils::fixup_type(const std::string &base, int nodes_per_eleme } } - if (std::strncmp(type.c_str(), "super", 5) == 0) { + if (Ioss::Utils::substr_equal("super", type)) { // A super element can have a varying number of nodes. Create // an IO element type for this super element just so the IO // system can read a mesh containing super elements. This @@ -553,9 +553,7 @@ namespace { // and see if it defines a valid type... std::vector suffices; - char suffix[2]; - suffix[0] = suffix_separator; - suffix[1] = 0; + char suffix[2] = {suffix_separator, '\0'}; for (int which_name : which_names) { std::vector tokens = Ioss::tokenize(names[which_name], suffix); @@ -1166,18 +1164,16 @@ void Ioss::Utils::input_file(const std::string &file_name, std::vector= prefix.size()) && str_equal(prefix, str.substr(0, prefix.size())); } std::string Ioss::Utils::uppercase(std::string name) @@ -2217,8 +2213,7 @@ namespace { max_field_size = field.get_size(); } if (field_name != "ids" && !oge->field_exists(field_name) && - (prefix.empty() || - std::strncmp(prefix.c_str(), field_name.c_str(), prefix.length()) == 0)) { + Ioss::Utils::substr_equal(prefix, field_name)) { // If the field does not already exist, add it to the output node block oge->field_add(field); } @@ -2252,8 +2247,7 @@ namespace { if (field_name == "ids") { continue; } - if ((prefix.empty() || - std::strncmp(prefix.c_str(), field_name.c_str(), prefix.length()) == 0)) { + if (Ioss::Utils::substr_equal(prefix, field_name)) { assert(oge->field_exists(field_name)); transfer_field_data_internal(ige, oge, pool, field_name, options); } diff --git a/packages/seacas/libraries/ioss/src/Ioss_Utils.h b/packages/seacas/libraries/ioss/src/Ioss_Utils.h index 1bc8dfb36b0f..cb3bfa004f4c 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Utils.h +++ b/packages/seacas/libraries/ioss/src/Ioss_Utils.h @@ -360,9 +360,17 @@ namespace Ioss { * * \param[in] s1 First string * \param[in] s2 Second string - * \returns 0 if strings are equal, nonzero otherwise. + * \returns `true` if strings are equal */ - static int case_strcmp(const std::string &s1, const std::string &s2); + static bool str_equal(const std::string &s1, const std::string &s2); + + /** \brief Case-insensitive substring comparison. + * + * \param[in] prefix + * \param[in] str + * \returns `true` if `str` begins with `prefix` or `prefix` is empty + */ + static bool substr_equal(const std::string &prefix, const std::string &str); /** \brief Get a string containing `uname` output. * diff --git a/packages/seacas/libraries/ioss/src/Ioss_VariableType.C b/packages/seacas/libraries/ioss/src/Ioss_VariableType.C index bcd2fb06be95..a76b305d6557 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_VariableType.C +++ b/packages/seacas/libraries/ioss/src/Ioss_VariableType.C @@ -219,7 +219,7 @@ namespace Ioss { size_t width = Ioss::Utils::number_width(size); for (size_t i = 0; i < size; i++) { std::string digits = fmt::format("{:0{}}", i + 1, width); - if (std::strcmp(&suffices[i].m_data[0], digits.c_str()) != 0) { + if (!Ioss::Utils::str_equal(&suffices[i].m_data[0], digits)) { match = false; break; } diff --git a/packages/seacas/libraries/ioss/src/Ioss_Version.h b/packages/seacas/libraries/ioss/src/Ioss_Version.h new file mode 100644 index 000000000000..956acfd0d1ba --- /dev/null +++ b/packages/seacas/libraries/ioss/src/Ioss_Version.h @@ -0,0 +1,38 @@ +// Copyright(C) 1999-2017 National Technology & Engineering Solutions +// of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with +// NTESS, the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// * 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. +// +// * Neither the name of NTESS nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef IOSS_VERSION_H +#define IOSS_VERSION_H +namespace Ioss { + inline const char *Version() { return "2019-10-30"; } +} // namespace Ioss +#endif diff --git a/packages/seacas/libraries/ioss/src/catch.hpp b/packages/seacas/libraries/ioss/src/catch.hpp index 4c2c638fffb6..7cbd8f7cf9a2 100644 --- a/packages/seacas/libraries/ioss/src/catch.hpp +++ b/packages/seacas/libraries/ioss/src/catch.hpp @@ -1,6 +1,6 @@ /* - * Catch v2.9.2 - * Generated: 2019-08-08 13:35:12.279703 + * Catch v2.10.2 + * Generated: 2019-10-24 17:49:11.459934 * ---------------------------------------------------------- * This file has been merged from multiple headers. Please don't edit it directly * Copyright (c) 2019 Two Blue Cubes Ltd. All rights reserved. @@ -12,88 +12,88 @@ #define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED // start catch.hpp - #define CATCH_VERSION_MAJOR 2 -#define CATCH_VERSION_MINOR 9 +#define CATCH_VERSION_MINOR 10 #define CATCH_VERSION_PATCH 2 #ifdef __clang__ -# pragma clang system_header +#pragma clang system_header #elif defined __GNUC__ -# pragma GCC system_header +#pragma GCC system_header #endif // start catch_suppress_warnings.h #ifdef __clang__ -# ifdef __ICC // icpc defines the __clang__ macro -# pragma warning(push) -# pragma warning(disable: 161 1682) -# else // __ICC -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wpadded" -# pragma clang diagnostic ignored "-Wswitch-enum" -# pragma clang diagnostic ignored "-Wcovered-switch-default" -# endif -#elif defined __GNUC__ - // Because REQUIREs trigger GCC's -Wparentheses, and because still - // supported version of g++ have only buggy support for _Pragmas, - // Wparentheses have to be suppressed globally. -# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details - -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-variable" -# pragma GCC diagnostic ignored "-Wpadded" +#ifdef __ICC // icpc defines the __clang__ macro +#pragma warning(push) +#pragma warning(disable : 161 1682) +#else // __ICC +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +#pragma clang diagnostic ignored "-Wswitch-enum" +#pragma clang diagnostic ignored "-Wcovered-switch-default" +#endif +#elif defined __GNUC__ +// Because REQUIREs trigger GCC's -Wparentheses, and because still +// supported version of g++ have only buggy support for _Pragmas, +// Wparentheses have to be suppressed globally. +#pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic ignored "-Wpadded" #endif // end catch_suppress_warnings.h #if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) -# define CATCH_IMPL -# define CATCH_CONFIG_ALL_PARTS +#define CATCH_IMPL +#define CATCH_CONFIG_ALL_PARTS #endif // In the impl file, we want to have access to all parts of the headers // Can also be used to sanely support PCHs #if defined(CATCH_CONFIG_ALL_PARTS) -# define CATCH_CONFIG_EXTERNAL_INTERFACES -# if defined(CATCH_CONFIG_DISABLE_MATCHERS) -# undef CATCH_CONFIG_DISABLE_MATCHERS -# endif -# if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) -# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER -# endif +#define CATCH_CONFIG_EXTERNAL_INTERFACES +#if defined(CATCH_CONFIG_DISABLE_MATCHERS) +#undef CATCH_CONFIG_DISABLE_MATCHERS +#endif +#if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) +#define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER +#endif #endif #if !defined(CATCH_CONFIG_IMPL_ONLY) // start catch_platform.h #ifdef __APPLE__ -# include -# if TARGET_OS_OSX == 1 -# define CATCH_PLATFORM_MAC -# elif TARGET_OS_IPHONE == 1 -# define CATCH_PLATFORM_IPHONE -# endif +#include +#if TARGET_OS_OSX == 1 +#define CATCH_PLATFORM_MAC +#elif TARGET_OS_IPHONE == 1 +#define CATCH_PLATFORM_IPHONE +#endif #elif defined(linux) || defined(__linux) || defined(__linux__) -# define CATCH_PLATFORM_LINUX +#define CATCH_PLATFORM_LINUX -#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) -# define CATCH_PLATFORM_WINDOWS +#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || \ + defined(__MINGW32__) +#define CATCH_PLATFORM_WINDOWS #endif // end catch_platform.h #ifdef CATCH_IMPL -# ifndef CLARA_CONFIG_MAIN -# define CLARA_CONFIG_MAIN_NOT_DEFINED -# define CLARA_CONFIG_MAIN -# endif +#ifndef CLARA_CONFIG_MAIN +#define CLARA_CONFIG_MAIN_NOT_DEFINED +#define CLARA_CONFIG_MAIN +#endif #endif // start catch_user_interfaces.h namespace Catch { - unsigned int rngSeed(); + unsigned int rngSeed(); } // end catch_user_interfaces.h @@ -122,82 +122,79 @@ namespace Catch { #ifdef __cplusplus -# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) -# define CATCH_CPP14_OR_GREATER -# endif +#if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) +#define CATCH_CPP14_OR_GREATER +#endif -# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) -# define CATCH_CPP17_OR_GREATER -# endif +#if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) +#define CATCH_CPP17_OR_GREATER +#endif #endif #if defined(CATCH_CPP17_OR_GREATER) -# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS +#define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS #endif #ifdef __clang__ -# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ - _Pragma( "clang diagnostic push" ) \ - _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \ - _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"") -# define CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS \ - _Pragma( "clang diagnostic pop" ) - -# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ - _Pragma( "clang diagnostic push" ) \ - _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) -# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \ - _Pragma( "clang diagnostic pop" ) - -# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ - _Pragma( "clang diagnostic push" ) \ - _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" ) -# define CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS \ - _Pragma( "clang diagnostic pop" ) - -# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ - _Pragma( "clang diagnostic push" ) \ - _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" ) -# define CATCH_INTERNAL_UNSUPPRESS_ZERO_VARIADIC_WARNINGS \ - _Pragma( "clang diagnostic pop" ) +#define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wexit-time-destructors\"") \ + _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") +#define CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS _Pragma("clang diagnostic pop") + +#define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ + _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wparentheses\"") +#define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS _Pragma("clang diagnostic pop") +#define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ + _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wunused-variable\"") +#define CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS _Pragma("clang diagnostic pop") + +#define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"") +#define CATCH_INTERNAL_UNSUPPRESS_ZERO_VARIADIC_WARNINGS _Pragma("clang diagnostic pop") + +#define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ + _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wunused-template\"") +#define CATCH_INTERNAL_UNSUPPRESS_UNUSED_TEMPLATE_WARNINGS _Pragma("clang diagnostic pop") #endif // __clang__ //////////////////////////////////////////////////////////////////////////////// // Assume that non-Windows platforms support posix signals by default #if !defined(CATCH_PLATFORM_WINDOWS) - #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS +#define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS #endif //////////////////////////////////////////////////////////////////////////////// // We know some environments not to support full POSIX signals #if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__) - #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +#define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS #endif #ifdef __OS400__ -# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS -# define CATCH_CONFIG_COLOUR_NONE +#define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +#define CATCH_CONFIG_COLOUR_NONE #endif //////////////////////////////////////////////////////////////////////////////// // Android somehow still does not support std::to_string #if defined(__ANDROID__) -# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING +#define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING +#define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE #endif //////////////////////////////////////////////////////////////////////////////// // Not all Windows environments support SEH properly #if defined(__MINGW32__) -# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH +#define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH #endif //////////////////////////////////////////////////////////////////////////////// // PS4 #if defined(__ORBIS__) -# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE +#define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE #endif //////////////////////////////////////////////////////////////////////////////// @@ -206,62 +203,62 @@ namespace Catch { // Required for some versions of Cygwin to declare gettimeofday // see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin -# define _BSD_SOURCE +#define _BSD_SOURCE // some versions of cygwin (most) do not support std::to_string. Use the libstd check. // https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813 -# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ - && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) +#if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) && \ + !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) -# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING +#define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING -# endif +#endif #endif // __CYGWIN__ //////////////////////////////////////////////////////////////////////////////// // Visual C++ #ifdef _MSC_VER -# if _MSC_VER >= 1900 // Visual Studio 2015 or newer -# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS -# endif +#if _MSC_VER >= 1900 // Visual Studio 2015 or newer +#define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS +#endif // Universal Windows platform does not support SEH // Or console colours (or console at all...) -# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) -# define CATCH_CONFIG_COLOUR_NONE -# else -# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH -# endif +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) +#define CATCH_CONFIG_COLOUR_NONE +#else +#define CATCH_INTERNAL_CONFIG_WINDOWS_SEH +#endif // MSVC traditional preprocessor needs some workaround for __VA_ARGS__ // _MSVC_TRADITIONAL == 0 means new conformant preprocessor // _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor -# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) -# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR -# endif +#if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) +#define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#endif #endif // _MSC_VER #if defined(_REENTRANT) || defined(_MSC_VER) // Enable async processing, as -pthread is specified or no additional linking is required -# define CATCH_INTERNAL_CONFIG_USE_ASYNC +#define CATCH_INTERNAL_CONFIG_USE_ASYNC #endif // _MSC_VER //////////////////////////////////////////////////////////////////////////////// // Check if we are compiled with -fno-exceptions or equivalent #if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) -# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED +#define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED #endif //////////////////////////////////////////////////////////////////////////////// // DJGPP #ifdef __DJGPP__ -# define CATCH_INTERNAL_CONFIG_NO_WCHAR +#define CATCH_INTERNAL_CONFIG_NO_WCHAR #endif // __DJGPP__ //////////////////////////////////////////////////////////////////////////////// // Embarcadero C++Build #if defined(__BORLANDC__) - #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN +#define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN #endif //////////////////////////////////////////////////////////////////////////////// @@ -271,8 +268,8 @@ namespace Catch { // handled by it. // Otherwise all supported compilers support COUNTER macro, // but user still might want to turn it off -#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) - #define CATCH_INTERNAL_CONFIG_COUNTER +#if (!defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L) +#define CATCH_INTERNAL_CONFIG_COUNTER #endif //////////////////////////////////////////////////////////////////////////////// @@ -281,129 +278,164 @@ namespace Catch { // This means that it is detected as Windows, but does not provide // the same set of capabilities as real Windows does. #if defined(UNDER_RTSS) || defined(RTX64_BUILD) - #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH - #define CATCH_INTERNAL_CONFIG_NO_ASYNC - #define CATCH_CONFIG_COLOUR_NONE +#define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH +#define CATCH_INTERNAL_CONFIG_NO_ASYNC +#define CATCH_CONFIG_COLOUR_NONE #endif -//////////////////////////////////////////////////////////////////////////////// -// Check if string_view is available and usable -// The check is split apart to work around v140 (VS2015) preprocessor issue... +#if defined(__UCLIBC__) +#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER +#endif + +// Various stdlib support checks that require __has_include #if defined(__has_include) +// Check if string_view is available and usable #if __has_include() && defined(CATCH_CPP17_OR_GREATER) -# define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW -#endif +#define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW #endif -//////////////////////////////////////////////////////////////////////////////// // Check if optional is available and usable -#if defined(__has_include) -# if __has_include() && defined(CATCH_CPP17_OR_GREATER) -# define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL -# endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) -#endif // __has_include +#if __has_include() && defined(CATCH_CPP17_OR_GREATER) +#define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL +#endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) -//////////////////////////////////////////////////////////////////////////////// // Check if byte is available and usable -#if defined(__has_include) -# if __has_include() && defined(CATCH_CPP17_OR_GREATER) -# define CATCH_INTERNAL_CONFIG_CPP17_BYTE -# endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) -#endif // __has_include +#if __has_include() && defined(CATCH_CPP17_OR_GREATER) +#define CATCH_INTERNAL_CONFIG_CPP17_BYTE +#endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) -//////////////////////////////////////////////////////////////////////////////// // Check if variant is available and usable -#if defined(__has_include) -# if __has_include() && defined(CATCH_CPP17_OR_GREATER) -# if defined(__clang__) && (__clang_major__ < 8) - // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 - // fix should be in clang 8, workaround in libstdc++ 8.2 -# include -# if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) -# define CATCH_CONFIG_NO_CPP17_VARIANT -# else -# define CATCH_INTERNAL_CONFIG_CPP17_VARIANT -# endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) -# else -# define CATCH_INTERNAL_CONFIG_CPP17_VARIANT -# endif // defined(__clang__) && (__clang_major__ < 8) -# endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) -#endif // __has_include - -#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) -# define CATCH_CONFIG_COUNTER +#if __has_include() && defined(CATCH_CPP17_OR_GREATER) +#if defined(__clang__) && (__clang_major__ < 8) +// work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 +// fix should be in clang 8, workaround in libstdc++ 8.2 +#include +#if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) +#define CATCH_CONFIG_NO_CPP17_VARIANT +#else +#define CATCH_INTERNAL_CONFIG_CPP17_VARIANT +#endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) +#else +#define CATCH_INTERNAL_CONFIG_CPP17_VARIANT +#endif // defined(__clang__) && (__clang_major__ < 8) +#endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) +#endif // defined(__has_include) + +#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && \ + !defined(CATCH_CONFIG_COUNTER) +#define CATCH_CONFIG_COUNTER #endif -#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH) -# define CATCH_CONFIG_WINDOWS_SEH +#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && \ + !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH) +#define CATCH_CONFIG_WINDOWS_SEH #endif -// This is set by default, because we assume that unix compilers are posix-signal-compatible by default. -#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) -# define CATCH_CONFIG_POSIX_SIGNALS +// This is set by default, because we assume that unix compilers are posix-signal-compatible by +// default. +#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && \ + !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && \ + !defined(CATCH_CONFIG_POSIX_SIGNALS) +#define CATCH_CONFIG_POSIX_SIGNALS #endif -// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions. -#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR) -# define CATCH_CONFIG_WCHAR +// This is set by default, because we assume that compilers with no wchar_t support are just rare +// exceptions. +#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && \ + !defined(CATCH_CONFIG_WCHAR) +#define CATCH_CONFIG_WCHAR #endif -#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING) -# define CATCH_CONFIG_CPP11_TO_STRING +#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && \ + !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING) +#define CATCH_CONFIG_CPP11_TO_STRING #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL) -# define CATCH_CONFIG_CPP17_OPTIONAL +#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && \ + !defined(CATCH_CONFIG_CPP17_OPTIONAL) +#define CATCH_CONFIG_CPP17_OPTIONAL #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) -# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS +#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && \ + !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && \ + !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) +#define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW) -# define CATCH_CONFIG_CPP17_STRING_VIEW +#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && \ + !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW) +#define CATCH_CONFIG_CPP17_STRING_VIEW #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT) -# define CATCH_CONFIG_CPP17_VARIANT +#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && \ + !defined(CATCH_CONFIG_CPP17_VARIANT) +#define CATCH_CONFIG_CPP17_VARIANT #endif -#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE) -# define CATCH_CONFIG_CPP17_BYTE +#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && \ + !defined(CATCH_CONFIG_CPP17_BYTE) +#define CATCH_CONFIG_CPP17_BYTE #endif #if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) -# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE +#define CATCH_INTERNAL_CONFIG_NEW_CAPTURE #endif -#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE) -# define CATCH_CONFIG_NEW_CAPTURE +#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && \ + !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && \ + !defined(CATCH_CONFIG_NEW_CAPTURE) +#define CATCH_CONFIG_NEW_CAPTURE #endif #if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) -# define CATCH_CONFIG_DISABLE_EXCEPTIONS +#define CATCH_CONFIG_DISABLE_EXCEPTIONS +#endif + +#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && \ + !defined(CATCH_CONFIG_POLYFILL_ISNAN) +#define CATCH_CONFIG_POLYFILL_ISNAN +#endif + +#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && \ + !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC) +#define CATCH_CONFIG_USE_ASYNC #endif -#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN) -# define CATCH_CONFIG_POLYFILL_ISNAN +#if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && \ + !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE) +#define CATCH_CONFIG_ANDROID_LOGWRITE #endif -#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC) -# define CATCH_CONFIG_USE_ASYNC +#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && \ + !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) +#define CATCH_CONFIG_GLOBAL_NEXTAFTER #endif #if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS -# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS +#define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS +#define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS #endif #if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS -# define CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS +#define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS +#define CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS #endif #if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS -# define CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS +#define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS +#define CATCH_INTERNAL_UNSUPPRESS_UNUSED_WARNINGS #endif #if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS) -# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS -# define CATCH_INTERNAL_UNSUPPRESS_ZERO_VARIADIC_WARNINGS +#define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS +#define CATCH_INTERNAL_UNSUPPRESS_ZERO_VARIADIC_WARNINGS +#endif + +#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10) +#undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#undef CATCH_INTERNAL_UNSUPPRESS_UNUSED_TEMPLATE_WARNINGS +#elif defined(__clang__) && (__clang_major__ < 5) +#undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#undef CATCH_INTERNAL_UNSUPPRESS_UNUSED_TEMPLATE_WARNINGS +#endif + +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS) +#define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#define CATCH_INTERNAL_UNSUPPRESS_UNUSED_TEMPLATE_WARNINGS #endif #if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) @@ -416,102 +448,107 @@ namespace Catch { #define CATCH_CATCH_ANON(type) catch (type) #endif -#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) +#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && \ + !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && \ + !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) #define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #endif // end catch_compiler_capabilities.h -#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line -#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) +#define INTERNAL_CATCH_UNIQUE_NAME_LINE2(name, line) name##line +#define INTERNAL_CATCH_UNIQUE_NAME_LINE(name, line) INTERNAL_CATCH_UNIQUE_NAME_LINE2(name, line) #ifdef CATCH_CONFIG_COUNTER -# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) +#define INTERNAL_CATCH_UNIQUE_NAME(name) INTERNAL_CATCH_UNIQUE_NAME_LINE(name, __COUNTER__) #else -# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) +#define INTERNAL_CATCH_UNIQUE_NAME(name) INTERNAL_CATCH_UNIQUE_NAME_LINE(name, __LINE__) #endif +#include #include #include -#include // We need a dummy global operator<< so we can bring it into Catch namespace later -struct Catch_global_namespace_dummy {}; -std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); +struct Catch_global_namespace_dummy +{ +}; +std::ostream &operator<<(std::ostream &, Catch_global_namespace_dummy); namespace Catch { - struct CaseSensitive { enum Choice { - Yes, - No - }; }; - - class NonCopyable { - NonCopyable( NonCopyable const& ) = delete; - NonCopyable( NonCopyable && ) = delete; - NonCopyable& operator = ( NonCopyable const& ) = delete; - NonCopyable& operator = ( NonCopyable && ) = delete; - - protected: - NonCopyable(); - virtual ~NonCopyable(); - }; - - struct SourceLineInfo { - - SourceLineInfo() = delete; - SourceLineInfo( char const* _file, std::size_t _line ) noexcept - : file( _file ), - line( _line ) - {} - - SourceLineInfo( SourceLineInfo const& other ) = default; - SourceLineInfo& operator = ( SourceLineInfo const& ) = default; - SourceLineInfo( SourceLineInfo&& ) noexcept = default; - SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default; - - bool empty() const noexcept; - bool operator == ( SourceLineInfo const& other ) const noexcept; - bool operator < ( SourceLineInfo const& other ) const noexcept; - - char const* file; - std::size_t line; - }; - - std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); - - // Bring in operator<< from global namespace into Catch namespace - // This is necessary because the overload of operator<< above makes - // lookup stop at namespace Catch - using ::operator<<; - - // Use this in variadic streaming macros to allow - // >> +StreamEndStop - // as well as - // >> stuff +StreamEndStop - struct StreamEndStop { - std::string operator+() const; - }; - template - T const& operator + ( T const& value, StreamEndStop ) { - return value; - } -} + struct CaseSensitive + { + enum Choice { Yes, No }; + }; + + class NonCopyable + { + NonCopyable(NonCopyable const &) = delete; + NonCopyable(NonCopyable &&) = delete; + NonCopyable &operator=(NonCopyable const &) = delete; + NonCopyable &operator=(NonCopyable &&) = delete; + + protected: + NonCopyable(); + virtual ~NonCopyable(); + }; + + struct SourceLineInfo + { + + SourceLineInfo() = delete; + SourceLineInfo(char const *_file, std::size_t _line) noexcept : file(_file), line(_line) {} + + SourceLineInfo(SourceLineInfo const &other) = default; + SourceLineInfo &operator=(SourceLineInfo const &) = default; + SourceLineInfo(SourceLineInfo &&) noexcept = default; + SourceLineInfo &operator=(SourceLineInfo &&) noexcept = default; + + bool empty() const noexcept { return file[0] == '\0'; } + bool operator==(SourceLineInfo const &other) const noexcept; + bool operator<(SourceLineInfo const &other) const noexcept; + + char const *file; + std::size_t line; + }; + + std::ostream &operator<<(std::ostream &os, SourceLineInfo const &info); + + // Bring in operator<< from global namespace into Catch namespace + // This is necessary because the overload of operator<< above makes + // lookup stop at namespace Catch + using ::operator<<; + + // Use this in variadic streaming macros to allow + // >> +StreamEndStop + // as well as + // >> stuff +StreamEndStop + struct StreamEndStop + { + std::string operator+() const; + }; + template T const &operator+(T const &value, StreamEndStop) { return value; } +} // namespace Catch -#define CATCH_INTERNAL_LINEINFO \ - ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) +#define CATCH_INTERNAL_LINEINFO \ + ::Catch::SourceLineInfo(__FILE__, static_cast(__LINE__)) // end catch_common.h namespace Catch { - struct RegistrarForTagAliases { - RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); - }; + struct RegistrarForTagAliases + { + RegistrarForTagAliases(char const *alias, char const *tag, SourceLineInfo const &lineInfo); + }; } // end namespace Catch -#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \ - CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ - namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \ - CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS +#define CATCH_REGISTER_TAG_ALIAS(alias, spec) \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + namespace { \ + Catch::RegistrarForTagAliases \ + INTERNAL_CATCH_UNIQUE_NAME(AutoRegisterTagAlias)(alias, spec, CATCH_INTERNAL_LINEINFO); \ + } \ + CATCH_INTERNAL_UNSUPPRESS_GLOBALS_WARNINGS // end catch_tag_alias_autoregistrar.h // start catch_test_registry.h @@ -522,203 +559,173 @@ namespace Catch { namespace Catch { - class TestSpec; + class TestSpec; - struct ITestInvoker { - virtual void invoke () const = 0; - virtual ~ITestInvoker(); - }; + struct ITestInvoker + { + virtual void invoke() const = 0; + virtual ~ITestInvoker(); + }; - class TestCase; - struct IConfig; + class TestCase; + struct IConfig; - struct ITestCaseRegistry { - virtual ~ITestCaseRegistry(); - virtual std::vector const& getAllTests() const = 0; - virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; - }; + struct ITestCaseRegistry + { + virtual ~ITestCaseRegistry(); + virtual std::vector const &getAllTests() const = 0; + virtual std::vector const &getAllTestsSorted(IConfig const &config) const = 0; + }; - bool isThrowSafe( TestCase const& testCase, IConfig const& config ); - bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ); - std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); - std::vector const& getAllTestCasesSorted( IConfig const& config ); + bool isThrowSafe(TestCase const &testCase, IConfig const &config); + bool matchTest(TestCase const &testCase, TestSpec const &testSpec, IConfig const &config); + std::vector filterTests(std::vector const &testCases, + TestSpec const &testSpec, IConfig const &config); + std::vector const &getAllTestCasesSorted(IConfig const &config); -} +} // namespace Catch // end catch_interfaces_testcase.h // start catch_stringref.h +#include #include -#include #include +#include namespace Catch { - /// A non-owning string class (similar to the forthcoming std::string_view) - /// Note that, because a StringRef may be a substring of another string, - /// it may not be null terminated. c_str() must return a null terminated - /// string, however, and so the StringRef will internally take ownership - /// (taking a copy), if necessary. In theory this ownership is not externally - /// visible - but it does mean (substring) StringRefs should not be shared between - /// threads. - class StringRef { - public: - using size_type = std::size_t; + /// A non-owning string class (similar to the forthcoming std::string_view) + /// Note that, because a StringRef may be a substring of another string, + /// it may not be null terminated. c_str() must return a null terminated + /// string, however, and so the StringRef will internally take ownership + /// (taking a copy), if necessary. In theory this ownership is not externally + /// visible - but it does mean (substring) StringRefs should not be shared between + /// threads. + class StringRef + { + public: + using size_type = std::size_t; + using const_iterator = const char *; - private: - friend struct StringRefTestAccess; + private: + friend struct StringRefTestAccess; - char const* m_start; - size_type m_size; + char const *m_start; + size_type m_size; - char* m_data = nullptr; + char *m_data = nullptr; - void takeOwnership(); + void takeOwnership(); - static constexpr char const* const s_empty = ""; + static constexpr char const *const s_empty = ""; - public: // construction/ assignment - StringRef() noexcept - : StringRef( s_empty, 0 ) - {} + public: // construction/ assignment + StringRef() noexcept : StringRef(s_empty, 0) {} - StringRef( StringRef const& other ) noexcept - : m_start( other.m_start ), - m_size( other.m_size ) - {} + StringRef(StringRef const &other) noexcept : m_start(other.m_start), m_size(other.m_size) {} - StringRef( StringRef&& other ) noexcept - : m_start( other.m_start ), - m_size( other.m_size ), - m_data( other.m_data ) - { - other.m_data = nullptr; - } + StringRef(StringRef &&other) noexcept + : m_start(other.m_start), m_size(other.m_size), m_data(other.m_data) + { + other.m_data = nullptr; + } - StringRef( char const* rawChars ) noexcept; + StringRef(char const *rawChars) noexcept; - StringRef( char const* rawChars, size_type size ) noexcept - : m_start( rawChars ), - m_size( size ) - {} + StringRef(char const *rawChars, size_type size) noexcept : m_start(rawChars), m_size(size) {} - StringRef( std::string const& stdString ) noexcept - : m_start( stdString.c_str() ), - m_size( stdString.size() ) - {} + StringRef(std::string const &stdString) noexcept + : m_start(stdString.c_str()), m_size(stdString.size()) + { + } - ~StringRef() noexcept { - delete[] m_data; - } + ~StringRef() noexcept { delete[] m_data; } - auto operator = ( StringRef const &other ) noexcept -> StringRef& { - delete[] m_data; - m_data = nullptr; - m_start = other.m_start; - m_size = other.m_size; - return *this; - } + auto operator=(StringRef const &other) noexcept -> StringRef & + { + delete[] m_data; + m_data = nullptr; + m_start = other.m_start; + m_size = other.m_size; + return *this; + } - operator std::string() const; + explicit operator std::string() const { return std::string(m_start, m_size); } - void swap( StringRef& other ) noexcept; + void swap(StringRef &other) noexcept; - public: // operators - auto operator == ( StringRef const& other ) const noexcept -> bool; - auto operator != ( StringRef const& other ) const noexcept -> bool; + public: // operators + auto operator==(StringRef const &other) const noexcept -> bool; + auto operator!=(StringRef const &other) const noexcept -> bool; - auto operator[] ( size_type index ) const noexcept -> char; + auto operator[](size_type index) const noexcept -> char + { + assert(index < m_size); + return m_start[index]; + } - public: // named queries - auto empty() const noexcept -> bool { - return m_size == 0; - } - auto size() const noexcept -> size_type { - return m_size; - } + public: // named queries + auto empty() const noexcept -> bool { return m_size == 0; } + auto size() const noexcept -> size_type { return m_size; } - auto numberOfCharacters() const noexcept -> size_type; - auto c_str() const -> char const*; + auto c_str() const -> char const *; - public: // substrings and searches - auto substr( size_type start, size_type size ) const noexcept -> StringRef; + public: // substrings and searches + auto substr(size_type start, size_type size) const noexcept -> StringRef; - // Returns the current start pointer. - // Note that the pointer can change when if the StringRef is a substring - auto currentData() const noexcept -> char const*; + // Returns the current start pointer. + // Note that the pointer can change when if the StringRef is a substring + auto currentData() const noexcept -> char const *; - private: // ownership queries - may not be consistent between calls - auto isOwned() const noexcept -> bool; - auto isSubstring() const noexcept -> bool; - }; + public: // iterators + const_iterator begin() const { return m_start; } + const_iterator end() const { return m_start + m_size; } - auto operator + ( StringRef const& lhs, StringRef const& rhs ) -> std::string; - auto operator + ( StringRef const& lhs, char const* rhs ) -> std::string; - auto operator + ( char const* lhs, StringRef const& rhs ) -> std::string; + private: // ownership queries - may not be consistent between calls + auto isOwned() const noexcept -> bool; + auto isSubstring() const noexcept -> bool; + }; - auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&; - auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&; + auto operator+=(std::string &lhs, StringRef const &sr) -> std::string &; + auto operator<<(std::ostream &os, StringRef const &sr) -> std::ostream &; - inline auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { - return StringRef( rawChars, size ); - } + inline auto operator"" _sr(char const *rawChars, std::size_t size) noexcept -> StringRef + { + return StringRef(rawChars, size); + } } // namespace Catch -inline auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { - return Catch::StringRef( rawChars, size ); +inline auto operator"" _catch_sr(char const *rawChars, std::size_t size) noexcept + -> Catch::StringRef +{ + return Catch::StringRef(rawChars, size); } // end catch_stringref.h -// start catch_type_traits.hpp - - -#include - -namespace Catch{ - -#ifdef CATCH_CPP17_OR_GREATER - template - inline constexpr auto is_unique = std::true_type{}; - - template - inline constexpr auto is_unique = std::bool_constant< - (!std::is_same_v && ...) && is_unique - >{}; -#else - -template -struct is_unique : std::true_type{}; - -template -struct is_unique : std::integral_constant -::value - && is_unique::value - && is_unique::value ->{}; - -#endif -} - -// end catch_type_traits.hpp // start catch_preprocessor.hpp - #define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ -#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) -#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) -#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) -#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) -#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL1(...) \ + CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL2(...) \ + CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL3(...) \ + CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL4(...) \ + CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL5(...) \ + CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) #ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ // MSVC needs more evaluations -#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) -#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) +#define CATCH_RECURSION_LEVEL6(...) \ + CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) #else -#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) #endif #define CATCH_REC_END(...) @@ -731,37 +738,51 @@ struct is_unique : std::integral_constant #define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 #define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 #define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT -#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0) -#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) - -#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) -#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ ) -#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) - -#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) -#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ ) -#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) - -// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results, -// and passes userdata as the first parameter to each invocation, -// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) -#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) - -#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) +#define CATCH_REC_NEXT1(test, next) CATCH_DEFER(CATCH_REC_NEXT0)(test, next, 0) +#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) + +#define CATCH_REC_LIST0(f, x, peek, ...) \ + , f(x) CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST1))(f, peek, __VA_ARGS__) +#define CATCH_REC_LIST1(f, x, peek, ...) \ + , f(x) CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST0))(f, peek, __VA_ARGS__) +#define CATCH_REC_LIST2(f, x, peek, ...) \ + f(x) CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST1))(f, peek, __VA_ARGS__) + +#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) \ + , f(userdata, x) \ + CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD))(f, userdata, peek, __VA_ARGS__) +#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) \ + , f(userdata, x) \ + CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD))(f, userdata, peek, __VA_ARGS__) +#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) \ + f(userdata, x) \ + CATCH_DEFER(CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD))(f, userdata, peek, __VA_ARGS__) + +// Applies the function macro `f` to each of the remaining parameters, inserts commas between the +// results, and passes userdata as the first parameter to each invocation, e.g. CATCH_REC_LIST_UD(f, +// x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) +#define CATCH_REC_LIST_UD(f, userdata, ...) \ + CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define CATCH_REC_LIST(f, ...) \ + CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) #define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) -#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ +#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO##__VA_ARGS__ #define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ #define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF #define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ -#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) \ + INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) #else -// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +// MSVC is adding extra space and needs another indirection to expand +// INTERNAL_CATCH_NOINTERNAL_CATCH_DEF #define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__) #define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__ -#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) \ + (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) #endif #define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__ @@ -770,551 +791,946 @@ struct is_unique : std::integral_constant #define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR -#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper()) -#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) \ + decltype(get_wrapper()) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) \ + INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) #else -#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper())) -#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) \ + INTERNAL_CATCH_EXPAND_VARGS( \ + decltype(get_wrapper())) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) \ + INTERNAL_CATCH_EXPAND_VARGS( \ + INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) #endif -#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\ - CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__) +#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...) \ + CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST, __VA_ARGS__) #define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0) -#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1) -#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2) -#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3) -#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4) -#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5) -#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _4, _5, _6) -#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7) -#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8) -#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9) -#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10) +#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) \ + INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1) +#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) \ + INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2) +#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) \ + INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3) +#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) \ + INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4) +#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) \ + INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5) +#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) \ + INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _4, _5, _6) +#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) \ + INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7) +#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) \ + INTERNAL_CATCH_REMOVE_PARENS(_0), \ + INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8) +#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \ + INTERNAL_CATCH_REMOVE_PARENS(_0), \ + INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9) +#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \ + INTERNAL_CATCH_REMOVE_PARENS(_0), \ + INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10) #define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N -#define INTERNAL_CATCH_TYPE_GEN\ - template struct TypeList {};\ - template\ - constexpr auto get_wrapper() noexcept -> TypeList { return {}; }\ - \ - template class L1, typename...E1, template class L2, typename...E2> \ - constexpr auto append(L1, L2) noexcept -> L1 { return {}; }\ - template< template class L1, typename...E1, template class L2, typename...E2, typename...Rest>\ - constexpr auto append(L1, L2, Rest...) noexcept -> decltype(append(L1{}, Rest{}...)) { return {}; }\ - template< template class L1, typename...E1, typename...Rest>\ - constexpr auto append(L1, TypeList, Rest...) noexcept -> L1 { return {}; }\ - \ - template< template class Container, template class List, typename...elems>\ - constexpr auto rewrap(List) noexcept -> TypeList> { return {}; }\ - template< template class Container, template class List, class...Elems, typename...Elements>\ - constexpr auto rewrap(List,Elements...) noexcept -> decltype(append(TypeList>{}, rewrap(Elements{}...))) { return {}; }\ - \ - template