diff --git a/packages/PEGTL/.appveyor.yml b/packages/PEGTL/.appveyor.yml
index db3d921f8ab9b7d44c989e54009b60cc46189e75..8150fbf6e507bbb55488376dd88bdc72add322fc 100644
--- a/packages/PEGTL/.appveyor.yml
+++ b/packages/PEGTL/.appveyor.yml
@@ -1,41 +1,23 @@
 version: '{branch}-{build}'
 
 os:
-- Visual Studio 2015
+- Visual Studio 2017
 
 configuration:
 - Release
 - Debug
 
+skip_commits:
+  files:
+    - doc/**/*
+
 environment:
   matrix:
-    - GENERATOR: Visual Studio 14 2015
-
-    - GENERATOR: Visual Studio 14 2015 Win64
-
-    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
-      GENERATOR: Visual Studio 15 2017
-
-    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
-      GENERATOR: Visual Studio 15 2017 Win64
-
-    - GENERATOR: MinGW Makefiles
-      BINDIR: C:\MinGW\bin
-
-    - GENERATOR: MinGW Makefiles
-      COMPILER: MinGW 5
-      BINDIR: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin
-
-    - GENERATOR: MinGW Makefiles
-      COMPILER: MinGW 6
-      BINDIR: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
+    - GENERATOR: Visual Studio 15 2017
 
-    - GENERATOR: MinGW Makefiles
-      COMPILER: MinGW 6
-      BINDIR: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin
+    - GENERATOR: Visual Studio 15 2017 Win64
 
-    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
-      GENERATOR: Visual Studio 15 2017
+    - GENERATOR: Visual Studio 15 2017
       CONAN_VISUAL_VERSIONS: 15
       PYTHON: "C:\\Python27"
       PYTHON_VERSION: "2.7.8"
@@ -49,7 +31,6 @@ install:
 - if defined CONAN (conan profile new default --detect)
 
 before_build:
-- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" (del "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets")
 - if defined BINDIR (set "PATH=%BINDIR%;%PATH:C:\Program Files\Git\usr\bin;=%")
 - md build
 - cd build
diff --git a/packages/PEGTL/.clang-format b/packages/PEGTL/.clang-format
index f72eb4c2543b33a54eef70788962c11bfd5047b2..729f882aad10760bbc2afa0fe571376390a19bdb 100644
--- a/packages/PEGTL/.clang-format
+++ b/packages/PEGTL/.clang-format
@@ -1,6 +1,6 @@
 # the official .clang-format style for https://github.com/taocpp
 #
-# clang-format-5.0 -i -style=file $(find . -name '[^.]*.[hc]pp')
+# clang-format -i -style=file $(find . -name '[^.]*.[hc]pp')
 
 Language: Cpp
 Standard: Cpp11
@@ -20,7 +20,7 @@ AllowShortIfStatementsOnASingleLine: false
 AllowShortLoopsOnASingleLine: false
 AlwaysBreakAfterReturnType: None
 AlwaysBreakBeforeMultilineStrings: false
-AlwaysBreakTemplateDeclarations: true
+AlwaysBreakTemplateDeclarations: Yes
 BinPackArguments: false
 BinPackParameters: false
 BraceWrapping:
@@ -31,15 +31,21 @@ BraceWrapping:
     AfterNamespace : true
     AfterStruct : true
     AfterUnion : true
+    AfterExternBlock: true
     BeforeCatch : true
     BeforeElse : true
     IndentBraces : false
+    SplitEmptyFunction: false
+    SplitEmptyRecord: false
+    SplitEmptyNamespace: false
 BreakBeforeBinaryOperators: All
 BreakBeforeBraces: Custom
 BreakBeforeTernaryOperators: false
+BreakConstructorInitializers: BeforeColon
+BreakInheritanceList: BeforeColon
 BreakStringLiterals: false
-BreakConstructorInitializersBeforeComma: false
 ColumnLimit: 0
+CompactNamespaces: false
 ConstructorInitializerAllOnOneLineOrOnePerLine: true
 ConstructorInitializerIndentWidth: 3
 ContinuationIndentWidth: 3
@@ -47,24 +53,31 @@ Cpp11BracedListStyle: false
 DerivePointerAlignment: false
 DisableFormat: false
 ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: true
+IncludeBlocks: Preserve
 IndentCaseLabels: true
+IndentPPDirectives: None
 IndentWidth: 3
 IndentWrappedFunctionNames: false
-KeepEmptyLinesAtTheStartOfBlocks: true
+KeepEmptyLinesAtTheStartOfBlocks: false
 MaxEmptyLinesToKeep: 1
 NamespaceIndentation: All
 PointerAlignment: Left
 ReflowComments: false
 SortIncludes: true
+SortUsingDeclarations: false
 SpaceAfterCStyleCast: false
 SpaceAfterTemplateKeyword: false
 SpaceBeforeAssignmentOperators: true
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
 SpaceBeforeParens: Never
+SpaceBeforeRangeBasedForLoopColon: true
 SpaceInEmptyParentheses: false
 SpacesBeforeTrailingComments: 2
 SpacesInAngles: true
 SpacesInCStyleCastParentheses: false
-SpacesInContainerLiterals: true
 SpacesInParentheses: true
 SpacesInSquareBrackets: true
 TabWidth: 8
diff --git a/packages/PEGTL/.conan/build.py b/packages/PEGTL/.conan/build.py
index 4c23b8385aadbfd0b0d2186ca561d618fb85ace7..838e7975543621810e255aa80c7d5a61331ea578 100644
--- a/packages/PEGTL/.conan/build.py
+++ b/packages/PEGTL/.conan/build.py
@@ -54,7 +54,7 @@ class BuilderSettings(object):
     def reference(self):
         """ Read project version from CMake file to create Conan referece
         """
-        pattern = re.compile(r"project \(pegtl VERSION (\d+\.\d+\.\d+) LANGUAGES CXX\)")
+        pattern = re.compile(r"project\(pegtl VERSION (\d+\.\d+\.\d+) LANGUAGES CXX\)")
         version = None
         with open('CMakeLists.txt') as file:
             for line in file:
diff --git a/packages/PEGTL/.conan/test_package/test_package.cpp b/packages/PEGTL/.conan/test_package/test_package.cpp
index 5404848ed21370871602f85175f08f4e91468fac..f16aa23099613b2ab809209ad0c7f32f2f0cf8f2 100644
--- a/packages/PEGTL/.conan/test_package/test_package.cpp
+++ b/packages/PEGTL/.conan/test_package/test_package.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <cassert>
@@ -15,7 +15,7 @@
 
 #include <tao/pegtl/analyze.hpp>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 namespace calculator
 {
@@ -168,7 +168,7 @@ namespace calculator
       void insert( const std::string& name, const order p, const std::function< long( long, long ) >& f )
       {
          assert( !name.empty() );
-         m_ops.insert( { name, { p, f } } );
+         m_ops.emplace( name, op{ p, f } );
       }
 
       const std::map< std::string, op >& ops() const
@@ -182,14 +182,13 @@ namespace calculator
 
    // Here the actual grammar starts.
 
-   using namespace tao::pegtl;  // NOLINT
+   using namespace pegtl;  // NOLINT
 
    // Comments are introduced by a '#' and proceed to the end-of-line/file.
 
    struct comment
       : if_must< one< '#' >, until< eolf > >
-   {
-   };
+   {};
 
    // The calculator ignores all spaces and comments; space is a pegtl rule
    // that matches the usual ascii characters ' ', '\t', '\n' etc. In other
@@ -197,8 +196,7 @@ namespace calculator
 
    struct ignored
       : sor< space, comment >
-   {
-   };
+   {};
 
    // Since the binary operators are taken from a runtime data structure
    // (rather than hard-coding them into the grammar), we need a custom
@@ -207,14 +205,17 @@ namespace calculator
 
    struct infix
    {
-      using analyze_t = analysis::generic< analysis::rule_type::ANY >;
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
 
       template< apply_mode,
                 rewind_mode,
-                template< typename... > class Action,
-                template< typename... > class Control,
-                typename Input >
-      static bool match( Input& in, const operators& b, stacks& s )
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      static bool match( Input& in, const operators& b, stacks& s, States&&... /*unused*/ )
       {
          // Look for the longest match of the input against the operators in the operator map.
 
@@ -250,8 +251,7 @@ namespace calculator
 
    struct number
       : seq< opt< one< '+', '-' > >, plus< digit > >
-   {
-   };
+   {};
 
    struct expression;
 
@@ -260,16 +260,14 @@ namespace calculator
 
    struct bracket
       : if_must< one< '(' >, expression, one< ')' > >
-   {
-   };
+   {};
 
    // An atomic expression, i.e. one without operators, is either a number or
    // a bracketed expression.
 
    struct atomic
       : sor< number, bracket >
-   {
-   };
+   {};
 
    // An expression is a non-empty list of atomic expressions where each pair
    // of atomic expressions is separated by an infix operator and we allow
@@ -277,28 +275,20 @@ namespace calculator
 
    struct expression
       : list< atomic, infix, ignored >
-   {
-   };
+   {};
 
    // The top-level grammar allows one expression and then expects eof.
 
    struct grammar
       : must< expression, eof >
-   {
-   };
+   {};
 
    // After the grammar we proceed with the additional actions that are
    // required to let our calculator actually do something.
 
-   // The base-case of the class template for the actions must derive from
-   // pegtl::nothing (or, alternatively, define an action that does something
-   // sensible for all rules for which no specialisation exists).
-
    template< typename Rule >
    struct action
-      : pegtl::nothing< Rule >
-   {
-   };
+   {};
 
    // This action will be called when the number rule matches; it converts the
    // matched portion of the input to a long and pushes it onto the operand
@@ -310,8 +300,7 @@ namespace calculator
       template< typename Input >
       static void apply( const Input& in, const operators& /*unused*/, stacks& s )
       {
-         std::stringstream ss;
-         ss.str( in.string() );
+         std::stringstream ss( in.string() );
          long v;
          ss >> v;
          s.push( v );
@@ -355,7 +344,7 @@ int main( int argc, char** argv )
    for( int i = 1; i < argc; ++i ) {
       // Parse and process the command-line arguments as calculator expressions...
 
-      pegtl::argv_input<> in( argv, i );
+      pegtl::argv_input in( argv, i );
       pegtl::parse< calculator::grammar, calculator::action >( in, b, s );
 
       // ...and print the respective results to std::cout.
diff --git a/packages/PEGTL/.doozer.json b/packages/PEGTL/.doozer.json
deleted file mode 100644
index 9f877bda3fcaced4aa5444ea441d4e4af99220bc..0000000000000000000000000000000000000000
--- a/packages/PEGTL/.doozer.json
+++ /dev/null
@@ -1,74 +0,0 @@
-{
-  "targets": {
-    "jessie-i386": {
-      "buildenv": "jessie-i386",
-      "builddeps": ["build-essential"],
-      "buildcmd": "make -j"
-    },
-    "trusty-i386": {
-      "buildenv": "trusty-i386",
-      "builddeps": ["build-essential"],
-      "buildcmd": "make -j"
-    },
-    "trusty-amd64": {
-      "buildenv": "trusty-amd64",
-      "builddeps": ["build-essential"],
-      "buildcmd": "make -j"
-    },
-    "xenial-i386": {
-      "buildenv": "xenial-i386",
-      "builddeps": ["build-essential"],
-      "buildcmd": "make -j"
-    },
-    "xenial-amd64": {
-      "buildenv": "xenial-amd64",
-      "builddeps": ["build-essential"],
-      "buildcmd": "make -j"
-    },
-    "xenial-armhf": {
-      "buildenv": "xenial-armhf",
-      "builddeps": ["build-essential"],
-      "buildcmd": "make -j"
-    },
-    "xenial-arm64": {
-      "buildenv": "xenial-arm64",
-      "builddeps": ["build-essential"],
-      "buildcmd": "make -j"
-    },
-    "fedora24-x86_64-g++": {
-      "buildenv": "fedora24-x86_64",
-      "builddeps": ["cmake", "make", "clang"],
-      "buildcmd": ["mkdir build", "cd build", "CXX=g++ cmake ..", "make -j", "ctest --output-on-failure"]
-    },
-    "fedora24-x86_64-clang": {
-      "buildenv": "fedora24-x86_64",
-      "builddeps": ["cmake", "make", "clang"],
-      "buildcmd": ["mkdir build", "cd build", "CXX=clang++ cmake ..", "make -j", "ctest --output-on-failure"]
-    },
-    "fedora24-x86_64-g++-debug": {
-      "buildenv": "fedora24-x86_64",
-      "builddeps": ["cmake", "make", "clang"],
-      "buildcmd": ["mkdir build", "cd build", "CXX=g++ cmake -DCMAKE_BUILD_TYPE=Debug ..", "make -j", "ctest --output-on-failure"]
-    },
-    "fedora24-x86_64-clang-debug": {
-      "buildenv": "fedora24-x86_64",
-      "builddeps": ["cmake", "make", "clang"],
-      "buildcmd": ["mkdir build", "cd build", "CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Debug ..", "make -j", "ctest --output-on-failure"]
-    },
-    "fedora24-x86_64-g++-release": {
-      "buildenv": "fedora24-x86_64",
-      "builddeps": ["cmake", "make", "clang"],
-      "buildcmd": ["mkdir build", "cd build", "CXX=g++ cmake -DCMAKE_BUILD_TYPE=Release ..", "make -j", "ctest --output-on-failure"]
-    },
-    "fedora24-x86_64-clang-release": {
-      "buildenv": "fedora24-x86_64",
-      "builddeps": ["cmake", "make", "clang"],
-      "buildcmd": ["mkdir build", "cd build", "CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release ..", "make -j", "ctest --output-on-failure"]
-    },
-    "osx": {
-      "buildenv": "osx",
-      "builddeps": ["build-essential"],
-      "buildcmd": "make -j"
-    }
-  }
-}
diff --git a/packages/PEGTL/.gitrepo b/packages/PEGTL/.gitrepo
index 13c3bc8b31205195acd81b7e81e3089b28b88ba3..943a8805864d887b81d04ed035cee2e1181d3661 100644
--- a/packages/PEGTL/.gitrepo
+++ b/packages/PEGTL/.gitrepo
@@ -6,6 +6,7 @@
 [subrepo]
 	remote = git@github.com:taocpp/PEGTL.git
 	branch = master
-	commit = 0a5ab8c8efb421f00d9b0e3f593c971991888a97
-	parent = 8a3664d89a9a662c3dfdd402d573b3618ebbdbbf
-	cmdver = 0.3.1
+	commit = 68790bd2c25fceff1049e9fc2fb9528ca4d93bbf
+	parent = 0fc26ddb5da553e9b9ddff3db48b3d6a1617eb96
+	cmdver = 0.4.0
+	method = merge
diff --git a/packages/PEGTL/.travis.yml b/packages/PEGTL/.travis.yml
index f4e899c9cb167fb3f2d99c1beba0e02b47d50356..32500f24224920c429068cea59853f9db37b5f0e 100644
--- a/packages/PEGTL/.travis.yml
+++ b/packages/PEGTL/.travis.yml
@@ -1,46 +1,9 @@
 language: generic
 os: linux
-dist: trusty
+dist: xenial
 
 matrix:
   include:
-    - compiler: gcc
-      env:
-        - CXX=g++-4.8
-
-    - compiler: gcc
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-4.9']
-      env:
-        - CXX=g++-4.9
-
-    - compiler: gcc
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-5']
-      env:
-        - CXX=g++-5
-
-    - compiler: gcc
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-5']
-      env:
-        - CXX=g++-5
-        - CXXSTD=-std=c++14
-
-    - compiler: gcc
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-6']
-      env:
-        - CXX=g++-6
-
     - compiler: gcc
       addons:
         apt:
@@ -49,23 +12,6 @@ matrix:
       env:
         - CXX=g++-7
 
-    - compiler: gcc
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-7']
-      env:
-        - CXX=g++-7
-        - CXXSTD=-std=c++17
-
-    - compiler: gcc
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-8']
-      env:
-        - CXX=g++-8
-
     - compiler: gcc
       addons:
         apt:
@@ -73,295 +19,60 @@ matrix:
           packages: ['g++-8']
       env:
         - CXX=g++-8
-        - CXXSTD=-std=c++17
-
-    - dist: precise
-      compiler: clang
-      env:
-        - CXX=clang++
-
-    - compiler: clang
-      addons:
-        apt:
-          packages: ['clang-3.5']
-      env:
-        - CXX=clang++-3.5
-
-    - compiler: clang
-      addons:
-        apt:
-          packages: ['clang-3.6']
-      env:
-        - CXX=clang++-3.6
-
-    - dist: precise
-      compiler: clang
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
-          packages: ['clang-3.7']
-      env:
-        - CXX=clang++-3.7
-
-    - compiler: clang
-      addons:
-        apt:
-          packages: ['clang-3.8']
-      env:
-        - CXX=clang++-3.8
 
     - compiler: clang
       addons:
         apt:
-          packages: ['clang-3.9']
+          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-5']
+          packages: ['clang-5.0', 'g++-7']
       env:
-        - CXX=clang++-3.9
-
-    - compiler: clang
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
-          packages: ['clang-4.0']
-      env:
-        - CXX=clang++-4.0
+        - CXX=clang++-5.0
 
     - compiler: clang
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
-          packages: ['clang-4.0']
+          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-6']
+          packages: ['clang-6.0', 'g++-7']
       env:
-        - CXX=clang++-4.0
-        - CXXSTD=-std=c++14
+        - CXX=clang++-6.0
 
     - compiler: clang
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
-          packages: ['clang-5.0']
+          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-7']
+          packages: ['clang-7', 'g++-7']
       env:
-        - CXX=clang++-5.0
+        - CXX=clang++-7
 
     - compiler: clang
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
-          packages: ['clang-6.0']
+          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
+          packages: ['clang-8', 'g++-8']
       env:
-        - CXX=clang++-6.0
+        - CXX=clang++-8
 
     - compiler: clang
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
-          packages: ['clang-6.0']
+          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
+          packages: ['clang-8', 'g++-8']
       env:
-        - CXX=clang++-6.0
+        - CXX=clang++-8
         - CPPFLAGS=-fms-extensions
 
-    - compiler: clang
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
-          packages: ['clang-6.0']
-      env:
-        - CXX=clang++-6.0
-        - CXXSTD=-std=c++17
-
     - os: osx
-      osx_image: xcode6.4
-      compiler: clang
-      env:
-        - CXX=clang++
-
-    - os: osx
-      osx_image: xcode7.3
-      compiler: clang
-      env:
-        - CXX=clang++
-
-    - os: osx
-      osx_image: xcode8.3
+      osx_image: xcode9.4
       compiler: clang
       env:
         - CXX=clang++
 
     - os: osx
-      osx_image: xcode9.4
+      osx_image: xcode10.2
       compiler: clang
       env:
         - CXX=clang++
 
-    - language: android
-      jdk: openjdk8
-      android:
-        components:
-          - tools
-          - platform-tools
-          - build-tools-23.0.3
-          - extra-android-support
-          - extra-android-m2repository
-          - android-19
-          - sys-img-armeabi-v7a-android-19
-          # Unfortunately travis uses the old android sdk tool instead of the new sdkmanager.
-          # In this deprecated android sdk tool there is no ndk-bundle or cmake package!
-        licenses:
-          - '.+'
-      before_install:
-        # Install NDK and cmake via android sdkmanager. Unfortunately to acknowledge the licenses
-        # takes a while. Looks like the "echo y" solution is not working. Needs improvement!
-        - export TERM=dumb
-        - touch ~/.android/repositories.cfg
-        - mkdir -p /usr/local/android-sdk/licenses
-        - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > /usr/local/android-sdk/licenses/android-sdk-license
-        - echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> /usr/local/android-sdk/licenses/android-sdk-license
-        # Install NDK and cmake via android sdkmanager.
-        - /usr/local/android-sdk/tools/bin/sdkmanager --update > /dev/null
-        - echo "y" | /usr/local/android-sdk/tools/bin/sdkmanager "emulator" "ndk-bundle" "cmake;3.6.4111459" > /dev/null
-      before_script:
-        - export TERM=dumb
-        - export _NO_CHECK_SIGNATURE=true
-        - echo no | /usr/local/android-sdk/tools/bin/avdmanager create avd -n test -k "system-images;android-19;default;armeabi-v7a"
-        - /usr/local/android-sdk/emulator/emulator -avd test -no-audio -no-window -dns-server 8.8.8.8 &
-        - android-wait-for-emulator || android-wait-for-emulator
-        - /usr/local/android-sdk/platform-tools/adb shell input keyevent 82 &
-      script:
-        # Using the ninja build command. Is much faster then make build command.
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-19 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DPEGTL_BUILD_EXAMPLES=OFF
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build . --target all
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest --output-on-failure
-
-
-    - language: android
-      jdk: openjdk8
-      android:
-        components:
-          - tools
-          - platform-tools
-          - build-tools-23.0.3
-          - extra-android-support
-          - extra-android-m2repository
-          - android-22
-          - sys-img-armeabi-v7a-android-22
-          # Unfortunately travis uses the old android sdk tool instead of the new sdkmanager.
-          # In this deprecated android sdk tool there is no ndk-bundle or cmake package!
-        licenses:
-          - '.+'
-      before_install:
-        # Install NDK and cmake via android sdkmanager. Unfortunately to acknowledge the licenses
-        # takes a while. Looks like the "echo y" solution is not working. Needs improvement!
-        - export TERM=dumb
-        - touch ~/.android/repositories.cfg
-        - mkdir -p /usr/local/android-sdk/licenses
-        - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > /usr/local/android-sdk/licenses/android-sdk-license
-        - echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> /usr/local/android-sdk/licenses/android-sdk-license
-        # Install NDK and cmake via android sdkmanager.
-        - /usr/local/android-sdk/tools/bin/sdkmanager --update > /dev/null
-        - echo "y" | /usr/local/android-sdk/tools/bin/sdkmanager "emulator" "ndk-bundle" "cmake;3.6.4111459" > /dev/null
-      before_script:
-        - export TERM=dumb
-        - export _NO_CHECK_SIGNATURE=true
-        - echo no | /usr/local/android-sdk/tools/bin/avdmanager create avd -n test -k "system-images;android-22;default;armeabi-v7a"
-        - /usr/local/android-sdk/emulator/emulator -avd test -no-audio -no-window -dns-server 8.8.8.8 &
-        - android-wait-for-emulator || android-wait-for-emulator
-        - /usr/local/android-sdk/platform-tools/adb shell input keyevent 82 &
-      script:
-        # Using the ninja build command. Is much faster then make build command.
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-22 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DPEGTL_BUILD_EXAMPLES=OFF
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build . --target all
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest --output-on-failure
-
-    - language: android
-      jdk: openjdk8
-      android:
-        components:
-          - tools
-          - platform-tools
-          - build-tools-23.0.3
-          - extra-android-support
-          - extra-android-m2repository
-          - android-23
-          # Unfortunately travis uses the old android sdk tool instead of the new sdkmanager.
-          # In this deprecated android sdk tool there is no ndk-bundle or cmake package!
-        licenses:
-          - '.+'
-      before_install:
-        # Install NDK and cmake via android sdkmanager. Unfortunately to acknowledge the licenses
-        # takes a while. Looks like the "echo y" solution is not working. Needs improvement!
-        - export TERM=dumb
-        - touch ~/.android/repositories.cfg
-        - mkdir -p /usr/local/android-sdk/licenses
-        - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > /usr/local/android-sdk/licenses/android-sdk-license
-        - echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> /usr/local/android-sdk/licenses/android-sdk-license
-        # Install NDK and cmake via android sdkmanager.
-        - /usr/local/android-sdk/tools/bin/sdkmanager --update > /dev/null
-        - echo "y" | /usr/local/android-sdk/tools/bin/sdkmanager "emulator" "ndk-bundle" "cmake;3.6.4111459" "system-images;android-23;google_apis;armeabi-v7a" > /dev/null
-      before_script:
-        - export TERM=dumb
-        - export _NO_CHECK_SIGNATURE=true
-        - echo no | /usr/local/android-sdk/tools/bin/avdmanager create avd -n test -k "system-images;android-23;google_apis;armeabi-v7a"
-        - /usr/local/android-sdk/emulator/emulator -avd test -no-audio -no-window -dns-server 8.8.8.8 &
-        - android-wait-for-emulator || android-wait-for-emulator
-        - /usr/local/android-sdk/platform-tools/adb shell input keyevent 82 &
-      script:
-        # Using the ninja build command. Is much faster then make build command.
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-23 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DPEGTL_BUILD_EXAMPLES=OFF
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build . --target all
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest --output-on-failure
-
-    - language: android
-      jdk: openjdk8
-      android:
-        components:
-          - tools
-          - platform-tools
-          - build-tools-23.0.3
-          - extra-android-support
-          - extra-android-m2repository
-          - android-24
-          - sys-img-armeabi-v7a-android-24
-          # Unfortunately travis uses the old android sdk tool instead of the new sdkmanager.
-          # In this deprecated android sdk tool there is no ndk-bundle or cmake package!
-        licenses:
-          - '.+'
-      before_install:
-        # Install NDK and cmake via android sdkmanager. Unfortunately to acknowledge the licenses
-        # takes a while. Looks like the "echo y" solution is not working. Needs improvement!
-        - export TERM=dumb
-        - touch ~/.android/repositories.cfg
-        - mkdir -p /usr/local/android-sdk/licenses
-        - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > /usr/local/android-sdk/licenses/android-sdk-license
-        - echo -e "\nd56f5187479451eabf01fb78af6dfcb131a6481e" >> /usr/local/android-sdk/licenses/android-sdk-license
-        # Install NDK and cmake via android sdkmanager.
-        - /usr/local/android-sdk/tools/bin/sdkmanager --update > /dev/null
-        - echo "y" | /usr/local/android-sdk/tools/bin/sdkmanager "emulator" "ndk-bundle" "cmake;3.6.4111459" > /dev/null
-      before_script:
-        - export TERM=dumb
-        - export _NO_CHECK_SIGNATURE=true
-        - echo no | /usr/local/android-sdk/tools/bin/avdmanager create avd -n test -k "system-images;android-24;default;armeabi-v7a"
-        - /usr/local/android-sdk/emulator/emulator -avd test -no-audio -no-window -dns-server 8.8.8.8 &
-        - android-wait-for-emulator || android-wait-for-emulator
-        - /usr/local/android-sdk/platform-tools/adb shell input keyevent 82 &
-      script:
-        # Using the ninja build command. Is much faster then make build command.
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake -G'Android Gradle - Ninja' -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/android-sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-24 -DCMAKE_MAKE_PROGRAM=/usr/local/android-sdk/cmake/3.6.4111459/bin/ninja -DPEGTL_BUILD_EXAMPLES=OFF
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/cmake --build . --target all
-        - /usr/local/android-sdk/cmake/3.6.4111459/bin/ctest --output-on-failure
-
-    - compiler: gcc
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-7']
-      env:
-        - CXX=g++-7
-        - CXXFLAGS="-O0 --coverage"
-      before_script:
-        - pip install --user cpp-coveralls
-      script:
-        - make -kj3 check
-        - coveralls --gcov gcov-7 --gcov-options '\-lp' --exclude src
-
     - compiler: gcc
       addons:
         apt:
@@ -384,55 +95,66 @@ matrix:
     - compiler: clang
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
-          packages: ['clang-6.0']
+          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
+          packages: ['clang-8', 'g++-8']
       env:
-        - CXX=clang++-6.0
+        - CXX=clang++-8
         - CPPFLAGS=-fsanitize=undefined
 
     - compiler: clang
       sudo: true
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
-          packages: ['clang-6.0']
+          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
+          packages: ['clang-8', 'g++-8']
       env:
-        - CXX=clang++-6.0
+        - CXX=clang++-8
         - CPPFLAGS=-fsanitize=address
 
-    - compiler: gcc
+    - compiler: clang
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-8', 'valgrind']
+          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
+          packages: ['clang-8', 'clang-tidy-8', 'g++-8']
       env:
-        - CXX=g++-8
-        - SPECIAL=valgrind
+        - CXX=clang++-8
+        - CLANG_TIDY=clang-tidy-8
       script:
-        - make -kj3 valgrind
+        - "sed -i 's#namespace TAO_PEGTL_NAMESPACE#namespace tao::pegtl#g' $(find . -name '*.[hc]pp')"
+        - make -kj3 clang-tidy
+
+    - compiler: clang
+      addons:
+        apt:
+          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-8']
+          packages: ['clang-8', 'clang-tools-8', 'g++-8']
+      script:
+        - scan-build-8 --use-c++=clang++-8 --status-bugs make -kj3
 
     - compiler: gcc
       addons:
         apt:
           sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-8', 'cppcheck']
+          packages: ['g++-8', 'valgrind']
       env:
         - CXX=g++-8
-        - SPECIAL=cppcheck
+        - SPECIAL=valgrind
       script:
-        - make -kj3 cppcheck
+        - make -kj3 valgrind
 
-    - compiler: clang
+    - compiler: gcc
       addons:
         apt:
-          sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
-          packages: ['clang-6.0', 'clang-tidy-6.0']
+          sources: ['ubuntu-toolchain-r-test']
+          packages: ['g++-7']
       env:
-        - CXX=clang++-6.0
-        - CLANG_TIDY=clang-tidy-6.0
+        - CXX=g++-7
+        - CXXFLAGS="-O0 --coverage"
+      before_script:
+        - pip install --user cpp-coveralls
       script:
-        - "sed -i 's#TAO_PEGTL_NAMESPACE#pegtl#g' $(find . -name '*.[hc]pp')"
-        - make -kj3 clang-tidy
+        - make -kj3 check
+        - coveralls --gcov gcov-7 --gcov-options '\-lp' --exclude src
 
     - language: python
       python:
diff --git a/packages/PEGTL/CMakeLists.txt b/packages/PEGTL/CMakeLists.txt
index c355e7cfb804aa7da64055d1b24ebde39d40c781..410ec90d1380f6d0461ce48eecfedfd117b90412 100644
--- a/packages/PEGTL/CMakeLists.txt
+++ b/packages/PEGTL/CMakeLists.txt
@@ -1,69 +1,68 @@
-cmake_minimum_required (VERSION 3.3.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
 
-project (pegtl VERSION 2.7.1 LANGUAGES CXX)
+project(pegtl VERSION 3.0.0 LANGUAGES CXX)
+
+if(${PROJECT_NAME}_FOUND)
+  # Multiple versions of PEGTL can't co-exist
+  if(NOT ${PROJECT_NAME}_VERSION STREQUAL ${PROJECT_VERSION})
+    message(FATAL_ERROR "Multiple mismatched PEGTL versions")
+  endif()
+
+  # Only include if this is the first include
+  if(NOT ${PROJECT_NAME}_DIR STREQUAL "${PROJECT_BINARY_DIR}")
+    return()
+  endif()
+endif()
+
+# Keep track of pegtl version
+set(${PROJECT_NAME}_FOUND TRUE CACHE BOOL "" FORCE)
+set(${PROJECT_NAME}_VERSION "${PROJECT_VERSION}" CACHE STRING "" FORCE)
+set(${PROJECT_NAME}_DIR "${PROJECT_BINARY_DIR}" CACHE PATH "" FORCE)
+
+mark_as_advanced(${PROJECT_NAME}_FOUND)
+mark_as_advanced(${PROJECT_NAME}_VERSION)
+mark_as_advanced(${PROJECT_NAME}_DIR)
 
 # installation directories
-set (PEGTL_INSTALL_INCLUDE_DIR "include" CACHE STRING "The installation include directory")
-set (PEGTL_INSTALL_DOC_DIR "share/doc/tao/pegtl" CACHE STRING "The installation doc directory")
-set (PEGTL_INSTALL_CMAKE_DIR "share/pegtl/cmake" CACHE STRING "The installation cmake directory")
+set(PEGTL_INSTALL_INCLUDE_DIR "include" CACHE STRING "The installation include directory")
+set(PEGTL_INSTALL_DOC_DIR "share/doc/tao/pegtl" CACHE STRING "The installation doc directory")
+set(PEGTL_INSTALL_CMAKE_DIR "share/pegtl/cmake" CACHE STRING "The installation cmake directory")
 
 # define a header-only library
-add_library (pegtl INTERFACE)
-add_library (taocpp::pegtl ALIAS pegtl)
-target_include_directories (pegtl INTERFACE
+add_library(pegtl INTERFACE)
+add_library(taocpp::pegtl ALIAS pegtl)
+target_include_directories(pegtl INTERFACE
   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
   $<INSTALL_INTERFACE:${PEGTL_INSTALL_INCLUDE_DIR}>
 )
 
-# features required by the PEGTL
-target_compile_features (pegtl INTERFACE
-  cxx_alias_templates
-  cxx_auto_type
-  cxx_constexpr
-  cxx_decltype
-  cxx_default_function_template_args
-  cxx_defaulted_functions
-  cxx_delegating_constructors
-  cxx_deleted_functions
-  cxx_explicit_conversions
-  cxx_generalized_initializers
-  cxx_inheriting_constructors
-  cxx_inline_namespaces
-  cxx_noexcept
-  cxx_nonstatic_member_init
-  cxx_nullptr
-  cxx_range_for
-  cxx_rvalue_references
-  cxx_static_assert
-  cxx_strong_enums
-  cxx_template_template_parameters
-  cxx_trailing_return_types
-  cxx_uniform_initialization
-  cxx_variadic_macros
-  cxx_variadic_templates
-)
+# require C++17
+target_compile_features(pegtl INTERFACE cxx_std_17)
 
 # testing
-enable_testing ()
-option (PEGTL_BUILD_TESTS "Build test programs" ON)
-if (PEGTL_BUILD_TESTS)
-  add_subdirectory (src/test/pegtl)
-endif ()
+enable_testing()
+option(PEGTL_BUILD_TESTS "Build test programs" ON)
+if(PEGTL_BUILD_TESTS)
+  add_subdirectory(src/test/pegtl)
+endif()
 
 # examples
-option (PEGTL_BUILD_EXAMPLES "Build example programs" ON)
-if (PEGTL_BUILD_EXAMPLES)
-  add_subdirectory (src/example/pegtl)
-endif ()
+option(PEGTL_BUILD_EXAMPLES "Build example programs" ON)
+if(PEGTL_BUILD_EXAMPLES)
+  add_subdirectory(src/example/pegtl)
+endif()
+
+# Make package findable
+configure_file(cmake/dummy-config.cmake.in pegtl-config.cmake @ONLY)
 
 # install and export target
-install (TARGETS pegtl EXPORT pegtl-targets)
+install(TARGETS pegtl EXPORT pegtl-targets)
 
-install (EXPORT pegtl-targets
+install(EXPORT pegtl-targets
   FILE pegtl-config.cmake
   NAMESPACE taocpp::
   DESTINATION ${PEGTL_INSTALL_CMAKE_DIR}
 )
 
-install (DIRECTORY include/ DESTINATION ${PEGTL_INSTALL_INCLUDE_DIR})
-install (FILES LICENSE DESTINATION ${PEGTL_INSTALL_DOC_DIR})
+install(DIRECTORY include/ DESTINATION ${PEGTL_INSTALL_INCLUDE_DIR})
+install(FILES LICENSE DESTINATION ${PEGTL_INSTALL_DOC_DIR})
diff --git a/packages/PEGTL/LICENSE b/packages/PEGTL/LICENSE
index 84bd84ac18dd866adf34571907f10682b4318a62..378c177b917908b7b86e7d4a499cfed714215157 100644
--- a/packages/PEGTL/LICENSE
+++ b/packages/PEGTL/LICENSE
@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) 2007-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2007-2019 Dr. Colin Hirsch and Daniel Frey
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/packages/PEGTL/Makefile b/packages/PEGTL/Makefile
index edf34b2f06fd9594a3ba757beefea4c6d54b88d5..983c806fa07b1a5bdd1f68bf5a767f2c6d55cda6 100644
--- a/packages/PEGTL/Makefile
+++ b/packages/PEGTL/Makefile
@@ -1,5 +1,5 @@
 # The Art of C++
-# Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+# Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 # Please see LICENSE for license or visit https://github.com/taocpp/PEGTL
 
 .SUFFIXES:
@@ -16,11 +16,11 @@ endif
 
 # For Darwin (Mac OS X / macOS) we assume that the default compiler
 # clang++ is used; when $(CXX) is some version of g++, then
-# $(CXXSTD) has to be set to -std=c++11 (or newer) so
+# $(CXXSTD) has to be set to -std=c++17 (or newer) so
 # that -stdlib=libc++ is not automatically added.
 
 ifeq ($(CXXSTD),)
-CXXSTD := -std=c++11
+CXXSTD := -std=c++17
 ifeq ($(UNAME_S),Darwin)
 CXXSTD += -stdlib=libc++
 endif
@@ -34,11 +34,13 @@ CXXFLAGS ?= -Wall -Wextra -Wshadow -Werror -O3 $(MINGW_CXXFLAGS)
 
 CLANG_TIDY ?= clang-tidy
 
-HEADERS := $(filter-out include/tao/pegtl/internal/endian_win.hpp include/tao/pegtl/internal/file_mapper_win32.hpp,$(shell find include -name '*.hpp')) $(filter-out src/test/pegtl/main.hpp,$(shell find src -name '*.hpp'))
+HEADERS := $(shell find include -name '*.hpp')
 SOURCES := $(shell find src -name '*.cpp')
 DEPENDS := $(SOURCES:%.cpp=build/%.d)
 BINARIES := $(SOURCES:%.cpp=build/%)
 
+CLANG_TIDY_HEADERS := $(filter-out include/tao/pegtl/internal/endian_win.hpp include/tao/pegtl/internal/file_mapper_win32.hpp,$(HEADER)) $(filter-out src/test/pegtl/main.hpp,$(shell find src -name '*.hpp'))
+
 UNIT_TESTS := $(filter build/src/test/%,$(BINARIES))
 
 .PHONY: all
@@ -59,23 +61,14 @@ build/%.valgrind: build/%
 valgrind: $(UNIT_TESTS:%=%.valgrind)
 	@echo "All $(words $(UNIT_TESTS)) valgrind tests passed."
 
-build/%.cppcheck: %.hpp
-	cppcheck --error-exitcode=1 --inconclusive --force --std=c++11 $<
-	@mkdir -p $(@D)
-	@touch $@
-
-.PHONY: cppcheck
-cppcheck: $(HEADERS:%.hpp=build/%.cppcheck)
-	@echo "All $(words $(HEADERS)) cppcheck tests passed."
-
 build/%.clang-tidy: %
-	$(CLANG_TIDY) -extra-arg "-Iinclude" -extra-arg "-std=c++11" -checks=*,-fuchsia-*,-google-runtime-references,-google-runtime-int,-google-readability-todo,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay,-hicpp-signed-bitwise,-modernize-raw-string-literal,-misc-sizeof-expression -warnings-as-errors=* $< 2>/dev/null
+	$(CLANG_TIDY) -extra-arg "-Iinclude" -extra-arg "-std=c++17" -checks=*,-fuchsia-*,-google-runtime-references,-google-runtime-int,-google-readability-todo,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-*-magic-numbers,-cppcoreguidelines-non-private-member-variables-in-classes,-cppcoreguidelines-macro-usage,-hicpp-no-array-decay,-hicpp-signed-bitwise,-modernize-raw-string-literal,-misc-sizeof-expression,-misc-non-private-member-variables-in-classes,-bugprone-sizeof-expression,-bugprone-exception-escape -warnings-as-errors=* $< 2>/dev/null
 	@mkdir -p $(@D)
 	@touch $@
 
 .PHONY: clang-tidy
-clang-tidy: $(HEADERS:%=build/%.clang-tidy) $(SOURCES:%=build/%.clang-tidy)
-	@echo "All $(words $(HEADERS) $(SOURCES)) clang-tidy tests passed."
+clang-tidy: $(CLANG_TIDY_HEADERS:%=build/%.clang-tidy) $(SOURCES:%=build/%.clang-tidy)
+	@echo "All $(words $(CLANG_TIDY_HEADERS) $(SOURCES)) clang-tidy tests passed."
 
 .PHONY: clean
 clean:
@@ -89,6 +82,32 @@ build/%.d: %.cpp Makefile
 build/%: %.cpp build/%.d
 	$(CXX) $(CXXSTD) -Iinclude $(CPPFLAGS) $(CXXFLAGS) $< -o $@
 
+.PHONY: amalgamate
+amalgamate: build/amalgamated/pegtl.hpp
+
+build/amalgamated/pegtl.hpp: $(HEADERS)
+	@mkdir -p $(@D)
+	@rm -rf build/include
+	@cp -a include build/
+	@rm -rf build/include/tao/pegtl/contrib/icu
+	@sed -i -e 's%^#%//#%g' $$(find build/include -name '*.hpp')
+	@sed -i -e 's%^//#include "%#include "%g' $$(find build/include -name '*.hpp')
+	@for i in $$(find build/include -name '*.hpp'); do echo "#pragma once" >tmp.out; echo "#line 1" >>tmp.out; cat $$i >>tmp.out; mv tmp.out $$i; done
+	@echo '#include "tao/pegtl.hpp"' >build/include/amalgamated.hpp
+	@echo '#include "tao/pegtl/analyze.hpp"' >>build/include/amalgamated.hpp
+	@( cd build/include ; for i in tao/pegtl/contrib/*.hpp; do echo "#include \"$$i\""; done ) >>build/include/amalgamated.hpp
+	@echo -e "/*\n\nWelcome to the Parsing Expression Grammar Template Library (PEGTL)." >$@
+	@echo -e "See https://github.com/taocpp/PEGTL/ for more information, documentation, etc.\n" >>$@
+	@echo -e "The library is licensed as follows:\n" >>$@
+	@cat LICENSE >>$@
+	@echo -e "\n*/\n" >>$@
+	@( cd build/include ; g++ -E -C -nostdinc amalgamated.hpp ) >>$@
+	@sed -i -e 's%^//#%#%g' $@
+	@sed -i -e 's%^# \([0-9]* "[^"]*"\).*%#line \1%g' $@
+	@sed -i -e 's%^// Copyright.*%%g' $@
+	@sed -i -e 's%^// Please.*%%g' $@
+	@echo "Generated/updated $@ successfully."
+
 ifeq ($(findstring $(MAKECMDGOALS),clean),)
 -include $(DEPENDS)
 endif
diff --git a/packages/PEGTL/README.md b/packages/PEGTL/README.md
index 150ea9e90b6c979b532c6413a37a875063c9c254..d9798a2260477fd6edf914fae582485250fce3e3 100644
--- a/packages/PEGTL/README.md
+++ b/packages/PEGTL/README.md
@@ -4,15 +4,16 @@
 [![Download](https://api.bintray.com/packages/taocpp/public-conan/pegtl%3Ataocpp/images/download.svg)](https://bintray.com/taocpp/public-conan/pegtl%3Ataocpp/_latestVersion)
 [![TravisCI](https://travis-ci.org/taocpp/PEGTL.svg?branch=master)](https://travis-ci.org/taocpp/PEGTL)
 [![AppVeyor](https://ci.appveyor.com/api/projects/status/pa5sbnw68tu650aq/branch/master?svg=true)](https://ci.appveyor.com/project/taocpp/PEGTL)
-[![Doozer.io](https://doozer.io/badge/taocpp/PEGTL/buildstatus/master)](https://doozer.io/user/taocpp/PEGTL)
 [![Coverage](https://coveralls.io/repos/github/taocpp/PEGTL/badge.svg?branch=master)](https://coveralls.io/github/taocpp/PEGTL)
+[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/taocpp/PEGTL.svg)](https://lgtm.com/projects/g/taocpp/PEGTL/context:cpp)
 
-The Parsing Expression Grammar Template Library (PEGTL) is a zero-dependency C++11 header-only parser combinator library for creating parsers according to a [Parsing Expression Grammar](http://en.wikipedia.org/wiki/Parsing_expression_grammar) (PEG).
+The Parsing Expression Grammar Template Library (PEGTL) is a zero-dependency C++ header-only parser combinator library for creating parsers according to a [Parsing Expression Grammar](http://en.wikipedia.org/wiki/Parsing_expression_grammar) (PEG).
 
 ## Documentation
 
-* [Version 2.x Documentation](doc/README.md)
-* [Version 1.3 Documentation](https://github.com/taocpp/PEGTL/blob/1.3.x/doc/README.md)
+* [Version 3.x](doc/README.md) (requires C++17)
+* [Version 2.x](https://github.com/taocpp/PEGTL/blob/2.x/doc/README.md) (requires C++11)
+* [Version 1.x](https://github.com/taocpp/PEGTL/blob/1.x/doc/README.md) (requires C++11)
 
 ## Introduction
 
@@ -25,13 +26,15 @@ Here is an example of how a PEG grammar rule is implemented as C++ class with th
 // PEG rule for integers consisting of a non-empty
 // sequence of digits with an optional sign:
 
-// integer ::= ( '+' / '-' )? digit+
+// sign ::= '+' / '-'
+// integer ::= sign? digit+
 
 // The same parsing rule implemented with the PEGTL:
 
 using namespace tao::pegtl;
 
-struct integer : seq< opt< one< '+', '-' > >, plus< digit > > {};
+struct sign : one< '+', '-' > {};
+struct integer : seq< opt< sign >, plus< digit > > {};
 ```
 
 PEGs are superficially similar to Context-Free Grammars (CFGs), however the more deterministic nature of PEGs gives rise to some very important differences.
@@ -57,74 +60,38 @@ Each commit is automatically tested with multiple architectures, operating syste
 
 * Windows
 
-  * Visual Studio 2015 (x86, x64)
   * Visual Studio 2017 (x86, x64)
-  * MinGW (i686), GCC 5.x
-  * MinGW-w64 (i686), GCC 5.x, 6.x
-  * MinGW-w64 (x86_64), GCC 6.x
 
-* Mac OS X / macOS (using libc++)
+* macOS (using libc++)
 
-  * Mac OS X 10.10, Xcode 6.4
-  * Mac OS X 10.11, Xcode 7.3
-  * macOS 10.12, Xcode 8.3
   * macOS 10.13, Xcode 9.4
+  * macOS 10.14, Xcode 10.2
 
-* Linux (using libstdc++)
+* Ubuntu 16.04 LTS (using libstdc++)
 
-  * Debian 8 (i386), GCC 4.9
-  * Ubuntu 12.04 LTS (amd64), Clang 3.4, 3.7
-  * Ubuntu 14.04 LTS (amd64), GCC 4.8, 4.9, 5.x, 6.x, 7.x, 8.x
-  * Ubuntu 14.04 LTS (amd64), Clang 3.5, 3.6, 3.8, 3.9, 4.x, 5.x, 6.x
-  * Ubuntu 14.04 LTS (i386, amd64), GCC 4.8
-  * Ubuntu 16.04 LTS (i386, amd64, armhf, arm64), GCC 5.x
-  * Fedora 24 (x86_64), GCC 6.x
-  * Fedora 24 (x86_64), Clang 3.8
+  * GCC 7.x, 8.x
+  * Clang 5.x, 6.x, 7.x, 8.x
 
-* Android
-
-  * Android 4.4 "KitKat" (API level 19)
-  * Android 5.1 "Lollipop" (API level 22)
-  * Android 6.0 "Marshmellow" (API level 23)
-  * Android 7.0 "Nougat" (API level 24)
-
-Additionally, each commit is checked with GCC's and Clang's sanitizers, as well as [`valgrind`](http://valgrind.org/)
-and [`clang-tidy`](http://clang.llvm.org/extra/clang-tidy/). Code coverage is automatically measured and the unit tests
-cover 100% of the core library code (for releases).
+Additionally, each commit is checked with Clang's [Static Analyzer](https://clang-analyzer.llvm.org/), GCC's and Clang's [sanitizers](https://github.com/google/sanitizers), [`clang-tidy`](http://clang.llvm.org/extra/clang-tidy/), and [`valgrind`](http://valgrind.org/).
+Code coverage is automatically measured and the unit tests cover 100% of the core library code (for releases).
 
 [Releases](https://github.com/taocpp/PEGTL/releases) are done in accordance with [Semantic Versioning](http://semver.org/).
 Incompatible API changes are *only* allowed to occur between major versions.
 For details see the [changelog](doc/Changelog.md).
 
-## Thank You
-
-* Christopher Diggins and the YARD parser for the general idea.
-* George Makrydakis for the [inspiration](https://github.com/irrequietus/typestring) to `TAO_PEGTL_STRING`.
-* Johannes Overmann for his invaluable [`streplace`](https://code.google.com/p/streplace/) command-line tool.
-* Jörg-Christian Böhme for improving the Android CI build.
-* Kai Wolf for help with CMake.
-* Kenneth Geisshirt for Android compatibility and Android CI.
-* Kuzma Shapran for EOL testing and fixes.
-* Michael Becker for help with CMake.
-* Paul Le Roux for CMake improvements and Conan support.
-* Paulo Custodio for Windows-related fixes.
-* Sam Hocevar for contributing Visual Studio 2015 compatibility.
-* Stephan Beal for the bug reports, suggestions and discussions.
-* Stuart Dootson for `mmap_input<>` support on Windows.
-* Sven Johannsen for help with CMake.
-* Zhihao Yuan for fixing several warnings when compiling with Visual Studio 2015.
-
 ## Contact
 
 The PEGTL is part of [The Art of C++](https://taocpp.github.io/).
 
-For questions and suggestions regarding the PEGTL, success or failure stories, and any other kind of feedback, please feel free to contact the authors at `taocpp(at)icemx.net`.
+We [are grateful](doc/Thank-You.md) for all support and contributions.
+
+For questions and suggestions regarding the PEGTL, success or failure stories, and any other kind of feedback, please feel free to open an issue or a PR on GitHub or contact the authors at `taocpp(at)icemx.net`.
 
 ## License
 
 The PEGTL is certified [Open Source](http://www.opensource.org/docs/definition.html) software. It may be used for any purpose, including commercial purposes, at absolutely no cost. It is distributed under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.html) reproduced here.
 
-> Copyright (c) 2007-2018 Dr. Colin Hirsch and Daniel Frey
+> Copyright (c) 2007-2019 Dr. Colin Hirsch and Daniel Frey
 >
 > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 >
diff --git a/packages/PEGTL/cmake/dummy-config.cmake.in b/packages/PEGTL/cmake/dummy-config.cmake.in
new file mode 100644
index 0000000000000000000000000000000000000000..3374d615f1e0c65342f79b402943957a8d307afe
--- /dev/null
+++ b/packages/PEGTL/cmake/dummy-config.cmake.in
@@ -0,0 +1,5 @@
+# Dummy config file
+# When a dependency is added with add_subdirectory, but searched with find_package
+
+# Redirect to the directory added with add_subdirectory
+add_subdirectory(@PROJECT_SOURCE_DIR@ @PROJECT_BINARY_DIR@)
diff --git a/packages/PEGTL/conanfile.py b/packages/PEGTL/conanfile.py
index 78036adcadb53acf82b3225121d3f9572481f68d..39ae05aa1d9680c3f913fc3bde115b71ac924dce 100644
--- a/packages/PEGTL/conanfile.py
+++ b/packages/PEGTL/conanfile.py
@@ -4,13 +4,15 @@ from conans import ConanFile, CMake
 
 class PEGTLConan(ConanFile):
     name = "pegtl"
-    description = "C++11 header-only parser combinator library for creating PEG parsers"
+    description = "C++ header-only parser combinator library for creating PEG parsers"
     homepage = "https://github.com/taocpp/PEGTL"
+    topics = ("conan", "taocpp", "pegtl", "peg", "grammar", "parsing")
     url = homepage
     license = "MIT"
     author = "taocpp@icemx.net"
     exports = "LICENSE"
-    exports_sources = "include/*", "CMakeLists.txt"
+    exports_sources = "cmake/*", "include/*", "CMakeLists.txt"
+    settings = "build_type", "compiler", "os", "arch"
     generators = "cmake"
     no_copy_source = True
 
diff --git a/packages/PEGTL/doc/Actions-and-States.md b/packages/PEGTL/doc/Actions-and-States.md
index 0b114929781f4e136209fdf9f2c27b7108bf6e31..0f65e55935b025b46396b238b16f86ce960a124f 100644
--- a/packages/PEGTL/doc/Actions-and-States.md
+++ b/packages/PEGTL/doc/Actions-and-States.md
@@ -1,119 +1,169 @@
 # Actions and States
 
-Parsing, i.e. matching an input with a grammar rule, by itself only indicates whether (a portion of) the input is valid according to the grammar.
-In order to do something useful with the input, it is usually necessary to attach user-defined *actions* to one or more rules.
-An action is *applied* whenever the rule to which it is attached succeeds.
-Applying an action means that its static `apply()` or `apply0()`-method is called.
-The first argument to an `apply()` method is always an object that represents the portion of the input consumed by the successful match of the rule.
-An action's `apply()` or `apply0()`-method can either return `void`, or a `bool`.
+In its most simple form, a parsing run only returns whether (a portion of) the input matches the grammar.
+To actually do something useful during a parsing run it is necessary to attach (user-defined) *actions* to one or more grammar rules.
+
+Actions are essentially functions that are called during the parsing run whenever the rule they are attached to successfully matched.
+When an action is *applied*, the corresponding function receives the *states*, an arbitrary list of (user-defined) objects, as arguments.
 
 ## Contents
 
-* [Actions](#actions)
-  * [Apply0](#apply0)
-  * [Apply](#apply)
+* [Overview](#overview)
+* [Example](#example)
 * [States](#states)
-* [Action Specialisation](#action-specialisation)
+* [Apply](#apply)
+* [Apply0](#apply0)
+* [Inheriting](#inheriting)
+* [Specialising](#specialising)
 * [Changing Actions](#changing-actions)
+  * [Via Rules](#via-rules)
+  * [Via Actions](#via-actions)
 * [Changing States](#changing-states)
-  * [No Switching](#no-switching)
-  * [Intrusive Switching](#intrusive-switching)
-  * [External Switching](#external-switching)
+  * [Via Rules](#via-rules-1)
+  * [Via Actions](#via-actions-1)
+* [Changing Actions and States](#changing-actions-and-states)
+* [Match](#match)
+* [Nothing](#nothing)
+* [Troubleshooting](#troubleshooting)
+  * [Boolean Return](#boolean-return)
+  * [State Mismatch](#state-mismatch)
 * [Legacy Actions](#legacy-actions)
 
-## Actions
+## Overview
+
+Actions are implemented as static member functions called `apply()` or `apply0()` of specialisations of custom class templates (which is not quite as difficult as it sounds).
+
+States are additional function arguments to `tao::pegtl::parse()` that are forwarded to all actions.
+
+To use actions during a parsing run they first need to be implemented.
+
+* Define a custom action class template.
+* Specialise the action class template for every rule for which a function is to be called and
+  * either implement an `apply()` or `apply0()` static member function,
+  * or derive from a class that implements the desired function.
 
-Actions are implemented as static `apply()` or `apply0()`-method of specialisations of custom class templates (which is not quite as difficult as it sounds).
-First the default- or base-case of the action class template has to be defined:
+The very first step, defining a custom action class template, usually looks like this.
 
 ```c++
 template< typename Rule >
-struct my_actions
+struct my_action
    : tao::pegtl::nothing< Rule > {};
 ```
 
-Inheriting from `tao::pegtl::nothing< Rule >` indicates to the PEGTL that no action is attached to `Rule`, i.e. that no `apply()` or `apply0()`-method should be called for successful matches of `Rule`.
+Instantiations of the primary template for `my_action< Rule >` inherit from `tao::pegtl::nothing< Rule >` to indicate that, by default, neither `my_action< Rule >::apply()` nor `my_action< Rule >::apply0()` are to be called when `Rule` is successfully matched during a parsing run, or, in short, that no action is to be applied to `Rule`.
 
-To attach an action to `Rule`, this class template has to be specialised for `Rule` with two important properties.
+You then specialise the action class template for those rules that you *do* want to call an action on.
+An example for a simple action for a specific state might look like this.
 
-1. The specialisation *must not* inherit from `tao::pegtl::nothing< Rule >`.
+```c++
+template<>
+struct my_action< my_rule >
+{
+   template< typename Input >
+   static void apply( const Input& in, my_state& s )
+   {
+      // ... implement
+   }
+};
+```
 
-2. An *appropriate* static `apply()` or `apply0()`-method has to be implemented.
+Then the parsing run needs to be set up with the actions and any required states.
+For this, the initial action can be passed as the second template parameter and the initial states can be passed as additional arguments to `tao::pegtl::parse()`.
 
-The PEGTL will auto-detect whether an action, i.e. a specialisation of an action class template, contains an appropriate `apply()` or `apply0()` function, and whether it returns `void` or `bool`.
-It will fail to compile when both `apply()` and `apply0()` are found.
+In order to manage the complexity in larger parsers and/or compose multiple grammars that each bring their own actions which in turn expect certain states, it can be useful to [change the actions](#changing-actions) and/or [change the states](#changing-states) within a parsing run.
 
-### Apply0
+## Example
 
-In cases where the matched part of the input is not required, an action method named `apply0()` is implemented.
-This allows for some optimisations compared to the `apply()` method which receives the matched input as first argument.
+Here is a very short example that shows the basic way to put together a parsing run with actions and states.
 
 ```c++
+// Define a simple grammar consisting of a single rule.
+struct my_grammar
+   : tao::pegtl::star< tao::pegtl::any > {};
+
+// Primary action class template.
+template< typename Rule >
+struct my_action
+   : tao::pegtl::nothing< Rule > {};
+
+// Specialise the action class template.
 template<>
-struct my_actions< tao::pegtl::plus< tao::pegtl::alpha > >
+struct my_action< tao::pegtl::any >
 {
-   static void apply0( /* all the states */ )
+   // Implement an apply() function that will be called by
+   // the PEGTL every time tao::pegtl::any matches during
+   // the parsing run.
+   template< typename Input >
+   static void apply( const Input& in, std::string& out )
    {
-      // Called whenever a call to tao::pegtl::plus< tao::pegtl::alpha >
-      // in the grammar succeeds.
+      // Get the portion of the original input that the
+      // rule matched this time as string and append it
+      // to the result string.
+      out += in.string();
    }
+};
 
-   // OR ALTERNATIVELY
+template< typename Input >
+std::string as_string( Input& in )
+{
+   // Set up the states, here a single std::string as that is
+   // what our action requires as additional function argument.
+   std::string out;
 
-   static bool apply0( /* all the states */ )
-   {
-      // Called whenever a call to tao::pegtl::plus< tao::pegtl::alpha >
-      // in the grammar succeeds.
-      return // see below
-   }
+   // Start the parsing run with our grammar, action and state.
+   tao::pegtl::parse< my_grammar, my_action >( in, out );
+
+   // Do something with the result.
+   return out;
 }
 ```
 
-When the return type is `bool`, the action can determine whether matching the rule to which it was attached, and which already returned with success, should be retro-actively considered a (local) failure.
-For the overall parsing run, there is no difference between a rule or an attached action returning `false` (but of course the action is not called when the rule already returned `false`).
-When an action returns `false`, the PEGTL takes care of rewinding the input to where it was when the rule to which the action was attached started its (successful) match (which is unlike rules' `match()` methods that have to take care of rewinding themselves).
+All together the `as_string()` function is a convoluted way of turning an [input](Inputs-and-Parsing.md) into a `std::string` byte-by-byte.
 
-Note that actions returning `bool` are an advanced use case that should be used with caution.
-They prevent some internal optimisations, in particular when used with `apply0()`.
-They can also have weird effects on the semantics of a parsing run, for example `at< rule >` can succeed for the same input for which `rule` fails when there is a `bool`-action attached to `rule` that returns `false` (remembering that actions are disabled within an `at<>` combinator).
+In the following we will take a more in-depth look at states and `apply()` and `apply0()` before diving into more advanced subjects.
 
-### Apply
+## States
 
-When the action method is called `apply()`, it receives a const-reference to an instance of an input class as first argument.
+There is not much more to say about the states other than what has already been mentioned, namely that they are a list (colloquial list, not `std::list`) of objects that are
+
+* passed by the user as additional arguments to [`tao::pegtl::parse()`](Inputs-and-Parsing.md#parse-function), and then
+
+* passed by the PEGTL as additional arguments to all actions' `apply()` or `apply0()` static member functions.
+
+The additional arguments to `apply()` and `apply0()` can be chosen freely, however all actions must accept the same list of states since they are all called with the same arguments by default.
+
+States are not forwarded with "perfect forwarding" since r-value references don't make much sense when they will be used as action arguments many times.
+The `parse()` function still uses universal references to bind to the state arguments in order to allow temporary objects.
+
+## Apply
+
+As seen above, the actual functions that are called when an action is applied are static member functions named `apply()` of the specialisations of the action class template.
 
 ```c++
 template<>
-struct my_actions< tao::pegtl::plus< tao::pegtl::digit > >
+struct my_action< my_rule >
 {
    template< typename Input >
    static void apply( const Input& in, /* all the states */ )
    {
-      // Called whenever a call to tao::pegtl::plus< tao::pegtl::digit >
-      // in the grammar succeeds. The argument named 'in' represents the
-      // matched part of the input.
-   }
-
-   // OR ALTERNATIVELY
-
-   template< typename Input >
-   static bool apply( const Input& in, /* all the states */ )
-   {
-      // Called whenever a call to tao::pegtl::plus< tao::pegtl::digit >
-      // in the grammar succeeds. The argument named 'in' represents the
-      // matched part of the input.
-      return // see description for apply0() above
+      // Called whenever matching my_rule during a parsing run
+      // succeeds (and actions are not disabled). The argument
+      // named 'in' represents the matched part of the input.
+      // Can also return bool instead of void.
    }
 }
 ```
 
-The exact type of the input class passed to an action's `apply()`-method is not specified.
-It is currently best practice to "template over" the type of the input as shown above.
+The first argument is not the input used in the parsing run, but rather a separate object of distinct type that represents the portion of the input that the rule to which the action is attached just matched. The remaining arguments to `apply()` are the current state arguments.
 
-Actions can then assume that the input provides (at least) the following members.
-The `Input` template parameter is set to the class of the input used at the point in the parsing run where the action is applied.
+The exact type of the input class passed to `apply()` is not specified.
+It is best practice to "template over" the type of the input as shown above.
+
+Actions can then assume that the input provides (at least) the following interface.
+The `Input` template parameter is set to the class of the input used as input in the parsing run at the point where the action is applied.
 
 For illustrative purposes, we will assume that the input passed to `apply()` is of type `action_input`.
-Any resemblance to real classes is not a coincidence.
+Any resemblance to real classes is not a coincidence, see `include/tao/pegtl/internal/action_input.hpp`.
 
 ```c++
 template< typename Input >
@@ -129,163 +179,363 @@ public:
    const char* begin() const noexcept;  // Non-owning pointer!
    const char* end() const noexcept;  // Non-owning pointer!
 
-   std::string string() const;  // { return std::string( begin(), end() ); }
-
-   char peek_char( const std::size_t offset = 0 ) const noexcept;   // { return begin()[ offset ]; }
-   unsigned char peek_byte( const std::size_t offset = 0 ) const noexcept;  // As above with cast.
+   std::string string() const; // std::string( begin(), end() )
+   std::string_view string_view() const noexcept;  // std::string_view( begin(), size() )
 
-   pegtl::position position() const noexcept;  // Not efficient with LAZY inputs.
+   char peek_char( const std::size_t offset = 0 ) const noexcept;  // begin()[ offset ]
+   std::uint8_t peek_uint8( const std::size_t offset = 0 ) const noexcept;  // similar
 
-   const Input& input() const noexcept;  // The input from the parsing run.
+   pegtl::position position() const noexcept;  // Not efficient with tracking_mode::lazy.
 
+   const Input& input() const noexcept;
    const iterator_t& iterator() const noexcept;
 };
 ```
 
-Note that the `action_input` does **not** own the data it points to, it belongs to the original input used in the parsing run. Therefore **the validity of the pointed-to data might not extend (much) beyond the call to the `apply()`-method**!
+Note that `input()` returns the input from the parsing run which will be at the position after what has just been parsed, i.e. for an action input `ai` the assertion `ai.end() == ai.input().current()` will always hold true.
+Conversely `iterator()` returns a pointer or iterator to the beginning of the action input's data, i.e. where the successful match attempt to the rule the action called with the action input is attached to started.
 
-When the original input has tracking mode `IMMEDIATE`, the `iterator_t` returned by `action_input::iterator()` will contain the `byte`, `line` and `byte_in_line` counters corresponding to the beginning of the matched input represented by the `action_input`.
+More importantly the `action_input` does **not** own the data it points to, it belongs to the original input used in the parsing run.
+Therefore **the validity of the pointed-to data might not extend (much) beyond the call to `apply()`**!
 
-When the original input has tracking mode `LAZY`, then `action_input::position()` is not efficient because it calculates the line number etc. by scanning the complete original input from the beginning.
+When the original input has tracking mode `eager`, the `iterator_t` returned by `action_input::iterator()` will contain the `byte`, `line` and `byte_in_line` counters corresponding to the beginning of the matched input represented by the `action_input`.
+
+When the original input has tracking mode `lazy`, then `action_input::position()` is not efficient because it calculates the line number etc. by scanning the complete original input from the beginning
 
 Actions often need to store and/or reference portions of the input for after the parsing run, for example when an abstract syntax tree is generated.
 Some of the syntax tree nodes will contain portions of the input, for example for a variable name in a script language that needs to be stored in the syntax tree just as it occurs in the input data.
 
-The **default safe choice** is to copy the matched portions of the input data that are passed to an action by storing a deep copy of the data as `std::string`, as obtained by the input class' `string()` method, in the data structures built while parsing.
-
-## States
-
-In most applications, the actions also need some kind of data or user-defined (parser/action) *state* to operate on.
-Since the `apply()` and `apply0()`-methods are `static`, they do not have an instance of the class of which they are a member function available for this purpose.
-Therefore the *state(s)* are an arbitrary collection of objects that are
+The **default safe choice** is to copy the matched portions of the input data that are passed to an action by storing a deep copy of the data as `std::string`, as obtained by the input class' `string()` member function, in the data structures built while parsing.
 
-* passed by the user as additional arguments to the [`parse()`-function](Inputs-and-Parsing.md#parse-function) that starts a parsing run, and then
+When the return type of an action, i.e. its `apply()`, is `bool`, it can retro-actively let the library consider the attempt to match the rule to which the action is attached a (local) failure.
+For the overall parsing run, there is no difference between a rule returning `false` and an attached action returning `false`, however the action is only called when the rule returned `true`.
+When an action returns `false`, the library rewinds the input to where it was when the rule to which the action was attached started its successful match.
+This is unlike `match()` static member functions that have to rewind the input themselves.
 
-* passed by the PEGTL as additional arguments to all actions' `apply()` or `apply0()`-method.
+## Apply0
 
-In other words, the additional arguments to the `apply()` and `apply0()`-method can be chosen freely, however **all** actions **must** accept the same argument list since they are **all** called with the same arguments.
-
-For example, in a practical grammar the example from above might use a second argument to store the parsed sequence of digits somewhere.
+In cases where the matched part of the input is not required, an action can implement a static member function called `apply0()` instead of `apply()`.
+What changes is that `apply0()` will be called without an input as first argument, i.e. only with all the states.
 
 ```c++
-template<> struct my_actions< tao::pegtl::plus< tao::pegtl::digit > >
+template<>
+struct my_action< my_rule >
 {
-   template< typename Input >
-   static void apply( const Input& in,
-                      std::vector< std::string >& digit_strings )
+   static void apply0( /* all the states */ )
    {
-      digit_strings.push_back( in.string() );
+      // Called whenever matching my_rule during a parsing run
+      // succeeds (and actions are not disabled). Can also return
+      // bool instead of void.
    }
-}
+};
 ```
 
-If we then assume that our grammar `my_grammar` contains the rule `tao::pegtl::plus< tao::pegtl::digit >` somewhere, we can use
+Using `apply0()` is never necessary, it is "only" an optimisation with minor benefits at compile time, and potentially more noteworthy benefits at run time.
+We recommend implementing `apply0()` over `apply()` whenever both are viable.
+
+Though an infrequently used feature, `apply0()` can also return `bool` instead of `void`, just like `apply()` and with the same implications.
+
+## Inheriting
+
+We will use an example to show how to use existing actions via inheritance.
+The grammar for this example consists of a couple of simple rules.
 
 ```c++
-const std::string parsed_data = ...;
-std::vector< std::string > digit_strings;
+struct plain
+   : tao::pegtl::utf8::range< 0x20, 0x10FFFF > {};
 
-tao::pegtl::memory_input<> in( parsed_data, "data-source-name" );
-tao::pegtl::parse< my_grammar, my_actions >( in, digit_strings );
+struct escaped
+   : tao::pegtl::one< '\'', '"', '?', '\\', 'a', 'b', 'f', 'n', 'r', 't', 'v' > {};
+
+struct character
+   : tao::pegtl::if_must_else< tao::pegtl::one< '\\' >, escaped, plain > {};
+
+struct text
+   : tao::pegtl::must< tao::pegtl::star< character >, tao::pegtl::eof > {};
 ```
 
-to collect all `digit_strings` that were detected by the grammar, i.e. the vector will contain one string for every time that the `tao::pegtl::plus< tao::pegtl::digit >` rule was matched against the input.
+Our goal is for a parsing run with the `text` rule to produce a copy of the input where the backslash escape sequences are replaced by the character they represent.
+When the `plain` rule matches, the bytes of the matched UTF-8-encoded code-point can be appended to the result.
+When the `escaped` rule matches, the bytes corresponding to the character represented by the escape sequence must be appended to the result.
+This can be achieved with appropriate specialisations of `my_action` using some [contrib](Contrib-and-Examples.md#contrib) classes from `tao/pegtl/contrib/unescape.hpp`.
 
-Since the `parse()`-functions are variadic function templates, an arbitrary sequence of state arguments can be used.
+```c++
+template<>
+struct my_action< plain >
+   : tao::pegtl::append_all {};
 
-## Action Specialisation
+template<>
+struct my_action< escaped >
+   : tao::pegtl::unescape_c< escaped, '\'', '"', '?', '\\', '\a', '\b', '\f', '\n', '\r', '\t', '\v' > {};
+```
 
-The rule class for which the action class template is specialised *must* exactly match how the rule is defined and referenced in the grammar.
-For example given the rule
+For step three the [input for the parsing run](Inputs-and-Parsing.md) is set up as usual.
+In addition, the actions are passed as second template parameter, and a `std::string` as second argument to `parse()`.
+Here `unescaped` is the state that is required by the `append_all` and `unescape_c` actions; all additional arguments passed to `parse()` are forwarded to all actions.
 
 ```c++
-struct foo : tao::pegtl::plus< tao::pegtl::one< '*' > > {};
+std::string unescape( const std::string& escaped )
+{
+   std::string unescaped;
+   tao::pegtl::memory_input in( result, __FUNCTION__ );
+   tao::pegtl::parse< text, my_action >( in, unescaped );
+   return unescaped;
+}
 ```
 
-an action class template can be specialised for `foo` or for `tao::pegtl::one< '*' >`, but *not* for `tao::pegtl::plus< tao::pegtl::one< '*' > >` because that is not the rule class name whose `match()`-method is called.
+At the end of the parsing run, the complete unescaped string can be found in the aptly named variable `unescaped`.
 
-(The method is called on class `foo`, which happens to inherit `match()` from `tao::pegtl::plus< tao::pegtl::one< '*' > >`, however base classes are not taken into consideration by the C++ language when choosing a specialisation.)
+A more complete example of how to unescape strings can be found in `src/examples/pegtl/unescape.cpp`.
 
-While it is possible to specialize for `tao::pegtl::one< '*' >` in the above rule, any such specialization would also match any other occurrence in the grammar. It is therefore best practice to *always* specialize for explicitly named top-level rules.
+## Specialising
 
-To then use these actions in a parsing run, simply pass them as additional template parameter to one of the parser functions defined in `<tao/pegtl/parse.hpp>`.
+The rule class for which an action class template is specialised *must* exactly match the definition of the rule in the grammar.
+For example consider the following rule.
 
 ```c++
-tao::pegtl::parse< my_grammar, my_actions >( ... );
+struct foo
+   : tao::pegtl::plus< tao::pegtl::alpha > {};
 ```
 
-## Changing Actions
+Now an action class template can be specialised for `foo`, or for `tao::pegtl::alpha`, but *not* for `tao::pegtl::plus< tao::pegtl::alpha >`.
 
-Within a grammar, the action class template can be changed, enabled or disabled using the `action<>`, `enable<>` and `disable<>` rules.
+This because base classes are not taken into consideration by the C++ language when choosing a specialisation, which might be surprising when being used to pointer arguments to functions where conversions from pointer-to-derived to pointer-to-base are performed implicitly and silently.
 
-The following two lines effectively do the same thing, namely parse with `my_grammar` as top-level parsing rule without invoking actions (unless actions are enabled again somewhere within the grammar).
+So although the function called by the library to match `foo` is the inherited `tao::pegtl::plus< tao::pegtl::alpha >::match()`, the rule class is `foo` and the function known as `foo::match()`, wherefore an action needs to be specialised for `foo` instead of `tao::pegtl::plus< tao::pegtl::alpha >`.
+
+While it is possible to specialise the action class template for `tao::pegtl::alpha`, it might not be a good idea since the action would be applied for *all* occurrences of `tao::pegtl::alpha` in the grammar.
+To circumvent this issue a new name can be given to the `tao::pegtl::alpha`, a name that will not be "randomly" used in other places of the grammar.
 
 ```c++
-tao::pegtl::parse< my_grammar >( ... );
-tao::pegtl::parse< tao::pegtl::disable< my_grammar >, my_actions >( ... );
+struct bar
+   : tao::pegtl::alpha {};
+
+struct foo
+   : tao::pegtl::plus< bar > {};
 ```
 
-Similarly the following two lines both start parsing `my_grammar` with `my_actions` (again with the caveat that something might change somewhere in the grammar).
+Now an action class template can be specialised for `foo` and `bar`, but again *not* for `tao::pegtl::plus< bar >` or `tao::pegtl::alpha`.
+
+More precisely, it could be specialised for the latter two rules, but wouldn't ever be called unless these rules were used elsewhere in the grammar, a different kettle of fish.
+
+Note that this is also the reason why you should **not** use type aliases instead of inheritance when defining your grammars.
+
+## Changing Actions
+
+The action class template can be changed, and actions enabled or disabled, in ways beyond supplying, or not, an action to `tao::pegtl::parse()` at the start of a parsing run.
+
+### Via Rules
+
+The [`tao::pegtl::enable<>`](Rule-Reference.md#enable-r-) and [`tao::pegtl::disable<>`](Rule-Reference.md#disable-r-) rules behave just like [`seq<>`](Rule-Reference.md#seq-r-) but, without touching the current action, enable or disable calling of actions within their sub-rules, respectively.
+
+The [`tao::pegtl::action<>`](Rule-Reference.md#action-a-r-) rule also behaves similarly to [`seq<>`](Rule-Reference.md#seq-r-) but takes an action class template as first template parameter and, without enabling or disabling actions, uses its first template parameter as action for the sub-rules.
+
+The following two lines effectively do the same thing, namely parse with `my_grammar` as top-level parsing rule without invoking actions (unless actions are enabled again somewhere else).
 
 ```c++
-tao::pegtl::parse< my_grammar, my_actions >( ... );
-tao::pegtl::parse< tao::pegtl::action< my_actions, my_grammar > >( ... );
+tao::pegtl::parse< my_grammar >( ... );
+tao::pegtl::parse< tao::pegtl::disable< my_grammar >, my_action >( ... );
 ```
 
-In other words, `enable<>` and `disable<>` behave just like `seq<>` but enable or disable the calling of actions. `action<>` changes the active action class template, which must be supplied as first template parameter to `action<>`.
+Similarly the following two lines both start parsing `my_grammar` with `my_action` (again only unless something changes somewhere else).
 
-Note that `action<>` does *not* implicitly enable actions when they were previously explicitly disabled.
+```c++
+tao::pegtl::parse< my_grammar, my_action >( ... );
+tao::pegtl::parse< tao::pegtl::action< my_action, my_grammar > >( ... );
+```
 
-User-defined parsing rules can use `action<>`, `enable<>` and `disable<>` just like any other combinator rules, for example to disable actions in LISP-style comments:
+User-defined parsing rules can use `action<>`, `enable<>` and `disable<>` just like any other combinator rules.
+For example to disable actions in LISP-style comments the following rule could be used as per `src/example/pegtl/s_expression.cpp`.
 
 ```c++
 struct comment
    : tao::pegtl::seq< tao::pegtl::one< '#' >, tao::pegtl::disable< cons_list > > {};
 ```
 
-This also allows using the same rules multiple times with different actions within the grammar.
+The ability to change the actions during a parsing run also allows using the same rules multiple times with different action class templates within a grammar.
+
+### Via Actions
+
+The action classes `tao::pegtl::disable_action` and `tao::pegtl::enable_action` can be used to disable and enable actions, respectively, for any rule (and its sub-rules).
+For example actions can be disabled for `my_rule` in a parsing run using `my_action` as follows.
+
+```c++
+template<>
+struct my_action< my_rule >
+   : tao::pegtl::disable_action {};
+
+tao::pegtl::parse< my_grammar, my_action >( ... );
+```
+
+Conversely `tao::pegtl::change_action<>` takes a new action class template as only template parameter and changes the current action in a parsing run to its template parameter.
+
+Note that parsing proceeds with the rule to which the action changing action is attached to "as if" the new action had been the current action all along.
+The new action can even perform an action change *on the same rule*, however care should be taken to not introduce infinite cycles of changes.
 
 ## Changing States
 
-Implementing a parser with the PEGTL consists of two main parts.
+The states, too, can be changed in ways beyond supplying them, or not, to `tao::pegtl::parse()` at the start of a parsing run.
+
+### Via Rules
+
+The [`state` rule](Rule-Reference.md#state-s-r-) behaves similarly to [`seq`](Rule-Reference.md#seq-r-) but uses the first template parameter as type of a new object.
+This new object is used replaces the current state(s) for the remainder of the implicit [`seq`](Rule-Reference.md#seq-r-).
+
+The new object is constructed with a const-reference to the current input of the parsing run, and all previous states, if any, as arguments.
+If the implicit [`seq`](Rule-Reference.md#seq-r-) of the sub-rules succeeds, then, by default, a member function named `success()` is called on this "new" object, receiving the same arguments as the constructor.
+At this point the input will be advanced by whatever the sub-rules have consumed in the meantime.
+
+Please consult `include/tao/pegtl/internal/state.hpp` to see how the default behaviour on success can be changed by overriding `tao::pegtl::state<>::success()` in a derived class when using that class instead.
+
+Embedding a state change into the grammar with [`state<>`](Rule-Reference.md#state-s-r-) is only recommended when some state is used by custom parsing rules.
+
+### Via Actions
+
+The actions `tao::pegtl::change_state<>` and `tao::pegtl::change_states<>` can be used to change from the current to a new set of states while parsing the rules they are attached to.
+
+The differences are summarised in this table; note that `change_state` is more similar to the legacy `change_state` control class as included with the 2.z versions of the PEGTL.
+
+| Feature | `change_state` | `change_states` |
+| --- | --- | --- |
+| Number of new states | one | any |
+| Construction of new states | with input and old states | default |
+| Success function on action | if not on new state | required |
+
+With `change_state` only a single new state type can be given as template parameter, and only a single new state will be created.
+The constructor of the new state receives the same arguments as per `tao::pegtl::state<>`, the current input from the parsing run and all previous states.
+
+A `success()` static member function is supplied that calls the `success()` member function on the new state, again with the current input from the parsing run and all previous states.
+The supplied `success()` can of course be overridden in a derived class.
+
+With `change_states`, being a variadic template, any number of new state types can be given and an appropriate set of new states will be created (nearly) simultaneously.
+All new states are default-constructed, if something else is required the reader is encouraged to copy and modify the implementation of `change_states` in their project.
+
+The user *must* implement a custom `success()` static member function that takes the current input from the parsing run, the new states, and the old states as arguments.
+
+Note that, *unlike* the `tao::pegtl::state<>` combinator, the success functions are *only called when actions are currently enabled*!
+
+Using the changing actions is again done via inheritance as shown in the following example for `change_states`.
+
+```c++
+template<>
+struct my_action< my_rule >
+   : tao::pegtl::change_states< new_state_1, new_state_2 >
+{
+   template< typename Input >
+   static void success( const Input&, new_state_1&, new_state_2&, /* the previous states*/ )
+   {
+      // Do whatever with both the new and the old states...
+   }
+};
+```
+
+For a more complete example of how to build a generic JSON data structure with `change_state` and friends see `src/example/pegtl/json_build.cpp`.
+
+## Changing Actions and States
+
+The actions `change_action_and_state<>` and `change_action_and_states<>` combine `change_action` with one of the `change_state<>` or `change_states<>` actions, respectively.
+For `change_action_and_state<>` and `change_action_and_states<>` the new action class template is passed as first template parameter as for `change_action`, followed by the new state(s) as given to `change_state<>` and `change_states<>`.
+
+Note that `change_action_and_state<>` and `change_action_and_states<>` behave like `change_action<>` in that they proceed to match the rule to which the changing action is attached to "as if" the new action had been the current action all along.
 
-1. The actual grammar that drives the parser.
-2. The states and actions that "do something".
+## Match
+
+Besides `apply()` and `apply0()`, an action class specialization can also have a `match()` static member function.
+The default control class template `normal` will detect the presence of a suitable `match()` function and call this function instead of `tao::pegtl::match()`.
+
+```c++
+template<>
+struct my_action< my_rule >
+{
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... > class Action,
+             template< typename... > class Control,
+             typename Input,
+             typename... States >
+   static bool match( Input& in, States&&... st )
+   {
+      // Call the function that would have been called otherwise,
+      // in this case without changing anything...
+      return tao::pegtl::match< Rule, A, M, Action, Control >( in, st... );
+   }
+}
+```
 
-For the second part, there are three distinct styles of how to manage the states and actions in non-trivial parsers.
+Implementing a custom `match()` for an action is considered a rather advanced feature that is not used directly very often.
+All "changing" action classes mentioned in this document are implemented as actions with `match()`.
+Their implementations can be found in `<tao/pegtl/change_*.hpp>` and should be studied before implementing a custom action with `match()`.
 
-The **main issue** addressed by the switching styles is the **growing complexity** encountered when a single state argument to a parsing run must perform multiple different tasks, including the management of nested data structures.
+## Nothing
 
-The way that this issue is addressed is by providing another tool for performing divide-and-conquer: A large state class with multiple tasks can be divided into
+Letting the primary template of an action class template derive from `tao::pegtl::nothing` is recommended, but not necessary.
 
-- multiple smaller state classes that each take care of a single issue,
-- one or more [control classes](Control-and-Debug.md) that switch between the states,
-- using the C++ stack for nested structures (rather than manually managing a stack).
+When using `nothing`, some assertions are enabled that are usually very helpful while developing a parser.
 
-The different styles can also be freely mixed within the same parser.
+When not using `nothing`, simply by never mentioning it (as base class), these assertions are disabled and it is possible for an action's `apply()` or `apply0()` implementation to be silently ignored.
 
-### No Switching
+In the following let `a` be an action template class, i.e. the instantiation of an action class template `action` for some rule `r`, or `using a = action< r >` for short.
 
-The "no switching style" consists of having one (or more) state-arguments that are passed to a parsing run and that are the arguments to all action's `apply0()`- and `apply()`-methods.
+We say that `apply()` is *callable* when it is the name of a static member function of `a` that returns either `void` or `bool` and can be called with an input and the current states.
 
-For an example of how to build a generic JSON data structure with the "no switching style" see `src/example/pegtl/json_build_two.cpp`.
+We say that `apply0()` is *callable* when it is the name of a static member function of `a` that returns either `void` or `bool` and can be called with the current states.
 
-### Intrusive Switching
+The following assertions are always enabled.
 
-The `state<>` and `action<>` [meta combinators](Rule-Reference.md#meta-rules) can be used to hard-code state and actions switches in the grammar.
+* There must be at most one callable `apply` or `apply0()` in `a`.
+* If `nothing< r >` is an accessible base class of `a` then `a` must not have a callable `apply()`.
+* If `nothing< r >` is an accessible base class of `a` then `a` must not have a callable `apply0()`.
+* If `require_apply` is an accessible base class of `a` then it must have a callable `apply()`.
+* If `require_apply0` is an accessible base class of `a` then it must have a callable `apply0()`.
 
-In some cases a state object is required for the grammar itself, and in these cases embedding the state-switch into the grammar is recommended.
+The classes `require_apply` and `require_apply0` are also explained in [the State Mismatch section](#state-mismatch).
 
-### External Switching
+The following assertion is only enabled when `std::is_base_of_v< tao::pegtl::nothing< void >, action< void > >` is `true`.
 
-"External switching" is when the states and/or actions are switched from outside of the grammar by providing a specialised control class.
+* Either `nothing` must be an accessible base class of `a`, or
+* `maybe_nothing` must be an accessible base class of `a`, or
+* `a` must have a callable `apply()` or `apply0()`.
 
-For an example of how to build a generic JSON data structure with the "external switching style" see `src/example/pegtl/json_build_one.cpp`.
+The class `tao::pegtl::maybe_nothing` is an accessible base class of all the changing actions explained above.
+This make is possible, but not necessary, to implement `apply()` or `apply0()` for actions derived from them.
+
+Note that `maybe_nothing` can be combined, through multiple inheritance, with one of `nothing< r >`, `require_apply` or `require_apply0`.
+
+For example when a class `b` is derived from `change_state`, it also gains that class' `maybe_nothing` as accessible base class.
+At this point `b` is allowed to either have or not have an `apply()` or `apply0()`.
+By letting `b` also derive from one of the three mentioned classes, the `maybe_nothing` will be ignored and `b` will be checked to have or not have the functions as dictated by the respective additional base class.
+
+## Troubleshooting
+
+### Boolean Return
+
+Actions returning `bool` are an advanced use case that should be used with caution.
+They prevent some internal optimisations, in particular when used with `apply0()`.
+They can also have weird effects on the semantics of a parsing run, for example `at< rule >` can succeed for the same input for which `rule` fails when there is a `bool`-action attached to `rule` that returns `false` (remember that actions are disabled within `at<>`).
+
+### State Mismatch
+
+When an action's `apply()` or `apply0()` expects different states than those present in the parsing run there will either be a possibly not very helpful compiler error, or it will compile without a call to the action, depending on whether `tao::pegtl::nothing<>` is used as base class of the primary action class template.
+
+By deriving an action specialisation from either `tao::pegtl::require_apply` or `tao::pegtl::require_apply0`, as appropriate, a -- potentially more helpful -- compiler error can be provoked, so when the grammar contains `my_rule` and the action is `my_action` then silently compiling without a call to `apply0()` is no longer possible.
+
+```c++
+template<>
+struct my_action< my_rule >
+  : require_apply0
+{
+   static void apply0( double )
+   {
+      // ...
+   }
+}
+```
 
-The actual switching control classes are defined in `<tao/pegtl/contrib/changes.hpp>` and can be used as template for custom switching.
+Note that deriving from `require_apply` or `require_apply0` is optional and usually only used for troubleshooting.
 
 ## Legacy Actions
 
 See the [section on legacy-style action rules](Rule-Reference.md#action-rules).
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Changelog.md b/packages/PEGTL/doc/Changelog.md
index 06b7ff0fd4ed30b01bb38acfeb3ebd1d82a8fad5..37b4184c7e05a19895e8aefb29f5023ed7ad4198 100644
--- a/packages/PEGTL/doc/Changelog.md
+++ b/packages/PEGTL/doc/Changelog.md
@@ -1,5 +1,48 @@
 # Changelog
 
+## 3.0.0
+
+**Not yet released**
+
+* Use the [**migration guide**](Migration-Guide.md#version-300) when updating.
+* Updated required C++ standard to C++17.
+* Updated required [CMake](https://cmake.org/) version to 3.8.
+* The macro `TAO_PEGTL_NAMESPACE` now contains the fully qualified namespace, e.g. `tao::pegtl`.
+* Replaced `tao::pegtl::input_error` with `std::system_error`.
+* Changed message of `tao::pegtl::parse_error` to no longer contain the position redundantly.
+* Removed option of [state](Rule-Reference.md#state-s-r-)'s `S::success()` to have an extended signature to get access to the current `apply_mode`, `rewind_mode`, *action*- and *control* class (template).
+* Added `[[nodiscard]]` to most non-void functions.
+* Removed compatibility macros starting with `TAOCPP_PEGTL_`.
+* Removed compatibility uppercase enumerators.
+* Removed compatibility `peek_byte()` member functions.
+* Removed compatibility header `changes.hpp` from contrib.
+
+## 2.8.0
+
+Released 2019-04-09
+
+* Use the [**migration guide**](Migration-Guide.md#version-280) when updating.
+* Changed enumerators to lowercase.
+  * Renamed `tracking_mode::IMMEDIATE` to `tracking_mode::eager`.
+  * Compatibility enumerators with uppercase names are still included.
+    * Will be removed in version 3.0.0.
+* Renamed `peek_byte()` to `peek_uint8()`.
+  * Compatibility member functions with previous names are still included.
+    * Will be removed in version 3.0.0.
+* Allowed actions to implement `match`.
+* Made deriving action class templates from `nothing` optional.
+* Added debug tools `require_apply` and `require_apply0`.
+* Added combinator class [`rematch`](Rule-Reference.md#rematch-r-s-).
+* Improved the [Parse Tree / AST interface](Parse-Tree.md) to mostly hide its internal state.
+* Added new action-based helpers `change_*.hpp`.
+  * The control-based helpers in `contrib/changes.hpp` are still included.
+    * Will be removed in version 3.0.0.
+* Added new action-based helpers `disable_action.hpp` and `enable_action.hpp`.
+* Added new action-based helpers `discard_input.hpp`, `discard_input_on_success.hpp`, and `discard_input_on_failure.hpp`.
+* Added [Clang Static Analyzer](https://clang-analyzer.llvm.org/) to the CI build.
+* Added new Makefile target `amalgamate` to generate a single-header version of the PEGTL.
+* Added support for [Universal Windows Platform (UWP)](https://en.wikipedia.org/wiki/Universal_Windows_Platform).
+
 ## 2.7.1
 
 Released 2018-09-29
@@ -60,8 +103,8 @@ Released 2018-05-01
 * Fixed parse tree node generation to correctly remove intermediate nodes.
 * Added big- and little-endian support to the UTF-16 and UTF-32 rules.
 * Added rules for UINT-8 and big- and little-endian UINT-16, UINT-32 and UINT-64.
-* Added function to `memory_input<>` to obtain the line around a position.
-* Added function to `memory_input<>` to start again from the beginning.
+* Added member functions to `memory_input<>` to obtain the line around a position.
+* Added member functions to `memory_input<>` to start again from the beginning.
 * Added example for Python-style indentation-aware grammars.
 * Added examples for regular, context-free, and context-sensitive grammars.
 * Added example for how to parse with a symbol table.
@@ -73,8 +116,11 @@ Released 2018-05-01
 
 Released 2018-02-17
 
+* Use the [**migration guide**](Migration-Guide.md#version-240) when updating.
 * Improved and documented the [Parse Tree / AST support](Parse-Tree.md).
-* Changed prefix of all macros from `TAOCPP_PEGTL_` to `TAO_PEGTL_`. Compatibility macros with the old names are provided, they will be removed in version 3.0.
+* Changed prefix of all macros from `TAOCPP_PEGTL_` to `TAO_PEGTL_`.
+  * Compatibility macros with the old names are provided.
+  * They will be removed in version 3.0.0.
 * Added a deleted overload to prevent creating a `memory_input<>` from a temporary `std::string`.
 
 ## 2.3.4
@@ -109,9 +155,9 @@ Released 2017-12-14
 Released 2017-12-11
 
 * Added constructor to `read_input<>` that accepts a `FILE*`, see issue [#78](https://github.com/taocpp/PEGTL/issues/78).
-* Enhanced [`apply`](Rule-Reference.md#apply-a-), [`apply0`](Rule-Reference.md#apply0-a-) and [`if_apply`](Rule-Reference.md#if_apply-r-a-) to support `apply()`/`apply0()`-methods returning boolean values.
-* Simplified implementation of [`raw_string`](Contrib-and-Examples.md#taopegtlcontribraw_stringhpp), the optional `Contents...` rules' `apply()`/`apply0()`-methods are now called with the original states.
-* Fixed the tracer to work with `apply()`/`apply0()`-methods returning boolean values. (Thanks Joel Frederico)
+* Enhanced [`apply`](Rule-Reference.md#apply-a-), [`apply0`](Rule-Reference.md#apply0-a-) and [`if_apply`](Rule-Reference.md#if_apply-r-a-) to support `apply()`/`apply0()` returning boolean values.
+* Simplified implementation of [`raw_string`](Contrib-and-Examples.md#taopegtlcontribraw_stringhpp), the optional `Contents...` rules' `apply()`/`apply0()` are now called with the original states.
+* Fixed the tracer to work with `apply()`/`apply0()` returning boolean values.
 * Fixed, simplified and improved [`examples/parse_tree.cpp`](Contrib-and-Examples.md#srcexamplepegtlparse_treecpp).
 
 ## 2.2.2
@@ -125,7 +171,7 @@ Released 2017-11-22
 Released 2017-11-22
 
 * Celebrating the PEGTL's 10th anniversary!
-* Fixed missing call to the [control class'](Control-and-Debug.md#control-functions) `failure()`-method when a rule with an `apply()`-method with a boolean return type fails.
+* Fixed missing call to the [control class'](Control-and-Debug.md#control-functions) `failure()` when a rule with `apply()` with a boolean return type fails.
 * Fixed string handling in [`examples/abnf2pegtl.cc`](Contrib-and-Examples.md#srcexamplepegtlabnf2pegtlcpp).
 * Simplified/improved Android build.
 
@@ -133,7 +179,7 @@ Released 2017-11-22
 
 Released 2017-09-24
 
-* Added possibility for actions' `apply()`- or `apply0()`-methods to return a `bool` which is then used to determine overall success or failure of the rule to which such an action was attached.
+* Added possibility for an action's `apply()` or `apply0()` to return `bool` which is then used to determine overall success or failure of the rule to which such an action was attached.
 * Added [`<tao/pegtl/contrib/parse_tree.hpp>`](Contrib-and-Examples.md#taopegtlcontribparse_treehpp) and the [`examples/parse_tree.cpp`](Contrib-and-Examples.md#srcexamplepegtlparse_treecpp) application that shows how to build a [parse tree](https://en.wikipedia.org/wiki/Parse_tree). The example goes beyond a traditional parse tree and demonstrates how to select which nodes to include in the parse tree and how to transform the nodes into an [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree)-like structure.
 * Added `bom` rules for UTF-8, UTF-16 and UTF-32.
 * Added some missing includes for `config.hpp`.
@@ -184,7 +230,7 @@ Released 2017-05-18
 * Project
 
   * Migrated to ["The Art of C++"](https://github.com/taocpp).
-  * A [**migration guide**](Migration-Guide.md#from-1y-to-2z) for porting applications from 1.y to 2.z is available.
+  * Use the [**migration guide**](Migration-Guide.md#version-200) when updating.
   * Version 2.z can be installed and used in parallel to version 1.y of the PEGTL.
   * The semantics of all parsing rules and grammars is the same as for versions 1.y.
 
@@ -220,7 +266,7 @@ Released 2017-05-18
 
 * Other Changes
 
-  * Added `apply()` and `apply0()` methods to [control class](Control-and-Debug.md#control-functions).
+  * Added `apply()` and `apply0()` to the [control class](Control-and-Debug.md#control-functions).
   * Optimised superfluous input markers.
   * Allowed optimisation of [actions that do not need the input](Actions-and-States.md#apply0).
   * Replaced layered matching with superior Duseltronik™.
@@ -285,7 +331,7 @@ Released 2015-07-31
 * Added experimental support for UTF-16 similar to the previously existing UTF-32 parsing rules.
 * Added support for merging escaped UTF-16 surrogate pairs to `pegtl/contrib/unescape.hh`.
 * Fixed incorrect handling of escaped UTF-16 surrogate pairs in the JSON examples.
-* A [state](Rule-Reference.md#state-s-r-)'s `S::success()`-method can now have an extended signature to get access to the current `apply_mode`, *action*- and *control* class (template).
+* A [state](Rule-Reference.md#state-s-r-)'s `S::success()` can now have an extended signature to get access to the current `apply_mode`, *action*- and *control* class (template).
 * The `contrib/raw_string` class template now calls `Action<raw_string<...>::content>::apply()` with the user's state(s).
 
 ## 1.0.0
@@ -311,7 +357,7 @@ Semantic versioning was introduced with version 1.0.0.
 * The variadic `states...` arguments that are passed through all rule invocations for use by the actions are *not* forwarded with `std::forward<>` anymore since it (usually) doesn't make much sense to move them, and accidentially moving multiple times was a possible error scenario.
 * There are now five different `rep` rules for repeating a sequence of rules with more control over the acceptable or required number of repetitions.
 * There are new rules `try_catch<>` and `try_catch_type<>` that convert global errors, i.e. exceptions, into local errors, i.e. a return value of `false`.
-* Unified concept for actions and debug hooks, i.e. just like the actions are called from a class template that is passed into the top-level `parse()`-function, there is another class template that is called for debug/trace and error throwing purposes; both can be changed at any point within the grammar.
+* Unified concept for actions and debug hooks, i.e. just like the actions are called from a class template that is passed into the top-level `parse()` function, there is another class template that is called for debug/trace and error throwing purposes; both can be changed at any point within the grammar.
 * A large under-the-hood reorganisation has the benefit of preventing actions from being invoked on rules that are implementation details of other rules, e.g. the `pad< Rule, Padding >` rule contains `star< Padding >` in its implementation, so a specialisation of the action-class-template for `star< Padding >` would be called within `pad<>`, even though the `star< Pad >` was not explicitly written by the user; in PEGTL 1.y these unintended action invocations no longer occur.
 * Partial support for Unicode has been added in the form of some basic rules like `one<>` and `range<>` also being supplied in a UTF-8 (and experimental UTF-16 and UTF-32) aware version(s) that can correctly process arbitrary code points from `0` to `0x10ffff`.
 * The supplied input classes work together with the supplied exception throwing to support better error locations when performing nested file parsing, i.e. a `parse_error` contains a vector of parse positions.
@@ -322,7 +368,7 @@ Semantic versioning was introduced with version 1.0.0.
 * The `if_then<>` rule was removed.
 * The `error_mode` flag was removed.
 * The semantics of the `must<>` rules was changed to convert local failure to global failure only for the immediate sub-rules of a `must<>` rule.
-* The `parse` methods now return a `bool` and can also produce local failures. To obtain the previous behaviour of success-or-global-failure, the top-level grammar rule has to be wrapped in a `must<>`.
+* The `parse()` functions now return a `bool` and can also produce local failures. To obtain the previous behaviour of success-or-global-failure, the top-level grammar rule has to be wrapped in a `must<>`.
 
 ## 0.32
 
@@ -355,7 +401,7 @@ Released 2011-02
 
 * Changed the type of exceptions thrown by the library to `pegtl::parse_error`.
 * Changed class `basic_debug` to only generate a grammar back-trace when a `pegtl::parse_error` is flying.
-* Changed logging to use a virtual method on the debug class inherited from common debug base class.
+* Changed logging to use a virtual member function on the debug class inherited from common debug base class.
 * Removed all `*_parse_*_nothrow()` parse functions.
 * Removed the `_throws` substring from all remaining parse functions and changed the return type to `void`.
 * Added convenience classes `file_input`, `ascii_file_input` and `dummy_file_input` for custom parse functions.
@@ -500,4 +546,4 @@ Released 2008
 Development of the PEGTL started in November 2007 as an experiment in C++0x.
 It is based on ideas from the YARD library by Christopher Diggins.
 
-Copyright (c) 2007-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2007-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Contrib-and-Examples.md b/packages/PEGTL/doc/Contrib-and-Examples.md
index fc311f854efe6a17a3951e8dae68c54a39d5a14e..f83cc6cf1d4e78cb45f312e0ce7a909d23124878 100644
--- a/packages/PEGTL/doc/Contrib-and-Examples.md
+++ b/packages/PEGTL/doc/Contrib-and-Examples.md
@@ -29,10 +29,26 @@ For all questions and remarks contact us at **taocpp(at)icemx.net**.
 * Constants for ASCII letters.
 * Shortens `string<'f','o','o'>` to `string<f,o,o>`.
 * Ready for production use.
+* Superceeded by `TAO_PEGTL_STRING()`.
 
-###### `<tao/pegtl/contrib/changes.hpp>`
+###### `<tao/pegtl/contrib/change_action.hpp>`
 
-* Control class components for [external switching style](Actions-and-States.md#external-switching).
+* Changes the action class template.
+* Ready for production use.
+
+###### `<tao/pegtl/contrib/change_action_and_state.hpp>`
+
+* Changes the action class template and the state.
+* Ready for production use but might be changed in the future.
+
+###### `<tao/pegtl/contrib/change_control.hpp>`
+
+* Changes the control class template.
+* Ready for production use.
+
+###### `<tao/pegtl/contrib/change_state.hpp>`
+
+* Changes the state.
 * Ready for production use but might be changed in the future.
 
 ###### `<tao/pegtl/contrib/counter.hpp>`
@@ -42,6 +58,16 @@ For all questions and remarks contact us at **taocpp(at)icemx.net**.
   2. succeeded to match,
   3. failed to match.
 
+###### `<tao/pegtl/contrib/disable_action.hpp>`
+
+* Disables actions.
+* Ready for production use.
+
+###### `<tao/pegtl/contrib/enable_action.hpp>`
+
+* Enables actions.
+* Ready for production use.
+
 ###### `<tao/pegtl/contrib/http.hpp>`
 
 * HTTP 1.1 grammar according to [RFC 7230](https://tools.ietf.org/html/rfc7230).
@@ -65,11 +91,15 @@ For all questions and remarks contact us at **taocpp(at)icemx.net**.
 * Grammar rules to parse Lua-style long (or raw) string literals.
 * Ready for production use.
 
+###### `<tao/pegtl/contrib/rep_string.hpp>`
+
+* Contains optimised version of `rep< N, string< Cs... > >`:
+* Rule `ascii::rep_string< N, Cs... >`.
+
 ###### `<tao/pegtl/contrib/rep_one_min_max.hpp>`
 
 * Contains optimised version of `rep_min_max< Min, Max, ascii::one< C > >`:
 * Rule `ascii::rep_one_min_max< Min, Max, C >`.
-* Rule `ascii::ellipsis` as shortcut for `ascii::rep_one_min_max< 3, 3, '.' >`.
 
 ###### `<tao/pegtl/contrib/to_string.hpp>`
 
@@ -150,13 +180,9 @@ Shows one approach to implementing an indentation-aware language with a very ver
 
 Shows how to use the custom error messages defined in `json_errors.hpp` with the `<tao/pegtl/contrib/json.hpp>` grammar to parse command line arguments as JSON data.
 
-###### `src/example/pegtl/json_build_one.cpp`
-
-Extends on `json_parse.cpp` by parsing JSON files into generic JSON data structures using the "[switching style](Actions-and-States.md#changing-state)" of managing actions and states.
-
-###### `src/example/pegtl/json_build_two.cpp`
+###### `src/example/pegtl/json_build.cpp`
 
-Extends on `json_parse.cpp` by parsing JSON files into generic JSON data structures using a more monolithic approach to managing the states and actions.
+Extends on `json_parse.cpp` by parsing JSON files into generic JSON data structure.
 
 ###### `src/example/pegtl/json_count.cpp`
 
@@ -177,30 +203,16 @@ A small example which shows how to create a parse tree for a given grammar using
 
 The example shows how to choose which rules will produce a parse tree node, which rules will store the content, and how to add additional transformations to the parse tree to transform it into an AST-like structure or to simplify it.
 
-Running the example with a slightly longer expression:
+The output is in [DOT](https://en.wikipedia.org/wiki/DOT_(graph_description_language)) format and can be converted into a graph.
 
 ```sh
-$ build/src/example/pegtl/parse_tree "2 + a*b*4 - x / ( 2 - b + c - d )"
-ROOT
-  example::minus at :1:9(9)
-    example::plus at :1:1(1)
-      example::integer "2" at :1:0(0) to :1:1(1)
-      example::multiply at :1:7(7)
-        example::multiply at :1:5(5)
-          example::variable "a" at :1:4(4) to :1:5(5)
-          example::variable "b" at :1:6(6) to :1:7(7)
-        example::integer "4" at :1:8(8) to :1:9(9)
-    example::divide at :1:13(13)
-      example::variable "x" at :1:12(12) to :1:13(13)
-      example::minus at :1:27(27)
-        example::plus at :1:23(23)
-          example::minus at :1:19(19)
-            example::integer "2" at :1:18(18) to :1:19(19)
-            example::variable "b" at :1:22(22) to :1:23(23)
-          example::variable "c" at :1:26(26) to :1:27(27)
-        example::variable "d" at :1:30(30) to :1:31(31)
+$ build/src/example/pegtl/parse_tree "(2*a + 3*b) / (4*n)" | dot -Tpng -o parse_tree.png
 ```
 
+The above will generate a PNG with a graphical representation of the parse tree.
+
+![Parse Tree](Parse-Tree.png)
+
 ###### `src/example/pegtl/proto3.cpp`
 
 Experimental grammar that parses Protocol Buffers (`.proto3`) files.
@@ -230,4 +242,4 @@ Uses the building blocks from `<tao/pegtl/contrib/unescape.hpp>` to show how to
 Shows how to use the included [tracer control](#taopegtlcontribtracerhpp), here together with the URI grammar from `<tao/pegtl/contrib/uri.hpp>`.
 Invoked with one or more URIs as command line arguments will attempt to parse the URIs while printing trace information to `std::cerr`.
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Control-and-Debug.md b/packages/PEGTL/doc/Control-and-Debug.md
index ef851de2f66b225a9b0d6d54c5bebe6550f92592..af5ef5a6706263f6d787cb19d711da2e1d4714fa 100644
--- a/packages/PEGTL/doc/Control-and-Debug.md
+++ b/packages/PEGTL/doc/Control-and-Debug.md
@@ -5,12 +5,12 @@ Beyond the top-level grammar rule, which *has* to be supplied to a parsing run,
 (Actually the control class is a class template which takes a parsing rule as template argument, however in many cases there will be no specialisations, wherefore we will drop the distinction and pretend here that it is simply a class.)
 
 Functions from the control class are called in strategic places during a parsing run and can be used to customise internal behaviour of the PEGTL and/or as debug aids.
-More precisely, the control class has functions to
+More precisely, the control class has static member functions to
 
 1. trace which rules are attempted to match where, and whether they succeed or fail,
-1. customise which exceptions are thrown in case of errors,
-3. customise how actions' `apply()` and `apply0()` methods are called,
-4. customise how rules' `match()` methods are called.
+2. customise which exceptions are thrown in case of errors,
+3. customise how an action's `apply()` or `apply0()` is called,
+4. customise how a rule's `match()` is called.
 
 ## Contents
 
@@ -30,48 +30,32 @@ struct normal
 {
    template< typename Input,
              typename... States >
-   static void start( const Input&, States&&... )
-   {
-   }
+   static void start( const Input&, States&&... );
 
    template< typename Input,
              typename... States >
-   static void success( const Input&, States&&... )
-   {
-   }
+   static void success( const Input&, States&&... );
 
    template< typename Input,
              typename... States >
-   static void failure( const Input&, States&&... )
-   {
-   }
+   static void failure( const Input&, States&&... );
 
    template< typename Input,
              typename... States >
-   static void raise( const Input& in, States&&... )
-   {
-      throw parse_error( "parse error matching " +
-                         internal::demangle< Rule >(), in );
-   }
+   static void raise( const Input& in, States&&... );
 
    template< template< typename... > class Action,
+             typename Iterator,
              typename Input,
              typename... States >
-   static void apply0( const Input&, States&&... st )
-   {
-      Action< Rule >::apply0( st... );
-   }
+   static auto apply( const Iterator& begin, const Input& in, States&&... st )
+      -> decltype( ... );
 
    template< template< typename... > class Action,
-             typename Iterator,
              typename Input,
              typename... States >
-   static void apply( const Iterator& begin, const Input& in, States&&... st )
-   {
-      using action_t = typename Input::action_t;
-      const action_t action_input( begin, in );
-      Action< Rule >::apply( action_input, st... );
-   }
+   static auto apply0( const Input&, States&&... st )
+      -> decltype( ... );
 
    template< apply_mode A,
              rewind_mode M,
@@ -79,28 +63,23 @@ struct normal
              template< typename... > class Control,
              typename Input,
              typename... States >
-   static bool match( Input& in, States&&... st )
-   {
-      constexpr bool use_control = !internal::skip_control< Rule >::value;
-      constexpr bool use_action = use_control && ( A == apply_mode::ACTION ) && ( !is_nothing< Action, Rule >::value );
-      constexpr bool use_apply0 = use_action && internal::has_apply0< Action< Rule >, internal::type_list< States... > >::value;
-      constexpr dusel_mode mode = static_cast< dusel_mode >( static_cast< char >( use_control ) + static_cast< char >( use_action ) + static_cast< char >( use_apply0 ) );
-      return internal::duseltronik< Rule, A, M, Action, Control, mode >::match( in, st... );
-   }
+   static bool match( Input& in, States&&... st );
 };
 ```
 
-The `start()`, `success()` and `failure()`-functions can be used to debug a grammar by using them to provide insight into what exactly is going on during a parsing run.
+The static member functions `start()`, `success()` and `failure()` can be used to debug a grammar by using them to provide insight into what exactly is going on during a parsing run, or to construct a parse tree, etc.
 
-The `raise()`-function is used to create a global error, and any replacement should again throw an exception, or abort the application.
+The static member function `raise()` is used to create a global error, and any replacement should again throw an exception, or abort the application.
 
-The `apply()` and `apply0()`-functions can customise how actions with, and without, receiving the matched input are called, respectively.
+The static member functions `apply()` and `apply0()` can customise how actions with, and without, receiving the matched input are called, respectively.
+Note that these functions should only exist or be visible when an appropriate `apply()` or `apply0` exists in the action class template.
+This can be achieved via SFINAE, e.g. with a trailing return type as shown above.
 
-The `match`-function wraps the actual matching duseltronik and chooses the correct one based on whether control is enabled for `Rule`, and whether the current action is enabled and has an `apply()` or `apply0()`-function.
+The static member function `match()` by default checks if there exists a suitable `match()` in the action class template for the current rule. If so, it is called, otherwise it calls the main `tao::pegtl::match()` function.
 
 ## Control Functions
 
-For debugging a grammar and tracing exactly what happens during a parsing run, the control class methods `start()`, `success()` and `failure()` can be used.
+For debugging a grammar and tracing exactly what happens during a parsing run, the control class' `start()`, `success()` and `failure()` can be used.
 In addition, `apply()` and `apply0()` can be used to see which actions are invoked.
 
 Before attempting to match a rule `R`, the PEGTL calls `C< R >::start()` where `C` is the current control class template.
@@ -109,31 +88,33 @@ Depending on what happens during the attempt to match `R`, one of the other thre
 
 - If `R` succeeds, then `C< R >::success()` is called; compared to the call to `C< R >::start()`, the input will have consumed whatever the successful match of `R` consumed.
 
-- If `R` finishes with a failure, i.e. a return value of `false` from its `match()`-function, then `C< R >::failure()` is called; a failed match is not allowed to consume input.
+- If `R` finishes with a failure, i.e. a return value of `false` from `match()`, then `C< R >::failure()` is called; a failed match **must not** consume input.
 
 - If `R` is wrapped in `must< R >`, a global failure is generated by calling `C< R >::raise()` to throw some exception as is expected by the PEGTL in this case.
 
 - If a sub-rule of `R` finishes with a global failure, and the exception is not caught by a `try_catch` or similar combinator, then no other function of `C< R >` is called after `C< R >::start()`.
 
-Additionally, if matching `R` was successful, actions are enabled, and `A< R >` is not derived from `tao::pegtl::nothing`, where `A` is the current action class template:
+Additionally, if matching `R` was successful and actions are enabled:
 
-- If `A< R >::apply0()` exists, then `C< R >::apply0()` is called with the current state arguments.
+- If `C< R >::apply()` exists, then `C< R >::apply()` is called with the matched input and the current state arguments.
 
-- If `A< R >::apply()` exists, then `C< R >::apply()` is called with the matched input and the current state arguments.
+- If `C< R >::apply0()` exists, then `C< R >::apply0()` is called with the current state arguments.
 
-It is an error when both `A< R >::apply0()` and `A< R >::apply()` exist.
+It is an error when both `C< R >::apply()` and `C< R >::apply0()` exist.
 
-In case of actions that return `bool`, i.e. actions whose `apply0()` or `apply()` function returns `bool`, the `C< R >::success()` function is only called when both the rule *and* the action succeed.
+Note that the default `C< R >::apply()` is SFINAE-enabled if `A< R >::apply()` exists (where `A` is the current action class template) and calls the latter. A control class might modify state, etc.
+
+In case of actions that return `bool`, i.e. actions where `apply()` or `apply0()` return `bool`, `C< R >::success()` is only called when both the rule *and* the action succeed.
 If either produce a (local) failure then `C< R >::failure()` is called.
 
 In all cases where an action is called, the success or failure hooks are invoked after the action returns.
 
-The included class `tao::pegtl::tracer` in `<tao/pegtl/contrib/tracer.hpp>` gives a pratical example that can be used as control class to debug grammars.
+The included class `tao::pegtl::tracer` in `<tao/pegtl/contrib/tracer.hpp>` gives a practical example that can be used as control class to debug grammars.
 When an instance of class `tao::pegtl::trace_state` is used as single state in a parsing run with the tracer-control then the debug output contains a line number and rule number as additional information.
 
 ## Exception Throwing
 
-The `raise()`-control-hook-function **must** throw an exception.
+The control-hook, the `raise()` static member function, **must** throw an exception.
 For most parts of the PEGTL the exception class is irrelevant and any user-defined data type can be thrown by a user-defined control hook.
 
 The `try_catch` rule only catches exceptions of type `tao::pegtl::parse_error`!
@@ -142,17 +123,21 @@ When custom exception types are used then `try_catch_type` must be used with the
 
 ## Advanced Control
 
-The control template's `match()`-function is the first, or outside-most, function that is called in the flow that eventually leads to calling a rule's `match()`-function.
+The control's `match()` is the first, outer-most function in the call-chain that eventually calls the rule's `match()`.
 
-For advanced use cases it is possible to create a custom control class with a custom `match()`-function that can change "everything" before calling the actual rule's `match()`-function.
+For advanced use cases, it is possible to create a custom control class with a custom `match()` that can change "everything" before calling the rule's `match()`.
 
-Similarly the control's `apply()` and `apply0()`-functions can customise action invocation; in particular `apply()` can change how the matched portion of the input is presented to the action.
+Similarly, the control's `apply()` and `apply0()` can customise action invocation; in particular `apply()` can change how the matched portion of the input is passed to the action.
 
 ## Changing Control
 
-Just like the action class template, a custom control class template can be used by either
+Just like the action class template, a custom control class template can be used (or changed) by either
+
+1. supplying it as explicit template argument to the `parse()` functions, or
+2. setting it as control class with the [`tao::pegtl::control`](Rule-Reference.md#control-c-r-) combinator, or
+3. setting it as control class with the `change_control` action.
 
-1. supplying it as explicit template argument to the `parse()`-functions, or
-2. setting it for a portion of the grammar with the `tao::pegtl::control` combinator.
+The latter requires the use of a [custom action](Actions-and-States.md).
+Deriving the specialisation of the custom action for `my_rule` from `tao::pegtl::change_control< my_control >` will switch the current control to `my_control` before attempting to match `my_rule`.
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Errors-and-Exceptions.md b/packages/PEGTL/doc/Errors-and-Exceptions.md
index bfa14bd4a58e9cfc92e58c13583379837a5f70be..d632031eaa47d3f2b1d092d36f5ef0afa652499b 100644
--- a/packages/PEGTL/doc/Errors-and-Exceptions.md
+++ b/packages/PEGTL/doc/Errors-and-Exceptions.md
@@ -1,6 +1,6 @@
 # Errors and Exceptions
 
-A parsing run, a call to one of the `parse()`-functions as explained in [Inputs and Parsing](Inputs-and-Parsing.md), can have the same results as calling the `match()`-method on a grammar rule.
+A parsing run, a call to one of the `parse()` functions as explained in [Inputs and Parsing](Inputs-and-Parsing.md), can have the same results as calling `match()` on a grammar rule.
 
 * A return value of `true` indicates a *successful* match.
 * A return value of `false` is called a *local failure* (even when propagated to the top).
@@ -29,7 +29,7 @@ The `must<>` rule is equivalent to `seq<>` in that it attempts to match all sub-
 Global failures can also be unconditionally provoked with the `raise<>` grammar rule, which is more flexible since the template argument can be any type, not just a parsing rule.
 It should be mentioned that `must< R >` is semantically equivalent to `sor< R, raise< R > >`, but more efficient.
 
-In any case, the task of actually throwing an exception is delegated to the [control class'](Control-and-Debug.md) `raise()`-method.
+In any case, the task of actually throwing an exception is delegated to the [control class'](Control-and-Debug.md) `raise()`.
 
 ## Global to Local Failure
 
@@ -45,10 +45,10 @@ For another use case consider the following parsing rules for a simplified C-str
 The rule `escaped` is for a single escaped character, the rule `content` is for the complete content of such a literal.
 
 ```c++
-   using namespace tao::pegtl;
-   struct escaped : seq< one< '\\' >, one< 'n', 'r', 't' > > {};
-   struct content : star< sor< escaped, not_one< '\\', '"' > > > {};
-   struct literal : seq< one< '"' >, content, one< '"' > > {};
+using namespace tao::pegtl;
+struct escaped : seq< one< '\\' >, one< 'n', 'r', 't' > > {};
+struct content : star< sor< escaped, not_one< '\\', '"' > > > {};
+struct literal : seq< one< '"' >, content, one< '"' > > {};
 ```
 
 The `escaped` rule first matches a backslash, and then one of the allowed subsequent characters.
@@ -61,24 +61,24 @@ It is however *not* appropriate when the backslash was not followed by one of th
 We can therefore re-write the `escaped` rule as follows so that once the backslash has matched we need one of the following allowed characters to match, otherwise a global failure is thrown.
 
 ```c++
-   using namespace tao::pegtl;
-   struct escaped : seq< one< '\\' >, must< one< 'n', 'r', 't' > > > {};
+using namespace tao::pegtl;
+struct escaped : seq< one< '\\' >, must< one< 'n', 'r', 't' > > > {};
 ```
 
 A `seq<>` where all but the first sub-rule is inside a `must<>` occurs frequently enough to merit a convenience rule.
 The following rule is equivalent to the above.
 
 ```c++
-   using namespace tao::pegtl;
-   struct escaped : if_must< one< '\\' >, one< 'n', 'r', 't' > > {};
+using namespace tao::pegtl;
+struct escaped : if_must< one< '\\' >, one< 'n', 'r', 't' > > {};
 ```
 
 Now the `escaped` rule can only return local failure when the next input byte is not a backslash.
 This knowledge can be used to simplify the `content` rule by not needing to exclude the backslash in the following rule.
 
 ```c++
-   using namespace tao::pegtl;
-   struct content : star< sor< escaped, not_one< '"' > > > {};
+using namespace tao::pegtl;
+struct content : star< sor< escaped, not_one< '"' > > > {};
 ```
 
 Finally we apply our "best practice" and give the `one< 'n', 'r', 't' >` rule a dedicated name.
@@ -86,11 +86,11 @@ This will improve the built-in error message when the global failure is thrown,
 The resulting example is as follows.
 
 ```c++
-   using namespace tao::pegtl;
-   struct escchar : one< 'n', 'r', 't' > {};
-   struct escaped : if_must< one< '\\' >, escchar > {};
-   struct content : star< sor< escaped, not_one< '"' > > > {};
-   struct literal : seq< one< '"' >, content, one< '"' > > {};
+using namespace tao::pegtl;
+struct escchar : one< 'n', 'r', 't' > {};
+struct escaped : if_must< one< '\\' >, escchar > {};
+struct content : star< sor< escaped, not_one< '"' > > > {};
+struct literal : seq< one< '"' >, content, one< '"' > > {};
 ```
 
 The same use of `if_must<>` can be applied to the `literal` rule assuming that it occurs in some `sor<>` where it is the only rule whose matched input can begin with a quotation mark...
@@ -99,7 +99,7 @@ The same use of `if_must<>` can be applied to the `literal` rule assuming that i
 
 By default, when using any `must<>` error points, the exceptions generated by the PEGTL use the demangled name of the failed parsing rule as descriptive part of the error message. This is often insufficient and one would like to provide more meaningful error messages.
 
-A practical technique to provide customised error message for all `must<>` error points uses a custom control class whose `raise()`-method uses a static string as error message.
+A practical technique to provide customised error message for all `must<>` error points uses a custom control class whose `raise()` uses a static string as error message.
 
 ```c++
 template< typename Rule >
@@ -119,38 +119,38 @@ struct my_control
 Now only the `error_message` string needs to be specialised per error point as follows.
 
 ```c++
-template<> const std::string my_control< MyRule >::error_message = "expected ...";
+template<> inline const std::string my_control< MyRule >::error_message = "expected ...";
 ```
 
-Since the `raise()`-method is only instantiated for those rules for which `must<>` could trigger an exception, it is sufficient to provide specialisations of the error message string for those rules.
+Since `raise()` is only instantiated for those rules for which `must<>` could trigger an exception, it is sufficient to provide specialisations of the error message string for those rules.
 Furthermore, there will be a linker error for all rules for which the specialisation was forgotten although `raise()` could be called.
 For an example of this method see `src/examples/pegtl/json_errors.hpp`, where all errors that might occur in the supplied JSON grammar are customised like this:
 
 ```c++
-template<> const std::string errors< tao::pegtl::json::text >::error_message = "no valid JSON";
-
-template<> const std::string errors< tao::pegtl::json::end_array >::error_message = "incomplete array, expected ']'";
-template<> const std::string errors< tao::pegtl::json::end_object >::error_message = "incomplete object, expected '}'";
-template<> const std::string errors< tao::pegtl::json::member >::error_message = "expected member";
-template<> const std::string errors< tao::pegtl::json::name_separator >::error_message = "expected ':'";
-template<> const std::string errors< tao::pegtl::json::array_element >::error_message = "expected value";
-template<> const std::string errors< tao::pegtl::json::value >::error_message = "expected value";
-
-template<> const std::string errors< tao::pegtl::json::digits >::error_message = "expected at least one digit";
-template<> const std::string errors< tao::pegtl::json::xdigit >::error_message = "incomplete universal character name";
-template<> const std::string errors< tao::pegtl::json::escaped >::error_message = "unknown escape sequence";
-template<> const std::string errors< tao::pegtl::json::char_ >::error_message = "invalid character in string";
-template<> const std::string errors< tao::pegtl::json::string::content >::error_message = "unterminated string";
-template<> const std::string errors< tao::pegtl::json::key::content >::error_message = "unterminated key";
-
-template<> const std::string errors< tao::pegtl::eof >::error_message = "unexpected character after JSON value";
+template<> inline const std::string errors< tao::pegtl::json::text >::error_message = "no valid JSON";
+
+template<> inline const std::string errors< tao::pegtl::json::end_array >::error_message = "incomplete array, expected ']'";
+template<> inline const std::string errors< tao::pegtl::json::end_object >::error_message = "incomplete object, expected '}'";
+template<> inline const std::string errors< tao::pegtl::json::member >::error_message = "expected member";
+template<> inline const std::string errors< tao::pegtl::json::name_separator >::error_message = "expected ':'";
+template<> inline const std::string errors< tao::pegtl::json::array_element >::error_message = "expected value";
+template<> inline const std::string errors< tao::pegtl::json::value >::error_message = "expected value";
+
+template<> inline const std::string errors< tao::pegtl::json::digits >::error_message = "expected at least one digit";
+template<> inline const std::string errors< tao::pegtl::json::xdigit >::error_message = "incomplete universal character name";
+template<> inline const std::string errors< tao::pegtl::json::escaped >::error_message = "unknown escape sequence";
+template<> inline const std::string errors< tao::pegtl::json::char_ >::error_message = "invalid character in string";
+template<> inline const std::string errors< tao::pegtl::json::string::content >::error_message = "unterminated string";
+template<> inline const std::string errors< tao::pegtl::json::key::content >::error_message = "unterminated key";
+
+template<> inline const std::string errors< tao::pegtl::eof >::error_message = "unexpected character after JSON value";
 ```
 
 It is also possible to provide a default error message that will be chosen by the compiler in the absence of a specialised one as follows.
 
 ```c++
 template< typename T >
-const std::string my_control< T >::error_message =
+inline const std::string my_control< T >::error_message =
    "parse error matching " + tao::pegtl::internal::demangle< T >();
 ```
 
@@ -159,4 +159,4 @@ This is similar to the default behaviour, but one will not get a linker error in
 It is advisable to choose the error points in the grammar with prudence.
 This choice becoming particularly cumbersome and/or resulting in a large number of error points might be an indication of the grammar needing some kind of simplification or restructuring.
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Getting-Started.md b/packages/PEGTL/doc/Getting-Started.md
index f294acd97f85a9e5a36ddea183485874d4a4e4cf..aa87cda4779191855098b952847863eafbe2b5d0 100644
--- a/packages/PEGTL/doc/Getting-Started.md
+++ b/packages/PEGTL/doc/Getting-Started.md
@@ -4,7 +4,7 @@ Since the PEGTL is a parser library, here is an "inverse hello world" example th
 rather than prints, the string `Hello, foo!` for any sequence of alphabetic ASCII characters `foo`.
 
 ```c++
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <string>
@@ -43,7 +43,6 @@ namespace hello
 
    template< typename Rule >
    struct action
-      : pegtl::nothing< Rule >
    {};
 
    // Specialisation of the user-defined action to do
@@ -71,7 +70,7 @@ int main( int argc, char* argv[] )
 
       std::string name;
 
-      pegtl::argv_input<> in( argv, 1 );
+      pegtl::argv_input in( argv, 1 );
       pegtl::parse< hello::grammar, hello::action >( in, name );
 
       std::cout << "Good bye, " << name << "!" << std::endl;
@@ -83,7 +82,7 @@ Assuming you are in the main directory of the PEGTL, the above source can be
 found in the `src/example/pegtl/` directory. Compile the program with something like
 
 ```sh
-$ g++ --std=c++11 -Iinclude src/example/pegtl/hello_world.cpp -o hello_world
+$ g++ --std=c++17 -Iinclude src/example/pegtl/hello_world.cpp -o hello_world
 ```
 
 and then invoke it as follows:
@@ -102,4 +101,4 @@ Aborted (core dumped)
 Frequently an application will include a top-level `try-catch` block to handle
 the exception.
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Grammar-Analysis.md b/packages/PEGTL/doc/Grammar-Analysis.md
index 43b1c49e75dde150e9f224c8cd7def462575c0ce..ad9070ce9c91f85943712e9a722030046e2e9902 100644
--- a/packages/PEGTL/doc/Grammar-Analysis.md
+++ b/packages/PEGTL/doc/Grammar-Analysis.md
@@ -1,11 +1,17 @@
 # Grammar Analysis
 
-The PEGTL contains an `analyze()`-function that checks a grammar for rules that can go into an infinite loop without consuming input.
+The PEGTL contains an `analyze()` function that checks a grammar for rules that can go into an infinite loop without consuming input.
 
 Unfortunately, given the expressive power of PEGs and the possibility of arbitrary custom combinator rules, it is impossible to detect *all* kinds of infinite loops.
 
 It does however catch most cases of left-recursion that are typical for grammars converted from CFGs or other formalisms that gracefully handle left-recursion.
 
+## Content
+
+* [Rule Analysis](#rule-analysis)
+* [Background](#background)
+* [Custom Rules](#custom-rules)
+
 ## Rule Analysis
 
 In order to run an analysis on a grammar it is necessary to explicitly include `<tao/pegtl/analyze.hpp>`.
@@ -17,7 +23,7 @@ Then call `tao::pegtl::analyze()` with the top-level grammar rule as template ar
 const std::size_t issues_found = tao::pegtl::analyze< my_grammar >();
 ```
 
-The `analyze()`-function returns the number of issues found and writes some information about them to `std::cout`.
+`analyze()` returns the number of issues found and writes some information about them to `std::cout`.
 
 Analysing a grammar is usually only done while developing and debugging a grammar, or after changing it.
 
@@ -41,7 +47,7 @@ Due to the differences regarding back-tracking and non-deterministic behaviour,
 
 ## Background
 
-In order to look for infinite loops in a grammar, the `analyze()`-function needs some information about all rules in the grammar.
+In order to look for infinite loops in a grammar, `analyze()` needs some information about all rules in the grammar.
 This "information" consists of a classification of the rules according to the following enum, plus, for non-atomic rules, a list of the sub-rules.
 
 ```c++
@@ -49,30 +55,30 @@ This "information" consists of a classification of the rules according to the fo
 
 enum class rule_type : char
 {
-   ANY,
-   OPT,
-   SEQ,
-   SOR
+   any,
+   opt,
+   seq,
+   sor
 };
 ```
 
-This enum value and rule list are provided to the `analyze()`-function via an `analyze_t` type member that all rules that are part of a grammar that is to be analysed with `analyze()` need to define.
+This enum value and rule list are provided to `analyze()` via an `analyze_t` type member that all rules that are part of a grammar that is to be analysed with `analyze()` need to define.
 
 The names of the enum values correspond to one of the PEGTL rule classes that has this rule type, however some rule types are used by many different classes.
 
-* `ANY` is for rules where "success implies consumption" is true; assumes bounded repetition of conjunction of sub-rules.
-* `OPT` is for rules where "success implies consumption" is false; assumes bounded repetition of conjunction of sub-rules.
-* `SEQ` is for rules where consumption on success depends on non-zero bounded repetition of the conjunction of sub-rules.
-* `SOR` is for rules where consumption on success depends on non-zero bounded repetition of the disjunction of sub-rules.
+* `any` is for rules where "success implies consumption" is true; assumes bounded repetition of conjunction of sub-rules.
+* `opt` is for rules where "success implies consumption" is false; assumes bounded repetition of conjunction of sub-rules.
+* `seq` is for rules where consumption on success depends on non-zero bounded repetition of the conjunction of sub-rules.
+* `sor` is for rules where consumption on success depends on non-zero bounded repetition of the disjunction of sub-rules.
 
-At the beginning of an `analyze()`-run the function `R::analyze_t::insert()` is called for all rules `R` in the grammar in order to insert the information about the rule `R` into a data structure.
+At the beginning of an `analyze()` run the function `R::analyze_t::insert()` is called for all rules `R` in the grammar in order to insert the information about the rule `R` into a data structure.
 
 ## Custom Rules
 
 For custom rules it should usually be sufficient to follow the lead of the rules supplied with the PEGTL and define `analyze_t` to either `tao::pegtl::analysis::generic` or `tao::pegtl::analysis::counted`.
 In both cases, the `rule_type` and the list of sub-rules must be supplied as template parameters.
-Class `tao::pegtl::analysis::counted` additionally takes an integer argument `Count` with the assumption being that a count of zero indicates that everything the rule type is `OPT` while a non-zero count uses the rule type given as template parameter.
+Class `tao::pegtl::analysis::counted` additionally takes an integer argument `Count` with the assumption being that a count of zero indicates that everything the rule type is `opt` while a non-zero count uses the rule type given as template parameter.
 
 When a custom rule goes beyond what can be currently expressed and all other questions, please contact the authors at **taocpp(at)icemx.net**.
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Inputs-and-Parsing.md b/packages/PEGTL/doc/Inputs-and-Parsing.md
index 16aa7e9c2bd7cd84758a56c9de84386fb8c07f3e..0066d35c62111bca3cc550747b2684f597c356bd 100644
--- a/packages/PEGTL/doc/Inputs-and-Parsing.md
+++ b/packages/PEGTL/doc/Inputs-and-Parsing.md
@@ -11,13 +11,13 @@ using namespace tao::pegtl;
 struct my_grammar : ...;
 
 template< typename Rule >
-struct my_actions : nothing< Rule > {};
+struct my_actions {};
 
 // Specialisations of my_actions as required...
 
 bool my_parse( const std::string& filename, my_state& state )
 {
-   file_input<> in( filename );
+   file_input in( filename );
    return parse< my_grammar, my_actions >( in, state );
 }
 ```
@@ -41,25 +41,28 @@ All classes and functions on this page are in namespace `tao::pegtl`.
 * [Parse Function](#parse-function)
 * [Nested Parsing](#nested-parsing)
 * [Incremental Input](#incremental-input)
-  * [Grammars and Buffering](#grammars-and-buffering)
-  * [Custom Data Sources](#custom-data-sources)
+  * [Buffer Size](#buffer-size)
+  * [Discard Input](#discard-input)
+  * [Custom Rules](#custom-rules)
+  * [Custom Readers](#custom-readers)
+  * [Buffer Details](#buffer-details)
 * [Error Reporting](#error-reporting)
-* [C++17 Deduction Guides](#c17-deduction-guides)
+* [Deduction Guides](#deduction-guides)
 
 ## Tracking Mode
 
-Some input classes allow a choice of tracking mode, or whether the `byte`, `line` and `byte_in_line` counters are continuously updated during a parsing run with `tracking_mode::IMMEDIATE`, or only calculated on-demand in the `position()`-method by scanning the complete input again with `tracking_mode::LAZY`.
+Some input classes allow a choice of tracking mode, or whether the `byte`, `line` and `byte_in_line` counters are continuously updated during a parsing run with `tracking_mode::eager`, or only calculated on-demand in `position()` by scanning the complete input again with `tracking_mode::lazy`.
 
 Lazy tracking is recommended when the position is used very infrequently, for example only in the case of throwing a `parse_error`.
 
-Immediate tracking is recommended when the position is used frequently and/or in non-exceptional cases, for example when annotating every AST node with the line number.
+Eager tracking is recommended when the position is used frequently and/or in non-exceptional cases, for example when annotating every AST node with the line number.
 
 ## Line Ending
 
 All input classes allow the choice of which line endings should be recognised by the `eol` and `eolf` rules, and used for line counting.
 The supported line endings are `cr`, a single carriage-return/`"\r"`/`0x0d` character as used on classic Mac OS, `lf`, a single line-feed/`"\n"`/`0x0a` as used on Unix, Linux, Mac OS X and macOS, and `crlf`, a sequence of both as used on MS-DOS and Windows.
 
-The default template argument for all input classes is `eol::lf_crlf` which recognises both Unix and MS-DOS line endings.
+The default template parameter for all input classes is `eol::lf_crlf` which recognises both Unix and MS-DOS line endings.
 The supplied alternatives are `eol::cr`, `eol::lf`, `eol::crlf` and `eol::cr_crlf`.
 
 ## Source
@@ -73,7 +76,7 @@ The classes `file_input<>`, `read_input<>` and, on supported platforms, `mmap_in
 
 * `read_input<>` uses C "stdio" facilities to read the file.
 * `mmap_input<>` uses `mmap(2)` on POSIX compliant systems or `MapViewOfFile()` on Windows.
-* `file_input<>` is derived from `mmap_input<>` when available, and `read_input<>` otherwise, inheriting the respective contructors.
+* `file_input<>` is derived from `mmap_input<>` when available, and `read_input<>` otherwise, inheriting the respective constructors.
 
 Most file input classes take a single argument, the filename, which can be supplied as `std::string` or `const char*`.
 They immediately make available the complete contents of the file; `read_input<>` reads the entire file upon construction.
@@ -81,7 +84,7 @@ They immediately make available the complete contents of the file; `read_input<>
 The constructors that take a `FILE*` argument take ownership of the file pointer, i.e. they `fclose()` it in the destructor.
 
 ```c++
-template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
+template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
 struct read_input
 {
    explicit read_input( const char* filename );
@@ -91,14 +94,14 @@ struct read_input
    read_input( FILE* file, const std::string& filename );
 };
 
-template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
+template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
 struct mmap_input
 {
    explicit mmap_input( const char* filename );
    explicit mmap_input( const std::string& filename );
 };
 
-template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
+template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
 using file_input = mmap_input< P, Eol >;  // Or read_input when no mmap_input available.
 ```
 
@@ -119,7 +122,7 @@ It will therefore *only* work correctly with data that is terminated with a 0-by
 The constructors that take additional `byte`, `line` and `byte_in_line` arguments initialise the internal counters with the supplied values, rather than the defaults of `0`, `1` and `0`.
 
 ```c++
-template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf, typename Source = std::string >
+template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf, typename Source = std::string >
 class memory_input
 {
    template< typename T >
@@ -148,7 +151,7 @@ class memory_input
 ###### Example 1
 
 ```c++
-memory_input<> in1( "this is the input to parse", "" );
+memory_input in1( "this is the input to parse", "" );
 ```
 
 Construct a `memory_input` with default tracking mode, default end-of-line mode (accepting Unix and MS-DOS line endings), and default source storage.
@@ -170,7 +173,7 @@ struct packet
 
 packet p = ...; // some UDP packet class
 
-memory_input< tracking_mode::LAZY, eol::crlf > in2( p.buffer().begin(), p.buffer().end(), p.identifier() );
+memory_input< tracking_mode::lazy, eol::crlf > in2( p.buffer().begin(), p.buffer().end(), p.identifier() );
 ```
 
 Consider a UDP packet that was received and should be parsed.
@@ -196,7 +199,7 @@ The class `string_input<>` can also be used to parse a `std::string`.
 Unlike class `memory_input<>`, this class stores a copied (or moved) version of the data for which it takes ownership.
 
 ```c++
-template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf, typename Source = std::string >
+template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf, typename Source = std::string >
 class string_input
 {
    template< typename V, typename T >
@@ -208,6 +211,18 @@ class string_input
 };
 ```
 
+### Example
+
+```c++
+std::string content(); // returns the content
+
+string_input in1( content(), "from_content" );
+```
+
+Construct a `string_input` with default tracking mode, default end-of-line mode (accepting Unix and MS-DOS line endings), and default source storage.
+The data returned from calling `content()` is copied into the input.
+The source is `from_content`.
+
 ### Additional Remarks
 
 Note that the implementation of the constructors is different than shown.
@@ -221,7 +236,7 @@ Unlike the file inputs above, they internally use `buffer_input<>` and therefore
 They all have a single constructor that takes a stream, the maximum buffer size, and the name of the source.
 Note that these classes only keep a pointer/reference to the stream and do **not** take ownership; in particular `cstream_input<>` does **not** call `std::close()`.
 
-See [Incremental Input](#incremental-input) for details on the `maximum` argument, and how to prepare a grammar for incremental input support using the `discard`-rule.
+See [Incremental Input](#incremental-input) for details on the `maximum` argument, and how to use the mandatory [discard facilities](#discard-buffer).
 
 ```c++
 template< typename Eol = eol::lf_crlf >
@@ -247,7 +262,7 @@ They should be used "as if" this was the actual signature.
 The class `argv_input<>` can be used to parse a string passed from the command line.
 
 ```c++
-template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
+template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
 class argv_input
 {
    argv_input( char** argv, const std::size_t n );
@@ -272,22 +287,22 @@ The parse functions accept the following template parameters and arguments:
 
 Additionally, two enumeration values can be used to control the behaviour:
 
-- The `apply_mode` which can also be set to `NOTHING` in order to disable action invocations, just like the `disable<>` rule does.
-- The `rewind_mode` which can also be set to `DONTCARE` in order to not require rewinding of the input on local failure, a micro optimisation.
+- The `apply_mode` which can also be set to `nothing` in order to disable action invocations, just like the `disable<>` rule does.
+- The `rewind_mode` which can also be set to `dontcare` in order to not require rewinding of the input on local failure, a micro optimisation.
 
 The result of a parsing run, i.e. an invocation of `tao::pegtl::parse()`, can be either
 
 - *success*, a return value of `true`,
 - *local failure*, a return value of `false`,
 - *global failure*, an exception of type `tao::pegtl::parse_error`, or
-- any other exception thrown by the input class or an action method.
+- any other exception thrown by the input class or an action function.
 
 ```c++
 template< typename Rule,
           template< typename... > class Action = nothing,
           template< typename... > class Control = normal,
-          apply_mode A = apply_mode::ACTION,
-          rewind_mode M = rewind_mode::REQUIRED,
+          apply_mode A = apply_mode::action,
+          rewind_mode M = rewind_mode::required,
           typename Input,
           typename... States >
 bool parse( Input& in,
@@ -308,8 +323,8 @@ Everything else remains the same.
 template< typename Rule,
           template< typename... > class Action = nothing,
           template< typename... > class Control = normal,
-          apply_mode A = apply_mode::ACTION,
-          rewind_mode M = rewind_mode::REQUIRED,
+          apply_mode A = apply_mode::action,
+          rewind_mode M = rewind_mode::required,
           typename Outer,
           typename Input,
           typename... States >
@@ -320,100 +335,193 @@ bool parse_nested( const Outer& oi,
 
 ## Incremental Input
 
-The PEGTL is designed and optimised for parsing single contiguous blocks of memory, e.g. the contents of a file made available via `mmap(2)`, or the contents of a `std::string`.
+The PEGTL is designed and optimised for parsing single contiguous blocks of memory like a memory-mapped file or the contents of a `std::string`.
+In cases where the data does not fit into memory, or other reasons prevent parsing the data as single memory block, an *incremental* input can be used.
+
+This allows parsing with only (small) portions of the input in a memory buffer at any single time.
+The buffer is filled automatically, however the [*discard* facilities](#discard-buffer) must be used to regularly flush the buffer and make space for a new portion of input data.
 
-In cases where the input does not fit into memory, or there are other reasons to not create a single memory block containing all input data, it is possible, with a little help from the grammar, to perform incremental parsing, where the data is incrementally made available, e.g. when reading from a stream.
+The [stream inputs](#stream-inputs) are ready-to-use input classes for C++-style and C-style streams.
+Apart from having to use the [discard facilities](#discard-buffer), and some extra care when implementing [custom rules](#custom-rules), they can be used just like any other [input class](Inputs-and-Parsing.md).
 
-### Grammars and Buffering
+### Buffer Size
 
-A buffer is used to keep a portion of the input data in a contiguous memory block.
-The buffer is allocated at the begin of the parsing run with a user-supplied maximum size.
+The [stream inputs](#stream-inputs), and all other inputs based on `buffer_input<>`, contain a buffer that is allocated in the constructor.
+The buffer capacity is the sum of a *maximum* value and a *chunk* size.
 
-The maximum buffer size usually depends on the grammar, the actions, and the input data.
-It must be chosen large enough to keep the data required for (a) any backtracking, and (b) all action invocations.
+The maximum value is passed to the constructor as function argument, the chunk size is a (rarely changed) template parameter.
+The required buffer capacity depends on the grammar, the actions, *and* the input data.
 
-The buffer is automatically filled by the parsing rules that require input data, however **discarding data from the buffer is** (currently) **not automatic**:
-The grammar has to call [`discard`](Rule-Reference.md#discard) in appropriate places to free the buffer again.
+The buffer must be able to hold
 
-More precisely, each rule that uses one of the following methods on the input will implicitly make a call to `tao::pegtl::buffer_input<>::require( amount )`.
-(The `empty()`-method uses a hard-coded `amount` of 1.)
+* any and all data for look-ahead performed by the grammar,
+* any and all data for back-tracking performed by the grammar,
+* any and all data for actions' [`apply()`](Actions-and-States.md#apply) (not [`apply0()`](Actions-and-States.md#apply0)).
+
+For example consider an excerpt from the JSON grammar from `include/tao/pegtl/contrib/json.hpp`.
 
 ```c++
-namespace tao
+struct xdigit : abnf::HEXDIG {};
+struct unicode : list< seq< one< 'u' >, rep< 4, must< xdigit > > >, one< '\\' > > {};
+struct escaped_char : one< '"', '\\', '/', 'b', 'f', 'n', 'r', 't' > {};
+struct escaped : sor< escaped_char, unicode > {};
+struct unescaped : utf8::range< 0x20, 0x10FFFF > {};
+struct char_ : if_then_else< one< '\\' >, must< escaped >, unescaped > {};
+
+struct string_content : until< at< one< '"' > >, must< char_ > > {};
+struct string : seq< one< '"' >, must< string_content >, any >
 {
-   namespace pegtl
-   {
-      template< class Reader, typename Eol = eol::lf_crlf >
-      class buffer_input
-      {
-         empty();
-         size( const std::size_t amount );
-         end( const std::size_t amount );
-         ...
-      };
-   }
-}
+   using content = string_content;
+};
+```
+
+The rule `string_content` matches JSON strings as they occur in a JSON document.
+If an action with `apply()` (rather than `apply0()`) is attached to the `string_content` rule, the buffer capacity is an upper bound on the length of the JSON strings that can be processed.
+
+If the actions are only attached to say `unescaped`, `escaped_char` and `rep< 4, must< xdigit > >`, the latter because it, too, occurs in an (implicit, inside of `list`) unbounded loop, then the JSON strings are processed unescaped-character-by-unescaped-character and escape-sequence-by-escape-sequence.
+As long as the buffer is [discarded](#discard-buffer) frequently, like after every unescaped character and every single escape sequence, a buffer capacity as small as 8 or 12 should suffice for parsing arbitrarily long JSON strings.
+
+Note that the [`eof`](Rule-Reference.md#eof) rule requires at least one byte of free buffer space when there is no unconsumed data in the buffer.
+
+### Discard Buffer
+
+To prevent the buffer from overflowing, the `discard()` member function of class `buffer_input<>` must be called regularly.
+
+**Discarding invalidates all pointers to the input's data and MUST NOT be used where backtracking to before the discard might occur AND/OR nested within a rule for which an action with input can be called.**
+
+#### Via Rules
+
+The [`discard`](Rule-Reference#discard) rule behaves just like the [`success`](Rule-Reference.md#success) rule but calls the discard function on the input before returning `true`.
+
+#### Via Actions
+
+The `tao::pegtl::discard_input`, `tao::pegtl::discard_input_on_success` and `tao::pegtl::discard_input_on_failure` [actions](Actions-and-States.md) can be used to discard input non-intrusively, i.e. without changing the grammar like with the [`discard`](Rule-Reference.md#discard) rule.
+
+These actions are used in the usual way, by deriving a custom action class template specialisation from them.
+In the case of `discard_input`, the input is discarded unconditionally after every match attempt of the rule that the action is attached to.
+
+The other two variants behave as implied by their respective names, keeping in mind that "failure" is to be understood as "local failure" (false), no discard is performed on global failure (exception).
+Similarly "unconditional" is wrt. success or local failure, not global failure.
+
+```c++
+template<>
+struct my_action< R >
+   : tao::pegtl::discard_input
+{
+   // It is safe to implement apply() here if appropriate:
+   // discard() will be called by discard_input's match()
+   // only _after_ calling this action's apply().
+};
 ```
 
-This tells the input that a rule wants to inspect and/or consume a certain `amount` of input bytes, and it will attempt to fill the buffer accordingly.
-The returned `size()`, and the distance from `begin()` to `end()`, can also be larger than the requested amount.
+In practice, since the "must"-rules like `must<>` and `if_must<>` inhibit backtracking, they can be good indicators of where to perform a discard.
+For example consider again this rule from the JSON grammar from `include/tao/pegtl/contrib/json.hpp`.
 
-For example, the rule `tao::pegtl::ascii::eol`, which (usually) checks for both `"\r\n"` and "`\n`", calls `size(2)` because it needs to inspect up to two bytes.
-Depending on whether the result of `size(2)` is `0`, `1` or `2`, it will choose which of these two sequences it can attempt to match.
-The number of actually consumed bytes can again be `0`, `1` or `2`, depending on whether they match a valid `eol`-sequence.
+```c++
+struct unicode : list< seq< one< 'u' >, rep< 4, must< xdigit > > >, one< '\\' > > {};
+```
 
-To prevent the buffer from overflowing, the `discard()`-method of class `tao::pegtl::buffer_input` must be called, usually by using the `discard` parsing rule.
-It discards all data in the buffer that precedes the current `begin()`-point, and any remaining data is moved to the beginning of the buffer.
+The `xdigit` rule is within a `must`, wherefore we know that no backtracking is possible, so we could discard after `xdigit` or `must< xdigit >`.
+However then we can't attach an action with [`apply()`](Actions-and-States.md#apply) to the `rep< 4, ... >` since we would be discarding after every single digit.
+This is not ideal, it would be more efficient to process all four xdigits in a single action invocation.
 
-**A `discard` invalidates all pointers to the input's data and MUST NOT be used where backtracking to before the `discard` might occur AND/OR nested within a rule for which an action with input can be called.**
+Looking close we can see that backtracking to before the `rep<>` is actually impossible because once the `list<>` has successfully matched `seq< one< 'u' >, rep< 4, must< xdigit > > >` it will never go back.
+It will attempt to match another backslash, the list item separator, and if successful loop to the `seq<>`, but once the next character is a `'u'`, the `must<>` in the `rep` seals the deal, there is no way to not complete the next list entry.
 
+Therefore we can safely attach an action to the `rep<>` that processes the four xdigits and then discards the input.
+
+```c++
+template<>
+struct my_action< rep< 4, must< xdigit > >
+   : tao::pegtl::discard_input
+{
+   template< typename Input >
+   void apply( const Input& in, /* the states */ )
+   {
+      assert( in.size() == 4 );
+      // process the 4 xdigits
+   }
+};
 ```
-Buffer Memory Layout
-
-B                   begin of buffer space
-:
-B + X               begin of unconsumed buffered data as per begin()
-:
-B + X + size( 0 )   end of unconsumed buffered data as per end( 0 )
-:
-B + maximum         end of buffer space
+
+Another good candidate in the JSON grammar to discard after is the `tao::pegtl::json::value` rule...
+
+### Custom Rules
+
+All incremental inputs included with the library and documented here are based on `buffer_input<>`.
+A custom rule that is compatible with incremental inputs needs to pay attention to the `amount` argument in the input's interface.
+Unlike the inputs based on `memory_input<>`, the `size( amount )` and `end( amount )` member functions do not ignore the `amount` argument, and the `require( amount )` member function is not a complete dummy.
+
+```c++
+template< ... >
+class buffer_input
+{
+   bool empty();
+   std::size_t size( const std::size_t amount );
+   const char* end( const std::size_t amount );
+   void require( const std::size_t amount );
+   ...
+};
 ```
 
-A discard moves the data in the buffer such that `X` is zero, and updates `begin()` to point at the beginning of the buffer.
+The `require( amount )` member function tells the input to make available at least `amount` unconsumed bytes of input data.
+It is not normally called directly unless there is good reason to prefetch some data.
+
+The `empty()`, `size( amount )` and `end( amount )` member functions call `require( amount )`, or, in the case of `empty()`, `require( 1 )`.
+The `amount` parameter should be understood as a parsing rule wishing to inspect and consume *up to* `amount` bytes of input.
 
-### Custom Data Sources
+A custom rule must make sure to use appropriate values of `amount`.
+For examples of how the `amount` is set by parsing rules please search for `in.size` in `include/tao/pegtl/internal/`.
 
-The PEGTL contains a set of stream parser input classes that take care of everything (except discarding data from the buffer, see above) for certain data sources.
-In order to support other data sources, it is necessary to create a custom input class, usually by creating a suitable *reader* class that can be supplied as template argument to class `tao::pegtl::buffer_input<>`.
+### Custom Readers
 
-The reader class can be anything that can be called like the following standard function wrapper:
+An incremental input consists of `buffer_input<>` together with a *reader*, a class or function that is used by the buffer input to fill the buffer.
+
+The buffer input is a class template with multiple template parameters.
+
+```c++
+template< typename Reader,
+          typename Eol = eol::lf_crlf,
+          typename Source = std::string,
+          std::size_t Chunk = 64 >
+class buffer_input;
+```
+
+The `Eol` and `Source` parameters are like for the other [input classes](Inputs-and-Parsing.md#memory-input).
+The `Chunk` parameter is explained below in detail.
+The `Reader` can be anything that can be called like the following wrapper.
 
 ```c++
 std::function< std::size_t( char* buffer, const std::size_t length ) >
 ```
 
-The arguments and return value are similar to other `read()`-style functions:
-Attempt to read up to `length` bytes into the memory pointed to by `buffer` and return the number of bytes actually read.
-Reaching the end of the input should be the only reason for the reader to return zero.
+The arguments and return value are similar to other `read()`-style functions, a request to read `length` bytes into the memory pointed to by `buffer` that returns the number of bytes actually read.
+Reaching the end of the input MUST be the only reason for the reader to return zero.
+The reader might be called again after returning zero, with the expectation of returning zero again.
+
+Note that `buffer_input<>` consumes the first two arguments to its constructor for the *source* and *maximum*, and uses perfect forwarding to pass everything else to the constructor of the embedded instance of `Reader`.
 
-The steps required to use a custom reader for a parsing run are:
+For examples of how to implement readers please look at `istream_reader.hpp` and `cstream_reader.hpp` in `include/tao/pegtl/internal/`.
 
-1. Create a suitable reader class `Reader` (or function).
-2. Create an instance of class `tao::pegtl::buffer_input< Reader >`, using the fact that the `buffer_input`'s constructor can pass arbitrary arguments to the embedded reader instance.
-3. Call `tao::pegtl::parse()` (or `tao::pegtl::parse_nested()`) with the previously created `buffer_input` instance as first argument.
+### Buffer Details
 
-The included examples for C- and C++-style streams can also be used as reference on how to create and use suitable readers, simply `grep(1)` for `cstream_reader` and `istream_reader` (and `cstring_reader`) in the PEGTL source code.
+The buffer input's `Chunk` template parameter is actually used in multiple places.
+
+1. The `maximum` buffer capacity passed by the user is incremented by `Chunk`.
+2. A discard does nothing when there are less than `Chunk` bytes of consumed buffered data.
+3. The buffer input requests at least `Chunk` bytes from the reader if there is enough space.
+
+Note that the first and second point go hand-in-hand, in order to optimise away some discards, the buffer must be extended in order to guarantee that at least `maximum` bytes can be buffered after a call to discard, even when it does nothing. The third point is simply an optimisation to call the reader less frequently.
 
 ## Error Reporting
 
 When reporting an error, one often wants to print the complete line from the input where the error occurred and a marker at the position where the error is found within that line.
-To support this, the `memory_input<>` class has methods `at( p )`, `begin_of_line( p )`, `end_of_line( p )` and `line_as_string( p )` which take a `tao::pegtl::position` as parameter.
-The first three methods return a `const char*` to position `p`, the begin-of-line before `p`, or the end-of-line after `p` (or the end of the input if the input is not terminated by an end-of-line), respectively.
-For convenience, `line_as_string( p )` returns a `std::string` with the complete line around `p`.
+To support this, the `memory_input<>` class has member functions `at( p )`, `begin_of_line( p )`, `end_of_line( p )` and `line_at( p )` which take a `tao::pegtl::position` as parameter.
+The first three functions return a `const char*` to position `p`, the begin-of-line before `p`, or the end-of-line after `p` (or the end of the input if the input is not terminated by an end-of-line), respectively.
+For convenience, `line_at( p )` returns a `std::string_view` with the complete line around `p`.
 Example usage:
 
 ```c++
-
 // create input 'in' here...
 try {
   // call parse on the input 'in' here...
@@ -421,16 +529,16 @@ try {
 catch( const parse_error& e ) {
    const auto p = e.positions.front();
    std::cerr << e.what() << std::endl
-             << in.line_as_string( p ) << std::endl
+             << in.line_at( p ) << std::endl
              << std::string( p.byte_in_line, ' ' ) << '^' << std::endl;
 }
 ```
 
 All input classes based on `memory_input<>` support the above, while all classes based on `buffer_input<>` are unable to supply the same functionality as previous input might have been discarded already.
-Trying to call any of those methods on `buffer_input<>`-based instances will lead to a compile error.
+Trying to call any of those functions on `buffer_input<>`-based instances will lead to a compile error.
 
-## C++17 Deduction Guides
+## Deduction Guides
 
-All input classes support C++17's [deduction guides](https://en.cppreference.com/w/cpp/language/class_template_argument_deduction) when compiling with C++17 or newer, e.g. instead of `file_input<> in( "filename.txt" )` one can use `file_input in( "filename.txt" )`.
+All input classes support [deduction guides](https://en.cppreference.com/w/cpp/language/class_template_argument_deduction), e.g. instead of `file_input<> in( "filename.txt" )` one can use `file_input in( "filename.txt" )`.
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Installing-and-Using.md b/packages/PEGTL/doc/Installing-and-Using.md
index 7c3ab624bbaf76bdc3b220722b582eeda131ba20..d0b78a470eb3f5a24de38f1804d14612d6e2f7c5 100644
--- a/packages/PEGTL/doc/Installing-and-Using.md
+++ b/packages/PEGTL/doc/Installing-and-Using.md
@@ -4,20 +4,28 @@
 
 * [Requirements](#requirements)
 * [Installation Packages](#installation-packages)
-* [CMake Installation](#cmake-installation)
+* [Using CMake](#using-cmake)
+  * [CMake Installation](#cmake-installation)
+  * [`find_package`](#find_package)
+  * [`add_subdirectory`](#add_subdirectory)
+  * [Mixing `find_package` and `add_subdirectory`](#mixing-find_package-and-add_subdirectory)
+* [Conan](#conan)
+  * [Using a development version](#using-a-development-version)
+  * [Developing with conan editable](#developing-with-conan-editable)
 * [Manual Installation](#manual-installation)
 * [Embedding the PEGTL](#embedding-the-pegtl)
   * [Embedding in Binaries](#embedding-in-binaries)
   * [Embedding in Libraries](#embedding-in-libraries)
   * [Embedding in Library Interfaces](#embedding-in-library-interfaces)
+* [Single Header Version](#single-header-version)
 
 ## Requirements
 
-The PEGTL requires a C++11-capable compiler, e.g. one of
+The PEGTL requires a C++17-capable compiler, e.g. one of
 
-* GCC 4.8
-* Clang 3.4
-* Visual Studio 2015
+* GCC 7
+* Clang 5
+* Visual Studio 2017
 
 on either
 
@@ -25,10 +33,10 @@ on either
 * macOS
 * Windows
 
-It requires C++11, e.g. using the `--std=c++11` compiler switch.
+It requires C++17, e.g. using the `--std=c++17` compiler switch.
 Using newer versions of the C++ standard is supported.
 
-It should also work with other C++11 compilers on other Unix systems (or any sufficiently compatible platform).
+It should also work with other C++17 compilers on other Unix systems (or any sufficiently compatible platform).
 
 The PEGTL is written with an emphasis on clean code and is compatible with
 the `-pedantic`, `-Wall`, `-Wextra` and `-Werror` compiler switches.
@@ -44,7 +52,9 @@ Installation packages are available from several package managers. Note that som
 * [Conan]
 * [Spack]
 
-## CMake Installation
+## Using CMake
+
+### CMake Installation
 
 The PEGTL can be built and installed using [CMake], e.g.
 
@@ -56,14 +66,127 @@ $ make
 $ make install
 ```
 
-The above will install the PEGTL into the standard installation path on a
-UNIX system, e.g. `/usr/local/include/`. To change the installation path, use:
+The above will install the PEGTL into the standard installation path on a UNIX
+system, e.g. `/usr/local/include/`. To change the installation path, use:
 
 ```sh
 $ cmake .. -DCMAKE_INSTALL_PREFIX=../install
 ```
 
-in the above. For more options and ways to use CMake, please refer to the [CMake documentation].
+in the above.
+
+### `find_package`
+
+Installation creates a `pegtl-config.cmake` which allows CMake
+projects to find the PEGTL using `find_package`:
+
+```cmake
+find_package(pegtl)
+```
+
+This exports the `taocpp::pegtl` target which can be linked against any other
+target. Linking against `taocpp:pegtl` automatically sets the include
+directories and required flags for C++17 or later. For example:
+
+```cmake
+add_executable(myexe mysources...)
+target_link_libraries(myexe PRIVATE taocpp::pegtl)
+```
+
+### `add_subdirectory`
+
+The PEGTL can also be added as a dependency with `add_subdirectory`:
+
+```cmake
+add_subdirectory(path/to/PEGTL)
+```
+
+This also exports the `taocpp::pegtl` target which can be linked against any
+other target just as with the installation case.
+
+Due to the global nature of CMake targets the target `pegtl` is also defined,
+but only `taocpp::pegtl` should be used for consistency.
+
+If `PEGTL_BUILD_TESTS` is true then the test targets, `pegtl-test-*`, are also
+defined and their corresponding tests registered with `add_test`.
+If `PEGTL_BUILD_EXAMPLES` is true then the example targets, `pegtl-example-*`,
+are also defined.
+
+### Mixing `find_package` and `add_subdirectory`
+
+With the advent of improved methods of managing dependencies (such as [Conan],
+[Spack], [CMake FetchContent]), multiple package inclusion methods needs to be
+able to co-exist.
+
+If PEGTL was first included with `find_package` then subsequent calls to
+`add_subdirectory(path/to/PEGTL)` will skip over the body of the
+`CMakeLists.txt` and use the installed package if the version matches.
+If the version does not match a fatal error will be signalled.
+
+If PEGTL was first included with `add_subdirectory` then a dummy
+`pegtl-config.cmake` is created and `pegtl_DIR` is set. Subsequent calls to
+`find_package(pegtl)` will then use the already added package if the version
+matches. If the version does not match a fatal error will be signalled.
+
+Since CMake targets are global, there exists no way for a CMake project to use
+two different versions of PEGTL simultaneously and signalling a fatal error
+becomes the only practical way of handling the inclusion of multiple different
+PEGTL versions.
+
+For more options and ways to use CMake, please refer to the
+[CMake documentation].
+
+Conan
+---
+
+The [PEGTL conan package](https://bintray.com/taocpp/public-conan/pegtl%3Ataocpp) is automatically updated when a release is made, and it should always be up to date with the latest official release.
+
+Simply add
+
+```ini
+pegtl/<version>@taocpp/stable
+```
+
+as a dependency to your conan project where `<version>` is the version of PEGTL you want to use.
+
+### Using a development version
+
+If a not yet released PEGTL version is required, then PEGTL can be exported in its current state.
+
+```bash
+mkdir build
+conan install -if build
+conan export-pkg -if build -bf build . pegtl/<version>@taocpp/devel
+```
+
+Then proceed by adding
+
+```ini
+pegtl/<version>@taocpp/devel
+```
+
+as a dependency to your conan project.
+
+### Developing with conan editable
+
+If it is required to develop PEGTL alongside another library/application then the package can be put into editable mode with
+
+```bash
+conan editable add . pegtl/<version>@taocpp/devel
+```
+
+If the editable layout has `[builddirs]` set correctly and one is using the `cmake_paths` or `cmake`generator
+
+```cmake
+find_package(pegtl)
+```
+
+will work as expected. It will find the editable package and add it to the current CMake project. An editable package implies that it is under development so tests and examples will be automatically built unless `PEGTL_BUILD_TESTS` and `PEGTL_BUILD_EXAMPLES` are turned off.
+
+Caveats with the editable package:
+
+- Currently, if the package is included with `CONAN_PKG::pegtl` or used in a build system other than CMake then the tests and examples won't be built as the CMake config script is bypassed.
+- CMake will compulsively rebuild tests and examples if the build directory is reconfigured from another directory.
 
 ## Manual Installation
 
@@ -113,12 +236,11 @@ or patch releases, libraries *have* to ensure that the symbols for the PEGTL
 they include differ from those of the applications that use them.
 
 This can be achieved by changing the macro `TAO_PEGTL_NAMESPACE` which, by
-default, is set to `pegtl`, which leads to all symbols residing in namespace
-`tao::pegtl`. To change the namespace, simply define `TAO_PEGTL_NAMESPACE`
-to a unique name before including the PEGTL, for example:
+default, is set to `tao::pegtl`. To change the namespace, simply define
+`TAO_PEGTL_NAMESPACE` to a unique name before including the PEGTL, for example:
 
 ```c++
-#define TAO_PEGTL_NAMESPACE mylib_pegtl
+#define TAO_PEGTL_NAMESPACE mylib::pegtl
 
 #include <tao/pegtl.hpp>
 #include <tao/contrib/json.hpp>
@@ -126,8 +248,8 @@ to a unique name before including the PEGTL, for example:
 int main( int argc, char* argv[] )
 {
    if( argc > 1 ) {
-     tao::mylib_pegtl::argv_input<> in( argv, 1 );
-     tao::mylib_pegtl::parse< tao::mylib_pegtl::json::text >( in );
+     mylib::pegtl::argv_input in( argv, 1 );
+     mylib::pegtl::parse< mylib::pegtl::json::text >( in );
    }
 }
 
@@ -141,29 +263,34 @@ application's and the library's copy of the PEGTL use the same macro names.
 
 In this case it is necessary to change the prefix of all macros of the embedded
 PEGTL from `TAO_PEGTL_` to another unique string in order to prevent macros
-from clashing. In a Unix-shell, the following commands will achieve this:
+from clashing. In a Unix-shell, the following command will achieve this:
 
 ```sh
-$ sed -i 's/TAO_PEGTL_/MYLIB_TAO_PEGTL_/g' $(find -name '[^.]*.[hc]pp')
-$ sed -i 's/TAOCPP_PEGTL_/MYLIB_TAOCPP_PEGTL_/g' $(find -name '[^.]*.[hc]pp')
+$ sed -i 's/TAO_PEGTL_/MYLIB_PEGTL_/g' $(find -name '[^.]*.[hc]pp')
 ```
 
-The above commands needs to run from the top-level directory of the embedded
-PEGTL. Additionally, `MYLIB_TAO_PEGTL_NAMESPACE` needs to be set as explained
+The above command needs to run from the top-level directory of the embedded
+PEGTL. Additionally, `MYLIB_PEGTL_NAMESPACE` needs to be set as explained
 above; alternatively `include/tao/pegtl/config.hpp` can be directly modified.
 
-Note that the second command is only needed because the PEGTL contains
-some compatibility macros for older versions that start with `TAOCPP_PEGTL_`
-instead of `TAO_PEGTL_`. Those older compatibility macros will be removed
-in version 3.0. Starting with version 2.4.0 you should only use macros
-that start with `TAO_PEGTL_`.
-
 A practical example of how the result looks like can be found in our own
-header-only [JSON library](https://github.com/taocpp/json/).
+header-only JSON library [taoJSON](https://github.com/taocpp/json/).
+
+## Single Header Version
+
+You can generate a single-header-version of the PEGTL with the included `Makefile`.
+In a Unix-shell, the following command will achieve this:
+
+```sh
+$ make amalgamate
+```
+
+The above will generate a `build/amalgamated/pegtl.hpp` which will consist of the headers `tao/pegtl.hpp`, `tao/pegtl/analyze.hpp`, their dependencies, and all headers in `tao/pegtl/contrib/` except for the headers in `tao/pegtl/contrib/icu/`.
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 
 [CMake]: https://cmake.org/
 [CMake documentation]: https://cmake.org/documentation/
+[CMake FetchContent]: https://cmake.org/cmake/help/latest/module/FetchContent.html
 [Conan]: https://bintray.com/taocpp/public-conan/pegtl%3Ataocpp
 [Spack]: http://spack.readthedocs.io/en/latest/package_list.html#pegtl
diff --git a/packages/PEGTL/doc/Migration-Guide.md b/packages/PEGTL/doc/Migration-Guide.md
index 6b8c95af968a8644cfab3ad24c409eb84a4b8165..a63ee5b5e2c272c887446a8b677daf3dcf5bf076 100644
--- a/packages/PEGTL/doc/Migration-Guide.md
+++ b/packages/PEGTL/doc/Migration-Guide.md
@@ -1,17 +1,35 @@
 # Migration Guide
 
+## Version 3.0.0
+
+* The build system needs to be configured for C++17 or later.
+* The macro `TAO_PEGTL_NAMESPACE` now defines the fully qualified namespace and was changed from `pegtl` to `tao::pegtl`. When setting `TAO_PEGTL_NAMESPACE`, adapt as needed; in case of doubt, add `tao::` as prefix.
+* The control class template's `apply()` and `apply0()` must only be visible (e.g. via SFINAE) when an action class template function with the appropriate signature exists. See `tao::pegtl::normal` as example.
+* The error message from `tao::pegtl::parse_error` no longer contains the position as a prefix. The positions are available from the `positions` member variable.
+* If you have a use-case for [state](Rule-Reference.md#state-s-r-)'s `S::success()` to have an extended signature to get access to the current `apply_mode`, `rewind_mode`, *action*- and *control* class (template), please let us know and we'll re-add this feature.
+* The compatibility macros starting with `TAOCPP_PEGTL_` were removed, the corresponding `TAO_PEGTL_`-prefixed macros must be used.
+* The compatibility uppercase enumerators were removed, the corresponding lowercase enumerators must be used.
+* The compatibility `peek_byte()` member functions were removed, the `peek_uint8()` member functions must be used.
+* The compatibility header `changes.hpp` was removed, use the action-based `change_*.hpp` headers.
+
+## Version 2.8.0
+
+* All enumerators were changed from uppercase to lowercase.
+* The enumerator `tracking_mode::IMMEDIATE` was renamed to `tracking_mode::eager`.
+* The input-classes' `peek_byte()` member function was renamed to `peek_uint8()`.
+
+Compatibility enumerators and functions are provided, they will be removed in version 3.0.0.
+
 ## Version 2.4.0
 
-The common prefix for all macros was changed from `TAOCPP_PEGTL_` to `TAO_PEGTL_`.
+* The common prefix for all macros was changed from `TAOCPP_PEGTL_` to `TAO_PEGTL_`.
 
-Compatibility macros can still be used, the library should be fully compatible when
-used with older macros. Note, however, that the old macros will be removed in a
-future version 3.0. Consider updating your macro prefixes now.
+Compatibility macros are provided, they will be removed in version 3.0.0.
 
-## From 1.y to 2.z
+## Version 2.0.0
 
 Some of the [changes](Changelog.md#200) for version 2.0.0 require modifications to any source using the PEGTL.
-The good news is that the semantics of all parsing rules and grammars is the same as for versions 1.y.
+The good news is that the semantics of all parsing rules and grammars is the same as for versions 1.x.
 Existing grammars will continue to work as before once the following list of mostly naming and namespace related changes is taken into account.
 
 * Everything in the PEGTL is now in namespace `tao::pegtl`.
@@ -19,8 +37,8 @@ Existing grammars will continue to work as before once the following list of mos
 * The main include file is now `<tao/pegtl.hpp>`, all other include files are `<tao/pegtl/*.hpp>`.
 * The distribution of tasks between [the parse functions and input classes](Inputs-and-Parsing.md) was changed.
 * The string macros have been renamed from `pegtl_(i)string_t` to `TAOCPP_PEGTL_(I)STRING`.
-* The `begin()` method of the input-classes is now called `current()`.
-* The first argument to actions' `apply()`-methods is now of type `tao::pegtl::internal::action_input< ... >`.
+* The `begin()` member function of the input-classes is now called `current()`.
+* The first argument to actions' `apply()` is now of type `tao::pegtl::internal::action_input< ... >`.
 
 For flexibility and future compatibility it is recommended to "template over" the first argument to `apply()` as shown in [Actions and States](Actions-and-States.md#actions).
 
@@ -31,9 +49,9 @@ Applications integrated more tightly with the PEGTL might require additional cha
 
 Please contact the authors at `taocpp(at)icemx.net` for any further questions when updating the PEGTL.
 
-## From 0.x to 1.y or 2.z
+## Version 1.0.0
 
 There were [many important changes](Changelog.md#100) leading up to version 1.0.0.
 Please contact the authors at `taocpp(at)icemx.net` for any further questions when updating the PEGTL.
 
-Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Parse-Tree.md b/packages/PEGTL/doc/Parse-Tree.md
index 961ecba1ecafe259b9eae0e41b762c5ad7135fba..cc1f319239719325fdd0d571fb6d26dce316eb0e 100644
--- a/packages/PEGTL/doc/Parse-Tree.md
+++ b/packages/PEGTL/doc/Parse-Tree.md
@@ -1,34 +1,51 @@
 # Parse Tree
 
-The PEGTL provides facilities for building a [parse tree](https://en.wikipedia.org/wiki/Parse_tree) / [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) in the header
+The PEGTL provides facilities for building a [parse tree](https://en.wikipedia.org/wiki/Parse_tree) (or [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree)).
 
-```c++
-#include <tao/pegtl/contrib/parse_tree.hpp>
-```
+It provides the basic infrastructure to build a parse tree that
 
-It provides the basic infrastructure to build a parse tree and:
-
-* Builds a full parse tree (one node for each matched rule) by default.
-* Includes a default node class to hold parse tree information.
-* Supports custom node classes to contain additional information.
-* Supports a selector class template to choose which nodes to store in the parse tree.
-* Supports a transform method in the selector specialization for custom modifications of the tree.
+* by default is *complete*, with one tree node for every successfully matched rule,
+  * with an optional *selection* to only generate nodes for a chosen subset of rules;
+* by default uses the included tree node class that stores all pertinent information,
+  * but can also be used with a custom tree node class that adheres to certain rules;
+* and supports on-the-fly tree transformations; some of the more common ones are included.
 
 > The parse tree / AST part of the PEGTL is currently in active development and serves as a prove-of-concept, expect changes at any time. Try it out, experiment with it, and most importantly let us know what you think of it. We need **your** feedback!
 
+## Content
+
+* [Full Parse Tree](#full-parse-tree)
+* [Partial Parse Tree](#partial-parse-tree)
+* [Transforming Nodes](#transforming-nodes)
+* [Transformers](#transformers)
+* [`tao::pegtl::parse_tree::node`](#taopegtlparse_treenode)
+* [Custom Node Class](#custom-node-class)
+
 ## Full Parse Tree
 
-To obtain a full parse tree, call the `tao::pegtl::parse_tree::parse()`-method with a grammar and an input:
+To obtain a (complete) parse tree, simply call `tao::pegtl::parse_tree::parse()` with a grammar and an input.
 
 ```c++
+#include <tao/pegtl/contrib/parse_tree.hpp>
+
 auto root = tao::pegtl::parse_tree::parse< my_grammar >( in );
 ```
 
-The result is a `std::unique_ptr< tao::pegtl::parse_tree::node >`. The pointer is empty when the input did not match the grammar, otherwise it contains the root node of the resulting parse tree. Intermediate nodes from rules which did not match will be removed automatically.
+The result is a `std::unique_ptr< tao::pegtl::parse_tree::node >`.
+The pointer is empty when the input did not match the grammar, otherwise it contains the root node of the resulting parse tree.
+
+The tree nodes have a `name()` member function that returns the name of the grammar rule of which it represents a successful match, `begin()` and `end()` member functions to access the position of the matched portion of the input, `string()` and `string_view()` to actually access said matched input, and a vector called `children` with unique pointers to the child nodes.
+
+Note that the included tree node class **points** to the matched data, rather than copying it into the node, wherefore the input **must** still be "alive" when accessing the matched data!
+
+A more complete description of the included tree node class can be found below.
 
 ## Partial Parse Tree
 
-When a full parse tree with nodes for all rules is too much it is possible to supply a second template parameter to the `parse_tree::parse()` function that controls which rules get a parse tree node. This second template parameter `S` is itself a class template. For each rule `Rule` that matched, a node is generated only when `S<Rule>::value` is `true`. It is then possible to select the rules that should generate nodes as follows:
+Usually only a subset of grammar rules should generate parse tree nodes.
+In order to select the grammar rules for which a successful match is to generate a parse tree node, a second template parameter can be passed to `parse_tree::parse()`.
+This parameter is a class template that is called a *selector*.
+For each rule `Rule`, the boolean value `selector< Rule >::value` determines whether a parse tree node is generated.
 
 ```c++
 template< typename Rule > struct my_selector : std::false_type {};
@@ -41,11 +58,32 @@ template<> struct my_selector< my_rule_3 > : std::true_type {};
 auto root = tao::pegtl::parse_tree::parse< my_grammar, my_selector >( in );
 ```
 
-The above style is a white-list, where the default is `std::false_type` and you explicitly list those rules which will generate a node. Of course, you can also set the default to `std::true_type` and explicitly list the rules that are *not* to generate a node (black-list style).
+Note that the example uses a white-list style; the default is `std::false_type` and only rules listed with a specialisation deriving from `std::true_type` will generate nodes.
+The opposite, a black-list style, is of course possible, too.
+
+The PEGTL includes a selector class and additional utility classes to allow for a less verbose specification of a selector.
+The following definition of `my_selector` will behave just like the one above.
+
+```c++
+template< typename Rule >
+using my_selector = tao::pegtl::parse_tree::selector< Rule,
+   tao::pegtl::parse_tree::store_content::on<
+      my_rule_1,
+      my_rule_2,
+      my_rule_3 > >;
+
+// ...
+
+auto root = tao::pegtl::parse_tree::parse< my_grammar, my_selector >( in );
+```
+
+Note that `store_content` further specifies that the information about the matched portion of the input be stored in the generated nodes; other possibilities are discussed below.
 
 ## Transforming Nodes
 
-A parse tree, full or partial, can still be too closely related to the structure of the grammar. In order to simplify the tree (or otherwise improve its structure), an optional `transform()` method can be added to each specialization of the selector class template (that generates a node). This methods gets passed a reference to the current node, which also gives access to the children, but not to the parent:
+A parse tree, full or partial, can still be too closely related to the structure of the grammar.
+In order to simplify the tree (or otherwise improve its structure), an optional `transform()` static member function can be added to each specialization of the selector class template (that generates a node).
+This function gets passed a reference to the current node, which also gives access to the children, but not to the parent:
 
 ```c++
 template<> struct my_selector< my_rule_2 > : std::true_type
@@ -57,82 +95,145 @@ template<> struct my_selector< my_rule_2 > : std::true_type
 };
 ```
 
-You can transform `n` in almost any way you can imagine, the [`parse_tree.cpp`](https://github.com/taocpp/PEGTL/blob/master/src/example/pegtl/parse_tree.cpp)-example shows two techniques for marking nodes as "content-less", and for actual transformations of the parse tree into an AST.
+`transform` can modify `n` in any way you like, the [`parse_tree.cpp`](https://github.com/taocpp/PEGTL/blob/master/src/example/pegtl/parse_tree.cpp)-example shows two techniques for marking nodes as "content-less", and for transforming the parse tree into an AST.
+
+It is also possible to call `n.reset()`, or otherwise set `n` to an empty pointer, which effectively removes `n` (and all of its child nodes) from the parse tree.
 
-There is another option not shown in the example: You can call `n.reset()` before returning from `transform()`. This prevents the node from being added to its parent. It removes the node (as well as all of its children) from the generated parse tree.
+## Transformer
+
+As shown above, the selector class template allows to specify which nodes should be stored. Several additional helper classes are predefined that have common `transform` methods. The selector allows to add multiple sections with different helpers like this:
+
+```c++
+template< typename Rule >
+using my_selector = tao::pegtl::parse_tree::selector< Rule,
+   tao::pegtl::parse_tree::store_content::on<
+      my_rule_1,
+      my_rule_2,
+      my_rule_3 >,
+   tao::pegtl::parse_tree::remove_content::on<
+      my_rule_4,
+      my_rule_5 >,
+   tao::pegtl::parse_tree::apply< my_helper >::on<
+      my_rule_7,
+      my_rule_8 > >;
+```
+
+Note that each rule may only be used in one section, it is an error to add a rule to multiple sections.
+
+`store_content` and `remove_content` are predefined by the library, whereas `my_helper` can be defined by yourself.
+
+###### `tao::pegtl::parse_tree::store_content`
+
+This stores the node, including pointing to the content it matched on.
+
+###### `tao::pegtl::parse_tree::remove_content`
+
+This stores the node, but calls the node's `remove_content` member function.
+
+###### `tao::pegtl::parse_tree::fold_one`
+
+This stores the node, but when a node has exactly one child, the node replaces itself with this child, otherwise removes its own content (not children).
+
+###### `tao::pegtl::parse_tree::discard_empty`
+
+This stores the node, except for when the node does *not* have any children, in which case it removes itself, otherwise removes its own content (not children).
+
+### Example
+
+An example of using some of the transformers can be found in `src/example/pegtl/abnf2pegtl.cpp`.
 
 ## `tao::pegtl::parse_tree::node`
 
-This is the default node class used by `tao::pegtl::parse_tree::parse` if no custom node class is specified. In that case, the root node, as well as all (nested) child nodes, provide the following interface:
+This is the interface of the node class used by `tao::pegtl::parse_tree::parse` when no custom node class is specified.
 
 ```c++
-struct node
+template< typename T >
+struct basic_node
 {
-   std::vector< std::unique_ptr< node > > children;
+   using node_t = T;
+   using children_t = std::vector< std::unique_ptr< node_t > >;
 
-   bool is_root() const noexcept();
+   children_t children;
+   std::type_index id;
+   std::string source;
+
+   template< typename U >
+   bool is() const noexcept { return id == typeid( U ); }
+
+   bool is_root() const noexcept;
 
    // precondition from here on: !is_root()
 
    std::string name() const;
 
-   bool has_content() const noexcept();
-   std::string content() const;  // precondition: has_content()
+   position begin() const;
+   position end() const;
+
+   bool has_content() const noexcept;
+   std::string_view string_view() const noexcept;  // precondition: has_content()
+   std::string string() const;  // precondition: has_content()
 
-   std::string source() const;
+   template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
+   memory_input< P, Eol > as_memory_input() const;
 
    // useful for transform:
    void remove_content();
 };
+
+struct node : basic_node< node > {};
 ```
 
-The name is the demangled name of the rule. By default all nodes (except the root node) can provide the content that matched, i.e. the part of the input that the rule the node was created for matched. You only need to check `has_content()` if you previously used `remove_content()` in your transform methods, otherwise there will always be content (except for at the root).
+The name is the demangled name of the rule. By default, all nodes (except the root node) can provide the content that matched, i.e. the part of the input that the rule the node was created for matched. It is only necessary to check `has_content()` when `remove_content()` was used by a transform function (either directly or indirectly via one of the convenience helpers), otherwise all nodes except for the root will always "have content".
 
-See the [`parse_tree.cpp`](https://github.com/taocpp/PEGTL/blob/master/src/example/pegtl/parse_tree.cpp)-example for more information how to output (or otherwise use) the nodes.
+See [`parse_tree.cpp`](https://github.com/taocpp/PEGTL/blob/master/src/example/pegtl/parse_tree.cpp) for more information on how to output (or otherwise use) the nodes.
 
 ## Custom Node Class
 
-If you need more control over how data is stored/handled in the nodes, you can provide your own node class. You can add it to the parse call as an additional template parameter after the rule:
+For more control over how data is stored/handled in the nodes, a custom node class can be utilised.
+The type of node is passed as an additional template parameter to the parse tree `parse()` function.
 
 ```c++
 auto r1 = tao::pegtl::parse_tree::parse< my_grammar, my_node >( in );
 auto r2 = tao::pegtl::parse_tree::parse< my_grammar, my_node, my_selector >( in );
 ```
 
-Note that `my_node` is a class type while `my_selector` is a class template. If you provide your own node class, it must provide the following interface:
+Note that `my_node` is a class, while `my_selector` is a class template. A custom node class must implement the following interface.
 
 ```c++
 struct my_node
 {
-   // it must be default constructible
+   // Must be default constructible
    my_node() = default;
 
-   // no copy/move is necessary
-   // (nodes are always owned/handled by a std::unique_ptr)
+   // Nodes are always owned/handled by a std::unique_ptr
+   // and never copied or assigned...
    my_node( const my_node& ) = delete;
    my_node( my_node&& ) = delete;
+   my_node& operator=( const my_node& ) = delete;
+   my_node& operator=( my_node&& ) = delete;
 
-   // it must be destructible
+   // Must be destructible
    ~my_node() = default;
 
-   // no assignment necessary
-   my_node& operator=( const my_node& ) = delete;
-   my_node& operator=( my_node&& ) = delete;
+   // All non-root nodes receive a call to start() when
+   // a match is attempted for Rule in a parsing run...
+   template< typename Rule, typename Input, typename... States >
+   void start( const Input& in, States&&... st );
 
-   // all non-root nodes are initialized by calling this method
-   template< typename Rule, typename Input >
-   void start( const Input& in );
+   // ...and later a call to success() when the match succeeded...
+   template< typename Rule, typename Input, typename... States >
+   void success( const Input& in, States&&... st );
 
-   // if parsing of the rule succeeded, this method is called
-   template< typename Rule, typename Input >
-   void success( const Input& in );
+   // ...or to failure() when a (local) failure was encountered.
+   template< typename Rule, typename Input, typename... States >
+   void failure( const Input& in, States&&... st );
 
-   // if parsing succeeded and the (optional) transform call
-   // did not discard the node, it is appended to its parent.
-   // note that "child" is the node whose Rule just succeeded
-   // and *this is the parent where the node should be appended.
-   void append( std::unique_ptr< my_node > child );
+   // After a call to success(), and the (optional) call to the selector's
+   // transform() did not discard a node, it is passed to its parent node
+   // with a call to the parent node's emplace_back() member function.
+   template< typename... States >
+   void emplace_back( std::unique_ptr< node_t > child, States&&... st );
 };
 ```
 
-Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Parse-Tree.png b/packages/PEGTL/doc/Parse-Tree.png
new file mode 100644
index 0000000000000000000000000000000000000000..fcacd0611dbb67c7516dbc0df9c54211d21d3ae9
Binary files /dev/null and b/packages/PEGTL/doc/Parse-Tree.png differ
diff --git a/packages/PEGTL/doc/Performance-Notes.md b/packages/PEGTL/doc/Performance-Notes.md
index 699319d28cdabd518285eb159aec5c90a54465e2..43198177dc0f998deec61a517b9ca73803296b7d 100644
--- a/packages/PEGTL/doc/Performance-Notes.md
+++ b/packages/PEGTL/doc/Performance-Notes.md
@@ -42,4 +42,4 @@ However with `-O0`, the optimised `at_one< '"' >` was faster by 5-10% in a [JSON
 
 We still need to test whether the compiler manages to perform the same optimisation in more complex cases.
 
-Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/README.md b/packages/PEGTL/doc/README.md
index 4fc2c5e2d351f9598e0470b4288a7583972a7f28..4f98196acd8814c5b1b92a783a4eefdfeedd6e2f 100644
--- a/packages/PEGTL/doc/README.md
+++ b/packages/PEGTL/doc/README.md
@@ -5,13 +5,17 @@
 * [Installing and Using](Installing-and-Using.md)
   * [Requirements](Installing-and-Using.md#requirements)
   * [Installation Packages](Installing-and-Using.md#installation-packages)
-  * [CMake Installation](Installing-and-Using.md#cmake-installation)
+  * [Using CMake](Installing-and-Using.md#using-cmake)
+    * [CMake Installation](Installing-and-Using.md#cmake-installation)
+    * [`find_package`](Installing-and-Using.md#find_package)
+    * [`add_subdirectory`](Installing-and-Using.md#add_subdirectory)
+    * [Mixing `find_package` and `add_subdirectory`](Installing-and-Using.md#mixing-find_package-and-add_subdirectory)
   * [Manual Installation](Installing-and-Using.md#manual-installation)
   * [Embedding the PEGTL](Installing-and-Using.md#embedding-the-pegtl)
     * [Embedding in Binaries](Installing-and-Using.md#embedding-in-binaries)
     * [Embedding in Libraries](Installing-and-Using.md#embedding-in-libraries)
     * [Embedding in Library Interfaces](Installing-and-Using.md#embedding-in-library-interfaces)
-  * [Limitations](Installing-and-Using.md#limitations)
+  * [Single Header Version](Installing-and-Using.md#single-header-version)
 * [Rules and Grammars](Rules-and-Grammars.md)
   * [Combining Existing Rules](Rules-and-Grammars.md#combining-existing-rules)
   * [Toy S-Expression Grammar](Rules-and-Grammars.md#toy-s-expression-grammar)
@@ -19,16 +23,26 @@
     * [Simple Rules](Rules-and-Grammars.md#simple-rules)
     * [Complex Rules](Rules-and-Grammars.md#complex-rules)
 * [Actions and States](Actions-and-States.md)
-  * [Actions](Actions-and-States.md#actions)
-    * [Apply0](Actions-and-States.md#apply0)
-    * [Apply](Actions-and-States.md#apply)
+  * [Overview](Actions-and-States.md#overview)
+  * [Example](Actions-and-States.md#example)
   * [States](Actions-and-States.md#states)
-  * [Action Specialisation](Actions-and-States.md#action-specialisation)
+  * [Apply](Actions-and-States.md#apply)
+  * [Apply0](Actions-and-States.md#apply0)
+  * [Inheriting](Actions-and-States.md#inheriting)
+  * [Specialising](Actions-and-States.md#specialising)
   * [Changing Actions](Actions-and-States.md#changing-actions)
+    * [Via Rules](Actions-and-States.md#via-rules)
+    * [Via Actions](Actions-and-States.md#via-actions)
   * [Changing States](Actions-and-States.md#changing-states)
-    * [No Switching](Actions-and-States.md#no-switching)
-    * [Intrusive Switching](Actions-and-States.md#intrusive-switching)
-    * [External Switching](Actions-and-States.md#external-switching)
+    * [Via Rules](Actions-and-States.md#via-rules-1)
+    * [Via Actions](Actions-and-States.md#via-actions-1)
+  * [Changing Actions and States](Actions-and-States.md#changing-actions-and-states)
+  * [Match](Actions-and-States.md#match)
+  * [Nothing](Actions-and-States.md#nothing)
+  * [Troubleshooting](Actions-and-States.md#troubleshooting)
+    * [Boolean Return](Actions-and-States.md#boolean-return)
+    * [State Mismatch](Actions-and-States.md#state-mismatch)
+  * [Legacy Actions](Actions-and-States.md#legacy-actions)
 * [Errors and Exceptions](Errors-and-Exceptions.md)
   * [Local to Global Failure](Errors-and-Exceptions.md#local-to-global-failure)
   * [Global to Local Failure](Errors-and-Exceptions.md#global-to-local-failure)
@@ -61,10 +75,13 @@
   * [Parse Function](Inputs-and-Parsing.md#parse-function)
   * [Nested Parsing](Inputs-and-Parsing.md#nested-parsing)
   * [Incremental Input](Inputs-and-Parsing.md#incremental-input)
-    * [Grammars and Buffering](Inputs-and-Parsing.md#grammars-and-buffering)
-    * [Custom Data Sources](Inputs-and-Parsing.md#custom-data-sources)
+    * [Buffer Size](Inputs-and-Parsing.md#buffer-size)
+    * [Discard Input](Inputs-and-Parsing.md#discard-input)
+    * [Custom Rules](Inputs-and-Parsing.md#custom-rules)
+    * [Custom Readers](Inputs-and-Parsing.md#custom-readers)
+    * [Buffer Details](Inputs-and-Parsing.md#buffer-details)
   * [Error Reporting](Inputs-and-Parsing.md#error-reporting)
-  * [C++17 Deduction Guides](Inputs-and-Parsing.md#c17-deduction-guides)
+  * [Deduction Guides](Inputs-and-Parsing.md#deduction-guides)
 * [Control and Debug](Control-and-Debug.md)
   * [Normal Control](Control-and-Debug.md#normal-control)
   * [Control Functions](Control-and-Debug.md#control-functions)
@@ -72,12 +89,22 @@
   * [Advanced Control](Control-and-Debug.md#advanced-control)
   * [Changing Control](Control-and-Debug.md#changing-control)
 * [Parse Tree](Parse-Tree.md)
+  * [Full Parse Tree](Parse-Tree.md#full-parse-tree)
+  * [Partial Parse Tree](Parse-Tree.md#partial-parse-tree)
+  * [Transforming Nodes](Parse-Tree.md#transforming-nodes)
+  * [Transformers](Parse-Tree.md#transformers)
+  * [`tao::pegtl::parse_tree::node`](Parse-Tree.md#taopegtlparse_treenode)
+  * [Custom Node Class](Parse-Tree.md#custom-node-class)
 * [Contrib and Examples](Contrib-and-Examples.md)
   * [Contrib](Contrib-and-Examples.md#contrib)
   * [Examples](Contrib-and-Examples.md#examples)
 * [Grammar Analysis](Grammar-Analysis.md)
+  * [Rule Analysis](Grammar-Analysis.md#rule-analysis)
+  * [Background](Grammar-Analysis.md#background)
+  * [Custom Rules](Grammar-Analysis.md#custom-rules)
 * [Changelog](Changelog.md)
 * [Migration Guide](Migration-Guide.md)
+* [Thank You](Thank-You.md)
 
 # Rule Reference Index
 
@@ -212,6 +239,7 @@
 * [`ranges< C1, D1, C2, D2, ..., E >`](Rule-Reference.md#ranges-c1-d1-c2-d2--e-) <sup>[(ascii rules)](Rule-Reference.md#ascii-rules)</sup>
 * [`ranges< C1, D1, C2, D2, ..., E >`](Rule-Reference.md#ranges-c1-d1-c2-d2--e--1) <sup>[(unicode rules)](Rule-Reference.md#unicode-rules)</sup>
 * [`ranges< C1, D1, C2, D2, ..., E >`](Rule-Reference.md#ranges-c1-d1-c2-d2--e--2) <sup>[(binary rules)](Rule-Reference.md#binary-rules)</sup>
+* [`rematch< R, S... >`](Rule-Reference.md#rematch-r-s-) <sup>[(convenience)](Rule-Reference.md#convenience)</sup>
 * [`rep< Num, R... >`](Rule-Reference.md#rep-num-r-) <sup>[(convenience)](Rule-Reference.md#convenience)</sup>
 * [`rep_max< Max, R... >`](Rule-Reference.md#rep_max-max-r-) <sup>[(convenience)](Rule-Reference.md#convenience)</sup>
 * [`rep_min< Min, R... >`](Rule-Reference.md#rep_min-min-r-) <sup>[(convenience)](Rule-Reference.md#convenience)</sup>
@@ -255,4 +283,4 @@
 * [`xid_continue`](Rule-Reference.md#xid_continue) <sup>[(icu rules)](Rule-Reference.md#icu-rules-for-binary-properties)</sup>
 * [`xid_start`](Rule-Reference.md#xid_start) <sup>[(icu rules)](Rule-Reference.md#icu-rules-for-binary-properties)</sup>
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Rule-Reference.md b/packages/PEGTL/doc/Rule-Reference.md
index bb91804332e446e6150ca005520be874f8eae9fa..85040484d959eca8015d4f6625538bd4f1001bdc 100644
--- a/packages/PEGTL/doc/Rule-Reference.md
+++ b/packages/PEGTL/doc/Rule-Reference.md
@@ -9,7 +9,7 @@ rules **never** consume input when they do not succeed.
 Remember that there are two failure modes, only the first of which usually leads to back-tracking:
 
 - *Local failure* or a return value of `false`, in which case the rule must rewind the input to the position at which the rule match was attempted.
-- *Global failure* or an exception (usually of type `tao::parse_error`) that is usually generated by a control-class' `raise()`-method.
+- *Global failure* or an exception (usually of type `tao::parse_error`) that is usually generated by a control-class' `raise()` static member function.
 
 ## Equivalence
 
@@ -21,7 +21,7 @@ is not how they are implemented, therefore:
 - *not* with regard to which actions will be invoked while matching.
 
 However, rule equivalence does show exactly where the `raise<>` rule is inserted
-and therefore which rule will be used to call the control class' `raise()`-method.
+and therefore which rule will be used to call the control class' `raise()`.
 
 ## Parameter Packs
 
@@ -70,7 +70,7 @@ These rules are in namespace `tao::pegtl`.
 ###### `discard`
 
 * Equivalent to `success`, but:
-* Calls the input's `discard()`-method.
+* Calls the input's `discard()` member function.
 * Must not be used where backtracking to before the `discard` might occur and/or nested within a rule for which an action with input can be called.
 * See [Incremental Input](Inputs-and-Parsing.md#incremental-input) for details.
 
@@ -89,7 +89,7 @@ These rules are in namespace `tao::pegtl`.
 * Equivalent to `seq< R... >`, but:
 * Replaces all state arguments with a new instance `s` of type `S`.
 * `s` is constructed with the input and all previous states as arguments.
-* If `seq< R... >` succeeds then `s.success()` is called with the input after the match and all previous states as arguments, and, if expected, with `A, M, Action, Control` as template parameters.
+* If `seq< R... >` succeeds then `s.success()` is called with the input after the match and all previous states as arguments.
 
 ## Combinators
 
@@ -210,9 +210,8 @@ These rules are in namespace `tao::pegtl`.
 
 ###### `minus< M, S >`
 
-* Succeeds if `M` matches, and then `S` does **not** match all of the input that `M` matched.
-* Does not call actions for `S` (unless `S` contains `enable<>`).
-* Ignores `S` for the [grammar analysis](Grammar-Analysis.md).
+* Succeeds if `M` matches, and `S` does *not* match *all* of the input that `M` matched.
+* Equivalent to `rematch< M, not_at< S, eof > >`.
 
 ###### `must< R... >`
 
@@ -235,6 +234,11 @@ These rules are in namespace `tao::pegtl`.
 * Matches an optional `R` that can be padded by arbitrary many `P` or just arbitrary many `P`.
 * Equivalent to `seq< star< P >, opt< R, star< P > > >`.
 
+###### `rematch< R, S... >`
+
+* Succeeds if `R` matches, and each `S` matches the input that `R` matched.
+* Ignores all `S` for the [grammar analysis](Grammar-Analysis.md).
+
 ###### `rep< Num, R... >`
 
 * Matches `seq< R... >` for `Num` times without checking for further matches.
@@ -293,7 +297,7 @@ These rules are in namespace `tao::pegtl`.
 These rules are in namespace `tao::pegtl`.
 
 These rules replicate the intrusive way actions were called from within the grammar in the PEGTL 0.x with the `apply<>` and `if_apply<>` rules.
-The actions for these rules are classes (rather than class templates as required for the `parse()`-functions and `action<>`-rule).
+The actions for these rules are classes (rather than class templates as required for `parse()` and the `action<>`-rule).
 These rules respect the current `apply_mode`, but don't use the control-class to invoke the actions.
 
 ###### `apply< A... >`
@@ -322,15 +326,15 @@ Atomic rules do not rely on other rules.
 
 ###### `bof`
 
-* Succeeds at "beginning-of-file", i.e. when the input's `byte()` method returns zero.
+* Succeeds at "beginning-of-file", i.e. when the input's `byte()` member function returns zero.
 * Does not consume input.
-* Does **not** work with inputs that don't have a `byte()` method.
+* Does **not** work with inputs that don't have a `byte()` member function.
 
 ###### `bol`
 
-* Succeeds at "beginning-of-line", i.e. when the input's `byte_in_line()` method returns zero.
+* Succeeds at "beginning-of-line", i.e. when the input's `byte_in_line()` member function returns zero.
 * Does not consume input.
-* Does **not** work with inputs that don't have a `byte_in_line()` method.
+* Does **not** work with inputs that don't have a `byte_in_line()` member function.
 
 ###### `bytes< Num >`
 
@@ -350,7 +354,7 @@ Atomic rules do not rely on other rules.
 ###### `raise< T >`
 
 * Generates a *global failure*.
-* Calls the control-class' `Control< T >::raise()`-method.
+* Calls the control-class' `Control< T >::raise()` static member function.
 * `T` *can* be a rule, but it does not have to be a rule.
 * Does not consume input.
 
@@ -398,6 +402,11 @@ can be matched by either `tao::pegtl::ascii::string< 0xe2, 0x82, 0xac >` or `tao
 * Matches and consumes a single ASCII decimal digit character.
 * Equivalent to `range< '0', '9' >`.
 
+###### `ellipsis`
+
+* Matches and consumes three dots.
+* Equivalent to `three< '.' >`.
+
 ###### `eol`
 
 * Depends on the `Eol` template parameter of the input, by default:
@@ -582,7 +591,7 @@ It is an error when a code unit in the range `0xd800` to `0xdfff` is encountered
 ###### `any`
 
 * Succeeds when the input is not empty, and:
-* The next N bytes encode of a valid Unicode code point.
+* The next N bytes encode a valid Unicode code point.
 * Consumes the N bytes when it succeeds.
 
 ###### `bom`
@@ -1192,6 +1201,7 @@ The term *input value* indicates a correspondingly sized integer value read from
 * [`ranges< C1, D1, C2, D2, ..., E >`](#ranges-c1-d1-c2-d2--e-) <sup>[(ascii rules)](#ascii-rules)</sup>
 * [`ranges< C1, D1, C2, D2, ..., E >`](#ranges-c1-d1-c2-d2--e--1) <sup>[(unicode rules)](#unicode-rules)</sup>
 * [`ranges< C1, D1, C2, D2, ..., E >`](#ranges-c1-d1-c2-d2--e--2) <sup>[(binary rules)](#binary-rules)</sup>
+* [`rematch< R, S... >`](#rematch-r-s-) <sup>[(convenience)](#convenience)</sup>
 * [`rep< Num, R... >`](#rep-num-r-) <sup>[(convenience)](#convenience)</sup>
 * [`rep_max< Max, R... >`](#rep_max-max-r-) <sup>[(convenience)](#convenience)</sup>
 * [`rep_min< Min, R... >`](#rep_min-min-r-) <sup>[(convenience)](#convenience)</sup>
@@ -1235,4 +1245,4 @@ The term *input value* indicates a correspondingly sized integer value read from
 * [`xid_continue`](#xid_continue) <sup>[(icu rules)](#icu-rules-for-binary-properties)</sup>
 * [`xid_start`](#xid_start) <sup>[(icu rules)](#icu-rules-for-binary-properties)</sup>
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Rules-and-Grammars.md b/packages/PEGTL/doc/Rules-and-Grammars.md
index 78c548c2ddde11e33717a49628ad3b7879746c54..f577ad97d990a013adcb9273f3febca03959529a 100644
--- a/packages/PEGTL/doc/Rules-and-Grammars.md
+++ b/packages/PEGTL/doc/Rules-and-Grammars.md
@@ -79,7 +79,7 @@ struct line_comment
 struct list;
 
 struct list_comment
-   : if_must< at< one< '(' >, disable< list > > > {};
+   : if_must< at< one< '(' > >, disable< list > > {};
 
 struct comment
    : if_must< one< '#' >, sor< list_comment, line_comment > > {};
@@ -116,21 +116,21 @@ In order to let a parsing run do more than verify whether an input conforms to t
 ## Creating New Rules
 
 Sometimes a grammar requires a parsing rule that can not be readily created as combination of the existing rules.
-In these cases a custom grammar rule, i.e. a class with a static `match()`-method that has to adhere to one of two possible interfaces or prototypes, can be implemented from scratch.
+In these cases a custom grammar rule, i.e. a class with a static member function called `match()` that has to adhere to one of two possible interfaces or prototypes, can be implemented from scratch.
 
-When implementing a custom rule class, it is important to remember that the input passed to a rules' `match()`-method represents the *remainder* of the complete input.
+When implementing a custom rule class, it is important to remember that the input passed to `match()` represents the *remainder* of the complete input.
 At the beginning of a parsing run, the input represents the complete data-to-be-parsed.
 During the parsing run, many rules *consume* the data that matched from the input.
-Consuming data from an input advances the pointer to the data that the input's `begin()`-method returns, and decrements the size by the same amount.
+Consuming data from an input advances the pointer to the data that the input's `begin()` member function returns, and decrements the size by the same amount.
 
 The PEGTL makes one **important** assumption about all parsing rules.
-If a call to a `match()`-method returns with `false`, then the rule **must not** have consumed input (for [complex rules](#complex-rules): only when the `rewind_mode` is `REQUIRED`).
+If a call to `match()` returns with `false`, then the rule **must not** have consumed input (for [complex rules](#complex-rules): only when the `rewind_mode` is `required`).
 For performance reasons this assumption is neither ensured nor verified by the PEGTL.
 
 ### Simple Rules
 
-In the simplified rule, the `match()`-function is called with a single argument, the input.
-All rules' `match()`-method return a `bool` to indicate success or (local) failure.
+In the simplified rule, `match()` is called with a single argument, the input.
+It returns a `bool` to indicate success or (local) failure.
 Rules with the simplified interface are called without the states as arguments.
 
 ```c++
@@ -142,7 +142,7 @@ struct simple_rule
 ```
 
 Here is an excerpt from the included example program `src/example/pegtl/modulus_match.cpp` that shows a simple custom rule.
-The - slightly artificial - rule `my_rule` uses three important `input` methods,
+The - slightly artificial - rule `my_rule` uses three important `input` functions,
 
 1. first `size()` to check whether the input is not empty,
 
@@ -183,7 +183,7 @@ namespace modulus
 int main( int argc, char* argv[] )
 {
    if( argc > 1 ) {
-      tao::pegtl::argv_input<> in( argv, 1 );
+      tao::pegtl::argv_input in( argv, 1 );
       tao::pegtl::parse< modulus::grammar >( in );
    }
    return 0;
@@ -192,10 +192,10 @@ int main( int argc, char* argv[] )
 
 ### Complex Rules
 
-The complex calling convention gives a rule's `match()`-method access to "everything", i.e. some modes, the action and control classes, and all state arguments.
+The complex calling convention gives a rule's `match()` member function access to "everything", i.e. some modes, the action- and control class, and all state arguments.
 All of these parameters are required for custom rules that need to themselves call other rules for matching.
 
-The `match()`-method in a complex rule takes the following form.
+The signature of `match()` in a complex rule takes the following form.
 
 ```c++
 struct complex_rule
@@ -216,19 +216,19 @@ struct complex_rule
 
 #### Modes
 
-The `apply_mode` can take the value `apply_mode::ACTION` or `apply_mode::NOTHING`, depending on whether actions are currently enabled or disabled.
+The `apply_mode` can take the value `apply_mode::action` or `apply_mode::nothing`, depending on whether actions are currently enabled or disabled.
 Most custom parsing rules will either ignore, or pass on the `apply_mode` unchanged; usually only the control interprets the `apply_mode`.
 
-The `rewind_mode` can take the value `rewind_mode::ACTIVE`, `rewind_mode::REQUIRED` or `rewind_mode::DONTCARE`.
-When `M` is `rewind_mode::REQUIRED`, the custom rule's `match()`-implementation **must**, on local failure, rewind the input to where it (the input) was when it (the `match()`-function) was first called.
+The `rewind_mode` can take the value `rewind_mode::active`, `rewind_mode::required` or `rewind_mode::dontcare`.
+When `M` is `rewind_mode::required`, the custom rule's `match()`-implementation **must**, on local failure, rewind the input to where it (the input) was when `match()` was called.
 
-When `M` is **not** `rewind_mode::REQUIRED`, it is not necessary to perform rewinding as either some other rule further up the call stack is already taking care of it (`rewind_mode::ACTIVE`), or rewinding is not necessary (`rewind_mode::DONTCARE`).
-For example within a `must<>`-rule (which converts local failure, a return value of `false` from the `match()`-function, to global failure, an exception) the `rewind_mode` is `DONTCARE`.
+When `M` is **not** `rewind_mode::required`, it is not necessary to perform rewinding as either some other rule further up the call stack is already taking care of it (`rewind_mode::active`), or rewinding is not necessary (`rewind_mode::dontcare`).
+For example within a `must<>`-rule (which converts local failure, a return value of `false` from `match()`, to global failure, an exception) the `rewind_mode` is `dontcare`.
 
-The following implementation of the `seq`-rule's `match()`-method shows how to correctly handle the `rewind_mode`.
-The input's `mark()`-method uses the `rewind_mode` to choose which input marker to return, either one that takes care of rewinding when required, or a dummy object that does nothing.
-In the first case, `next_rewind_mode` is set to `ACTIVE`, otherwise it is equal to `M`, just as required for the next rules called by the current one.
-The return value of the `match()`-method is then passed through the input marker `m` so that, if the return value is `false` and the marker is not the dummy, it can rewind the input `in`.
+The following implementation of the `seq`-rule's `match()` shows how to correctly handle the `rewind_mode`.
+The input's `mark()` member function uses the `rewind_mode` to choose which input marker to return, either one that takes care of rewinding when required, or a dummy object that does nothing.
+In the first case, `next_rewind_mode` is set to `active`, otherwise it is equal to `M`, just as required for the next rules called by the current one.
+The return value of `match()` is then passed through the input marker `m` so that, if the return value is `false` and the marker is not the dummy, it can rewind the input `in`.
 
 ```c++
 template< typename... Rules >
@@ -281,8 +281,7 @@ The action stores the matched string that corresponds to `"foo"` in a string var
 
 ```c++
    template< typename Rule >
-   struct action
-      : tao::pegtl::nothing< Rule > {};
+   struct action {};
 
    template<>
    struct action< long_literal_id >
@@ -320,7 +319,7 @@ The custom rule itself
       template< tao::pegtl::apply_mode A,
                 tao::pegtl::rewind_mode M,
                 template< typename... > class Action,
-                template< typename... > class Control
+                template< typename... > class Control,
                 typename Input >
       static bool match( Input& in,
                          const std::string& id,
@@ -373,7 +372,7 @@ int main( int argc, char* argv[] )
       std::string id;
       std::string body;
 
-      tao::pegtl::argv_input<> in( argv, 1 );
+      tao::pegtl::argv_input in( argv, 1 );
       tao::pegtl::parse< dynamic::grammar, dynamic::action >( in, id, body );
 
       std::cout << "long literal id was: " << id << std::endl;
@@ -395,4 +394,4 @@ long literal id was: "fraggle"
 long literal body was: "[foo["
 ```
 
-Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/doc/Thank-You.md b/packages/PEGTL/doc/Thank-You.md
new file mode 100644
index 0000000000000000000000000000000000000000..63beb187c8e0e95720d965e3a6e7f14ff5ef04d8
--- /dev/null
+++ b/packages/PEGTL/doc/Thank-You.md
@@ -0,0 +1,41 @@
+# Thank You
+
+In appreciation of all contributions here are the people that have [directly contributed](https://github.com/taocpp/PEGTL/graphs/contributors) to the PEGTL and/or its development.
+
+[<img alt="andoma" src="https://avatars2.githubusercontent.com/u/216384?v=4&s=117" width="117">](https://github.com/andoma)
+[<img alt="Bjoe" src="https://avatars3.githubusercontent.com/u/727911?v=4&s=117" width="117">](https://github.com/Bjoe)
+[<img alt="bwagner" src="https://avatars3.githubusercontent.com/u/447049?v=4&s=117" width="117">](https://github.com/bwagner)
+[<img alt="cdiggins" src="https://avatars2.githubusercontent.com/u/1759994?s=460&v=4?v=4&s=117" width="117">](https://github.com/cdiggins)
+[<img alt="delpinux" src="https://avatars0.githubusercontent.com/u/35096584?v=4&s=117" width="117">](https://github.com/delpinux)
+[<img alt="dkopecek" src="https://avatars2.githubusercontent.com/u/1353140?v=4&s=117" width="117">](https://github.com/dkopecek)
+[<img alt="irrequietus" src="https://avatars0.githubusercontent.com/u/231192?v=4&s=117" width="117">](https://github.com/irrequietus)
+[<img alt="jedelbo" src="https://avatars2.githubusercontent.com/u/572755?v=4&s=117" width="117">](https://github.com/jedelbo)
+[<img alt="joelfrederico" src="https://avatars0.githubusercontent.com/u/458871?v=4&s=117" width="117">](https://github.com/joelfrederico)
+[<img alt="jovermann" src="https://avatars3.githubusercontent.com/u/6087443?v=4&s=117" width="117">](https://github.com/jovermann)
+[<img alt="kneth" src="https://avatars0.githubusercontent.com/u/1225363?v=4&s=117" width="117">](https://github.com/kneth)
+[<img alt="kuzmas" src="https://avatars1.githubusercontent.com/u/1858553?v=4&s=117" width="117">](https://github.com/kuzmas)
+[<img alt="lambdafu" src="https://avatars1.githubusercontent.com/u/1138455?v=4&s=117" width="117">](https://github.com/lambdafu)
+[<img alt="lichray" src="https://avatars2.githubusercontent.com/u/433009?v=4&s=117" width="117">](https://github.com/lichray)
+[<img alt="michael-brade" src="https://avatars0.githubusercontent.com/u/8768950?v=4&s=117" width="117">](https://github.com/michael-brade)
+[<img alt="mkrupcale" src="https://avatars1.githubusercontent.com/u/13936020?v=4&s=117" width="117">](https://github.com/mkrupcale)
+[<img alt="NewProggie" src="https://avatars3.githubusercontent.com/u/162319?s=460&v=4?v=4&s=117" width="117">](https://github.com/NewProggie)
+[<img alt="pauloscustodio" src="https://avatars1.githubusercontent.com/u/70773?v=4&s=117" width="117">](https://github.com/pauloscustodio)
+[<img alt="pleroux0" src="https://avatars2.githubusercontent.com/u/39619854?v=4&s=117" width="117">](https://github.com/pleroux0)
+[<img alt="quadfault" src="https://avatars3.githubusercontent.com/u/30195320?v=4&s=117" width="117">](https://github.com/quadfault)
+[<img alt="samhocevar" src="https://avatars2.githubusercontent.com/u/245089?v=4&s=117" width="117">](https://github.com/samhocevar)
+[<img alt="sanssecours" src="https://avatars2.githubusercontent.com/u/691989?v=4&s=117" width="117">](https://github.com/sanssecours)
+[<img alt="sgbeal" src="https://avatars1.githubusercontent.com/u/235303?v=4&s=117" width="117">](https://github.com/sgbeal)
+[<img alt="studoot" src="https://avatars1.githubusercontent.com/u/799344?v=4&s=117" width="117">](https://github.com/studoot)
+[<img alt="SvenJo" src="https://avatars1.githubusercontent.com/u/1538181?s=460&v=4?v=4&s=117" width="117">](https://github.com/SvenJo)
+[<img alt="wickedmic" src="https://avatars1.githubusercontent.com/u/12001183?v=4&s=117" width="117">](https://github.com/wickedmic)
+[<img alt="zhihaoy" src="https://avatars2.githubusercontent.com/u/43971430?v=4&s=117" width="117">](https://github.com/zhihaoy)
+
+## The Art of C++
+
+Members of the *Art of C++* project.
+
+[<img alt="ColinH" src="https://avatars0.githubusercontent.com/u/113184?v=4&s=117" width="117">](https://github.com/ColinH)
+[<img alt="d-frey" src="https://avatars2.githubusercontent.com/u/3956325?v=4&s=117" width="117">](https://github.com/d-frey)
+[<img alt="uilianries" src="https://avatars0.githubusercontent.com/u/4870173?v=4&s=117" width="117">](https://github.com/uilianries)
+
+Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
diff --git a/packages/PEGTL/include/tao/pegtl.hpp b/packages/PEGTL/include/tao/pegtl.hpp
index 993dfc193cc85f59dffa94a9ff96d2c9e65ada7b..42141a9df128515b3638fca8b70baf585c876d62 100644
--- a/packages/PEGTL/include/tao/pegtl.hpp
+++ b/packages/PEGTL/include/tao/pegtl.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_HPP
@@ -7,8 +7,9 @@
 #include "pegtl/config.hpp"
 #include "pegtl/version.hpp"
 
-#include "pegtl/ascii.hpp"
 #include "pegtl/parse.hpp"
+
+#include "pegtl/ascii.hpp"
 #include "pegtl/rules.hpp"
 #include "pegtl/uint16.hpp"
 #include "pegtl/uint32.hpp"
@@ -27,6 +28,20 @@
 #include "pegtl/read_input.hpp"
 #include "pegtl/string_input.hpp"
 
+#include "pegtl/change_action.hpp"
+#include "pegtl/change_action_and_state.hpp"
+#include "pegtl/change_action_and_states.hpp"
+#include "pegtl/change_control.hpp"
+#include "pegtl/change_state.hpp"
+#include "pegtl/change_states.hpp"
+
+#include "pegtl/disable_action.hpp"
+#include "pegtl/enable_action.hpp"
+
+#include "pegtl/discard_input.hpp"
+#include "pegtl/discard_input_on_failure.hpp"
+#include "pegtl/discard_input_on_success.hpp"
+
 // The following are not included by
 // default because they include <iostream>.
 
diff --git a/packages/PEGTL/include/tao/pegtl/analysis/analyze_cycles.hpp b/packages/PEGTL/include/tao/pegtl/analysis/analyze_cycles.hpp
index e25f3bbf2bcf6df4963b213bd64c546f6af24410..9f7ce5f83b130b1a548f1f098c8c3f7a1b702e44 100644
--- a/packages/PEGTL/include/tao/pegtl/analysis/analyze_cycles.hpp
+++ b/packages/PEGTL/include/tao/pegtl/analysis/analyze_cycles.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ANALYSIS_ANALYZE_CYCLES_HPP
@@ -18,118 +18,110 @@
 #include "grammar_info.hpp"
 #include "insert_guard.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::analysis
 {
-   namespace TAO_PEGTL_NAMESPACE
+   class analyze_cycles_impl
    {
-      namespace analysis
+   protected:
+      explicit analyze_cycles_impl( const bool verbose ) noexcept
+         : m_verbose( verbose ),
+           m_problems( 0 )
       {
-         class analyze_cycles_impl
-         {
-         protected:
-            explicit analyze_cycles_impl( const bool verbose ) noexcept
-               : m_verbose( verbose ),
-                 m_problems( 0 )
-            {
-            }
+      }
 
-            const bool m_verbose;
-            unsigned m_problems;
-            grammar_info m_info;
-            std::set< std::string > m_stack;
-            std::map< std::string, bool > m_cache;
-            std::map< std::string, bool > m_results;
-
-            const std::map< std::string, rule_info >::const_iterator find( const std::string& name ) const noexcept
-            {
-               const auto iter = m_info.map.find( name );
-               assert( iter != m_info.map.end() );
-               return iter;
-            }
+      const bool m_verbose;
+      unsigned m_problems;
+      grammar_info m_info;
+      std::set< std::string > m_stack;
+      std::map< std::string, bool > m_cache;
+      std::map< std::string, bool > m_results;
 
-            bool work( const std::map< std::string, rule_info >::const_iterator& start, const bool accum )
-            {
-               const auto j = m_cache.find( start->first );
+      [[nodiscard]] std::map< std::string, rule_info >::const_iterator find( const std::string& name ) const noexcept
+      {
+         const auto iter = m_info.map.find( name );
+         assert( iter != m_info.map.end() );
+         return iter;
+      }
 
-               if( j != m_cache.end() ) {
-                  return j->second;
+      [[nodiscard]] bool work( const std::map< std::string, rule_info >::const_iterator& start, const bool accum )
+      {
+         const auto j = m_cache.find( start->first );
+
+         if( j != m_cache.end() ) {
+            return j->second;
+         }
+         if( const auto g = insert_guard( m_stack, start->first ) ) {
+            switch( start->second.type ) {
+               case rule_type::any: {
+                  bool a = false;
+                  for( const auto& r : start->second.rules ) {
+                     a = a || work( find( r ), accum || a );
+                  }
+                  return m_cache[ start->first ] = true;
                }
-               if( const auto g = make_insert_guard( m_stack, start->first ) ) {
-                  switch( start->second.type ) {
-                     case rule_type::ANY: {
-                        bool a = false;
-                        for( const auto& r : start->second.rules ) {
-                           a = a || work( find( r ), accum || a );
-                        }
-                        return m_cache[ start->first ] = true;
-                     }
-                     case rule_type::OPT: {
-                        bool a = false;
-                        for( const auto& r : start->second.rules ) {
-                           a = a || work( find( r ), accum || a );
-                        }
-                        return m_cache[ start->first ] = false;
-                     }
-                     case rule_type::SEQ: {
-                        bool a = false;
-                        for( const auto& r : start->second.rules ) {
-                           a = a || work( find( r ), accum || a );
-                        }
-                        return m_cache[ start->first ] = a;
-                     }
-                     case rule_type::SOR: {
-                        bool a = true;
-                        for( const auto& r : start->second.rules ) {
-                           a = a && work( find( r ), accum );
-                        }
-                        return m_cache[ start->first ] = a;
-                     }
+               case rule_type::opt: {
+                  bool a = false;
+                  for( const auto& r : start->second.rules ) {
+                     a = a || work( find( r ), accum || a );
                   }
-                  throw std::logic_error( "code should be unreachable: invalid rule_type value" );  // NOLINT, LCOV_EXCL_LINE
+                  return m_cache[ start->first ] = false;
                }
-               if( !accum ) {
-                  ++m_problems;
-                  if( m_verbose ) {
-                     std::cout << "problem: cycle without progress detected at rule class " << start->first << std::endl;  // LCOV_EXCL_LINE
+               case rule_type::seq: {
+                  bool a = false;
+                  for( const auto& r : start->second.rules ) {
+                     a = a || work( find( r ), accum || a );
                   }
+                  return m_cache[ start->first ] = a;
                }
-               return m_cache[ start->first ] = accum;
-            }
-         };
-
-         template< typename Grammar >
-         class analyze_cycles
-            : private analyze_cycles_impl
-         {
-         public:
-            explicit analyze_cycles( const bool verbose )
-               : analyze_cycles_impl( verbose )
-            {
-               Grammar::analyze_t::template insert< Grammar >( m_info );
-            }
-
-            std::size_t problems()
-            {
-               for( auto i = m_info.map.begin(); i != m_info.map.end(); ++i ) {
-                  m_results[ i->first ] = work( i, false );
-                  m_cache.clear();
+               case rule_type::sor: {
+                  bool a = true;
+                  for( const auto& r : start->second.rules ) {
+                     a = a && work( find( r ), accum );
+                  }
+                  return m_cache[ start->first ] = a;
                }
-               return m_problems;
             }
-
-            template< typename Rule >
-            bool consumes() const noexcept
-            {
-               const auto i = m_results.find( internal::demangle< Rule >() );
-               assert( i != m_results.end() );
-               return i->second;
+            throw std::logic_error( "code should be unreachable: invalid rule_type value" );  // NOLINT, LCOV_EXCL_LINE
+         }
+         if( !accum ) {
+            ++m_problems;
+            if( m_verbose ) {
+               std::cout << "problem: cycle without progress detected at rule class " << start->first << std::endl;  // LCOV_EXCL_LINE
             }
-         };
-
-      }  // namespace analysis
+         }
+         return m_cache[ start->first ] = accum;
+      }
+   };
+
+   template< typename Grammar >
+   class analyze_cycles
+      : private analyze_cycles_impl
+   {
+   public:
+      explicit analyze_cycles( const bool verbose )
+         : analyze_cycles_impl( verbose )
+      {
+         Grammar::analyze_t::template insert< Grammar >( m_info );
+      }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      [[nodiscard]] std::size_t problems()
+      {
+         for( auto i = m_info.map.begin(); i != m_info.map.end(); ++i ) {
+            m_results[ i->first ] = work( i, false );
+            m_cache.clear();
+         }
+         return m_problems;
+      }
+
+      template< typename Rule >
+      [[nodiscard]] bool consumes() const noexcept
+      {
+         const auto i = m_results.find( internal::demangle< Rule >() );
+         assert( i != m_results.end() );
+         return i->second;
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::analysis
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/analysis/counted.hpp b/packages/PEGTL/include/tao/pegtl/analysis/counted.hpp
index 6dff5b9897866e2bc3253180814488830ab7bad7..2c1939ca1dc88282d178f373c0243fa89696c0a5 100644
--- a/packages/PEGTL/include/tao/pegtl/analysis/counted.hpp
+++ b/packages/PEGTL/include/tao/pegtl/analysis/counted.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ANALYSIS_COUNTED_HPP
@@ -8,22 +8,14 @@
 
 #include "generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::analysis
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< rule_type Type, unsigned Count, typename... Rules >
+   struct counted
+      : generic< ( Count != 0 ) ? Type : rule_type::opt, Rules... >
    {
-      namespace analysis
-      {
-         template< rule_type Type, unsigned Count, typename... Rules >
-         struct counted
-            : generic< ( Count != 0 ) ? Type : rule_type::OPT, Rules... >
-         {
-         };
+   };
 
-      }  // namespace analysis
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::analysis
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/analysis/generic.hpp b/packages/PEGTL/include/tao/pegtl/analysis/generic.hpp
index 9c0f4e6d653f74a7bb245a7c167d4886ca5ea540..ae8685ab84b3915a1e8cf3c39666b2138ea7a8df 100644
--- a/packages/PEGTL/include/tao/pegtl/analysis/generic.hpp
+++ b/packages/PEGTL/include/tao/pegtl/analysis/generic.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ANALYSIS_GENERIC_HPP
@@ -10,30 +10,22 @@
 #include "insert_rules.hpp"
 #include "rule_type.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::analysis
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< rule_type Type, typename... Rules >
+   struct generic
    {
-      namespace analysis
+      template< typename Name >
+      static std::string insert( grammar_info& g )
       {
-         template< rule_type Type, typename... Rules >
-         struct generic
-         {
-            template< typename Name >
-            static std::string insert( grammar_info& g )
-            {
-               const auto r = g.insert< Name >( Type );
-               if( r.second ) {
-                  insert_rules< Rules... >::insert( g, r.first->second );
-               }
-               return r.first->first;
-            }
-         };
-
-      }  // namespace analysis
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         const auto [ it, success ] = g.insert< Name >( Type );
+         if( success ) {
+            insert_rules< Rules... >::insert( g, it->second );
+         }
+         return it->first;
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::analysis
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/analysis/grammar_info.hpp b/packages/PEGTL/include/tao/pegtl/analysis/grammar_info.hpp
index 06d73e844416ffc04bb3db88cddc1715477c4dc0..a6f63ed68189dc60b69df12e7e415195a7ca0fdb 100644
--- a/packages/PEGTL/include/tao/pegtl/analysis/grammar_info.hpp
+++ b/packages/PEGTL/include/tao/pegtl/analysis/grammar_info.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ANALYSIS_GRAMMAR_INFO_HPP
@@ -13,28 +13,20 @@
 
 #include "rule_info.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::analysis
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct grammar_info
    {
-      namespace analysis
-      {
-         struct grammar_info
-         {
-            using map_t = std::map< std::string, rule_info >;
-            map_t map;
-
-            template< typename Name >
-            std::pair< map_t::iterator, bool > insert( const rule_type type )
-            {
-               return map.insert( map_t::value_type( internal::demangle< Name >(), rule_info( type ) ) );
-            }
-         };
+      using map_t = std::map< std::string, rule_info >;
+      map_t map;
 
-      }  // namespace analysis
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+      template< typename Name >
+      auto insert( const rule_type type )
+      {
+         return map.emplace( internal::demangle< Name >(), rule_info( type ) );
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::analysis
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/analysis/insert_guard.hpp b/packages/PEGTL/include/tao/pegtl/analysis/insert_guard.hpp
index 6cd61c8062b46f6bbe4dcffd7fff3d5adfb14e8a..1fb00503cf8895945df35b2766482c470149b0a6 100644
--- a/packages/PEGTL/include/tao/pegtl/analysis/insert_guard.hpp
+++ b/packages/PEGTL/include/tao/pegtl/analysis/insert_guard.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ANALYSIS_INSERT_GUARD_HPP
@@ -8,61 +8,44 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::analysis
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename C >
+   class insert_guard
    {
-      namespace analysis
+   public:
+      insert_guard( C& container, const typename C::value_type& value )
+         : m_i( container.insert( value ) ),
+           m_c( container )
       {
-         template< typename C >
-         class insert_guard
-         {
-         public:
-            insert_guard( C& container, const typename C::value_type& value )
-               : m_i( container.insert( value ) ),
-                 m_c( &container )
-            {
-            }
+      }
 
-            insert_guard( const insert_guard& ) = delete;
+      insert_guard( const insert_guard& ) = delete;
+      insert_guard( insert_guard&& ) = delete;
 
-            insert_guard( insert_guard&& other ) noexcept
-               : m_i( other.m_i ),
-                 m_c( other.m_c )
-            {
-               other.m_c = nullptr;
-            }
-
-            ~insert_guard()
-            {
-               if( m_c && m_i.second ) {
-                  m_c->erase( m_i.first );
-               }
-            }
-
-            void operator=( const insert_guard& ) = delete;
-            void operator=( insert_guard&& ) = delete;
-
-            explicit operator bool() const noexcept
-            {
-               return m_i.second;
-            }
+      ~insert_guard()
+      {
+         if( m_i.second ) {
+            m_c.erase( m_i.first );
+         }
+      }
 
-         private:
-            const std::pair< typename C::iterator, bool > m_i;
-            C* m_c;
-         };
+      void operator=( const insert_guard& ) = delete;
+      void operator=( insert_guard&& ) = delete;
 
-         template< typename C >
-         insert_guard< C > make_insert_guard( C& container, const typename C::value_type& value )
-         {
-            return insert_guard< C >( container, value );
-         }
+      explicit operator bool() const noexcept
+      {
+         return m_i.second;
+      }
 
-      }  // namespace analysis
+   private:
+      const std::pair< typename C::iterator, bool > m_i;
+      C& m_c;
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename C >
+   insert_guard( C&, const typename C::value_type& )->insert_guard< C >;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::analysis
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/analysis/insert_rules.hpp b/packages/PEGTL/include/tao/pegtl/analysis/insert_rules.hpp
index 6e172b3c7026edea59500fc02f1770c6ea0b4d1c..617031a63c3ef86aec1456c4376c720e811ed5b1 100644
--- a/packages/PEGTL/include/tao/pegtl/analysis/insert_rules.hpp
+++ b/packages/PEGTL/include/tao/pegtl/analysis/insert_rules.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ANALYSIS_INSERT_RULES_HPP
@@ -9,37 +9,17 @@
 #include "grammar_info.hpp"
 #include "rule_info.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::analysis
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   struct insert_rules
    {
-      namespace analysis
+      static void insert( grammar_info& g, rule_info& r )
       {
-         template< typename... >
-         struct insert_rules;
+         ( r.rules.emplace_back( Rules::analyze_t::template insert< Rules >( g ) ), ... );
+      }
+   };
 
-         template<>
-         struct insert_rules<>
-         {
-            static void insert( grammar_info& /*unused*/, rule_info& /*unused*/ )
-            {
-            }
-         };
-
-         template< typename Rule, typename... Rules >
-         struct insert_rules< Rule, Rules... >
-         {
-            static void insert( grammar_info& g, rule_info& r )
-            {
-               r.rules.push_back( Rule::analyze_t::template insert< Rule >( g ) );
-               insert_rules< Rules... >::insert( g, r );
-            }
-         };
-
-      }  // namespace analysis
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::analysis
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/analysis/rule_info.hpp b/packages/PEGTL/include/tao/pegtl/analysis/rule_info.hpp
index 30af0ed00adc2565c29bc7983a51a2614e89d233..0f06950bdc88f8a7333e9585137fa5aa721a0870 100644
--- a/packages/PEGTL/include/tao/pegtl/analysis/rule_info.hpp
+++ b/packages/PEGTL/include/tao/pegtl/analysis/rule_info.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ANALYSIS_RULE_INFO_HPP
@@ -11,27 +11,19 @@
 
 #include "rule_type.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::analysis
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct rule_info
    {
-      namespace analysis
+      explicit rule_info( const rule_type in_type ) noexcept
+         : type( in_type )
       {
-         struct rule_info
-         {
-            explicit rule_info( const rule_type in_type ) noexcept
-               : type( in_type )
-            {
-            }
+      }
 
-            rule_type type;
-            std::vector< std::string > rules;
-         };
+      rule_type type;
+      std::vector< std::string > rules;
+   };
 
-      }  // namespace analysis
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::analysis
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/analysis/rule_type.hpp b/packages/PEGTL/include/tao/pegtl/analysis/rule_type.hpp
index ebd7f4e3ef7b31c74b4347bfa10179451683525f..ec1f29c91558ba2e0dfebd001569ae4b04103bad 100644
--- a/packages/PEGTL/include/tao/pegtl/analysis/rule_type.hpp
+++ b/packages/PEGTL/include/tao/pegtl/analysis/rule_type.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ANALYSIS_RULE_TYPE_HPP
@@ -6,24 +6,16 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::analysis
 {
-   namespace TAO_PEGTL_NAMESPACE
+   enum class rule_type : char
    {
-      namespace analysis
-      {
-         enum class rule_type : char
-         {
-            ANY,  // Consumption-on-success is always true; assumes bounded repetition of conjunction of sub-rules.
-            OPT,  // Consumption-on-success not necessarily true; assumes bounded repetition of conjunction of sub-rules.
-            SEQ,  // Consumption-on-success depends on consumption of (non-zero bounded repetition of) conjunction of sub-rules.
-            SOR   // Consumption-on-success depends on consumption of (non-zero bounded repetition of) disjunction of sub-rules.
-         };
+      any,  // Consumption-on-success is always true; assumes bounded repetition of conjunction of sub-rules.
+      opt,  // Consumption-on-success not necessarily true; assumes bounded repetition of conjunction of sub-rules.
+      seq,  // Consumption-on-success depends on consumption of (non-zero bounded repetition of) conjunction of sub-rules.
+      sor   // Consumption-on-success depends on consumption of (non-zero bounded repetition of) disjunction of sub-rules.
+   };
 
-      }  // namespace analysis
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::analysis
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/analyze.hpp b/packages/PEGTL/include/tao/pegtl/analyze.hpp
index 08e0d7b406e6232f836dad2dcc3b9b808efc0b92..d0e0641ce2ea8071cb52812a55c99240d50ff640 100644
--- a/packages/PEGTL/include/tao/pegtl/analyze.hpp
+++ b/packages/PEGTL/include/tao/pegtl/analyze.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ANALYZE_HPP
@@ -8,18 +8,14 @@
 
 #include "analysis/analyze_cycles.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule >
+   [[nodiscard]] std::size_t analyze( const bool verbose = true )
    {
-      template< typename Rule >
-      std::size_t analyze( const bool verbose = true )
-      {
-         return analysis::analyze_cycles< Rule >( verbose ).problems();
-      }
+      return analysis::analyze_cycles< Rule >( verbose ).problems();
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/apply_mode.hpp b/packages/PEGTL/include/tao/pegtl/apply_mode.hpp
index c403c1b72e0c0cd01c615d3834d6c0fb93f48727..144f0cb79426edf60d11f7b7f1ffa89834b431c4 100644
--- a/packages/PEGTL/include/tao/pegtl/apply_mode.hpp
+++ b/packages/PEGTL/include/tao/pegtl/apply_mode.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_APPLY_MODE_HPP
@@ -6,18 +6,14 @@
 
 #include "config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   enum class apply_mode : bool
    {
-      enum class apply_mode : bool
-      {
-         ACTION = true,
-         NOTHING = false
-      };
+      action = true,
+      nothing = false
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/argv_input.hpp b/packages/PEGTL/include/tao/pegtl/argv_input.hpp
index de2343c5bf3f67216685ca46aed757cfcb4c7334..c7b1430d02086f3d0f1cb76ba3e72ecbef246f4c 100644
--- a/packages/PEGTL/include/tao/pegtl/argv_input.hpp
+++ b/packages/PEGTL/include/tao/pegtl/argv_input.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ARGV_INPUT_HPP
@@ -14,44 +14,38 @@
 #include "memory_input.hpp"
 #include "tracking_mode.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      namespace internal
+      [[nodiscard]] inline std::string make_argv_source( const std::size_t argn )
       {
-         inline std::string make_argv_source( const std::size_t argn )
-         {
-            std::ostringstream os;
-            os << "argv[" << argn << ']';
-            return os.str();
-         }
-
-      }  // namespace internal
-
-      template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
-      struct argv_input
-         : public memory_input< P, Eol >
+         std::ostringstream os;
+         os << "argv[" << argn << ']';
+         return os.str();
+      }
+
+   }  // namespace internal
+
+   template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
+   struct argv_input
+      : public memory_input< P, Eol >
+   {
+      template< typename T >
+      argv_input( char** argv, const std::size_t argn, T&& in_source )  // NOLINT
+         : memory_input< P, Eol >( static_cast< const char* >( argv[ argn ] ), std::forward< T >( in_source ) )
       {
-         template< typename T >
-         argv_input( char** argv, const std::size_t argn, T&& in_source )
-            : memory_input< P, Eol >( static_cast< const char* >( argv[ argn ] ), std::forward< T >( in_source ) )
-         {
-         }
-
-         argv_input( char** argv, const std::size_t argn )
-            : argv_input( argv, argn, internal::make_argv_source( argn ) )
-         {
-         }
-      };
-
-#ifdef __cpp_deduction_guides
-      template< typename... Ts >
-      argv_input( Ts&&... )->argv_input<>;
-#endif
+      }
+
+      argv_input( char** argv, const std::size_t argn )  // NOLINT
+         : argv_input( argv, argn, internal::make_argv_source( argn ) )
+      {
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Ts >
+   argv_input( Ts&&... )->argv_input<>;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/ascii.hpp b/packages/PEGTL/include/tao/pegtl/ascii.hpp
index b440b4d910253b33cacb11d1bf6fc22b1af15a38..b28cc350a364d1863c5b261b73d70a3a5a264fbd 100644
--- a/packages/PEGTL/include/tao/pegtl/ascii.hpp
+++ b/packages/PEGTL/include/tao/pegtl/ascii.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ASCII_HPP
@@ -7,62 +7,60 @@
 #include "config.hpp"
 #include "eol.hpp"
 
+#include "internal/always_false.hpp"
 #include "internal/result_on_found.hpp"
 #include "internal/rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   inline namespace ascii
    {
-      inline namespace ascii
-      {
-         // clang-format off
-         struct alnum : internal::alnum {};
-         struct alpha : internal::alpha {};
-         struct any : internal::any< internal::peek_char > {};
-         struct blank : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ', '\t' > {};
-         struct digit : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, '0', '9' > {};
-         struct eolf : internal::eolf {};
-         template< char... Cs > struct forty_two : internal::rep< 42, internal::one< internal::result_on_found::SUCCESS, internal::peek_char, Cs... > > {};
-         struct identifier_first : internal::identifier_first {};
-         struct identifier_other : internal::identifier_other {};
-         struct identifier : internal::identifier {};
-         template< char... Cs > struct istring : internal::istring< Cs... > {};
-         template< char... Cs > struct keyword : internal::seq< internal::string< Cs... >, internal::not_at< internal::identifier_other > > {};
-         struct lower : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, 'a', 'z' > {};
-         template< char... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_char, Cs... > {};
-         template< char Lo, char Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_char, Lo, Hi > {};
-         struct nul : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, char( 0 ) > {};
-         template< char... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, Cs... > {};
-         struct print : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, char( 32 ), char( 126 ) > {};
-         template< char Lo, char Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, Lo, Hi > {};
-         template< char... Cs > struct ranges : internal::ranges< internal::peek_char, Cs... > {};
-         struct seven : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, char( 0 ), char( 127 ) > {};
-         struct shebang : internal::if_must< false, internal::string< '#', '!' >, internal::until< internal::eolf > > {};
-         struct space : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ', '\n', '\r', '\t', '\v', '\f' > {};
-         template< char... Cs > struct string : internal::string< Cs... > {};
-         template< char C > struct three : internal::three< C > {};
-         template< char C > struct two : internal::two< C > {};
-         struct upper : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, 'A', 'Z' > {};
-         struct xdigit : internal::ranges< internal::peek_char, '0', '9', 'a', 'f', 'A', 'F' > {};
-         // clang-format on
+      // clang-format off
+      struct alnum : internal::alnum {};
+      struct alpha : internal::alpha {};
+      struct any : internal::any< internal::peek_char > {};
+      struct blank : internal::one< internal::result_on_found::success, internal::peek_char, ' ', '\t' > {};
+      struct digit : internal::range< internal::result_on_found::success, internal::peek_char, '0', '9' > {};
+      struct ellipsis : internal::string< '.', '.', '.' > {};
+      struct eolf : internal::eolf {};
+      template< char... Cs > struct forty_two : internal::rep< 42, internal::one< internal::result_on_found::success, internal::peek_char, Cs... > > {};
+      struct identifier_first : internal::identifier_first {};
+      struct identifier_other : internal::identifier_other {};
+      struct identifier : internal::identifier {};
+      template< char... Cs > struct istring : internal::istring< Cs... > {};
+      template< char... Cs > struct keyword : internal::seq< internal::string< Cs... >, internal::not_at< internal::identifier_other > > {};
+      struct lower : internal::range< internal::result_on_found::success, internal::peek_char, 'a', 'z' > {};
+      template< char... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_char, Cs... > {};
+      template< char Lo, char Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_char, Lo, Hi > {};
+      struct nul : internal::one< internal::result_on_found::success, internal::peek_char, char( 0 ) > {};
+      template< char... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_char, Cs... > {};
+      struct print : internal::range< internal::result_on_found::success, internal::peek_char, char( 32 ), char( 126 ) > {};
+      template< char Lo, char Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_char, Lo, Hi > {};
+      template< char... Cs > struct ranges : internal::ranges< internal::peek_char, Cs... > {};
+      struct seven : internal::range< internal::result_on_found::success, internal::peek_char, char( 0 ), char( 127 ) > {};
+      struct shebang : internal::if_must< false, internal::string< '#', '!' >, internal::until< internal::eolf > > {};
+      struct space : internal::one< internal::result_on_found::success, internal::peek_char, ' ', '\n', '\r', '\t', '\v', '\f' > {};
+      template< char... Cs > struct string : internal::string< Cs... > {};
+      template< char C > struct three : internal::string< C, C, C > {};
+      template< char C > struct two : internal::string< C, C > {};
+      struct upper : internal::range< internal::result_on_found::success, internal::peek_char, 'A', 'Z' > {};
+      struct xdigit : internal::ranges< internal::peek_char, '0', '9', 'a', 'f', 'A', 'F' > {};
+      // clang-format on
 
-         template<>
-         struct keyword<>
+      template<>
+      struct keyword<>
+      {
+         template< typename Input >
+         [[nodiscard]] static bool match( Input& /*unused*/ ) noexcept
          {
-            template< typename Input >
-            static bool match( Input& /*unused*/ ) noexcept
-            {
-               static_assert( sizeof( Input ) == 0, "empty keywords not allowed" );
-               return false;
-            }
-         };
-
-      }  // namespace ascii
+            static_assert( internal::always_false< Input >::value, "empty keywords not allowed" );
+            return false;
+         }
+      };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   }  // namespace ascii
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "internal/pegtl_string.hpp"
 
diff --git a/packages/PEGTL/include/tao/pegtl/buffer_input.hpp b/packages/PEGTL/include/tao/pegtl/buffer_input.hpp
index 143d94d3155f75df52d440e64210286e5ff879b0..0487b48ec90344bbc233a0391c33f0236be8ec30 100644
--- a/packages/PEGTL/include/tao/pegtl/buffer_input.hpp
+++ b/packages/PEGTL/include/tao/pegtl/buffer_input.hpp
@@ -1,13 +1,16 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_BUFFER_INPUT_HPP
 #define TAO_PEGTL_BUFFER_INPUT_HPP
 
+#include <algorithm>
+#include <cassert>
 #include <cstddef>
 #include <cstdint>
 #include <cstring>
 #include <memory>
+#include <stdexcept>
 #include <string>
 
 #include "config.hpp"
@@ -17,170 +20,193 @@
 #include "tracking_mode.hpp"
 
 #include "internal/action_input.hpp"
-#include "internal/bump_impl.hpp"
+#include "internal/bump.hpp"
 #include "internal/iterator.hpp"
 #include "internal/marker.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Reader, typename Eol = eol::lf_crlf, typename Source = std::string, std::size_t Chunk = 64 >
+   class buffer_input
    {
-      template< typename Reader, typename Eol = eol::lf_crlf, typename Source = std::string >
-      class buffer_input
-      {
-      public:
-         static constexpr tracking_mode tracking_mode_v = tracking_mode::IMMEDIATE;
-         using reader_t = Reader;
+   public:
+      using reader_t = Reader;
 
-         using eol_t = Eol;
-         using source_t = Source;
+      using eol_t = Eol;
+      using source_t = Source;
 
-         using iterator_t = internal::iterator;
+      using iterator_t = internal::iterator;
 
-         using action_t = internal::action_input< buffer_input >;
+      using action_t = internal::action_input< buffer_input >;
 
-         template< typename T, typename... As >
-         buffer_input( T&& in_source, const std::size_t maximum, As&&... as )
-            : m_reader( std::forward< As >( as )... ),
-              m_maximum( maximum ),
-              m_buffer( new char[ maximum ] ),
-              m_current( m_buffer.get() ),
-              m_end( m_buffer.get() ),
-              m_source( std::forward< T >( in_source ) )
-         {
-         }
+      static constexpr std::size_t chunk_size = Chunk;
+      static constexpr tracking_mode tracking_mode_v = tracking_mode::eager;
 
-         buffer_input( const buffer_input& ) = delete;
-         buffer_input( buffer_input&& ) = delete;
+      template< typename T, typename... As >
+      buffer_input( T&& in_source, const std::size_t maximum, As&&... as )
+         : m_reader( std::forward< As >( as )... ),
+           m_maximum( maximum + Chunk ),
+           m_buffer( new char[ maximum + Chunk ] ),
+           m_current( m_buffer.get() ),
+           m_end( m_buffer.get() ),
+           m_source( std::forward< T >( in_source ) )
+      {
+         static_assert( Chunk, "zero chunk size not implemented" );
+         assert( m_maximum > maximum );  // Catches overflow; change to >= when zero chunk size is implemented.
+      }
 
-         ~buffer_input() = default;
+      buffer_input( const buffer_input& ) = delete;
+      buffer_input( buffer_input&& ) = delete;
 
-         void operator=( const buffer_input& ) = delete;
-         void operator=( buffer_input&& ) = delete;
+      ~buffer_input() = default;
 
-         bool empty()
-         {
-            require( 1 );
-            return m_current.data == m_end;
-         }
+      void operator=( const buffer_input& ) = delete;
+      void operator=( buffer_input&& ) = delete;
 
-         std::size_t size( const std::size_t amount )
-         {
-            require( amount );
-            return std::size_t( m_end - m_current.data );
-         }
+      [[nodiscard]] bool empty()
+      {
+         require( 1 );
+         return m_current.data == m_end;
+      }
 
-         const char* current() const noexcept
-         {
-            return m_current.data;
-         }
+      [[nodiscard]] std::size_t size( const std::size_t amount )
+      {
+         require( amount );
+         return buffer_occupied();
+      }
 
-         const char* end( const std::size_t amount )
-         {
-            require( amount );
-            return m_end;
-         }
+      [[nodiscard]] const char* current() const noexcept
+      {
+         return m_current.data;
+      }
 
-         std::size_t byte() const noexcept
-         {
-            return m_current.byte;
-         }
+      [[nodiscard]] const char* end( const std::size_t amount )
+      {
+         require( amount );
+         return m_end;
+      }
 
-         std::size_t line() const noexcept
-         {
-            return m_current.line;
-         }
+      [[nodiscard]] std::size_t byte() const noexcept
+      {
+         return m_current.byte;
+      }
 
-         std::size_t byte_in_line() const noexcept
-         {
-            return m_current.byte_in_line;
-         }
+      [[nodiscard]] std::size_t line() const noexcept
+      {
+         return m_current.line;
+      }
 
-         const Source& source() const noexcept
-         {
-            return m_source;
-         }
+      [[nodiscard]] std::size_t byte_in_line() const noexcept
+      {
+         return m_current.byte_in_line;
+      }
 
-         char peek_char( const std::size_t offset = 0 ) const noexcept
-         {
-            return m_current.data[ offset ];
-         }
+      [[nodiscard]] const Source& source() const noexcept
+      {
+         return m_source;
+      }
 
-         std::uint8_t peek_byte( const std::size_t offset = 0 ) const noexcept
-         {
-            return static_cast< std::uint8_t >( peek_char( offset ) );
-         }
+      [[nodiscard]] char peek_char( const std::size_t offset = 0 ) const noexcept
+      {
+         return m_current.data[ offset ];
+      }
 
-         void bump( const std::size_t in_count = 1 ) noexcept
-         {
-            internal::bump( m_current, in_count, Eol::ch );
-         }
+      [[nodiscard]] std::uint8_t peek_uint8( const std::size_t offset = 0 ) const noexcept
+      {
+         return static_cast< std::uint8_t >( peek_char( offset ) );
+      }
 
-         void bump_in_this_line( const std::size_t in_count = 1 ) noexcept
-         {
-            internal::bump_in_this_line( m_current, in_count );
-         }
+      void bump( const std::size_t in_count = 1 ) noexcept
+      {
+         internal::bump( m_current, in_count, Eol::ch );
+      }
 
-         void bump_to_next_line( const std::size_t in_count = 1 ) noexcept
-         {
-            internal::bump_to_next_line( m_current, in_count );
-         }
+      void bump_in_this_line( const std::size_t in_count = 1 ) noexcept
+      {
+         internal::bump_in_this_line( m_current, in_count );
+      }
+
+      void bump_to_next_line( const std::size_t in_count = 1 ) noexcept
+      {
+         internal::bump_to_next_line( m_current, in_count );
+      }
 
-         void discard() noexcept
-         {
+      void discard() noexcept
+      {
+         if( m_current.data > m_buffer.get() + Chunk ) {
             const auto s = m_end - m_current.data;
             std::memmove( m_buffer.get(), m_current.data, s );
             m_current.data = m_buffer.get();
             m_end = m_buffer.get() + s;
          }
+      }
 
-         void require( const std::size_t amount )
-         {
-            if( m_current.data + amount > m_end ) {
-               if( m_current.data + amount <= m_buffer.get() + m_maximum ) {
-                  if( const auto r = m_reader( m_end, amount - std::size_t( m_end - m_current.data ) ) ) {
-                     m_end += r;
-                  }
-                  else {
-                     m_maximum = 0;
-                  }
-               }
-            }
+      void require( const std::size_t amount )
+      {
+         if( m_current.data + amount <= m_end ) {
+            return;
          }
-
-         template< rewind_mode M >
-         internal::marker< iterator_t, M > mark() noexcept
-         {
-            return internal::marker< iterator_t, M >( m_current );
+         if( m_current.data + amount > m_buffer.get() + m_maximum ) {
+            throw std::overflow_error( "require beyond end of buffer" );
          }
-
-         TAO_PEGTL_NAMESPACE::position position( const iterator_t& it ) const
-         {
-            return TAO_PEGTL_NAMESPACE::position( it, m_source );
+         if( const auto r = m_reader( m_end, ( std::min )( buffer_free_after_end(), ( std::max )( amount, Chunk ) ) ) ) {
+            m_end += r;
          }
+      }
 
-         TAO_PEGTL_NAMESPACE::position position() const
-         {
-            return position( m_current );
-         }
+      template< rewind_mode M >
+      [[nodiscard]] internal::marker< iterator_t, M > mark() noexcept
+      {
+         return internal::marker< iterator_t, M >( m_current );
+      }
 
-         const iterator_t& iterator() const noexcept
-         {
-            return m_current;
-         }
+      [[nodiscard]] TAO_PEGTL_NAMESPACE::position position( const iterator_t& it ) const
+      {
+         return TAO_PEGTL_NAMESPACE::position( it, m_source );
+      }
+
+      [[nodiscard]] TAO_PEGTL_NAMESPACE::position position() const
+      {
+         return position( m_current );
+      }
 
-      private:
-         Reader m_reader;
-         std::size_t m_maximum;
-         std::unique_ptr< char[] > m_buffer;
-         iterator_t m_current;
-         char* m_end;
-         const Source m_source;
-         void* internal_state = nullptr;
-      };
+      [[nodiscard]] const iterator_t& iterator() const noexcept
+      {
+         return m_current;
+      }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      [[nodiscard]] std::size_t buffer_capacity() const noexcept
+      {
+         return m_maximum;
+      }
 
-}  // namespace tao
+      [[nodiscard]] std::size_t buffer_occupied() const noexcept
+      {
+         assert( m_end >= m_current.data );
+         return std::size_t( m_end - m_current.data );
+      }
+
+      [[nodiscard]] std::size_t buffer_free_before_current() const noexcept
+      {
+         assert( m_current.data >= m_buffer.get() );
+         return std::size_t( m_current.data - m_buffer.get() );
+      }
+
+      [[nodiscard]] std::size_t buffer_free_after_end() const noexcept
+      {
+         assert( m_buffer.get() + m_maximum >= m_end );
+         return std::size_t( m_buffer.get() + m_maximum - m_end );
+      }
+
+   private:
+      Reader m_reader;
+      std::size_t m_maximum;
+      std::unique_ptr< char[] > m_buffer;  // NOLINT
+      iterator_t m_current;
+      char* m_end;
+      const Source m_source;
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/change_action.hpp b/packages/PEGTL/include/tao/pegtl/change_action.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..bd73db8520935d9fa1cae3e352831fc243b00e38
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/change_action.hpp
@@ -0,0 +1,38 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_CHANGE_ACTION_HPP
+#define TAO_PEGTL_CHANGE_ACTION_HPP
+
+#include <type_traits>
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   template< template< typename... > class NewAction >
+   struct change_action
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         static_assert( !std::is_same_v< Action< void >, NewAction< void > >, "old and new action class templates are identical" );
+         return Control< Rule >::template match< A, M, NewAction, Control >( in, st... );
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/change_action_and_state.hpp b/packages/PEGTL/include/tao/pegtl/change_action_and_state.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..84a174f17512ce7bbd8e3437eec29ed4c229fabf
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/change_action_and_state.hpp
@@ -0,0 +1,53 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_CHANGE_ACTION_AND_STATE_HPP
+#define TAO_PEGTL_CHANGE_ACTION_AND_STATE_HPP
+
+#include <type_traits>
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "match.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   template< template< typename... > class NewAction, typename NewState >
+   struct change_action_and_state
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         static_assert( !std::is_same_v< Action< void >, NewAction< void > >, "old and new action class templates are identical" );
+         NewState s( static_cast< const Input& >( in ), st... );
+         if( Control< Rule >::template match< A, M, NewAction, Control >( in, s ) ) {
+            if constexpr( A == apply_mode::action ) {
+               Action< Rule >::success( static_cast< const Input& >( in ), s, st... );
+            }
+            return true;
+         }
+         return false;
+      }
+
+      template< typename Input,
+                typename... States >
+      static void success( const Input& in, NewState& s, States&&... st ) noexcept( noexcept( s.success( in, st... ) ) )
+      {
+         s.success( in, st... );
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/change_action_and_states.hpp b/packages/PEGTL/include/tao/pegtl/change_action_and_states.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..c4fd02eeeafbfc022d499eddbaab42a26fae2cbe
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/change_action_and_states.hpp
@@ -0,0 +1,62 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_CHANGE_ACTION_AND_STATES_HPP
+#define TAO_PEGTL_CHANGE_ACTION_AND_STATES_HPP
+
+#include <tuple>
+#include <utility>
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "match.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   template< template< typename... > class NewAction, typename... NewStates >
+   struct change_action_and_states
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                std::size_t... Ns,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( std::index_sequence< Ns... >, Input& in, States&&... st )
+      {
+         auto t = std::tie( st... );
+         if( Control< Rule >::template match< A, M, NewAction, Control >( in, std::get< Ns >( t )... ) ) {
+            if constexpr( A == apply_mode::action ) {
+               Action< Rule >::success( static_cast< const Input& >( in ), st... );
+            }
+            return true;
+         }
+         return false;
+      }
+
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         static_assert( !std::is_same_v< Action< void >, NewAction< void > >, "old and new action class templates are identical" );
+         return match< Rule, A, M, Action, Control >( std::index_sequence_for< NewStates... >(), in, NewStates()..., st... );
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/change_control.hpp b/packages/PEGTL/include/tao/pegtl/change_control.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..cef670118868775f807b2c74806f8e5a190419a2
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/change_control.hpp
@@ -0,0 +1,36 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_CHANGE_CONTROL_HPP
+#define TAO_PEGTL_CHANGE_CONTROL_HPP
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "match.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   template< template< typename... > class NewControl >
+   struct change_control
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         return TAO_PEGTL_NAMESPACE::match< Rule, A, M, Action, NewControl >( in, st... );
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/change_state.hpp b/packages/PEGTL/include/tao/pegtl/change_state.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..9e3568e94d8a3e5cd0653e87be0f26a241e7c544
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/change_state.hpp
@@ -0,0 +1,50 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_CHANGE_STATE_HPP
+#define TAO_PEGTL_CHANGE_STATE_HPP
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "match.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   template< typename NewState >
+   struct change_state
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         NewState s( static_cast< const Input& >( in ), st... );
+         if( TAO_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in, s ) ) {
+            if constexpr( A == apply_mode::action ) {
+               Action< Rule >::success( static_cast< const Input& >( in ), s, st... );
+            }
+            return true;
+         }
+         return false;
+      }
+
+      template< typename Input,
+                typename... States >
+      static void success( const Input& in, NewState& s, States&&... st ) noexcept( noexcept( s.success( in, st... ) ) )
+      {
+         s.success( in, st... );
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/change_states.hpp b/packages/PEGTL/include/tao/pegtl/change_states.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..09d49dd10c359f108458fa4d976aa533acd2fb76
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/change_states.hpp
@@ -0,0 +1,61 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_CHANGE_STATES_HPP
+#define TAO_PEGTL_CHANGE_STATES_HPP
+
+#include <tuple>
+#include <utility>
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "match.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   template< typename... NewStates >
+   struct change_states
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                std::size_t... Ns,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( std::index_sequence< Ns... >, Input& in, States&&... st )
+      {
+         auto t = std::tie( st... );
+         if( TAO_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in, std::get< Ns >( t )... ) ) {
+            if constexpr( A == apply_mode::action ) {
+               Action< Rule >::success( static_cast< const Input& >( in ), st... );
+            }
+            return true;
+         }
+         return false;
+      }
+
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         return match< Rule, A, M, Action, Control >( std::index_sequence_for< NewStates... >(), in, NewStates()..., st... );
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/config.hpp b/packages/PEGTL/include/tao/pegtl/config.hpp
index ed8cbd1df6bb9c698e3587f59eea8f58526f02fc..4bcdd10353d9d0ffbe3e97059a0fd07b03e8e538 100644
--- a/packages/PEGTL/include/tao/pegtl/config.hpp
+++ b/packages/PEGTL/include/tao/pegtl/config.hpp
@@ -1,16 +1,11 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONFIG_HPP
 #define TAO_PEGTL_CONFIG_HPP
 
-// Compatibility, remove with 3.0
-#ifdef TAOCPP_PEGTL_NAMESPACE
-#define TAO_PEGTL_NAMESPACE TAOCPP_PEGTL_NAMESPACE
-#endif
-
-#ifndef TAO_PEGTL_NAMESPACE
-#define TAO_PEGTL_NAMESPACE pegtl
+#if !defined( TAO_PEGTL_NAMESPACE )
+#define TAO_PEGTL_NAMESPACE tao::pegtl
 #endif
 
 // Enable some improvements to the readability of
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/abnf.hpp b/packages/PEGTL/include/tao/pegtl/contrib/abnf.hpp
index e006f0659b35019903113bdb31b84cc9e6314a46..f90d6b9497142691695fb4227a7665d7256ce3ea 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/abnf.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/abnf.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_ABNF_HPP
@@ -7,37 +7,29 @@
 #include "../config.hpp"
 #include "../internal/rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::abnf
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace abnf
-      {
-         // Core ABNF rules according to RFC 5234, Appendix B
-
-         // clang-format off
-         struct ALPHA : internal::ranges< internal::peek_char, 'a', 'z', 'A', 'Z' > {};
-         struct BIT : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, '0', '1' > {};
-         struct CHAR : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, char( 1 ), char( 127 ) > {};
-         struct CR : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, '\r' > {};
-         struct CRLF : internal::string< '\r', '\n' > {};
-         struct CTL : internal::ranges< internal::peek_char, char( 0 ), char( 31 ), char( 127 ) > {};
-         struct DIGIT : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, '0', '9' > {};
-         struct DQUOTE : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, '"' > {};
-         struct HEXDIG : internal::ranges< internal::peek_char, '0', '9', 'a', 'f', 'A', 'F' > {};
-         struct HTAB : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, '\t' > {};
-         struct LF : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, '\n' > {};
-         struct LWSP : internal::star< internal::sor< internal::string< '\r', '\n' >, internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ', '\t' > >, internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ', '\t' > > {};
-         struct OCTET : internal::any< internal::peek_char > {};
-         struct SP : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ' > {};
-         struct VCHAR : internal::range< internal::result_on_found::SUCCESS, internal::peek_char, char( 33 ), char( 126 ) > {};
-         struct WSP : internal::one< internal::result_on_found::SUCCESS, internal::peek_char, ' ', '\t' > {};
-         // clang-format on
-
-      }  // namespace abnf
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+   // Core ABNF rules according to RFC 5234, Appendix B
+
+   // clang-format off
+   struct ALPHA : internal::ranges< internal::peek_char, 'a', 'z', 'A', 'Z' > {};
+   struct BIT : internal::one< internal::result_on_found::success, internal::peek_char, '0', '1' > {};
+   struct CHAR : internal::range< internal::result_on_found::success, internal::peek_char, char( 1 ), char( 127 ) > {};
+   struct CR : internal::one< internal::result_on_found::success, internal::peek_char, '\r' > {};
+   struct CRLF : internal::string< '\r', '\n' > {};
+   struct CTL : internal::ranges< internal::peek_char, char( 0 ), char( 31 ), char( 127 ) > {};
+   struct DIGIT : internal::range< internal::result_on_found::success, internal::peek_char, '0', '9' > {};
+   struct DQUOTE : internal::one< internal::result_on_found::success, internal::peek_char, '"' > {};
+   struct HEXDIG : internal::ranges< internal::peek_char, '0', '9', 'a', 'f', 'A', 'F' > {};
+   struct HTAB : internal::one< internal::result_on_found::success, internal::peek_char, '\t' > {};
+   struct LF : internal::one< internal::result_on_found::success, internal::peek_char, '\n' > {};
+   struct LWSP : internal::star< internal::sor< internal::string< '\r', '\n' >, internal::one< internal::result_on_found::success, internal::peek_char, ' ', '\t' > >, internal::one< internal::result_on_found::success, internal::peek_char, ' ', '\t' > > {};
+   struct OCTET : internal::any< internal::peek_char > {};
+   struct SP : internal::one< internal::result_on_found::success, internal::peek_char, ' ' > {};
+   struct VCHAR : internal::range< internal::result_on_found::success, internal::peek_char, char( 33 ), char( 126 ) > {};
+   struct WSP : internal::one< internal::result_on_found::success, internal::peek_char, ' ', '\t' > {};
+   // clang-format on
+
+}  // namespace TAO_PEGTL_NAMESPACE::abnf
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/alphabet.hpp b/packages/PEGTL/include/tao/pegtl/contrib/alphabet.hpp
index 2e0228b3282f90f93818105e0040d7bdb95f9ce0..e1d3292d562b6358d40d9549bb56ca00357c4d10 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/alphabet.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/alphabet.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_ALPHABET_HPP
@@ -6,70 +6,62 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::alphabet
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace alphabet
-      {
-         static const int a = 'a';
-         static const int b = 'b';
-         static const int c = 'c';
-         static const int d = 'd';
-         static const int e = 'e';
-         static const int f = 'f';
-         static const int g = 'g';
-         static const int h = 'h';
-         static const int i = 'i';
-         static const int j = 'j';
-         static const int k = 'k';
-         static const int l = 'l';
-         static const int m = 'm';
-         static const int n = 'n';
-         static const int o = 'o';
-         static const int p = 'p';
-         static const int q = 'q';
-         static const int r = 'r';
-         static const int s = 's';
-         static const int t = 't';
-         static const int u = 'u';
-         static const int v = 'v';
-         static const int w = 'w';
-         static const int x = 'x';
-         static const int y = 'y';
-         static const int z = 'z';
+   static const int a = 'a';
+   static const int b = 'b';
+   static const int c = 'c';
+   static const int d = 'd';
+   static const int e = 'e';
+   static const int f = 'f';
+   static const int g = 'g';
+   static const int h = 'h';
+   static const int i = 'i';
+   static const int j = 'j';
+   static const int k = 'k';
+   static const int l = 'l';
+   static const int m = 'm';
+   static const int n = 'n';
+   static const int o = 'o';
+   static const int p = 'p';
+   static const int q = 'q';
+   static const int r = 'r';
+   static const int s = 's';
+   static const int t = 't';
+   static const int u = 'u';
+   static const int v = 'v';
+   static const int w = 'w';
+   static const int x = 'x';
+   static const int y = 'y';
+   static const int z = 'z';
 
-         static const int A = 'A';
-         static const int B = 'B';
-         static const int C = 'C';
-         static const int D = 'D';
-         static const int E = 'E';
-         static const int F = 'F';
-         static const int G = 'G';
-         static const int H = 'H';
-         static const int I = 'I';
-         static const int J = 'J';
-         static const int K = 'K';
-         static const int L = 'L';
-         static const int M = 'M';
-         static const int N = 'N';
-         static const int O = 'O';
-         static const int P = 'P';
-         static const int Q = 'Q';
-         static const int R = 'R';
-         static const int S = 'S';
-         static const int T = 'T';
-         static const int U = 'U';
-         static const int V = 'V';
-         static const int W = 'W';
-         static const int X = 'X';
-         static const int Y = 'Y';
-         static const int Z = 'Z';
+   static const int A = 'A';
+   static const int B = 'B';
+   static const int C = 'C';
+   static const int D = 'D';
+   static const int E = 'E';
+   static const int F = 'F';
+   static const int G = 'G';
+   static const int H = 'H';
+   static const int I = 'I';
+   static const int J = 'J';
+   static const int K = 'K';
+   static const int L = 'L';
+   static const int M = 'M';
+   static const int N = 'N';
+   static const int O = 'O';
+   static const int P = 'P';
+   static const int Q = 'Q';
+   static const int R = 'R';
+   static const int S = 'S';
+   static const int T = 'T';
+   static const int U = 'U';
+   static const int V = 'V';
+   static const int W = 'W';
+   static const int X = 'X';
+   static const int Y = 'Y';
+   static const int Z = 'Z';
 
-      }  // namespace alphabet
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::alphabet
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/changes.hpp b/packages/PEGTL/include/tao/pegtl/contrib/changes.hpp
deleted file mode 100644
index 0aa8ab038dd195273b3f91edf690d32922405e88..0000000000000000000000000000000000000000
--- a/packages/PEGTL/include/tao/pegtl/contrib/changes.hpp
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
-// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
-
-#ifndef TAO_PEGTL_CONTRIB_CHANGES_HPP
-#define TAO_PEGTL_CONTRIB_CHANGES_HPP
-
-#include "../config.hpp"
-#include "../normal.hpp"
-
-#include "../internal/conditional.hpp"
-
-namespace tao
-{
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         struct dummy_disabled_state
-         {
-            template< typename... Ts >
-            void success( Ts&&... /*unused*/ ) const noexcept
-            {
-            }
-         };
-
-         template< apply_mode A, typename State >
-         using state_disable_helper = typename conditional< A == apply_mode::ACTION >::template type< State, dummy_disabled_state >;
-
-      }  // namespace internal
-
-      template< typename Rule, typename State, template< typename... > class Base = normal >
-      struct change_state
-         : public Base< Rule >
-      {
-         template< apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control,
-                   typename Input,
-                   typename... States >
-         static bool match( Input& in, States&&... st )
-         {
-            internal::state_disable_helper< A, State > s;
-
-            if( Base< Rule >::template match< A, M, Action, Control >( in, s ) ) {
-               s.success( st... );
-               return true;
-            }
-            return false;
-         }
-      };
-
-      template< typename Rule, template< typename... > class Action, template< typename... > class Base = normal >
-      struct change_action
-         : public Base< Rule >
-      {
-         template< apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class,
-                   template< typename... > class Control,
-                   typename Input,
-                   typename... States >
-         static bool match( Input& in, States&&... st )
-         {
-            return Base< Rule >::template match< A, M, Action, Control >( in, st... );
-         }
-      };
-
-      template< template< typename... > class Action, template< typename... > class Base >
-      struct change_both_helper
-      {
-         template< typename T >
-         using change_action = change_action< T, Action, Base >;
-      };
-
-      template< typename Rule, typename State, template< typename... > class Action, template< typename... > class Base = normal >
-      struct change_state_and_action
-         : public change_state< Rule, State, change_both_helper< Action, Base >::template change_action >
-      {
-      };
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
-
-#endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/counter.hpp b/packages/PEGTL/include/tao/pegtl/contrib/counter.hpp
index 111fd38a8ebba58eaa73e5afddfaf13723961719..fab396f936736fbb5742c00d60231feacef768c3 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/counter.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/counter.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_COUNTER_HPP
@@ -12,47 +12,43 @@
 
 #include "../internal/demangle.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct counter_data
    {
-      struct counter_data
+      unsigned start = 0;
+      unsigned success = 0;
+      unsigned failure = 0;
+   };
+
+   struct counter_state
+   {
+      std::map< std::string, counter_data > counts;
+   };
+
+   template< typename Rule >
+   struct counter
+      : normal< Rule >
+   {
+      template< typename Input >
+      static void start( const Input& /*unused*/, counter_state& ts )
       {
-         unsigned start = 0;
-         unsigned success = 0;
-         unsigned failure = 0;
-      };
+         ++ts.counts[ internal::demangle< Rule >() ].start;
+      }
 
-      struct counter_state
+      template< typename Input >
+      static void success( const Input& /*unused*/, counter_state& ts )
       {
-         std::map< std::string, counter_data > counts;
-      };
+         ++ts.counts[ internal::demangle< Rule >() ].success;
+      }
 
-      template< typename Rule >
-      struct counter
-         : normal< Rule >
+      template< typename Input >
+      static void failure( const Input& /*unused*/, counter_state& ts )
       {
-         template< typename Input >
-         static void start( const Input& /*unused*/, counter_state& ts )
-         {
-            ++ts.counts[ internal::demangle< Rule >() ].start;
-         }
-
-         template< typename Input >
-         static void success( const Input& /*unused*/, counter_state& ts )
-         {
-            ++ts.counts[ internal::demangle< Rule >() ].success;
-         }
-
-         template< typename Input >
-         static void failure( const Input& /*unused*/, counter_state& ts )
-         {
-            ++ts.counts[ internal::demangle< Rule >() ].failure;
-         }
-      };
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         ++ts.counts[ internal::demangle< Rule >() ].failure;
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/http.hpp b/packages/PEGTL/include/tao/pegtl/contrib/http.hpp
index c49cb6f681821a25ab090d70fdbb286077e61263..3d28f466a10b920119c849452c4ca7d87640400a 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/http.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/http.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_HTTP_HPP
@@ -12,140 +12,131 @@
 #include "abnf.hpp"
 #include "uri.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::http
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace http
-      {
-         // HTTP 1.1 grammar according to RFC 7230.
+   // HTTP 1.1 grammar according to RFC 7230.
 
-         // This grammar is a direct PEG translation of the original HTTP grammar.
-         // It should be considered experimental -- in case of any issues, in particular
-         // missing rules for attached actions, please contact the developers.
+   // This grammar is a direct PEG translation of the original HTTP grammar.
+   // It should be considered experimental -- in case of any issues, in particular
+   // missing rules for attached actions, please contact the developers.
 
-         using OWS = star< abnf::WSP >;  // optional whitespace
-         using RWS = plus< abnf::WSP >;  // required whitespace
-         using BWS = OWS;                // "bad" whitespace
+   using OWS = star< abnf::WSP >;  // optional whitespace
+   using RWS = plus< abnf::WSP >;  // required whitespace
+   using BWS = OWS;                // "bad" whitespace
 
-         // cppcheck-suppress constStatement
-         using obs_text = not_range< 0x00, 0x7F >;
-         using obs_fold = seq< abnf::CRLF, plus< abnf::WSP > >;
+   using obs_text = not_range< 0x00, 0x7F >;
+   using obs_fold = seq< abnf::CRLF, plus< abnf::WSP > >;
 
-         // clang-format off
-         struct tchar : sor< abnf::ALPHA, abnf::DIGIT, one< '!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~' > > {};
-         struct token : plus< tchar > {};
+   // clang-format off
+   struct tchar : sor< abnf::ALPHA, abnf::DIGIT, one< '!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~' > > {};
+   struct token : plus< tchar > {};
 
-         struct field_name : token {};
+   struct field_name : token {};
 
-         struct field_vchar : sor< abnf::VCHAR, obs_text > {};
-         struct field_content : list< field_vchar, plus< abnf::WSP > > {};
-         struct field_value : star< sor< field_content, obs_fold > > {};
+   struct field_vchar : sor< abnf::VCHAR, obs_text > {};
+   struct field_content : list< field_vchar, plus< abnf::WSP > > {};
+   struct field_value : star< sor< field_content, obs_fold > > {};
 
-         struct header_field : seq< field_name, one< ':' >, OWS, field_value, OWS > {};
+   struct header_field : seq< field_name, one< ':' >, OWS, field_value, OWS > {};
 
-         struct method : token {};
+   struct method : token {};
 
-         struct absolute_path : plus< one< '/' >, uri::segment > {};
+   struct absolute_path : plus< one< '/' >, uri::segment > {};
 
-         struct origin_form : seq< absolute_path, uri::opt_query >  {};
-         struct absolute_form : uri::absolute_URI {};
-         struct authority_form : uri::authority {};
-         struct asterisk_form : one< '*' > {};
+   struct origin_form : seq< absolute_path, uri::opt_query >  {};
+   struct absolute_form : uri::absolute_URI {};
+   struct authority_form : uri::authority {};
+   struct asterisk_form : one< '*' > {};
 
-         struct request_target : sor< origin_form, absolute_form, authority_form, asterisk_form > {};
+   struct request_target : sor< origin_form, absolute_form, authority_form, asterisk_form > {};
 
-         struct status_code : rep< 3, abnf::DIGIT > {};
-         struct reason_phrase : star< sor< abnf::VCHAR, obs_text, abnf::WSP > > {};
+   struct status_code : rep< 3, abnf::DIGIT > {};
+   struct reason_phrase : star< sor< abnf::VCHAR, obs_text, abnf::WSP > > {};
 
-         struct HTTP_version : if_must< string< 'H', 'T', 'T', 'P', '/' >, abnf::DIGIT, one< '.' >, abnf::DIGIT > {};
+   struct HTTP_version : if_must< string< 'H', 'T', 'T', 'P', '/' >, abnf::DIGIT, one< '.' >, abnf::DIGIT > {};
 
-         struct request_line : if_must< method, abnf::SP, request_target, abnf::SP, HTTP_version, abnf::CRLF > {};
-         struct status_line : if_must< HTTP_version, abnf::SP, status_code, abnf::SP, reason_phrase, abnf::CRLF > {};
-         struct start_line : sor< status_line, request_line > {};
+   struct request_line : if_must< method, abnf::SP, request_target, abnf::SP, HTTP_version, abnf::CRLF > {};
+   struct status_line : if_must< HTTP_version, abnf::SP, status_code, abnf::SP, reason_phrase, abnf::CRLF > {};
+   struct start_line : sor< status_line, request_line > {};
 
-         struct message_body : star< abnf::OCTET > {};
-         struct HTTP_message : seq< start_line, star< header_field, abnf::CRLF >, abnf::CRLF, opt< message_body > > {};
+   struct message_body : star< abnf::OCTET > {};
+   struct HTTP_message : seq< start_line, star< header_field, abnf::CRLF >, abnf::CRLF, opt< message_body > > {};
 
-         struct Content_Length : plus< abnf::DIGIT > {};
+   struct Content_Length : plus< abnf::DIGIT > {};
 
-         struct uri_host : uri::host {};
-         struct port : uri::port {};
+   struct uri_host : uri::host {};
+   struct port : uri::port {};
 
-         struct Host : seq< uri_host, opt< one< ':' >, port > > {};
+   struct Host : seq< uri_host, opt< one< ':' >, port > > {};
 
-         // PEG are different from CFGs! (this replaces ctext and qdtext)
-         using text = sor< abnf::HTAB, range< 0x20, 0x7E >, obs_text >;
+   // PEG are different from CFGs! (this replaces ctext and qdtext)
+   using text = sor< abnf::HTAB, range< 0x20, 0x7E >, obs_text >;
 
-         struct quoted_pair : if_must< one< '\\' >, sor< abnf::VCHAR, obs_text, abnf::WSP > > {};
-         struct quoted_string : if_must< abnf::DQUOTE, until< abnf::DQUOTE, sor< quoted_pair, text > > > {};
+   struct quoted_pair : if_must< one< '\\' >, sor< abnf::VCHAR, obs_text, abnf::WSP > > {};
+   struct quoted_string : if_must< abnf::DQUOTE, until< abnf::DQUOTE, sor< quoted_pair, text > > > {};
 
-         struct transfer_parameter : seq< token, BWS, one< '=' >, BWS, sor< token, quoted_string > > {};
-         struct transfer_extension : seq< token, star< OWS, one< ';' >, OWS, transfer_parameter > > {};
-         struct transfer_coding : sor< istring< 'c', 'h', 'u', 'n', 'k', 'e', 'd' >,
-                                       istring< 'c', 'o', 'm', 'p', 'r', 'e', 's', 's' >,
-                                       istring< 'd', 'e', 'f', 'l', 'a', 't', 'e' >,
-                                       istring< 'g', 'z', 'i', 'p' >,
-                                       transfer_extension > {};
+   struct transfer_parameter : seq< token, BWS, one< '=' >, BWS, sor< token, quoted_string > > {};
+   struct transfer_extension : seq< token, star< OWS, one< ';' >, OWS, transfer_parameter > > {};
+   struct transfer_coding : sor< istring< 'c', 'h', 'u', 'n', 'k', 'e', 'd' >,
+                                 istring< 'c', 'o', 'm', 'p', 'r', 'e', 's', 's' >,
+                                 istring< 'd', 'e', 'f', 'l', 'a', 't', 'e' >,
+                                 istring< 'g', 'z', 'i', 'p' >,
+                                 transfer_extension > {};
 
-         struct rank : sor< seq< one< '0' >, opt< one< '.' >, rep_opt< 3, abnf::DIGIT > > >,
-                            seq< one< '1' >, opt< one< '.' >, rep_opt< 3, one< '0' > > > > > {};
+   struct rank : sor< seq< one< '0' >, opt< one< '.' >, rep_opt< 3, abnf::DIGIT > > >,
+                      seq< one< '1' >, opt< one< '.' >, rep_opt< 3, one< '0' > > > > > {};
 
-         struct t_ranking : seq< OWS, one< ';' >, OWS, one< 'q', 'Q' >, one< '=' >, rank > {};
-         struct t_codings : sor< istring< 't', 'r', 'a', 'i', 'l', 'e', 'r', 's' >, seq< transfer_coding, opt< t_ranking > > > {};
+   struct t_ranking : seq< OWS, one< ';' >, OWS, one< 'q', 'Q' >, one< '=' >, rank > {};
+   struct t_codings : sor< istring< 't', 'r', 'a', 'i', 'l', 'e', 'r', 's' >, seq< transfer_coding, opt< t_ranking > > > {};
 
-         struct TE : opt< sor< one< ',' >, t_codings >, star< OWS, one< ',' >, opt< OWS, t_codings > > > {};
+   struct TE : opt< sor< one< ',' >, t_codings >, star< OWS, one< ',' >, opt< OWS, t_codings > > > {};
 
-         template< typename T >
-         using make_comma_list = seq< star< one< ',' >, OWS >, T, star< OWS, one< ',' >, opt< OWS, T > > >;
+   template< typename T >
+   using make_comma_list = seq< star< one< ',' >, OWS >, T, star< OWS, one< ',' >, opt< OWS, T > > >;
 
-         struct connection_option : token {};
-         struct Connection : make_comma_list< connection_option > {};
+   struct connection_option : token {};
+   struct Connection : make_comma_list< connection_option > {};
 
-         struct Trailer : make_comma_list< field_name > {};
+   struct Trailer : make_comma_list< field_name > {};
 
-         struct Transfer_Encoding : make_comma_list< transfer_coding > {};
+   struct Transfer_Encoding : make_comma_list< transfer_coding > {};
 
-         struct protocol_name : token {};
-         struct protocol_version : token {};
-         struct protocol : seq< protocol_name, opt< one< '/' >, protocol_version > > {};
-         struct Upgrade : make_comma_list< protocol > {};
+   struct protocol_name : token {};
+   struct protocol_version : token {};
+   struct protocol : seq< protocol_name, opt< one< '/' >, protocol_version > > {};
+   struct Upgrade : make_comma_list< protocol > {};
 
-         struct pseudonym : token {};
+   struct pseudonym : token {};
 
-         struct received_protocol : seq< opt< protocol_name, one< '/' > >, protocol_version > {};
-         struct received_by : sor< seq< uri_host, opt< one< ':' >, port > >, pseudonym > {};
+   struct received_protocol : seq< opt< protocol_name, one< '/' > >, protocol_version > {};
+   struct received_by : sor< seq< uri_host, opt< one< ':' >, port > >, pseudonym > {};
 
-         struct comment : if_must< one< '(' >, until< one< ')' >, sor< comment, quoted_pair, text > > > {};
+   struct comment : if_must< one< '(' >, until< one< ')' >, sor< comment, quoted_pair, text > > > {};
 
-         struct Via : make_comma_list< seq< received_protocol, RWS, received_by, opt< RWS, comment > > > {};
+   struct Via : make_comma_list< seq< received_protocol, RWS, received_by, opt< RWS, comment > > > {};
 
-         struct http_URI : if_must< istring< 'h', 't', 't', 'p', ':', '/', '/' >, uri::authority, uri::path_abempty, uri::opt_query, uri::opt_fragment > {};
-         struct https_URI : if_must< istring< 'h', 't', 't', 'p', 's', ':', '/', '/' >, uri::authority, uri::path_abempty, uri::opt_query, uri::opt_fragment > {};
+   struct http_URI : if_must< istring< 'h', 't', 't', 'p', ':', '/', '/' >, uri::authority, uri::path_abempty, uri::opt_query, uri::opt_fragment > {};
+   struct https_URI : if_must< istring< 'h', 't', 't', 'p', 's', ':', '/', '/' >, uri::authority, uri::path_abempty, uri::opt_query, uri::opt_fragment > {};
 
-         struct partial_URI : seq< uri::relative_part, uri::opt_query > {};
+   struct partial_URI : seq< uri::relative_part, uri::opt_query > {};
 
-         struct chunk_size : plus< abnf::HEXDIG > {};
+   struct chunk_size : plus< abnf::HEXDIG > {};
 
-         struct chunk_ext_name : token {};
-         struct chunk_ext_val : sor< quoted_string, token > {};
-         struct chunk_ext : star_must< one< ';' >, chunk_ext_name, if_must< one< '=' >, chunk_ext_val > > {};
+   struct chunk_ext_name : token {};
+   struct chunk_ext_val : sor< quoted_string, token > {};
+   struct chunk_ext : star_must< one< ';' >, chunk_ext_name, if_must< one< '=' >, chunk_ext_val > > {};
 
-         struct chunk_data : until< at< abnf::CRLF >, abnf::OCTET > {};
+   struct chunk_data : until< at< abnf::CRLF >, abnf::OCTET > {};
 
-         struct chunk : seq< chunk_size, opt< chunk_ext >, abnf::CRLF, chunk_data, abnf::CRLF > {};
+   struct chunk : seq< chunk_size, opt< chunk_ext >, abnf::CRLF, chunk_data, abnf::CRLF > {};
 
-         struct last_chunk : seq< plus< one< '0' > >, opt< chunk_ext >, abnf::CRLF > {};
+   struct last_chunk : seq< plus< one< '0' > >, opt< chunk_ext >, abnf::CRLF > {};
 
-         struct trailer_part : star< header_field, abnf::CRLF > {};
+   struct trailer_part : star< header_field, abnf::CRLF > {};
 
-         struct chunked_body : seq< until< last_chunk, chunk >, trailer_part, abnf::CRLF > {};
-         // clang-format on
+   struct chunked_body : seq< until< last_chunk, chunk >, trailer_part, abnf::CRLF > {};
+   // clang-format on
 
-      }  // namespace http
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::http
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/icu/internal.hpp b/packages/PEGTL/include/tao/pegtl/contrib/icu/internal.hpp
index e1af0bba22525bff27052e13e0005b8492b4a294..c71bac3429e598bd609a57a8dfb2fa856aa5188e 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/icu/internal.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/icu/internal.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_ICU_INTERNAL_HPP
@@ -11,66 +11,58 @@
 #include "../../analysis/generic.hpp"
 #include "../../internal/skip_control.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace icu
    {
-      namespace internal
+      template< typename Peek, UProperty P, bool V = true >
+      struct binary_property
       {
-         namespace icu
-         {
-            template< typename Peek, UProperty P, bool V = true >
-            struct binary_property
-            {
-               using analyze_t = analysis::generic< analysis::rule_type::ANY >;
+         using analyze_t = analysis::generic< analysis::rule_type::any >;
 
-               template< typename Input >
-               static bool match( Input& in ) noexcept( noexcept( Peek::peek( in ) ) )
-               {
-                  if( const auto r = Peek::peek( in ) ) {
-                     if( u_hasBinaryProperty( r.data, P ) == V ) {
-                        in.bump( r.size );
-                        return true;
-                     }
+         template< typename Input >
+         [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( Peek::max_input_size ) ) )
+         {
+            if( const std::size_t s = in.size( Peek::max_input_size ); s >= Peek::min_input_size ) {
+               if( const auto r = Peek::peek( in, s ) ) {
+                  if( u_hasBinaryProperty( r.data, P ) == V ) {
+                     in.bump( r.size );
+                     return true;
                   }
-                  return false;
                }
-            };
+            }
+            return false;
+         }
+      };
 
-            template< typename Peek, UProperty P, int V >
-            struct property_value
-            {
-               using analyze_t = analysis::generic< analysis::rule_type::ANY >;
+      template< typename Peek, UProperty P, int V >
+      struct property_value
+      {
+         using analyze_t = analysis::generic< analysis::rule_type::any >;
 
-               template< typename Input >
-               static bool match( Input& in ) noexcept( noexcept( Peek::peek( in ) ) )
-               {
-                  if( const auto r = Peek::peek( in ) ) {
-                     if( u_getIntPropertyValue( r.data, P ) == V ) {
-                        in.bump( r.size );
-                        return true;
-                     }
+         template< typename Input >
+         [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( Peek::max_input_size ) ) )
+         {
+            if( const std::size_t s = in.size( Peek::max_input_size ); s >= Peek::min_input_size ) {
+               if( const auto r = Peek::peek( in, s ) ) {
+                  if( u_getIntPropertyValue( r.data, P ) == V ) {
+                     in.bump( r.size );
+                     return true;
                   }
-                  return false;
                }
-            };
+            }
+            return false;
+         }
+      };
 
-         }  // namespace icu
-
-         template< typename Peek, UProperty P, bool V >
-         struct skip_control< icu::binary_property< Peek, P, V > > : std::true_type
-         {
-         };
-
-         template< typename Peek, UProperty P, int V >
-         struct skip_control< icu::property_value< Peek, P, V > > : std::true_type
-         {
-         };
+   }  // namespace icu
 
-      }  // namespace internal
+   template< typename Peek, UProperty P, bool V >
+   inline constexpr bool skip_control< icu::binary_property< Peek, P, V > > = true;
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename Peek, UProperty P, int V >
+   inline constexpr bool skip_control< icu::property_value< Peek, P, V > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/icu/utf16.hpp b/packages/PEGTL/include/tao/pegtl/contrib/icu/utf16.hpp
index 2412545d39d166ea2faf48b9ccf6e17bbd26caee..316eb84c375633f09a30f49fb1a61b898370b5bc 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/icu/utf16.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/icu/utf16.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_ICU_UTF16_HPP
@@ -11,202 +11,190 @@
 
 #include "../../internal/peek_utf16.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace utf16_be::icu
    {
-      namespace utf16_be
+      template< UProperty P, bool V = true >
+      struct binary_property
+         : internal::icu::binary_property< internal::peek_utf16_be, P, V >
       {
-         namespace icu
-         {
-            template< UProperty P, bool V = true >
-            struct binary_property
-               : internal::icu::binary_property< internal::peek_utf16_be, P, V >
-            {
-            };
-
-            template< UProperty P, int V >
-            struct property_value
-               : internal::icu::property_value< internal::peek_utf16_be, P, V >
-            {
-            };
-
-            // clang-format off
-            struct alphabetic : binary_property< UCHAR_ALPHABETIC > {};
-            struct ascii_hex_digit : binary_property< UCHAR_ASCII_HEX_DIGIT > {};
-            struct bidi_control : binary_property< UCHAR_BIDI_CONTROL > {};
-            struct bidi_mirrored : binary_property< UCHAR_BIDI_MIRRORED > {};
-            struct case_sensitive : binary_property< UCHAR_CASE_SENSITIVE > {};
-            struct dash : binary_property< UCHAR_DASH > {};
-            struct default_ignorable_code_point : binary_property< UCHAR_DEFAULT_IGNORABLE_CODE_POINT > {};
-            struct deprecated : binary_property< UCHAR_DEPRECATED > {};
-            struct diacritic : binary_property< UCHAR_DIACRITIC > {};
-            struct extender : binary_property< UCHAR_EXTENDER > {};
-            struct full_composition_exclusion : binary_property< UCHAR_FULL_COMPOSITION_EXCLUSION > {};
-            struct grapheme_base : binary_property< UCHAR_GRAPHEME_BASE > {};
-            struct grapheme_extend : binary_property< UCHAR_GRAPHEME_EXTEND > {};
-            struct grapheme_link : binary_property< UCHAR_GRAPHEME_LINK > {};
-            struct hex_digit : binary_property< UCHAR_HEX_DIGIT > {};
-            struct hyphen : binary_property< UCHAR_HYPHEN > {};
-            struct id_continue : binary_property< UCHAR_ID_CONTINUE > {};
-            struct id_start : binary_property< UCHAR_ID_START > {};
-            struct ideographic : binary_property< UCHAR_IDEOGRAPHIC > {};
-            struct ids_binary_operator : binary_property< UCHAR_IDS_BINARY_OPERATOR > {};
-            struct ids_trinary_operator : binary_property< UCHAR_IDS_TRINARY_OPERATOR > {};
-            struct join_control : binary_property< UCHAR_JOIN_CONTROL > {};
-            struct logical_order_exception : binary_property< UCHAR_LOGICAL_ORDER_EXCEPTION > {};
-            struct lowercase : binary_property< UCHAR_LOWERCASE > {};
-            struct math : binary_property< UCHAR_MATH > {};
-            struct nfc_inert : binary_property< UCHAR_NFC_INERT > {};
-            struct nfd_inert : binary_property< UCHAR_NFD_INERT > {};
-            struct nfkc_inert : binary_property< UCHAR_NFKC_INERT > {};
-            struct nfkd_inert : binary_property< UCHAR_NFKD_INERT > {};
-            struct noncharacter_code_point : binary_property< UCHAR_NONCHARACTER_CODE_POINT > {};
-            struct pattern_syntax : binary_property< UCHAR_PATTERN_SYNTAX > {};
-            struct pattern_white_space : binary_property< UCHAR_PATTERN_WHITE_SPACE > {};
-            struct posix_alnum : binary_property< UCHAR_POSIX_ALNUM > {};
-            struct posix_blank : binary_property< UCHAR_POSIX_BLANK > {};
-            struct posix_graph : binary_property< UCHAR_POSIX_GRAPH > {};
-            struct posix_print : binary_property< UCHAR_POSIX_PRINT > {};
-            struct posix_xdigit : binary_property< UCHAR_POSIX_XDIGIT > {};
-            struct quotation_mark : binary_property< UCHAR_QUOTATION_MARK > {};
-            struct radical : binary_property< UCHAR_RADICAL > {};
-            struct s_term : binary_property< UCHAR_S_TERM > {};
-            struct segment_starter : binary_property< UCHAR_SEGMENT_STARTER > {};
-            struct soft_dotted : binary_property< UCHAR_SOFT_DOTTED > {};
-            struct terminal_punctuation : binary_property< UCHAR_TERMINAL_PUNCTUATION > {};
-            struct unified_ideograph : binary_property< UCHAR_UNIFIED_IDEOGRAPH > {};
-            struct uppercase : binary_property< UCHAR_UPPERCASE > {};
-            struct variation_selector : binary_property< UCHAR_VARIATION_SELECTOR > {};
-            struct white_space : binary_property< UCHAR_WHITE_SPACE > {};
-            struct xid_continue : binary_property< UCHAR_XID_CONTINUE > {};
-            struct xid_start : binary_property< UCHAR_XID_START > {};
-
-            template< UCharDirection V > struct bidi_class : property_value< UCHAR_BIDI_CLASS, V > {};
-            template< UBlockCode V > struct block : property_value< UCHAR_BLOCK, V > {};
-            template< UDecompositionType V > struct decomposition_type : property_value< UCHAR_DECOMPOSITION_TYPE, V > {};
-            template< UEastAsianWidth V > struct east_asian_width : property_value< UCHAR_EAST_ASIAN_WIDTH, V > {};
-            template< UCharCategory V > struct general_category : property_value< UCHAR_GENERAL_CATEGORY, V > {};
-            template< UGraphemeClusterBreak V > struct grapheme_cluster_break : property_value< UCHAR_GRAPHEME_CLUSTER_BREAK, V > {};
-            template< UHangulSyllableType V > struct hangul_syllable_type : property_value< UCHAR_HANGUL_SYLLABLE_TYPE, V > {};
-            template< UJoiningGroup V > struct joining_group : property_value< UCHAR_JOINING_GROUP, V > {};
-            template< UJoiningType V > struct joining_type : property_value< UCHAR_JOINING_TYPE, V > {};
-            template< ULineBreak V > struct line_break : property_value< UCHAR_LINE_BREAK, V > {};
-            // UNormalizationCheckResult requires an additional header <unicode/unorm2.h>:
-            // template< UNormalizationCheckResult V > struct nfc_quick_check : property_value< UCHAR_NFC_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfd_quick_check : property_value< UCHAR_NFD_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfkc_quick_check : property_value< UCHAR_NFKC_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfkd_quick_check : property_value< UCHAR_NFKD_QUICK_CHECK, V > {};
-            template< UNumericType V > struct numeric_type : property_value< UCHAR_NUMERIC_TYPE, V > {};
-            template< USentenceBreak V > struct sentence_break : property_value< UCHAR_SENTENCE_BREAK, V > {};
-            template< UWordBreakValues V > struct word_break : property_value< UCHAR_WORD_BREAK, V > {};
-
-            template< std::uint8_t V > struct canonical_combining_class : property_value< UCHAR_CANONICAL_COMBINING_CLASS, V > {};
-            template< std::uint8_t V > struct lead_canonical_combining_class : property_value< UCHAR_LEAD_CANONICAL_COMBINING_CLASS, V > {};
-            template< std::uint8_t V > struct trail_canonical_combining_class : property_value< UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, V > {};
-            // clang-format on
-
-         }  // namespace icu
-
-      }  // namespace utf16_be
-
-      namespace utf16_le
+      };
+
+      template< UProperty P, int V >
+      struct property_value
+         : internal::icu::property_value< internal::peek_utf16_be, P, V >
+      {
+      };
+
+      // clang-format off
+      struct alphabetic : binary_property< UCHAR_ALPHABETIC > {};
+      struct ascii_hex_digit : binary_property< UCHAR_ASCII_HEX_DIGIT > {};
+      struct bidi_control : binary_property< UCHAR_BIDI_CONTROL > {};
+      struct bidi_mirrored : binary_property< UCHAR_BIDI_MIRRORED > {};
+      struct case_sensitive : binary_property< UCHAR_CASE_SENSITIVE > {};
+      struct dash : binary_property< UCHAR_DASH > {};
+      struct default_ignorable_code_point : binary_property< UCHAR_DEFAULT_IGNORABLE_CODE_POINT > {};
+      struct deprecated : binary_property< UCHAR_DEPRECATED > {};
+      struct diacritic : binary_property< UCHAR_DIACRITIC > {};
+      struct extender : binary_property< UCHAR_EXTENDER > {};
+      struct full_composition_exclusion : binary_property< UCHAR_FULL_COMPOSITION_EXCLUSION > {};
+      struct grapheme_base : binary_property< UCHAR_GRAPHEME_BASE > {};
+      struct grapheme_extend : binary_property< UCHAR_GRAPHEME_EXTEND > {};
+      struct grapheme_link : binary_property< UCHAR_GRAPHEME_LINK > {};
+      struct hex_digit : binary_property< UCHAR_HEX_DIGIT > {};
+      struct hyphen : binary_property< UCHAR_HYPHEN > {};
+      struct id_continue : binary_property< UCHAR_ID_CONTINUE > {};
+      struct id_start : binary_property< UCHAR_ID_START > {};
+      struct ideographic : binary_property< UCHAR_IDEOGRAPHIC > {};
+      struct ids_binary_operator : binary_property< UCHAR_IDS_BINARY_OPERATOR > {};
+      struct ids_trinary_operator : binary_property< UCHAR_IDS_TRINARY_OPERATOR > {};
+      struct join_control : binary_property< UCHAR_JOIN_CONTROL > {};
+      struct logical_order_exception : binary_property< UCHAR_LOGICAL_ORDER_EXCEPTION > {};
+      struct lowercase : binary_property< UCHAR_LOWERCASE > {};
+      struct math : binary_property< UCHAR_MATH > {};
+      struct nfc_inert : binary_property< UCHAR_NFC_INERT > {};
+      struct nfd_inert : binary_property< UCHAR_NFD_INERT > {};
+      struct nfkc_inert : binary_property< UCHAR_NFKC_INERT > {};
+      struct nfkd_inert : binary_property< UCHAR_NFKD_INERT > {};
+      struct noncharacter_code_point : binary_property< UCHAR_NONCHARACTER_CODE_POINT > {};
+      struct pattern_syntax : binary_property< UCHAR_PATTERN_SYNTAX > {};
+      struct pattern_white_space : binary_property< UCHAR_PATTERN_WHITE_SPACE > {};
+      struct posix_alnum : binary_property< UCHAR_POSIX_ALNUM > {};
+      struct posix_blank : binary_property< UCHAR_POSIX_BLANK > {};
+      struct posix_graph : binary_property< UCHAR_POSIX_GRAPH > {};
+      struct posix_print : binary_property< UCHAR_POSIX_PRINT > {};
+      struct posix_xdigit : binary_property< UCHAR_POSIX_XDIGIT > {};
+      struct quotation_mark : binary_property< UCHAR_QUOTATION_MARK > {};
+      struct radical : binary_property< UCHAR_RADICAL > {};
+      struct s_term : binary_property< UCHAR_S_TERM > {};
+      struct segment_starter : binary_property< UCHAR_SEGMENT_STARTER > {};
+      struct soft_dotted : binary_property< UCHAR_SOFT_DOTTED > {};
+      struct terminal_punctuation : binary_property< UCHAR_TERMINAL_PUNCTUATION > {};
+      struct unified_ideograph : binary_property< UCHAR_UNIFIED_IDEOGRAPH > {};
+      struct uppercase : binary_property< UCHAR_UPPERCASE > {};
+      struct variation_selector : binary_property< UCHAR_VARIATION_SELECTOR > {};
+      struct white_space : binary_property< UCHAR_WHITE_SPACE > {};
+      struct xid_continue : binary_property< UCHAR_XID_CONTINUE > {};
+      struct xid_start : binary_property< UCHAR_XID_START > {};
+
+      template< UCharDirection V > struct bidi_class : property_value< UCHAR_BIDI_CLASS, V > {};
+      template< UBlockCode V > struct block : property_value< UCHAR_BLOCK, V > {};
+      template< UDecompositionType V > struct decomposition_type : property_value< UCHAR_DECOMPOSITION_TYPE, V > {};
+      template< UEastAsianWidth V > struct east_asian_width : property_value< UCHAR_EAST_ASIAN_WIDTH, V > {};
+      template< UCharCategory V > struct general_category : property_value< UCHAR_GENERAL_CATEGORY, V > {};
+      template< UGraphemeClusterBreak V > struct grapheme_cluster_break : property_value< UCHAR_GRAPHEME_CLUSTER_BREAK, V > {};
+      template< UHangulSyllableType V > struct hangul_syllable_type : property_value< UCHAR_HANGUL_SYLLABLE_TYPE, V > {};
+      template< UJoiningGroup V > struct joining_group : property_value< UCHAR_JOINING_GROUP, V > {};
+      template< UJoiningType V > struct joining_type : property_value< UCHAR_JOINING_TYPE, V > {};
+      template< ULineBreak V > struct line_break : property_value< UCHAR_LINE_BREAK, V > {};
+      // UNormalizationCheckResult requires an additional header <unicode/unorm2.h>:
+      // template< UNormalizationCheckResult V > struct nfc_quick_check : property_value< UCHAR_NFC_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfd_quick_check : property_value< UCHAR_NFD_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfkc_quick_check : property_value< UCHAR_NFKC_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfkd_quick_check : property_value< UCHAR_NFKD_QUICK_CHECK, V > {};
+      template< UNumericType V > struct numeric_type : property_value< UCHAR_NUMERIC_TYPE, V > {};
+      template< USentenceBreak V > struct sentence_break : property_value< UCHAR_SENTENCE_BREAK, V > {};
+      template< UWordBreakValues V > struct word_break : property_value< UCHAR_WORD_BREAK, V > {};
+
+      template< std::uint8_t V > struct canonical_combining_class : property_value< UCHAR_CANONICAL_COMBINING_CLASS, V > {};
+      template< std::uint8_t V > struct lead_canonical_combining_class : property_value< UCHAR_LEAD_CANONICAL_COMBINING_CLASS, V > {};
+      template< std::uint8_t V > struct trail_canonical_combining_class : property_value< UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, V > {};
+      // clang-format on
+
+   }  // namespace utf16_be::icu
+
+   namespace utf16_le::icu
+   {
+      template< UProperty P, bool V = true >
+      struct binary_property
+         : internal::icu::binary_property< internal::peek_utf16_le, P, V >
+      {
+      };
+
+      template< UProperty P, int V >
+      struct property_value
+         : internal::icu::property_value< internal::peek_utf16_le, P, V >
       {
-         namespace icu
-         {
-            template< UProperty P, bool V = true >
-            struct binary_property
-               : internal::icu::binary_property< internal::peek_utf16_le, P, V >
-            {
-            };
-
-            template< UProperty P, int V >
-            struct property_value
-               : internal::icu::property_value< internal::peek_utf16_le, P, V >
-            {
-            };
-
-            // clang-format off
-            struct alphabetic : binary_property< UCHAR_ALPHABETIC > {};
-            struct ascii_hex_digit : binary_property< UCHAR_ASCII_HEX_DIGIT > {};
-            struct bidi_control : binary_property< UCHAR_BIDI_CONTROL > {};
-            struct bidi_mirrored : binary_property< UCHAR_BIDI_MIRRORED > {};
-            struct case_sensitive : binary_property< UCHAR_CASE_SENSITIVE > {};
-            struct dash : binary_property< UCHAR_DASH > {};
-            struct default_ignorable_code_point : binary_property< UCHAR_DEFAULT_IGNORABLE_CODE_POINT > {};
-            struct deprecated : binary_property< UCHAR_DEPRECATED > {};
-            struct diacritic : binary_property< UCHAR_DIACRITIC > {};
-            struct extender : binary_property< UCHAR_EXTENDER > {};
-            struct full_composition_exclusion : binary_property< UCHAR_FULL_COMPOSITION_EXCLUSION > {};
-            struct grapheme_base : binary_property< UCHAR_GRAPHEME_BASE > {};
-            struct grapheme_extend : binary_property< UCHAR_GRAPHEME_EXTEND > {};
-            struct grapheme_link : binary_property< UCHAR_GRAPHEME_LINK > {};
-            struct hex_digit : binary_property< UCHAR_HEX_DIGIT > {};
-            struct hyphen : binary_property< UCHAR_HYPHEN > {};
-            struct id_continue : binary_property< UCHAR_ID_CONTINUE > {};
-            struct id_start : binary_property< UCHAR_ID_START > {};
-            struct ideographic : binary_property< UCHAR_IDEOGRAPHIC > {};
-            struct ids_binary_operator : binary_property< UCHAR_IDS_BINARY_OPERATOR > {};
-            struct ids_trinary_operator : binary_property< UCHAR_IDS_TRINARY_OPERATOR > {};
-            struct join_control : binary_property< UCHAR_JOIN_CONTROL > {};
-            struct logical_order_exception : binary_property< UCHAR_LOGICAL_ORDER_EXCEPTION > {};
-            struct lowercase : binary_property< UCHAR_LOWERCASE > {};
-            struct math : binary_property< UCHAR_MATH > {};
-            struct nfc_inert : binary_property< UCHAR_NFC_INERT > {};
-            struct nfd_inert : binary_property< UCHAR_NFD_INERT > {};
-            struct nfkc_inert : binary_property< UCHAR_NFKC_INERT > {};
-            struct nfkd_inert : binary_property< UCHAR_NFKD_INERT > {};
-            struct noncharacter_code_point : binary_property< UCHAR_NONCHARACTER_CODE_POINT > {};
-            struct pattern_syntax : binary_property< UCHAR_PATTERN_SYNTAX > {};
-            struct pattern_white_space : binary_property< UCHAR_PATTERN_WHITE_SPACE > {};
-            struct posix_alnum : binary_property< UCHAR_POSIX_ALNUM > {};
-            struct posix_blank : binary_property< UCHAR_POSIX_BLANK > {};
-            struct posix_graph : binary_property< UCHAR_POSIX_GRAPH > {};
-            struct posix_print : binary_property< UCHAR_POSIX_PRINT > {};
-            struct posix_xdigit : binary_property< UCHAR_POSIX_XDIGIT > {};
-            struct quotation_mark : binary_property< UCHAR_QUOTATION_MARK > {};
-            struct radical : binary_property< UCHAR_RADICAL > {};
-            struct s_term : binary_property< UCHAR_S_TERM > {};
-            struct segment_starter : binary_property< UCHAR_SEGMENT_STARTER > {};
-            struct soft_dotted : binary_property< UCHAR_SOFT_DOTTED > {};
-            struct terminal_punctuation : binary_property< UCHAR_TERMINAL_PUNCTUATION > {};
-            struct unified_ideograph : binary_property< UCHAR_UNIFIED_IDEOGRAPH > {};
-            struct uppercase : binary_property< UCHAR_UPPERCASE > {};
-            struct variation_selector : binary_property< UCHAR_VARIATION_SELECTOR > {};
-            struct white_space : binary_property< UCHAR_WHITE_SPACE > {};
-            struct xid_continue : binary_property< UCHAR_XID_CONTINUE > {};
-            struct xid_start : binary_property< UCHAR_XID_START > {};
-
-            template< UCharDirection V > struct bidi_class : property_value< UCHAR_BIDI_CLASS, V > {};
-            template< UBlockCode V > struct block : property_value< UCHAR_BLOCK, V > {};
-            template< UDecompositionType V > struct decomposition_type : property_value< UCHAR_DECOMPOSITION_TYPE, V > {};
-            template< UEastAsianWidth V > struct east_asian_width : property_value< UCHAR_EAST_ASIAN_WIDTH, V > {};
-            template< UCharCategory V > struct general_category : property_value< UCHAR_GENERAL_CATEGORY, V > {};
-            template< UGraphemeClusterBreak V > struct grapheme_cluster_break : property_value< UCHAR_GRAPHEME_CLUSTER_BREAK, V > {};
-            template< UHangulSyllableType V > struct hangul_syllable_type : property_value< UCHAR_HANGUL_SYLLABLE_TYPE, V > {};
-            template< UJoiningGroup V > struct joining_group : property_value< UCHAR_JOINING_GROUP, V > {};
-            template< UJoiningType V > struct joining_type : property_value< UCHAR_JOINING_TYPE, V > {};
-            template< ULineBreak V > struct line_break : property_value< UCHAR_LINE_BREAK, V > {};
-            // UNormalizationCheckResult requires an additional header <unicode/unorm2.h>:
-            // template< UNormalizationCheckResult V > struct nfc_quick_check : property_value< UCHAR_NFC_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfd_quick_check : property_value< UCHAR_NFD_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfkc_quick_check : property_value< UCHAR_NFKC_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfkd_quick_check : property_value< UCHAR_NFKD_QUICK_CHECK, V > {};
-            template< UNumericType V > struct numeric_type : property_value< UCHAR_NUMERIC_TYPE, V > {};
-            template< USentenceBreak V > struct sentence_break : property_value< UCHAR_SENTENCE_BREAK, V > {};
-            template< UWordBreakValues V > struct word_break : property_value< UCHAR_WORD_BREAK, V > {};
-
-            template< std::uint8_t V > struct canonical_combining_class : property_value< UCHAR_CANONICAL_COMBINING_CLASS, V > {};
-            template< std::uint8_t V > struct lead_canonical_combining_class : property_value< UCHAR_LEAD_CANONICAL_COMBINING_CLASS, V > {};
-            template< std::uint8_t V > struct trail_canonical_combining_class : property_value< UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, V > {};
-            // clang-format on
-
-         }  // namespace icu
-
-      }  // namespace utf16_le
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      };
+
+      // clang-format off
+      struct alphabetic : binary_property< UCHAR_ALPHABETIC > {};
+      struct ascii_hex_digit : binary_property< UCHAR_ASCII_HEX_DIGIT > {};
+      struct bidi_control : binary_property< UCHAR_BIDI_CONTROL > {};
+      struct bidi_mirrored : binary_property< UCHAR_BIDI_MIRRORED > {};
+      struct case_sensitive : binary_property< UCHAR_CASE_SENSITIVE > {};
+      struct dash : binary_property< UCHAR_DASH > {};
+      struct default_ignorable_code_point : binary_property< UCHAR_DEFAULT_IGNORABLE_CODE_POINT > {};
+      struct deprecated : binary_property< UCHAR_DEPRECATED > {};
+      struct diacritic : binary_property< UCHAR_DIACRITIC > {};
+      struct extender : binary_property< UCHAR_EXTENDER > {};
+      struct full_composition_exclusion : binary_property< UCHAR_FULL_COMPOSITION_EXCLUSION > {};
+      struct grapheme_base : binary_property< UCHAR_GRAPHEME_BASE > {};
+      struct grapheme_extend : binary_property< UCHAR_GRAPHEME_EXTEND > {};
+      struct grapheme_link : binary_property< UCHAR_GRAPHEME_LINK > {};
+      struct hex_digit : binary_property< UCHAR_HEX_DIGIT > {};
+      struct hyphen : binary_property< UCHAR_HYPHEN > {};
+      struct id_continue : binary_property< UCHAR_ID_CONTINUE > {};
+      struct id_start : binary_property< UCHAR_ID_START > {};
+      struct ideographic : binary_property< UCHAR_IDEOGRAPHIC > {};
+      struct ids_binary_operator : binary_property< UCHAR_IDS_BINARY_OPERATOR > {};
+      struct ids_trinary_operator : binary_property< UCHAR_IDS_TRINARY_OPERATOR > {};
+      struct join_control : binary_property< UCHAR_JOIN_CONTROL > {};
+      struct logical_order_exception : binary_property< UCHAR_LOGICAL_ORDER_EXCEPTION > {};
+      struct lowercase : binary_property< UCHAR_LOWERCASE > {};
+      struct math : binary_property< UCHAR_MATH > {};
+      struct nfc_inert : binary_property< UCHAR_NFC_INERT > {};
+      struct nfd_inert : binary_property< UCHAR_NFD_INERT > {};
+      struct nfkc_inert : binary_property< UCHAR_NFKC_INERT > {};
+      struct nfkd_inert : binary_property< UCHAR_NFKD_INERT > {};
+      struct noncharacter_code_point : binary_property< UCHAR_NONCHARACTER_CODE_POINT > {};
+      struct pattern_syntax : binary_property< UCHAR_PATTERN_SYNTAX > {};
+      struct pattern_white_space : binary_property< UCHAR_PATTERN_WHITE_SPACE > {};
+      struct posix_alnum : binary_property< UCHAR_POSIX_ALNUM > {};
+      struct posix_blank : binary_property< UCHAR_POSIX_BLANK > {};
+      struct posix_graph : binary_property< UCHAR_POSIX_GRAPH > {};
+      struct posix_print : binary_property< UCHAR_POSIX_PRINT > {};
+      struct posix_xdigit : binary_property< UCHAR_POSIX_XDIGIT > {};
+      struct quotation_mark : binary_property< UCHAR_QUOTATION_MARK > {};
+      struct radical : binary_property< UCHAR_RADICAL > {};
+      struct s_term : binary_property< UCHAR_S_TERM > {};
+      struct segment_starter : binary_property< UCHAR_SEGMENT_STARTER > {};
+      struct soft_dotted : binary_property< UCHAR_SOFT_DOTTED > {};
+      struct terminal_punctuation : binary_property< UCHAR_TERMINAL_PUNCTUATION > {};
+      struct unified_ideograph : binary_property< UCHAR_UNIFIED_IDEOGRAPH > {};
+      struct uppercase : binary_property< UCHAR_UPPERCASE > {};
+      struct variation_selector : binary_property< UCHAR_VARIATION_SELECTOR > {};
+      struct white_space : binary_property< UCHAR_WHITE_SPACE > {};
+      struct xid_continue : binary_property< UCHAR_XID_CONTINUE > {};
+      struct xid_start : binary_property< UCHAR_XID_START > {};
+
+      template< UCharDirection V > struct bidi_class : property_value< UCHAR_BIDI_CLASS, V > {};
+      template< UBlockCode V > struct block : property_value< UCHAR_BLOCK, V > {};
+      template< UDecompositionType V > struct decomposition_type : property_value< UCHAR_DECOMPOSITION_TYPE, V > {};
+      template< UEastAsianWidth V > struct east_asian_width : property_value< UCHAR_EAST_ASIAN_WIDTH, V > {};
+      template< UCharCategory V > struct general_category : property_value< UCHAR_GENERAL_CATEGORY, V > {};
+      template< UGraphemeClusterBreak V > struct grapheme_cluster_break : property_value< UCHAR_GRAPHEME_CLUSTER_BREAK, V > {};
+      template< UHangulSyllableType V > struct hangul_syllable_type : property_value< UCHAR_HANGUL_SYLLABLE_TYPE, V > {};
+      template< UJoiningGroup V > struct joining_group : property_value< UCHAR_JOINING_GROUP, V > {};
+      template< UJoiningType V > struct joining_type : property_value< UCHAR_JOINING_TYPE, V > {};
+      template< ULineBreak V > struct line_break : property_value< UCHAR_LINE_BREAK, V > {};
+      // UNormalizationCheckResult requires an additional header <unicode/unorm2.h>:
+      // template< UNormalizationCheckResult V > struct nfc_quick_check : property_value< UCHAR_NFC_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfd_quick_check : property_value< UCHAR_NFD_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfkc_quick_check : property_value< UCHAR_NFKC_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfkd_quick_check : property_value< UCHAR_NFKD_QUICK_CHECK, V > {};
+      template< UNumericType V > struct numeric_type : property_value< UCHAR_NUMERIC_TYPE, V > {};
+      template< USentenceBreak V > struct sentence_break : property_value< UCHAR_SENTENCE_BREAK, V > {};
+      template< UWordBreakValues V > struct word_break : property_value< UCHAR_WORD_BREAK, V > {};
+
+      template< std::uint8_t V > struct canonical_combining_class : property_value< UCHAR_CANONICAL_COMBINING_CLASS, V > {};
+      template< std::uint8_t V > struct lead_canonical_combining_class : property_value< UCHAR_LEAD_CANONICAL_COMBINING_CLASS, V > {};
+      template< std::uint8_t V > struct trail_canonical_combining_class : property_value< UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, V > {};
+      // clang-format on
+
+   }  // namespace utf16_le::icu
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/icu/utf32.hpp b/packages/PEGTL/include/tao/pegtl/contrib/icu/utf32.hpp
index 95c1a34b82b80aa92f5888fe4caa606752666046..8c7189edfe6d2d2cdcab4968afb7ddb645565516 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/icu/utf32.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/icu/utf32.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_ICU_UTF32_HPP
@@ -11,202 +11,190 @@
 
 #include "../../internal/peek_utf32.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace utf32_be::icu
    {
-      namespace utf32_be
+      template< UProperty P, bool V = true >
+      struct binary_property
+         : internal::icu::binary_property< internal::peek_utf32_be, P, V >
       {
-         namespace icu
-         {
-            template< UProperty P, bool V = true >
-            struct binary_property
-               : internal::icu::binary_property< internal::peek_utf32_be, P, V >
-            {
-            };
-
-            template< UProperty P, int V >
-            struct property_value
-               : internal::icu::property_value< internal::peek_utf32_be, P, V >
-            {
-            };
-
-            // clang-format off
-            struct alphabetic : binary_property< UCHAR_ALPHABETIC > {};
-            struct ascii_hex_digit : binary_property< UCHAR_ASCII_HEX_DIGIT > {};
-            struct bidi_control : binary_property< UCHAR_BIDI_CONTROL > {};
-            struct bidi_mirrored : binary_property< UCHAR_BIDI_MIRRORED > {};
-            struct case_sensitive : binary_property< UCHAR_CASE_SENSITIVE > {};
-            struct dash : binary_property< UCHAR_DASH > {};
-            struct default_ignorable_code_point : binary_property< UCHAR_DEFAULT_IGNORABLE_CODE_POINT > {};
-            struct deprecated : binary_property< UCHAR_DEPRECATED > {};
-            struct diacritic : binary_property< UCHAR_DIACRITIC > {};
-            struct extender : binary_property< UCHAR_EXTENDER > {};
-            struct full_composition_exclusion : binary_property< UCHAR_FULL_COMPOSITION_EXCLUSION > {};
-            struct grapheme_base : binary_property< UCHAR_GRAPHEME_BASE > {};
-            struct grapheme_extend : binary_property< UCHAR_GRAPHEME_EXTEND > {};
-            struct grapheme_link : binary_property< UCHAR_GRAPHEME_LINK > {};
-            struct hex_digit : binary_property< UCHAR_HEX_DIGIT > {};
-            struct hyphen : binary_property< UCHAR_HYPHEN > {};
-            struct id_continue : binary_property< UCHAR_ID_CONTINUE > {};
-            struct id_start : binary_property< UCHAR_ID_START > {};
-            struct ideographic : binary_property< UCHAR_IDEOGRAPHIC > {};
-            struct ids_binary_operator : binary_property< UCHAR_IDS_BINARY_OPERATOR > {};
-            struct ids_trinary_operator : binary_property< UCHAR_IDS_TRINARY_OPERATOR > {};
-            struct join_control : binary_property< UCHAR_JOIN_CONTROL > {};
-            struct logical_order_exception : binary_property< UCHAR_LOGICAL_ORDER_EXCEPTION > {};
-            struct lowercase : binary_property< UCHAR_LOWERCASE > {};
-            struct math : binary_property< UCHAR_MATH > {};
-            struct nfc_inert : binary_property< UCHAR_NFC_INERT > {};
-            struct nfd_inert : binary_property< UCHAR_NFD_INERT > {};
-            struct nfkc_inert : binary_property< UCHAR_NFKC_INERT > {};
-            struct nfkd_inert : binary_property< UCHAR_NFKD_INERT > {};
-            struct noncharacter_code_point : binary_property< UCHAR_NONCHARACTER_CODE_POINT > {};
-            struct pattern_syntax : binary_property< UCHAR_PATTERN_SYNTAX > {};
-            struct pattern_white_space : binary_property< UCHAR_PATTERN_WHITE_SPACE > {};
-            struct posix_alnum : binary_property< UCHAR_POSIX_ALNUM > {};
-            struct posix_blank : binary_property< UCHAR_POSIX_BLANK > {};
-            struct posix_graph : binary_property< UCHAR_POSIX_GRAPH > {};
-            struct posix_print : binary_property< UCHAR_POSIX_PRINT > {};
-            struct posix_xdigit : binary_property< UCHAR_POSIX_XDIGIT > {};
-            struct quotation_mark : binary_property< UCHAR_QUOTATION_MARK > {};
-            struct radical : binary_property< UCHAR_RADICAL > {};
-            struct s_term : binary_property< UCHAR_S_TERM > {};
-            struct segment_starter : binary_property< UCHAR_SEGMENT_STARTER > {};
-            struct soft_dotted : binary_property< UCHAR_SOFT_DOTTED > {};
-            struct terminal_punctuation : binary_property< UCHAR_TERMINAL_PUNCTUATION > {};
-            struct unified_ideograph : binary_property< UCHAR_UNIFIED_IDEOGRAPH > {};
-            struct uppercase : binary_property< UCHAR_UPPERCASE > {};
-            struct variation_selector : binary_property< UCHAR_VARIATION_SELECTOR > {};
-            struct white_space : binary_property< UCHAR_WHITE_SPACE > {};
-            struct xid_continue : binary_property< UCHAR_XID_CONTINUE > {};
-            struct xid_start : binary_property< UCHAR_XID_START > {};
-
-            template< UCharDirection V > struct bidi_class : property_value< UCHAR_BIDI_CLASS, V > {};
-            template< UBlockCode V > struct block : property_value< UCHAR_BLOCK, V > {};
-            template< UDecompositionType V > struct decomposition_type : property_value< UCHAR_DECOMPOSITION_TYPE, V > {};
-            template< UEastAsianWidth V > struct east_asian_width : property_value< UCHAR_EAST_ASIAN_WIDTH, V > {};
-            template< UCharCategory V > struct general_category : property_value< UCHAR_GENERAL_CATEGORY, V > {};
-            template< UGraphemeClusterBreak V > struct grapheme_cluster_break : property_value< UCHAR_GRAPHEME_CLUSTER_BREAK, V > {};
-            template< UHangulSyllableType V > struct hangul_syllable_type : property_value< UCHAR_HANGUL_SYLLABLE_TYPE, V > {};
-            template< UJoiningGroup V > struct joining_group : property_value< UCHAR_JOINING_GROUP, V > {};
-            template< UJoiningType V > struct joining_type : property_value< UCHAR_JOINING_TYPE, V > {};
-            template< ULineBreak V > struct line_break : property_value< UCHAR_LINE_BREAK, V > {};
-            // UNormalizationCheckResult requires an additional header <unicode/unorm2.h>:
-            // template< UNormalizationCheckResult V > struct nfc_quick_check : property_value< UCHAR_NFC_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfd_quick_check : property_value< UCHAR_NFD_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfkc_quick_check : property_value< UCHAR_NFKC_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfkd_quick_check : property_value< UCHAR_NFKD_QUICK_CHECK, V > {};
-            template< UNumericType V > struct numeric_type : property_value< UCHAR_NUMERIC_TYPE, V > {};
-            template< USentenceBreak V > struct sentence_break : property_value< UCHAR_SENTENCE_BREAK, V > {};
-            template< UWordBreakValues V > struct word_break : property_value< UCHAR_WORD_BREAK, V > {};
-
-            template< std::uint8_t V > struct canonical_combining_class : property_value< UCHAR_CANONICAL_COMBINING_CLASS, V > {};
-            template< std::uint8_t V > struct lead_canonical_combining_class : property_value< UCHAR_LEAD_CANONICAL_COMBINING_CLASS, V > {};
-            template< std::uint8_t V > struct trail_canonical_combining_class : property_value< UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, V > {};
-            // clang-format on
-
-         }  // namespace icu
-
-      }  // namespace utf32_be
-
-      namespace utf32_le
+      };
+
+      template< UProperty P, int V >
+      struct property_value
+         : internal::icu::property_value< internal::peek_utf32_be, P, V >
+      {
+      };
+
+      // clang-format off
+      struct alphabetic : binary_property< UCHAR_ALPHABETIC > {};
+      struct ascii_hex_digit : binary_property< UCHAR_ASCII_HEX_DIGIT > {};
+      struct bidi_control : binary_property< UCHAR_BIDI_CONTROL > {};
+      struct bidi_mirrored : binary_property< UCHAR_BIDI_MIRRORED > {};
+      struct case_sensitive : binary_property< UCHAR_CASE_SENSITIVE > {};
+      struct dash : binary_property< UCHAR_DASH > {};
+      struct default_ignorable_code_point : binary_property< UCHAR_DEFAULT_IGNORABLE_CODE_POINT > {};
+      struct deprecated : binary_property< UCHAR_DEPRECATED > {};
+      struct diacritic : binary_property< UCHAR_DIACRITIC > {};
+      struct extender : binary_property< UCHAR_EXTENDER > {};
+      struct full_composition_exclusion : binary_property< UCHAR_FULL_COMPOSITION_EXCLUSION > {};
+      struct grapheme_base : binary_property< UCHAR_GRAPHEME_BASE > {};
+      struct grapheme_extend : binary_property< UCHAR_GRAPHEME_EXTEND > {};
+      struct grapheme_link : binary_property< UCHAR_GRAPHEME_LINK > {};
+      struct hex_digit : binary_property< UCHAR_HEX_DIGIT > {};
+      struct hyphen : binary_property< UCHAR_HYPHEN > {};
+      struct id_continue : binary_property< UCHAR_ID_CONTINUE > {};
+      struct id_start : binary_property< UCHAR_ID_START > {};
+      struct ideographic : binary_property< UCHAR_IDEOGRAPHIC > {};
+      struct ids_binary_operator : binary_property< UCHAR_IDS_BINARY_OPERATOR > {};
+      struct ids_trinary_operator : binary_property< UCHAR_IDS_TRINARY_OPERATOR > {};
+      struct join_control : binary_property< UCHAR_JOIN_CONTROL > {};
+      struct logical_order_exception : binary_property< UCHAR_LOGICAL_ORDER_EXCEPTION > {};
+      struct lowercase : binary_property< UCHAR_LOWERCASE > {};
+      struct math : binary_property< UCHAR_MATH > {};
+      struct nfc_inert : binary_property< UCHAR_NFC_INERT > {};
+      struct nfd_inert : binary_property< UCHAR_NFD_INERT > {};
+      struct nfkc_inert : binary_property< UCHAR_NFKC_INERT > {};
+      struct nfkd_inert : binary_property< UCHAR_NFKD_INERT > {};
+      struct noncharacter_code_point : binary_property< UCHAR_NONCHARACTER_CODE_POINT > {};
+      struct pattern_syntax : binary_property< UCHAR_PATTERN_SYNTAX > {};
+      struct pattern_white_space : binary_property< UCHAR_PATTERN_WHITE_SPACE > {};
+      struct posix_alnum : binary_property< UCHAR_POSIX_ALNUM > {};
+      struct posix_blank : binary_property< UCHAR_POSIX_BLANK > {};
+      struct posix_graph : binary_property< UCHAR_POSIX_GRAPH > {};
+      struct posix_print : binary_property< UCHAR_POSIX_PRINT > {};
+      struct posix_xdigit : binary_property< UCHAR_POSIX_XDIGIT > {};
+      struct quotation_mark : binary_property< UCHAR_QUOTATION_MARK > {};
+      struct radical : binary_property< UCHAR_RADICAL > {};
+      struct s_term : binary_property< UCHAR_S_TERM > {};
+      struct segment_starter : binary_property< UCHAR_SEGMENT_STARTER > {};
+      struct soft_dotted : binary_property< UCHAR_SOFT_DOTTED > {};
+      struct terminal_punctuation : binary_property< UCHAR_TERMINAL_PUNCTUATION > {};
+      struct unified_ideograph : binary_property< UCHAR_UNIFIED_IDEOGRAPH > {};
+      struct uppercase : binary_property< UCHAR_UPPERCASE > {};
+      struct variation_selector : binary_property< UCHAR_VARIATION_SELECTOR > {};
+      struct white_space : binary_property< UCHAR_WHITE_SPACE > {};
+      struct xid_continue : binary_property< UCHAR_XID_CONTINUE > {};
+      struct xid_start : binary_property< UCHAR_XID_START > {};
+
+      template< UCharDirection V > struct bidi_class : property_value< UCHAR_BIDI_CLASS, V > {};
+      template< UBlockCode V > struct block : property_value< UCHAR_BLOCK, V > {};
+      template< UDecompositionType V > struct decomposition_type : property_value< UCHAR_DECOMPOSITION_TYPE, V > {};
+      template< UEastAsianWidth V > struct east_asian_width : property_value< UCHAR_EAST_ASIAN_WIDTH, V > {};
+      template< UCharCategory V > struct general_category : property_value< UCHAR_GENERAL_CATEGORY, V > {};
+      template< UGraphemeClusterBreak V > struct grapheme_cluster_break : property_value< UCHAR_GRAPHEME_CLUSTER_BREAK, V > {};
+      template< UHangulSyllableType V > struct hangul_syllable_type : property_value< UCHAR_HANGUL_SYLLABLE_TYPE, V > {};
+      template< UJoiningGroup V > struct joining_group : property_value< UCHAR_JOINING_GROUP, V > {};
+      template< UJoiningType V > struct joining_type : property_value< UCHAR_JOINING_TYPE, V > {};
+      template< ULineBreak V > struct line_break : property_value< UCHAR_LINE_BREAK, V > {};
+      // UNormalizationCheckResult requires an additional header <unicode/unorm2.h>:
+      // template< UNormalizationCheckResult V > struct nfc_quick_check : property_value< UCHAR_NFC_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfd_quick_check : property_value< UCHAR_NFD_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfkc_quick_check : property_value< UCHAR_NFKC_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfkd_quick_check : property_value< UCHAR_NFKD_QUICK_CHECK, V > {};
+      template< UNumericType V > struct numeric_type : property_value< UCHAR_NUMERIC_TYPE, V > {};
+      template< USentenceBreak V > struct sentence_break : property_value< UCHAR_SENTENCE_BREAK, V > {};
+      template< UWordBreakValues V > struct word_break : property_value< UCHAR_WORD_BREAK, V > {};
+
+      template< std::uint8_t V > struct canonical_combining_class : property_value< UCHAR_CANONICAL_COMBINING_CLASS, V > {};
+      template< std::uint8_t V > struct lead_canonical_combining_class : property_value< UCHAR_LEAD_CANONICAL_COMBINING_CLASS, V > {};
+      template< std::uint8_t V > struct trail_canonical_combining_class : property_value< UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, V > {};
+      // clang-format on
+
+   }  // namespace utf32_be::icu
+
+   namespace utf32_le::icu
+   {
+      template< UProperty P, bool V = true >
+      struct binary_property
+         : internal::icu::binary_property< internal::peek_utf32_le, P, V >
+      {
+      };
+
+      template< UProperty P, int V >
+      struct property_value
+         : internal::icu::property_value< internal::peek_utf32_le, P, V >
       {
-         namespace icu
-         {
-            template< UProperty P, bool V = true >
-            struct binary_property
-               : internal::icu::binary_property< internal::peek_utf32_le, P, V >
-            {
-            };
-
-            template< UProperty P, int V >
-            struct property_value
-               : internal::icu::property_value< internal::peek_utf32_le, P, V >
-            {
-            };
-
-            // clang-format off
-            struct alphabetic : binary_property< UCHAR_ALPHABETIC > {};
-            struct ascii_hex_digit : binary_property< UCHAR_ASCII_HEX_DIGIT > {};
-            struct bidi_control : binary_property< UCHAR_BIDI_CONTROL > {};
-            struct bidi_mirrored : binary_property< UCHAR_BIDI_MIRRORED > {};
-            struct case_sensitive : binary_property< UCHAR_CASE_SENSITIVE > {};
-            struct dash : binary_property< UCHAR_DASH > {};
-            struct default_ignorable_code_point : binary_property< UCHAR_DEFAULT_IGNORABLE_CODE_POINT > {};
-            struct deprecated : binary_property< UCHAR_DEPRECATED > {};
-            struct diacritic : binary_property< UCHAR_DIACRITIC > {};
-            struct extender : binary_property< UCHAR_EXTENDER > {};
-            struct full_composition_exclusion : binary_property< UCHAR_FULL_COMPOSITION_EXCLUSION > {};
-            struct grapheme_base : binary_property< UCHAR_GRAPHEME_BASE > {};
-            struct grapheme_extend : binary_property< UCHAR_GRAPHEME_EXTEND > {};
-            struct grapheme_link : binary_property< UCHAR_GRAPHEME_LINK > {};
-            struct hex_digit : binary_property< UCHAR_HEX_DIGIT > {};
-            struct hyphen : binary_property< UCHAR_HYPHEN > {};
-            struct id_continue : binary_property< UCHAR_ID_CONTINUE > {};
-            struct id_start : binary_property< UCHAR_ID_START > {};
-            struct ideographic : binary_property< UCHAR_IDEOGRAPHIC > {};
-            struct ids_binary_operator : binary_property< UCHAR_IDS_BINARY_OPERATOR > {};
-            struct ids_trinary_operator : binary_property< UCHAR_IDS_TRINARY_OPERATOR > {};
-            struct join_control : binary_property< UCHAR_JOIN_CONTROL > {};
-            struct logical_order_exception : binary_property< UCHAR_LOGICAL_ORDER_EXCEPTION > {};
-            struct lowercase : binary_property< UCHAR_LOWERCASE > {};
-            struct math : binary_property< UCHAR_MATH > {};
-            struct nfc_inert : binary_property< UCHAR_NFC_INERT > {};
-            struct nfd_inert : binary_property< UCHAR_NFD_INERT > {};
-            struct nfkc_inert : binary_property< UCHAR_NFKC_INERT > {};
-            struct nfkd_inert : binary_property< UCHAR_NFKD_INERT > {};
-            struct noncharacter_code_point : binary_property< UCHAR_NONCHARACTER_CODE_POINT > {};
-            struct pattern_syntax : binary_property< UCHAR_PATTERN_SYNTAX > {};
-            struct pattern_white_space : binary_property< UCHAR_PATTERN_WHITE_SPACE > {};
-            struct posix_alnum : binary_property< UCHAR_POSIX_ALNUM > {};
-            struct posix_blank : binary_property< UCHAR_POSIX_BLANK > {};
-            struct posix_graph : binary_property< UCHAR_POSIX_GRAPH > {};
-            struct posix_print : binary_property< UCHAR_POSIX_PRINT > {};
-            struct posix_xdigit : binary_property< UCHAR_POSIX_XDIGIT > {};
-            struct quotation_mark : binary_property< UCHAR_QUOTATION_MARK > {};
-            struct radical : binary_property< UCHAR_RADICAL > {};
-            struct s_term : binary_property< UCHAR_S_TERM > {};
-            struct segment_starter : binary_property< UCHAR_SEGMENT_STARTER > {};
-            struct soft_dotted : binary_property< UCHAR_SOFT_DOTTED > {};
-            struct terminal_punctuation : binary_property< UCHAR_TERMINAL_PUNCTUATION > {};
-            struct unified_ideograph : binary_property< UCHAR_UNIFIED_IDEOGRAPH > {};
-            struct uppercase : binary_property< UCHAR_UPPERCASE > {};
-            struct variation_selector : binary_property< UCHAR_VARIATION_SELECTOR > {};
-            struct white_space : binary_property< UCHAR_WHITE_SPACE > {};
-            struct xid_continue : binary_property< UCHAR_XID_CONTINUE > {};
-            struct xid_start : binary_property< UCHAR_XID_START > {};
-
-            template< UCharDirection V > struct bidi_class : property_value< UCHAR_BIDI_CLASS, V > {};
-            template< UBlockCode V > struct block : property_value< UCHAR_BLOCK, V > {};
-            template< UDecompositionType V > struct decomposition_type : property_value< UCHAR_DECOMPOSITION_TYPE, V > {};
-            template< UEastAsianWidth V > struct east_asian_width : property_value< UCHAR_EAST_ASIAN_WIDTH, V > {};
-            template< UCharCategory V > struct general_category : property_value< UCHAR_GENERAL_CATEGORY, V > {};
-            template< UGraphemeClusterBreak V > struct grapheme_cluster_break : property_value< UCHAR_GRAPHEME_CLUSTER_BREAK, V > {};
-            template< UHangulSyllableType V > struct hangul_syllable_type : property_value< UCHAR_HANGUL_SYLLABLE_TYPE, V > {};
-            template< UJoiningGroup V > struct joining_group : property_value< UCHAR_JOINING_GROUP, V > {};
-            template< UJoiningType V > struct joining_type : property_value< UCHAR_JOINING_TYPE, V > {};
-            template< ULineBreak V > struct line_break : property_value< UCHAR_LINE_BREAK, V > {};
-            // UNormalizationCheckResult requires an additional header <unicode/unorm2.h>:
-            // template< UNormalizationCheckResult V > struct nfc_quick_check : property_value< UCHAR_NFC_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfd_quick_check : property_value< UCHAR_NFD_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfkc_quick_check : property_value< UCHAR_NFKC_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfkd_quick_check : property_value< UCHAR_NFKD_QUICK_CHECK, V > {};
-            template< UNumericType V > struct numeric_type : property_value< UCHAR_NUMERIC_TYPE, V > {};
-            template< USentenceBreak V > struct sentence_break : property_value< UCHAR_SENTENCE_BREAK, V > {};
-            template< UWordBreakValues V > struct word_break : property_value< UCHAR_WORD_BREAK, V > {};
-
-            template< std::uint8_t V > struct canonical_combining_class : property_value< UCHAR_CANONICAL_COMBINING_CLASS, V > {};
-            template< std::uint8_t V > struct lead_canonical_combining_class : property_value< UCHAR_LEAD_CANONICAL_COMBINING_CLASS, V > {};
-            template< std::uint8_t V > struct trail_canonical_combining_class : property_value< UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, V > {};
-            // clang-format on
-
-         }  // namespace icu
-
-      }  // namespace utf32_le
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      };
+
+      // clang-format off
+      struct alphabetic : binary_property< UCHAR_ALPHABETIC > {};
+      struct ascii_hex_digit : binary_property< UCHAR_ASCII_HEX_DIGIT > {};
+      struct bidi_control : binary_property< UCHAR_BIDI_CONTROL > {};
+      struct bidi_mirrored : binary_property< UCHAR_BIDI_MIRRORED > {};
+      struct case_sensitive : binary_property< UCHAR_CASE_SENSITIVE > {};
+      struct dash : binary_property< UCHAR_DASH > {};
+      struct default_ignorable_code_point : binary_property< UCHAR_DEFAULT_IGNORABLE_CODE_POINT > {};
+      struct deprecated : binary_property< UCHAR_DEPRECATED > {};
+      struct diacritic : binary_property< UCHAR_DIACRITIC > {};
+      struct extender : binary_property< UCHAR_EXTENDER > {};
+      struct full_composition_exclusion : binary_property< UCHAR_FULL_COMPOSITION_EXCLUSION > {};
+      struct grapheme_base : binary_property< UCHAR_GRAPHEME_BASE > {};
+      struct grapheme_extend : binary_property< UCHAR_GRAPHEME_EXTEND > {};
+      struct grapheme_link : binary_property< UCHAR_GRAPHEME_LINK > {};
+      struct hex_digit : binary_property< UCHAR_HEX_DIGIT > {};
+      struct hyphen : binary_property< UCHAR_HYPHEN > {};
+      struct id_continue : binary_property< UCHAR_ID_CONTINUE > {};
+      struct id_start : binary_property< UCHAR_ID_START > {};
+      struct ideographic : binary_property< UCHAR_IDEOGRAPHIC > {};
+      struct ids_binary_operator : binary_property< UCHAR_IDS_BINARY_OPERATOR > {};
+      struct ids_trinary_operator : binary_property< UCHAR_IDS_TRINARY_OPERATOR > {};
+      struct join_control : binary_property< UCHAR_JOIN_CONTROL > {};
+      struct logical_order_exception : binary_property< UCHAR_LOGICAL_ORDER_EXCEPTION > {};
+      struct lowercase : binary_property< UCHAR_LOWERCASE > {};
+      struct math : binary_property< UCHAR_MATH > {};
+      struct nfc_inert : binary_property< UCHAR_NFC_INERT > {};
+      struct nfd_inert : binary_property< UCHAR_NFD_INERT > {};
+      struct nfkc_inert : binary_property< UCHAR_NFKC_INERT > {};
+      struct nfkd_inert : binary_property< UCHAR_NFKD_INERT > {};
+      struct noncharacter_code_point : binary_property< UCHAR_NONCHARACTER_CODE_POINT > {};
+      struct pattern_syntax : binary_property< UCHAR_PATTERN_SYNTAX > {};
+      struct pattern_white_space : binary_property< UCHAR_PATTERN_WHITE_SPACE > {};
+      struct posix_alnum : binary_property< UCHAR_POSIX_ALNUM > {};
+      struct posix_blank : binary_property< UCHAR_POSIX_BLANK > {};
+      struct posix_graph : binary_property< UCHAR_POSIX_GRAPH > {};
+      struct posix_print : binary_property< UCHAR_POSIX_PRINT > {};
+      struct posix_xdigit : binary_property< UCHAR_POSIX_XDIGIT > {};
+      struct quotation_mark : binary_property< UCHAR_QUOTATION_MARK > {};
+      struct radical : binary_property< UCHAR_RADICAL > {};
+      struct s_term : binary_property< UCHAR_S_TERM > {};
+      struct segment_starter : binary_property< UCHAR_SEGMENT_STARTER > {};
+      struct soft_dotted : binary_property< UCHAR_SOFT_DOTTED > {};
+      struct terminal_punctuation : binary_property< UCHAR_TERMINAL_PUNCTUATION > {};
+      struct unified_ideograph : binary_property< UCHAR_UNIFIED_IDEOGRAPH > {};
+      struct uppercase : binary_property< UCHAR_UPPERCASE > {};
+      struct variation_selector : binary_property< UCHAR_VARIATION_SELECTOR > {};
+      struct white_space : binary_property< UCHAR_WHITE_SPACE > {};
+      struct xid_continue : binary_property< UCHAR_XID_CONTINUE > {};
+      struct xid_start : binary_property< UCHAR_XID_START > {};
+
+      template< UCharDirection V > struct bidi_class : property_value< UCHAR_BIDI_CLASS, V > {};
+      template< UBlockCode V > struct block : property_value< UCHAR_BLOCK, V > {};
+      template< UDecompositionType V > struct decomposition_type : property_value< UCHAR_DECOMPOSITION_TYPE, V > {};
+      template< UEastAsianWidth V > struct east_asian_width : property_value< UCHAR_EAST_ASIAN_WIDTH, V > {};
+      template< UCharCategory V > struct general_category : property_value< UCHAR_GENERAL_CATEGORY, V > {};
+      template< UGraphemeClusterBreak V > struct grapheme_cluster_break : property_value< UCHAR_GRAPHEME_CLUSTER_BREAK, V > {};
+      template< UHangulSyllableType V > struct hangul_syllable_type : property_value< UCHAR_HANGUL_SYLLABLE_TYPE, V > {};
+      template< UJoiningGroup V > struct joining_group : property_value< UCHAR_JOINING_GROUP, V > {};
+      template< UJoiningType V > struct joining_type : property_value< UCHAR_JOINING_TYPE, V > {};
+      template< ULineBreak V > struct line_break : property_value< UCHAR_LINE_BREAK, V > {};
+      // UNormalizationCheckResult requires an additional header <unicode/unorm2.h>:
+      // template< UNormalizationCheckResult V > struct nfc_quick_check : property_value< UCHAR_NFC_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfd_quick_check : property_value< UCHAR_NFD_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfkc_quick_check : property_value< UCHAR_NFKC_QUICK_CHECK, V > {};
+      // template< UNormalizationCheckResult V > struct nfkd_quick_check : property_value< UCHAR_NFKD_QUICK_CHECK, V > {};
+      template< UNumericType V > struct numeric_type : property_value< UCHAR_NUMERIC_TYPE, V > {};
+      template< USentenceBreak V > struct sentence_break : property_value< UCHAR_SENTENCE_BREAK, V > {};
+      template< UWordBreakValues V > struct word_break : property_value< UCHAR_WORD_BREAK, V > {};
+
+      template< std::uint8_t V > struct canonical_combining_class : property_value< UCHAR_CANONICAL_COMBINING_CLASS, V > {};
+      template< std::uint8_t V > struct lead_canonical_combining_class : property_value< UCHAR_LEAD_CANONICAL_COMBINING_CLASS, V > {};
+      template< std::uint8_t V > struct trail_canonical_combining_class : property_value< UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, V > {};
+      // clang-format on
+
+   }  // namespace utf32_le::icu
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/icu/utf8.hpp b/packages/PEGTL/include/tao/pegtl/contrib/icu/utf8.hpp
index a2aba563f5d6200601a555a8b959911dc5d791f3..7c7cc5573b2f617a61a6badfae57fa89c07da565 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/icu/utf8.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/icu/utf8.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_ICU_UTF8_HPP
@@ -11,107 +11,95 @@
 
 #include "../../internal/peek_utf8.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::utf8::icu
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< UProperty P, bool V = true >
+   struct binary_property
+      : internal::icu::binary_property< internal::peek_utf8, P, V >
    {
-      namespace utf8
-      {
-         namespace icu
-         {
-            template< UProperty P, bool V = true >
-            struct binary_property
-               : internal::icu::binary_property< internal::peek_utf8, P, V >
-            {
-            };
+   };
 
-            template< UProperty P, int V >
-            struct property_value
-               : internal::icu::property_value< internal::peek_utf8, P, V >
-            {
-            };
-
-            // clang-format off
-            struct alphabetic : binary_property< UCHAR_ALPHABETIC > {};
-            struct ascii_hex_digit : binary_property< UCHAR_ASCII_HEX_DIGIT > {};
-            struct bidi_control : binary_property< UCHAR_BIDI_CONTROL > {};
-            struct bidi_mirrored : binary_property< UCHAR_BIDI_MIRRORED > {};
-            struct case_sensitive : binary_property< UCHAR_CASE_SENSITIVE > {};
-            struct dash : binary_property< UCHAR_DASH > {};
-            struct default_ignorable_code_point : binary_property< UCHAR_DEFAULT_IGNORABLE_CODE_POINT > {};
-            struct deprecated : binary_property< UCHAR_DEPRECATED > {};
-            struct diacritic : binary_property< UCHAR_DIACRITIC > {};
-            struct extender : binary_property< UCHAR_EXTENDER > {};
-            struct full_composition_exclusion : binary_property< UCHAR_FULL_COMPOSITION_EXCLUSION > {};
-            struct grapheme_base : binary_property< UCHAR_GRAPHEME_BASE > {};
-            struct grapheme_extend : binary_property< UCHAR_GRAPHEME_EXTEND > {};
-            struct grapheme_link : binary_property< UCHAR_GRAPHEME_LINK > {};
-            struct hex_digit : binary_property< UCHAR_HEX_DIGIT > {};
-            struct hyphen : binary_property< UCHAR_HYPHEN > {};
-            struct id_continue : binary_property< UCHAR_ID_CONTINUE > {};
-            struct id_start : binary_property< UCHAR_ID_START > {};
-            struct ideographic : binary_property< UCHAR_IDEOGRAPHIC > {};
-            struct ids_binary_operator : binary_property< UCHAR_IDS_BINARY_OPERATOR > {};
-            struct ids_trinary_operator : binary_property< UCHAR_IDS_TRINARY_OPERATOR > {};
-            struct join_control : binary_property< UCHAR_JOIN_CONTROL > {};
-            struct logical_order_exception : binary_property< UCHAR_LOGICAL_ORDER_EXCEPTION > {};
-            struct lowercase : binary_property< UCHAR_LOWERCASE > {};
-            struct math : binary_property< UCHAR_MATH > {};
-            struct nfc_inert : binary_property< UCHAR_NFC_INERT > {};
-            struct nfd_inert : binary_property< UCHAR_NFD_INERT > {};
-            struct nfkc_inert : binary_property< UCHAR_NFKC_INERT > {};
-            struct nfkd_inert : binary_property< UCHAR_NFKD_INERT > {};
-            struct noncharacter_code_point : binary_property< UCHAR_NONCHARACTER_CODE_POINT > {};
-            struct pattern_syntax : binary_property< UCHAR_PATTERN_SYNTAX > {};
-            struct pattern_white_space : binary_property< UCHAR_PATTERN_WHITE_SPACE > {};
-            struct posix_alnum : binary_property< UCHAR_POSIX_ALNUM > {};
-            struct posix_blank : binary_property< UCHAR_POSIX_BLANK > {};
-            struct posix_graph : binary_property< UCHAR_POSIX_GRAPH > {};
-            struct posix_print : binary_property< UCHAR_POSIX_PRINT > {};
-            struct posix_xdigit : binary_property< UCHAR_POSIX_XDIGIT > {};
-            struct quotation_mark : binary_property< UCHAR_QUOTATION_MARK > {};
-            struct radical : binary_property< UCHAR_RADICAL > {};
-            struct s_term : binary_property< UCHAR_S_TERM > {};
-            struct segment_starter : binary_property< UCHAR_SEGMENT_STARTER > {};
-            struct soft_dotted : binary_property< UCHAR_SOFT_DOTTED > {};
-            struct terminal_punctuation : binary_property< UCHAR_TERMINAL_PUNCTUATION > {};
-            struct unified_ideograph : binary_property< UCHAR_UNIFIED_IDEOGRAPH > {};
-            struct uppercase : binary_property< UCHAR_UPPERCASE > {};
-            struct variation_selector : binary_property< UCHAR_VARIATION_SELECTOR > {};
-            struct white_space : binary_property< UCHAR_WHITE_SPACE > {};
-            struct xid_continue : binary_property< UCHAR_XID_CONTINUE > {};
-            struct xid_start : binary_property< UCHAR_XID_START > {};
-
-            template< UCharDirection V > struct bidi_class : property_value< UCHAR_BIDI_CLASS, V > {};
-            template< UBlockCode V > struct block : property_value< UCHAR_BLOCK, V > {};
-            template< UDecompositionType V > struct decomposition_type : property_value< UCHAR_DECOMPOSITION_TYPE, V > {};
-            template< UEastAsianWidth V > struct east_asian_width : property_value< UCHAR_EAST_ASIAN_WIDTH, V > {};
-            template< UCharCategory V > struct general_category : property_value< UCHAR_GENERAL_CATEGORY, V > {};
-            template< UGraphemeClusterBreak V > struct grapheme_cluster_break : property_value< UCHAR_GRAPHEME_CLUSTER_BREAK, V > {};
-            template< UHangulSyllableType V > struct hangul_syllable_type : property_value< UCHAR_HANGUL_SYLLABLE_TYPE, V > {};
-            template< UJoiningGroup V > struct joining_group : property_value< UCHAR_JOINING_GROUP, V > {};
-            template< UJoiningType V > struct joining_type : property_value< UCHAR_JOINING_TYPE, V > {};
-            template< ULineBreak V > struct line_break : property_value< UCHAR_LINE_BREAK, V > {};
-            // UNormalizationCheckResult requires an additional header <unicode/unorm2.h>:
-            // template< UNormalizationCheckResult V > struct nfc_quick_check : property_value< UCHAR_NFC_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfd_quick_check : property_value< UCHAR_NFD_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfkc_quick_check : property_value< UCHAR_NFKC_QUICK_CHECK, V > {};
-            // template< UNormalizationCheckResult V > struct nfkd_quick_check : property_value< UCHAR_NFKD_QUICK_CHECK, V > {};
-            template< UNumericType V > struct numeric_type : property_value< UCHAR_NUMERIC_TYPE, V > {};
-            template< USentenceBreak V > struct sentence_break : property_value< UCHAR_SENTENCE_BREAK, V > {};
-            template< UWordBreakValues V > struct word_break : property_value< UCHAR_WORD_BREAK, V > {};
-
-            template< std::uint8_t V > struct canonical_combining_class : property_value< UCHAR_CANONICAL_COMBINING_CLASS, V > {};
-            template< std::uint8_t V > struct lead_canonical_combining_class : property_value< UCHAR_LEAD_CANONICAL_COMBINING_CLASS, V > {};
-            template< std::uint8_t V > struct trail_canonical_combining_class : property_value< UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, V > {};
-            // clang-format on
+   template< UProperty P, int V >
+   struct property_value
+      : internal::icu::property_value< internal::peek_utf8, P, V >
+   {
+   };
 
-         }  // namespace icu
+   // clang-format off
+   struct alphabetic : binary_property< UCHAR_ALPHABETIC > {};
+   struct ascii_hex_digit : binary_property< UCHAR_ASCII_HEX_DIGIT > {};
+   struct bidi_control : binary_property< UCHAR_BIDI_CONTROL > {};
+   struct bidi_mirrored : binary_property< UCHAR_BIDI_MIRRORED > {};
+   struct case_sensitive : binary_property< UCHAR_CASE_SENSITIVE > {};
+   struct dash : binary_property< UCHAR_DASH > {};
+   struct default_ignorable_code_point : binary_property< UCHAR_DEFAULT_IGNORABLE_CODE_POINT > {};
+   struct deprecated : binary_property< UCHAR_DEPRECATED > {};
+   struct diacritic : binary_property< UCHAR_DIACRITIC > {};
+   struct extender : binary_property< UCHAR_EXTENDER > {};
+   struct full_composition_exclusion : binary_property< UCHAR_FULL_COMPOSITION_EXCLUSION > {};
+   struct grapheme_base : binary_property< UCHAR_GRAPHEME_BASE > {};
+   struct grapheme_extend : binary_property< UCHAR_GRAPHEME_EXTEND > {};
+   struct grapheme_link : binary_property< UCHAR_GRAPHEME_LINK > {};
+   struct hex_digit : binary_property< UCHAR_HEX_DIGIT > {};
+   struct hyphen : binary_property< UCHAR_HYPHEN > {};
+   struct id_continue : binary_property< UCHAR_ID_CONTINUE > {};
+   struct id_start : binary_property< UCHAR_ID_START > {};
+   struct ideographic : binary_property< UCHAR_IDEOGRAPHIC > {};
+   struct ids_binary_operator : binary_property< UCHAR_IDS_BINARY_OPERATOR > {};
+   struct ids_trinary_operator : binary_property< UCHAR_IDS_TRINARY_OPERATOR > {};
+   struct join_control : binary_property< UCHAR_JOIN_CONTROL > {};
+   struct logical_order_exception : binary_property< UCHAR_LOGICAL_ORDER_EXCEPTION > {};
+   struct lowercase : binary_property< UCHAR_LOWERCASE > {};
+   struct math : binary_property< UCHAR_MATH > {};
+   struct nfc_inert : binary_property< UCHAR_NFC_INERT > {};
+   struct nfd_inert : binary_property< UCHAR_NFD_INERT > {};
+   struct nfkc_inert : binary_property< UCHAR_NFKC_INERT > {};
+   struct nfkd_inert : binary_property< UCHAR_NFKD_INERT > {};
+   struct noncharacter_code_point : binary_property< UCHAR_NONCHARACTER_CODE_POINT > {};
+   struct pattern_syntax : binary_property< UCHAR_PATTERN_SYNTAX > {};
+   struct pattern_white_space : binary_property< UCHAR_PATTERN_WHITE_SPACE > {};
+   struct posix_alnum : binary_property< UCHAR_POSIX_ALNUM > {};
+   struct posix_blank : binary_property< UCHAR_POSIX_BLANK > {};
+   struct posix_graph : binary_property< UCHAR_POSIX_GRAPH > {};
+   struct posix_print : binary_property< UCHAR_POSIX_PRINT > {};
+   struct posix_xdigit : binary_property< UCHAR_POSIX_XDIGIT > {};
+   struct quotation_mark : binary_property< UCHAR_QUOTATION_MARK > {};
+   struct radical : binary_property< UCHAR_RADICAL > {};
+   struct s_term : binary_property< UCHAR_S_TERM > {};
+   struct segment_starter : binary_property< UCHAR_SEGMENT_STARTER > {};
+   struct soft_dotted : binary_property< UCHAR_SOFT_DOTTED > {};
+   struct terminal_punctuation : binary_property< UCHAR_TERMINAL_PUNCTUATION > {};
+   struct unified_ideograph : binary_property< UCHAR_UNIFIED_IDEOGRAPH > {};
+   struct uppercase : binary_property< UCHAR_UPPERCASE > {};
+   struct variation_selector : binary_property< UCHAR_VARIATION_SELECTOR > {};
+   struct white_space : binary_property< UCHAR_WHITE_SPACE > {};
+   struct xid_continue : binary_property< UCHAR_XID_CONTINUE > {};
+   struct xid_start : binary_property< UCHAR_XID_START > {};
 
-      }  // namespace utf8
+   template< UCharDirection V > struct bidi_class : property_value< UCHAR_BIDI_CLASS, V > {};
+   template< UBlockCode V > struct block : property_value< UCHAR_BLOCK, V > {};
+   template< UDecompositionType V > struct decomposition_type : property_value< UCHAR_DECOMPOSITION_TYPE, V > {};
+   template< UEastAsianWidth V > struct east_asian_width : property_value< UCHAR_EAST_ASIAN_WIDTH, V > {};
+   template< UCharCategory V > struct general_category : property_value< UCHAR_GENERAL_CATEGORY, V > {};
+   template< UGraphemeClusterBreak V > struct grapheme_cluster_break : property_value< UCHAR_GRAPHEME_CLUSTER_BREAK, V > {};
+   template< UHangulSyllableType V > struct hangul_syllable_type : property_value< UCHAR_HANGUL_SYLLABLE_TYPE, V > {};
+   template< UJoiningGroup V > struct joining_group : property_value< UCHAR_JOINING_GROUP, V > {};
+   template< UJoiningType V > struct joining_type : property_value< UCHAR_JOINING_TYPE, V > {};
+   template< ULineBreak V > struct line_break : property_value< UCHAR_LINE_BREAK, V > {};
+   // UNormalizationCheckResult requires an additional header <unicode/unorm2.h>:
+   // template< UNormalizationCheckResult V > struct nfc_quick_check : property_value< UCHAR_NFC_QUICK_CHECK, V > {};
+   // template< UNormalizationCheckResult V > struct nfd_quick_check : property_value< UCHAR_NFD_QUICK_CHECK, V > {};
+   // template< UNormalizationCheckResult V > struct nfkc_quick_check : property_value< UCHAR_NFKC_QUICK_CHECK, V > {};
+   // template< UNormalizationCheckResult V > struct nfkd_quick_check : property_value< UCHAR_NFKD_QUICK_CHECK, V > {};
+   template< UNumericType V > struct numeric_type : property_value< UCHAR_NUMERIC_TYPE, V > {};
+   template< USentenceBreak V > struct sentence_break : property_value< UCHAR_SENTENCE_BREAK, V > {};
+   template< UWordBreakValues V > struct word_break : property_value< UCHAR_WORD_BREAK, V > {};
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< std::uint8_t V > struct canonical_combining_class : property_value< UCHAR_CANONICAL_COMBINING_CLASS, V > {};
+   template< std::uint8_t V > struct lead_canonical_combining_class : property_value< UCHAR_LEAD_CANONICAL_COMBINING_CLASS, V > {};
+   template< std::uint8_t V > struct trail_canonical_combining_class : property_value< UCHAR_TRAIL_CANONICAL_COMBINING_CLASS, V > {};
+   // clang-format on
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::utf8::icu
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/if_then.hpp b/packages/PEGTL/include/tao/pegtl/contrib/if_then.hpp
index 496ada60ec1565923b41130d2125be56a9303711..63e4e9c96f5fbd5810c7de401cce01083e194823 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/if_then.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/if_then.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_IF_THEN_HPP
@@ -13,49 +13,43 @@
 #include "../internal/skip_control.hpp"
 #include "../internal/trivial.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      namespace internal
+      template< typename Cond, typename Then >
+      struct if_pair
       {
-         template< typename Cond, typename Then >
-         struct if_pair
-         {
-         };
+      };
 
-         template< typename... Pairs >
-         struct if_then;
+      template< typename... Pairs >
+      struct if_then;
 
-         template< typename Cond, typename Then, typename... Pairs >
-         struct if_then< if_pair< Cond, Then >, Pairs... >
-            : if_then_else< Cond, Then, if_then< Pairs... > >
-         {
-            template< typename ElseCond, typename... Thens >
-            using else_if_then = if_then< if_pair< Cond, Then >, Pairs..., if_pair< ElseCond, seq< Thens... > > >;
-
-            template< typename... Thens >
-            using else_then = if_then_else< Cond, Then, if_then< Pairs..., if_pair< trivial< true >, seq< Thens... > > > >;
-         };
+      template< typename Cond, typename Then, typename... Pairs >
+      struct if_then< if_pair< Cond, Then >, Pairs... >
+         : if_then_else< Cond, Then, if_then< Pairs... > >
+      {
+         template< typename ElseCond, typename... Thens >
+         using else_if_then = if_then< if_pair< Cond, Then >, Pairs..., if_pair< ElseCond, seq< Thens... > > >;
 
-         template<>
-         struct if_then<>
-            : trivial< false >
-         {
-         };
+         template< typename... Thens >
+         using else_then = if_then_else< Cond, Then, if_then< Pairs..., if_pair< trivial< true >, seq< Thens... > > > >;
+      };
 
-         template< typename... Pairs >
-         struct skip_control< if_then< Pairs... > > : std::true_type
-         {
-         };
+      template<>
+      struct if_then<>
+         : trivial< false >
+      {
+      };
 
-      }  // namespace internal
+      template< typename... Pairs >
+      inline constexpr bool skip_control< if_then< Pairs... > > = true;
 
-      template< typename Cond, typename... Thens >
-      using if_then = internal::if_then< internal::if_pair< Cond, internal::seq< Thens... > > >;
+   }  // namespace internal
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename Cond, typename... Thens >
+   using if_then = internal::if_then< internal::if_pair< Cond, internal::seq< Thens... > > >;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/integer.hpp b/packages/PEGTL/include/tao/pegtl/contrib/integer.hpp
index d619afd31e28f6236e4c2c378305a683b3cdb25c..77d11421bb033414df96df4506356efeec04de5c 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/integer.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/integer.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_INTEGER_HPP
@@ -11,98 +11,90 @@
 #include "../parse_error.hpp"
 #include "../rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::integer
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      namespace integer
+      template< typename I, I Limit, typename Input >
+      [[nodiscard]] I actual_convert( const Input& in, std::size_t index )
       {
-         namespace internal
-         {
-            template< typename I, I Limit, typename Input >
-            I actual_convert( const Input& in, std::size_t index )
-            {
-               static constexpr I cutoff = Limit / 10;
-               static constexpr I cutlim = Limit % 10;
-
-               I out = in.peek_char( index ) - '0';
-               while( ++index < in.size() ) {
-                  const I c = in.peek_char( index ) - '0';
-                  if( ( out > cutoff ) || ( ( out == cutoff ) && ( c > cutlim ) ) ) {
-                     throw parse_error( "integer out of range", in );
-                  }
-                  out *= 10;
-                  out += c;
-               }
-               return out;
-            }
-
-            template< typename I, typename Input >
-            I convert_positive( const Input& in, std::size_t index )
-            {
-               static constexpr I limit = std::numeric_limits< I >::max();
-               return actual_convert< I, limit >( in, index );
-            }
-
-            template< typename I, typename Input >
-            I convert_negative( const Input& in, std::size_t index )
-            {
-               using U = typename std::make_unsigned< I >::type;
-               static constexpr U limit = static_cast< U >( std::numeric_limits< I >::max() ) + 1;
-               return static_cast< I >( ~actual_convert< U, limit >( in, index ) ) + 1;
+         static constexpr I cutoff = Limit / 10;
+         static constexpr I cutlim = Limit % 10;
+
+         I out = in.peek_char( index ) - '0';
+         while( ++index < in.size() ) {
+            const I c = in.peek_char( index ) - '0';
+            if( ( out > cutoff ) || ( ( out == cutoff ) && ( c > cutlim ) ) ) {
+               throw parse_error( "integer out of range", in );
             }
+            out *= 10;
+            out += c;
+         }
+         return out;
+      }
+
+      template< typename I, typename Input >
+      [[nodiscard]] I convert_positive( const Input& in, std::size_t index )
+      {
+         static constexpr I limit = ( std::numeric_limits< I >::max )();
+         return actual_convert< I, limit >( in, index );
+      }
 
-         }  // namespace internal
+      template< typename I, typename Input >
+      [[nodiscard]] I convert_negative( const Input& in, std::size_t index )
+      {
+         using U = std::make_unsigned_t< I >;
+         static constexpr U limit = static_cast< U >( ( std::numeric_limits< I >::max )() ) + 1;
+         return static_cast< I >( ~actual_convert< U, limit >( in, index ) ) + 1;
+      }
 
-         struct unsigned_rule
-            : plus< digit >
-         {
-         };
+   }  // namespace internal
 
-         struct unsigned_action
-         {
-            // Assumes that 'in' contains a non-empty sequence of ASCII digits.
+   struct unsigned_rule
+      : plus< digit >
+   {
+   };
 
-            template< typename Input, typename State >
-            static void apply( const Input& in, State& st )
-            {
-               using T = typename std::decay< decltype( st.converted ) >::type;
-               static_assert( std::is_integral< T >::value, "need integral type" );
-               static_assert( std::is_unsigned< T >::value, "need unsigned type" );
-               st.converted = internal::convert_positive< T >( in, 0 );
-            }
-         };
-
-         struct signed_rule
-            : seq< opt< one< '+', '-' > >, plus< digit > >
-         {
-         };
-
-         struct signed_action
-         {
-            // Assumes that 'in' contains a non-empty sequence of ASCII digits,
-            // with optional leading sign; with sign, in.size() must be >= 2.
-
-            template< typename Input, typename State >
-            static void apply( const Input& in, State& st )
-            {
-               using T = typename std::decay< decltype( st.converted ) >::type;
-               static_assert( std::is_integral< T >::value, "need integral type" );
-               static_assert( std::is_signed< T >::value, "need signed type" );
-               const auto c = in.peek_char();
-               if( c == '-' ) {
-                  st.converted = internal::convert_negative< T >( in, 1 );
-               }
-               else {
-                  st.converted = internal::convert_positive< T >( in, std::size_t( c == '+' ) );
-               }
-            }
-         };
+   struct unsigned_action
+   {
+      // Assumes that 'in' contains a non-empty sequence of ASCII digits.
 
-      }  // namespace integer
+      template< typename Input, typename State >
+      static void apply( const Input& in, State& st )
+      {
+         using T = std::decay_t< decltype( st.converted ) >;
+         static_assert( std::is_integral_v< T > );
+         static_assert( std::is_unsigned_v< T > );
+         st.converted = internal::convert_positive< T >( in, 0 );
+      }
+   };
+
+   struct signed_rule
+      : seq< opt< one< '+', '-' > >, plus< digit > >
+   {
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   struct signed_action
+   {
+      // Assumes that 'in' contains a non-empty sequence of ASCII digits,
+      // with optional leading sign; with sign, in.size() must be >= 2.
 
-}  // namespace tao
+      template< typename Input, typename State >
+      static void apply( const Input& in, State& st )
+      {
+         using T = std::decay_t< decltype( st.converted ) >;
+         static_assert( std::is_integral_v< T > );
+         static_assert( std::is_signed_v< T > );
+         const auto c = in.peek_char();
+         if( c == '-' ) {
+            st.converted = internal::convert_negative< T >( in, 1 );
+         }
+         else {
+            st.converted = internal::convert_positive< T >( in, std::size_t( c == '+' ) );
+         }
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::integer
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/json.hpp b/packages/PEGTL/include/tao/pegtl/contrib/json.hpp
index 576532c62ad3083704fbd67a316178f9fc6962a0..76564b5ef991f9a8cc788784f58a1e05fec5918e 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/json.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/json.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_JSON_HPP
@@ -11,88 +11,80 @@
 
 #include "abnf.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::json
 {
-   namespace TAO_PEGTL_NAMESPACE
+   // JSON grammar according to RFC 8259
+
+   // clang-format off
+   struct ws : one< ' ', '\t', '\n', '\r' > {};
+
+   template< typename R, typename P = ws >
+   struct padr : internal::seq< R, internal::star< P > > {};
+
+   struct begin_array : padr< one< '[' > > {};
+   struct begin_object : padr< one< '{' > > {};
+   struct end_array : one< ']' > {};
+   struct end_object : one< '}' > {};
+   struct name_separator : pad< one< ':' >, ws > {};
+   struct value_separator : padr< one< ',' > > {};
+
+   struct false_ : string< 'f', 'a', 'l', 's', 'e' > {};
+   struct null : string< 'n', 'u', 'l', 'l' > {};
+   struct true_ : string< 't', 'r', 'u', 'e' > {};
+
+   struct digits : plus< abnf::DIGIT > {};
+   struct exp : seq< one< 'e', 'E' >, opt< one< '-', '+'> >, must< digits > > {};
+   struct frac : if_must< one< '.' >, digits > {};
+   struct int_ : sor< one< '0' >, digits > {};
+   struct number : seq< opt< one< '-' > >, int_, opt< frac >, opt< exp > > {};
+
+   struct xdigit : abnf::HEXDIG {};
+   struct unicode : list< seq< one< 'u' >, rep< 4, must< xdigit > > >, one< '\\' > > {};
+   struct escaped_char : one< '"', '\\', '/', 'b', 'f', 'n', 'r', 't' > {};
+   struct escaped : sor< escaped_char, unicode > {};
+   struct unescaped : utf8::range< 0x20, 0x10FFFF > {};
+   struct char_ : if_then_else< one< '\\' >, must< escaped >, unescaped > {};
+
+   struct string_content : until< at< one< '"' > >, must< char_ > > {};
+   struct string : seq< one< '"' >, must< string_content >, any >
    {
-      namespace json
-      {
-         // JSON grammar according to RFC 8259
-
-         // clang-format off
-         struct ws : one< ' ', '\t', '\n', '\r' > {};
-
-         template< typename R, typename P = ws >
-         struct padr : internal::seq< R, internal::star< P > > {};
-
-         struct begin_array : padr< one< '[' > > {};
-         struct begin_object : padr< one< '{' > > {};
-         struct end_array : one< ']' > {};
-         struct end_object : one< '}' > {};
-         struct name_separator : pad< one< ':' >, ws > {};
-         struct value_separator : padr< one< ',' > > {};
-
-         struct false_ : string< 'f', 'a', 'l', 's', 'e' > {};
-         struct null : string< 'n', 'u', 'l', 'l' > {};
-         struct true_ : string< 't', 'r', 'u', 'e' > {};
-
-         struct digits : plus< abnf::DIGIT > {};
-         struct exp : seq< one< 'e', 'E' >, opt< one< '-', '+'> >, must< digits > > {};
-         struct frac : if_must< one< '.' >, digits > {};
-         struct int_ : sor< one< '0' >, digits > {};
-         struct number : seq< opt< one< '-' > >, int_, opt< frac >, opt< exp > > {};
-
-         struct xdigit : abnf::HEXDIG {};
-         struct unicode : list< seq< one< 'u' >, rep< 4, must< xdigit > > >, one< '\\' > > {};
-         struct escaped_char : one< '"', '\\', '/', 'b', 'f', 'n', 'r', 't' > {};
-         struct escaped : sor< escaped_char, unicode > {};
-         struct unescaped : utf8::range< 0x20, 0x10FFFF > {};
-         struct char_ : if_then_else< one< '\\' >, must< escaped >, unescaped > {};
-
-         struct string_content : until< at< one< '"' > >, must< char_ > > {};
-         struct string : seq< one< '"' >, must< string_content >, any >
-         {
-            using content = string_content;
-         };
-
-         struct key_content : until< at< one< '"' > >, must< char_ > > {};
-         struct key : seq< one< '"' >, must< key_content >, any >
-         {
-            using content = key_content;
-         };
-
-         struct value;
-
-         struct array_element;
-         struct array_content : opt< list_must< array_element, value_separator > > {};
-         struct array : seq< begin_array, array_content, must< end_array > >
-         {
-            using begin = begin_array;
-            using end = end_array;
-            using element = array_element;
-            using content = array_content;
-         };
-
-         struct member : if_must< key, name_separator, value > {};
-         struct object_content : opt< list_must< member, value_separator > > {};
-         struct object : seq< begin_object, object_content, must< end_object > >
-         {
-            using begin = begin_object;
-            using end = end_object;
-            using element = member;
-            using content = object_content;
-         };
-
-         struct value : padr< sor< string, number, object, array, false_, true_, null > > {};
-         struct array_element : seq< value > {};
-
-         struct text : seq< star< ws >, value > {};
-         // clang-format on
-
-      }  // namespace json
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      using content = string_content;
+   };
+
+   struct key_content : until< at< one< '"' > >, must< char_ > > {};
+   struct key : seq< one< '"' >, must< key_content >, any >
+   {
+      using content = key_content;
+   };
+
+   struct value;
+
+   struct array_element;
+   struct array_content : opt< list_must< array_element, value_separator > > {};
+   struct array : seq< begin_array, array_content, must< end_array > >
+   {
+      using begin = begin_array;
+      using end = end_array;
+      using element = array_element;
+      using content = array_content;
+   };
+
+   struct member : if_must< key, name_separator, value > {};
+   struct object_content : opt< list_must< member, value_separator > > {};
+   struct object : seq< begin_object, object_content, must< end_object > >
+   {
+      using begin = begin_object;
+      using end = end_object;
+      using element = member;
+      using content = object_content;
+   };
+
+   struct value : padr< sor< string, number, object, array, false_, true_, null > > {};
+   struct array_element : seq< value > {};
+
+   struct text : seq< star< ws >, value > {};
+   // clang-format on
+
+}  // namespace TAO_PEGTL_NAMESPACE::json
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/parse_tree.hpp b/packages/PEGTL/include/tao/pegtl/contrib/parse_tree.hpp
index 66401e5eadd149fa96dd90fec341d92dcdb205d7..61182d770a8748e438a0f033c647c18eb29cb809 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/parse_tree.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/parse_tree.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_PARSE_TREE_HPP
@@ -6,456 +6,550 @@
 
 #include <cassert>
 #include <memory>
+#include <string>
+#include <string_view>
+#include <tuple>
 #include <type_traits>
-#include <typeinfo>
+#include <typeindex>
 #include <utility>
 #include <vector>
 
 #include "../config.hpp"
+#include "../memory_input.hpp"
 #include "../normal.hpp"
 #include "../nothing.hpp"
 #include "../parse.hpp"
 
 #include "../analysis/counted.hpp"
 #include "../analysis/generic.hpp"
-#include "../internal/conditional.hpp"
 #include "../internal/demangle.hpp"
 #include "../internal/iterator.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::parse_tree
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename T >
+   struct basic_node
    {
-      namespace parse_tree
+      using node_t = T;
+      using children_t = std::vector< std::unique_ptr< node_t > >;
+      children_t children;
+
+      std::type_index id = typeid( void );
+      std::string source;
+
+      TAO_PEGTL_NAMESPACE::internal::iterator m_begin;
+      TAO_PEGTL_NAMESPACE::internal::iterator m_end;
+
+      // each node will be default constructed
+      basic_node() = default;
+
+      // no copy/move is necessary
+      // (nodes are always owned/handled by a std::unique_ptr)
+      basic_node( const basic_node& ) = delete;
+      basic_node( basic_node&& ) = delete;
+
+      ~basic_node() = default;
+
+      // no assignment either
+      basic_node& operator=( const basic_node& ) = delete;
+      basic_node& operator=( basic_node&& ) = delete;
+
+      [[nodiscard]] bool is_root() const noexcept
       {
-         template< typename T >
-         struct basic_node
-         {
-            using node_t = T;
-            using children_t = std::vector< std::unique_ptr< node_t > >;
-            children_t children;
+         return id == typeid( void );
+      }
 
-            const std::type_info* id = nullptr;
-            std::string source;
+      template< typename U >
+      [[nodiscard]] bool is() const noexcept
+      {
+         return id == typeid( U );
+      }
 
-            TAO_PEGTL_NAMESPACE::internal::iterator m_begin;
-            TAO_PEGTL_NAMESPACE::internal::iterator m_end;
+      [[nodiscard]] std::string name() const
+      {
+         assert( !is_root() );
+         return TAO_PEGTL_NAMESPACE::internal::demangle( id.name() );
+      }
 
-            // each node will be default constructed
-            basic_node() = default;
+      [[nodiscard]] position begin() const
+      {
+         return position( m_begin, source );
+      }
 
-            // no copy/move is necessary
-            // (nodes are always owned/handled by a std::unique_ptr)
-            basic_node( const basic_node& ) = delete;
-            basic_node( basic_node&& ) = delete;
+      [[nodiscard]] position end() const
+      {
+         return position( m_end, source );
+      }
 
-            ~basic_node() = default;
+      [[nodiscard]] bool has_content() const noexcept
+      {
+         return m_end.data != nullptr;
+      }
 
-            // no assignment either
-            basic_node& operator=( const basic_node& ) = delete;
-            basic_node& operator=( basic_node&& ) = delete;
+      [[nodiscard]] std::string_view string_view() const noexcept
+      {
+         assert( has_content() );
+         return std::string_view( m_begin.data, m_end.data - m_begin.data );
+      }
 
-            bool is_root() const noexcept
-            {
-               return id == nullptr;
-            }
+      [[nodiscard]] std::string string() const
+      {
+         assert( has_content() );
+         return std::string( m_begin.data, m_end.data );
+      }
 
-            template< typename U >
-            bool is() const noexcept
-            {
-               return id == &typeid( U );
-            }
+      template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
+      [[nodiscard]] memory_input< P, Eol > as_memory_input() const
+      {
+         assert( has_content() );
+         return { m_begin.data, m_end.data, source, m_begin.byte, m_begin.line, m_begin.byte_in_line };
+      }
 
-            std::string name() const
-            {
-               assert( !is_root() );
-               return TAO_PEGTL_NAMESPACE::internal::demangle( id->name() );
-            }
+      template< typename... States >
+      void remove_content( States&&... /*unused*/ ) noexcept
+      {
+         m_end.reset();
+      }
 
-            position begin() const
-            {
-               return position( m_begin, source );
-            }
+      // all non-root nodes are initialized by calling this method
+      template< typename Rule, typename Input, typename... States >
+      void start( const Input& in, States&&... /*unused*/ )
+      {
+         id = typeid( Rule );
+         source = in.source();
+         m_begin = TAO_PEGTL_NAMESPACE::internal::iterator( in.iterator() );
+      }
+
+      // if parsing of the rule succeeded, this method is called
+      template< typename Rule, typename Input, typename... States >
+      void success( const Input& in, States&&... /*unused*/ ) noexcept
+      {
+         m_end = TAO_PEGTL_NAMESPACE::internal::iterator( in.iterator() );
+      }
 
-            position end() const
-            {
-               return position( m_end, source );
-            }
+      // if parsing of the rule failed, this method is called
+      template< typename Rule, typename Input, typename... States >
+      void failure( const Input& /*unused*/, States&&... /*unused*/ ) noexcept
+      {
+      }
+
+      // if parsing succeeded and the (optional) transform call
+      // did not discard the node, it is appended to its parent.
+      // note that "child" is the node whose Rule just succeeded
+      // and "*this" is the parent where the node should be appended.
+      template< typename... States >
+      void emplace_back( std::unique_ptr< node_t >&& child, States&&... /*unused*/ )
+      {
+         assert( child );
+         children.emplace_back( std::move( child ) );
+      }
+   };
 
-            bool has_content() const noexcept
-            {
-               return m_end.data != nullptr;
-            }
+   struct node
+      : basic_node< node >
+   {
+   };
 
-            std::string content() const
-            {
-               assert( has_content() );
-               return std::string( m_begin.data, m_end.data );
-            }
+   namespace internal
+   {
+      template< typename Node >
+      struct state
+      {
+         std::vector< std::unique_ptr< Node > > stack;
 
-            template< typename... States >
-            void remove_content( States&&... /*unused*/ ) noexcept
-            {
-               m_end.reset();
-            }
+         state()
+         {
+            emplace_back();
+         }
 
-            // all non-root nodes are initialized by calling this method
-            template< typename Rule, typename Input, typename... States >
-            void start( const Input& in, States&&... /*unused*/ )
-            {
-               id = &typeid( Rule );
-               source = in.source();
-               m_begin = in.iterator();
-            }
+         void emplace_back()
+         {
+            stack.emplace_back( std::make_unique< Node >() );
+         }
 
-            // if parsing of the rule succeeded, this method is called
-            template< typename Rule, typename Input, typename... States >
-            void success( const Input& in, States&&... /*unused*/ ) noexcept
-            {
-               m_end = in.iterator();
-            }
+         [[nodiscard]] std::unique_ptr< Node >& back() noexcept
+         {
+            assert( !stack.empty() );
+            return stack.back();
+         }
 
-            // if parsing of the rule failed, this method is called
-            template< typename Rule, typename Input, typename... States >
-            void failure( const Input& /*unused*/, States&&... /*unused*/ ) noexcept
-            {
-            }
+         void pop_back() noexcept
+         {
+            assert( !stack.empty() );
+            return stack.pop_back();
+         }
+      };
 
-            // if parsing succeeded and the (optional) transform call
-            // did not discard the node, it is appended to its parent.
-            // note that "child" is the node whose Rule just succeeded
-            // and "*this" is the parent where the node should be appended.
-            template< typename... States >
-            void emplace_back( std::unique_ptr< node_t > child, States&&... /*unused*/ )
-            {
-               assert( child );
-               children.emplace_back( std::move( child ) );
-            }
-         };
+      template< typename Selector, typename... Parameters >
+      void transform( Parameters&&... /*unused*/ ) noexcept
+      {
+      }
+
+      // this one, if applicable, is more specialized than the above
+      template< typename Selector, typename Node, typename... States >
+      auto transform( std::unique_ptr< Node >& n, States&&... st ) noexcept( noexcept( Selector::transform( n, st... ) ) )
+         -> decltype( Selector::transform( n, st... ), void() )
+      {
+         Selector::transform( n, st... );
+      }
 
-         struct node
-            : basic_node< node >
+      template< unsigned Level, typename Analyse, template< typename... > class Selector >
+      struct is_leaf
+         : std::false_type
+      {
+      };
+
+      template< analysis::rule_type Type, template< typename... > class Selector >
+      struct is_leaf< 0, analysis::generic< Type >, Selector >
+         : std::true_type
+      {
+      };
+
+      template< analysis::rule_type Type, unsigned Count, template< typename... > class Selector >
+      struct is_leaf< 0, analysis::counted< Type, Count >, Selector >
+         : std::true_type
+      {
+      };
+
+      template< analysis::rule_type Type, typename... Rules, template< typename... > class Selector >
+      struct is_leaf< 0, analysis::generic< Type, Rules... >, Selector >
+         : std::false_type
+      {
+      };
+
+      template< analysis::rule_type Type, unsigned Count, typename... Rules, template< typename... > class Selector >
+      struct is_leaf< 0, analysis::counted< Type, Count, Rules... >, Selector >
+         : std::false_type
+      {
+      };
+
+      template< unsigned Level, typename Rule, template< typename... > class Selector >
+      inline constexpr bool is_unselected_leaf = !Selector< Rule >::value && is_leaf< Level, typename Rule::analyze_t, Selector >::value;
+
+      template< unsigned Level, analysis::rule_type Type, typename... Rules, template< typename... > class Selector >
+      struct is_leaf< Level, analysis::generic< Type, Rules... >, Selector >
+         : std::bool_constant< ( is_unselected_leaf< Level - 1, Rules, Selector > && ... ) >
+      {
+      };
+
+      template< unsigned Level, analysis::rule_type Type, unsigned Count, typename... Rules, template< typename... > class Selector >
+      struct is_leaf< Level, analysis::counted< Type, Count, Rules... >, Selector >
+         : std::bool_constant< ( is_unselected_leaf< Level - 1, Rules, Selector > && ... ) >
+      {
+      };
+
+      template< typename T >
+      struct control
+      {
+         template< typename Input, typename Tuple, std::size_t... Is >
+         static void start_impl( const Input& in, const Tuple& t, std::index_sequence< Is... > /*unused*/ ) noexcept( noexcept( T::start( in, std::get< sizeof...( Is ) >( t ), std::get< Is >( t )... ) ) )
          {
-         };
+            T::start( in, std::get< sizeof...( Is ) >( t ), std::get< Is >( t )... );
+         }
 
-         namespace internal
+         template< typename Input, typename... States >
+         static void start( const Input& in, States&&... st ) noexcept( noexcept( start_impl( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() ) ) )
          {
-            template< typename Node >
-            struct state
-            {
-               std::vector< std::unique_ptr< Node > > stack;
-
-               state()
-               {
-                  emplace_back();
-               }
-
-               void emplace_back()
-               {
-                  stack.emplace_back( std::unique_ptr< Node >( new Node ) );  // NOLINT: std::make_unique requires C++14
-               }
-
-               std::unique_ptr< Node >& back() noexcept
-               {
-                  return stack.back();
-               }
-
-               void pop_back() noexcept
-               {
-                  return stack.pop_back();
-               }
-            };
-
-            template< typename Node, typename Selector, typename = void >
-            struct transform
-            {
-               template< typename... States >
-               static void call( std::unique_ptr< Node >& /*unused*/, States&&... /*unused*/ ) noexcept
-               {
-               }
-            };
-
-            template< typename Node, typename Selector >
-            struct transform< Node, Selector, decltype( Selector::transform( std::declval< std::unique_ptr< Node >& >() ), void() ) >
-            {
-               template< typename... States >
-               static void call( std::unique_ptr< Node >& n, States&&... st ) noexcept( noexcept( Selector::transform( n, st... ) ) )
-               {
-                  Selector::transform( n, st... );
-               }
-            };
-
-            template< unsigned Level, typename Analyse, template< typename... > class Selector >
-            struct is_leaf
-               : std::false_type
-            {
-            };
-
-            template< analysis::rule_type Type, template< typename... > class Selector >
-            struct is_leaf< 0, analysis::generic< Type >, Selector >
-               : std::true_type
-            {
-            };
-
-            template< analysis::rule_type Type, unsigned Count, template< typename... > class Selector >
-            struct is_leaf< 0, analysis::counted< Type, Count >, Selector >
-               : std::true_type
-            {
-            };
-
-            template< analysis::rule_type Type, typename... Rules, template< typename... > class Selector >
-            struct is_leaf< 0, analysis::generic< Type, Rules... >, Selector >
-               : std::false_type
-            {
-            };
-
-            template< analysis::rule_type Type, unsigned Count, typename... Rules, template< typename... > class Selector >
-            struct is_leaf< 0, analysis::counted< Type, Count, Rules... >, Selector >
-               : std::false_type
-            {
-            };
-
-            template< bool... >
-            struct bool_sequence;
-
-            template< bool... Bs >
-            using is_all = std::is_same< bool_sequence< Bs..., true >, bool_sequence< true, Bs... > >;
-
-            template< unsigned Level, typename Rule, template< typename... > class Selector >
-            using is_unselected_leaf = std::integral_constant< bool, !Selector< Rule >::value && is_leaf< Level, typename Rule::analyze_t, Selector >::value >;
-
-            template< unsigned Level, analysis::rule_type Type, typename... Rules, template< typename... > class Selector >
-            struct is_leaf< Level, analysis::generic< Type, Rules... >, Selector >
-               : is_all< is_unselected_leaf< Level - 1, Rules, Selector >::value... >
-            {
-            };
-
-            template< unsigned Level, analysis::rule_type Type, unsigned Count, typename... Rules, template< typename... > class Selector >
-            struct is_leaf< Level, analysis::counted< Type, Count, Rules... >, Selector >
-               : is_all< is_unselected_leaf< Level - 1, Rules, Selector >::value... >
-            {
-            };
-
-            template< typename Node, template< typename... > class Selector, template< typename... > class Control >
-            struct make_control
-            {
-               template< typename Rule, bool, bool >
-               struct control;
-
-               template< typename Rule >
-               using type = control< Rule, Selector< Rule >::value, is_leaf< 8, typename Rule::analyze_t, Selector >::value >;
-            };
-
-            template< typename Node, template< typename... > class Selector, template< typename... > class Control >
-            template< typename Rule >
-            struct make_control< Node, Selector, Control >::control< Rule, false, true >
-               : Control< Rule >
-            {
-            };
-
-            template< typename Node, template< typename... > class Selector, template< typename... > class Control >
-            template< typename Rule >
-            struct make_control< Node, Selector, Control >::control< Rule, false, false >
-               : Control< Rule >
-            {
-               template< typename Input, typename... States >
-               static void start( const Input& in, States&&... st )
-               {
-                  Control< Rule >::start( in, st... );
-                  auto& state = *static_cast< internal::state< Node >* >( in.internal_state );
-                  state.emplace_back();
-               }
-
-               template< typename Input, typename... States >
-               static void success( const Input& in, States&&... st )
-               {
-                  Control< Rule >::success( in, st... );
-                  auto& state = *static_cast< internal::state< Node >* >( in.internal_state );
-                  auto n = std::move( state.back() );
-                  state.pop_back();
-                  for( auto& c : n->children ) {
-                     state.back()->children.emplace_back( std::move( c ) );
-                  }
-               }
-
-               template< typename Input, typename... States >
-               static void failure( const Input& in, States&&... st ) noexcept( noexcept( Control< Rule >::failure( in, st... ) ) )
-               {
-                  Control< Rule >::failure( in, st... );
-                  auto& state = *static_cast< internal::state< Node >* >( in.internal_state );
-                  state.pop_back();
-               }
-            };
-
-            template< typename Node, template< typename... > class Selector, template< typename... > class Control >
-            template< typename Rule, bool B >
-            struct make_control< Node, Selector, Control >::control< Rule, true, B >
-               : Control< Rule >
-            {
-               template< typename Input, typename... States >
-               static void start( const Input& in, States&&... st )
-               {
-                  Control< Rule >::start( in, st... );
-                  auto& state = *static_cast< internal::state< Node >* >( in.internal_state );
-                  state.emplace_back();
-                  state.back()->template start< Rule >( in, st... );
-               }
-
-               template< typename Input, typename... States >
-               static void success( const Input& in, States&&... st )
-               {
-                  Control< Rule >::success( in, st... );
-                  auto& state = *static_cast< internal::state< Node >* >( in.internal_state );
-                  auto n = std::move( state.back() );
-                  state.pop_back();
-                  n->template success< Rule >( in, st... );
-                  transform< Node, Selector< Rule > >::call( n, st... );
-                  if( n ) {
-                     state.back()->emplace_back( std::move( n ), st... );
-                  }
-               }
-
-               template< typename Input, typename... States >
-               static void failure( const Input& in, States&&... st ) noexcept( noexcept( Control< Rule >::failure( in, st... ) ) && noexcept( std::declval< node& >().template failure< Rule >( in, st... ) ) )
-               {
-                  Control< Rule >::failure( in, st... );
-                  auto& state = *static_cast< internal::state< Node >* >( in.internal_state );
-                  state.back()->template failure< Rule >( in, st... );
-                  state.pop_back();
-               }
-            };
-
-            template< typename >
-            struct element
-            {
-            };
-
-            template< typename >
-            struct store_all : std::true_type
-            {
-            };
-
-         }  // namespace internal
-
-         struct store_content : std::true_type
+            start_impl( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() );
+         }
+
+         template< typename Input, typename Tuple, std::size_t... Is >
+         static void success_impl( const Input& in, const Tuple& t, std::index_sequence< Is... > /*unused*/ ) noexcept( noexcept( T::success( in, std::get< sizeof...( Is ) >( t ), std::get< Is >( t )... ) ) )
          {
-            template< typename Node, typename... States >
-            static void transform( std::unique_ptr< Node >& /*unused*/, States&&... /*unused*/ ) noexcept
-            {
-            }
-         };
+            T::success( in, std::get< sizeof...( Is ) >( t ), std::get< Is >( t )... );
+         }
 
-         // some nodes don't need to store their content
-         struct remove_content : std::true_type
+         template< typename Input, typename... States >
+         static void success( const Input& in, States&&... st ) noexcept( noexcept( success_impl( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() ) ) )
          {
-            template< typename Node, typename... States >
-            static void transform( std::unique_ptr< Node >& n, States&&... st ) noexcept( noexcept( n->Node::remove_content( st... ) ) )
-            {
-               n->remove_content( st... );
-            }
-         };
+            success_impl( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() );
+         }
 
-         // if a node has only one child, replace the node with its child, otherwise apply B
-         template< typename Base >
-         struct fold_one_or : Base
+         template< typename Input, typename Tuple, std::size_t... Is >
+         static void failure_impl( const Input& in, const Tuple& t, std::index_sequence< Is... > /*unused*/ ) noexcept( noexcept( T::failure( in, std::get< sizeof...( Is ) >( t ), std::get< Is >( t )... ) ) )
          {
-            template< typename Node, typename... States >
-            static void transform( std::unique_ptr< Node >& n, States&&... st ) noexcept( noexcept( n->children.size(), Base::transform( n, st... ) ) )
-            {
-               if( n->children.size() == 1 ) {
-                  n = std::move( n->children.front() );
-               }
-               else {
-                  Base::transform( n, st... );
-               }
-            }
-         };
+            T::failure( in, std::get< sizeof...( Is ) >( t ), std::get< Is >( t )... );
+         }
 
-         // if a node has no children, discard the node, otherwise apply B
-         template< typename Base >
-         struct discard_empty_or : Base
+         template< typename Input, typename... States >
+         static void failure( const Input& in, States&&... st ) noexcept( noexcept( failure_impl( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() ) ) )
          {
-            template< typename Node, typename... States >
-            static void transform( std::unique_ptr< Node >& n, States&&... st ) noexcept( noexcept( n->children.empty(), Base::transform( n, st... ) ) )
-            {
-               if( n->children.empty() ) {
-                  n.reset();
-               }
-               else {
-                  Base::transform( n, st... );
-               }
-            }
-         };
+            failure_impl( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() );
+         }
 
-         using fold_one = fold_one_or< remove_content >;
-         using discard_empty = discard_empty_or< remove_content >;
+         template< typename Input, typename Tuple, std::size_t... Is >
+         static void raise_impl( const Input& in, const Tuple& t, std::index_sequence< Is... > /*unused*/ ) noexcept( noexcept( T::raise( in, std::get< Is >( t )... ) ) )
+         {
+            T::raise( in, std::get< Is >( t )... );
+         }
+
+         template< typename Input, typename... States >
+         static void raise( const Input& in, States&&... st ) noexcept( noexcept( raise_impl( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() ) ) )
+         {
+            raise_impl( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() );
+         }
 
-         template< typename Rule, typename... Collections >
-         struct selector : std::false_type
+         template< template< typename... > class Action, typename Iterator, typename Input, typename Tuple, std::size_t... Is >
+         static auto apply_impl( const Iterator& begin, const Input& in, const Tuple& t, std::index_sequence< Is... > /*unused*/ ) noexcept( noexcept( T::template apply< Action >( begin, in, std::get< Is >( t )... ) ) )
+            -> decltype( T::template apply< Action >( begin, in, std::get< Is >( t )... ) )
          {
-         };
+            return T::template apply< Action >( begin, in, std::get< Is >( t )... );
+         }
 
-         // TODO: Implement in a non-recursive way
-         // TODO: Check for multiple matches (currently: first match wins)
-         template< typename Rule, typename Collection, typename... Collections >
-         struct selector< Rule, Collection, Collections... >
-            : TAO_PEGTL_NAMESPACE::internal::conditional< Collection::template contains< Rule >::value >::template type< typename Collection::type, selector< Rule, Collections... > >
+         template< template< typename... > class Action, typename Iterator, typename Input, typename... States >
+         static auto apply( const Iterator& begin, const Input& in, States&&... st ) noexcept( noexcept( apply_impl< Action >( begin, in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() ) ) )
+            -> decltype( apply_impl< Action >( begin, in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() ) )
          {
-         };
+            return apply_impl< Action >( begin, in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() );
+         }
+
+         template< template< typename... > class Action, typename Input, typename Tuple, std::size_t... Is >
+         static auto apply0_impl( const Input& in, const Tuple& t, std::index_sequence< Is... > /*unused*/ ) noexcept( noexcept( T::template apply0< Action >( in, std::get< Is >( t )... ) ) )
+            -> decltype( T::template apply0< Action >( in, std::get< Is >( t )... ) )
+         {
+            return T::template apply0< Action >( in, std::get< Is >( t )... );
+         }
 
-         template< typename Base >
-         struct apply
+         template< template< typename... > class Action, typename Input, typename... States >
+         static auto apply0( const Input& in, States&&... st ) noexcept( noexcept( apply0_impl< Action >( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() ) ) )
+            -> decltype( apply0_impl< Action >( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() ) )
          {
-            template< typename... Rules >
-            struct to
-               : internal::element< Rules >...
-            {
-               using type = Base;
-
-               template< typename Rule >
-               using contains = std::is_base_of< internal::element< Rule >, to >;
-            };
-         };
-
-         using apply_store_content = apply< store_content >;
-         using apply_remove_content = apply< remove_content >;
-         using apply_fold_one = apply< fold_one >;
-         using apply_discard_empty = apply< discard_empty >;
-
-         template< typename Rule,
-                   typename Node,
-                   template< typename... > class Selector = internal::store_all,
-                   template< typename... > class Action = nothing,
-                   template< typename... > class Control = normal,
+            return apply0_impl< Action >( in, std::tie( st... ), std::make_index_sequence< sizeof...( st ) - 1 >() );
+         }
+
+         template< apply_mode A,
+                   rewind_mode M,
+                   template< typename... >
+                   class Action,
+                   template< typename... >
+                   class Control,
                    typename Input,
                    typename... States >
-         std::unique_ptr< Node > parse( Input&& in, States&&... st )
+         [[nodiscard]] static bool match( Input& in, States&&... st )
+         {
+            return T::template match< A, M, Action, Control >( in, st... );
+         }
+      };
+
+      template< typename Node, template< typename... > class Selector, template< typename... > class Control >
+      struct make_control
+      {
+         template< typename Rule, bool, bool >
+         struct state_handler;
+
+         template< typename Rule >
+         using type = control< state_handler< Rule, Selector< Rule >::value, is_leaf< 8, typename Rule::analyze_t, Selector >::value > >;
+      };
+
+      template< typename Node, template< typename... > class Selector, template< typename... > class Control >
+      template< typename Rule >
+      struct make_control< Node, Selector, Control >::state_handler< Rule, false, true >
+         : Control< Rule >
+      {
+         template< typename Input, typename... States >
+         static void start( const Input& in, state< Node >& /*unused*/, States&&... st ) noexcept( noexcept( Control< Rule >::start( in, st... ) ) )
          {
-            internal::state< Node > state;
-            assert( in.internal_state == nullptr );
-            in.internal_state = &state;
-            if( !TAO_PEGTL_NAMESPACE::parse< Rule, Action, internal::make_control< Node, Selector, Control >::template type >( in, st... ) ) {
-               return nullptr;
+            Control< Rule >::start( in, st... );
+         }
+
+         template< typename Input, typename... States >
+         static void success( const Input& in, state< Node >& /*unused*/, States&&... st ) noexcept( noexcept( Control< Rule >::success( in, st... ) ) )
+         {
+            Control< Rule >::success( in, st... );
+         }
+
+         template< typename Input, typename... States >
+         static void failure( const Input& in, state< Node >& /*unused*/, States&&... st ) noexcept( noexcept( Control< Rule >::failure( in, st... ) ) )
+         {
+            Control< Rule >::failure( in, st... );
+         }
+      };
+
+      template< typename Node, template< typename... > class Selector, template< typename... > class Control >
+      template< typename Rule >
+      struct make_control< Node, Selector, Control >::state_handler< Rule, false, false >
+         : Control< Rule >
+      {
+         template< typename Input, typename... States >
+         static void start( const Input& in, state< Node >& state, States&&... st )
+         {
+            Control< Rule >::start( in, st... );
+            state.emplace_back();
+         }
+
+         template< typename Input, typename... States >
+         static void success( const Input& in, state< Node >& state, States&&... st )
+         {
+            Control< Rule >::success( in, st... );
+            auto n = std::move( state.back() );
+            state.pop_back();
+            for( auto& c : n->children ) {
+               state.back()->children.emplace_back( std::move( c ) );
             }
-            assert( state.stack.size() == 1 );
-            return std::move( state.back() );
          }
 
-         template< typename Rule,
-                   template< typename... > class Selector = internal::store_all,
-                   template< typename... > class Action = nothing,
-                   template< typename... > class Control = normal,
-                   typename Input,
-                   typename... States >
-         std::unique_ptr< node > parse( Input&& in, States&&... st )
+         template< typename Input, typename... States >
+         static void failure( const Input& in, state< Node >& state, States&&... st ) noexcept( noexcept( Control< Rule >::failure( in, st... ) ) )
          {
-            return parse< Rule, node, Selector, Action, Control >( in, st... );
+            Control< Rule >::failure( in, st... );
+            state.pop_back();
          }
+      };
 
-      }  // namespace parse_tree
+      template< typename Node, template< typename... > class Selector, template< typename... > class Control >
+      template< typename Rule, bool B >
+      struct make_control< Node, Selector, Control >::state_handler< Rule, true, B >
+         : Control< Rule >
+      {
+         template< typename Input, typename... States >
+         static void start( const Input& in, state< Node >& state, States&&... st )
+         {
+            Control< Rule >::start( in, st... );
+            state.emplace_back();
+            state.back()->template start< Rule >( in, st... );
+         }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+         template< typename Input, typename... States >
+         static void success( const Input& in, state< Node >& state, States&&... st )
+         {
+            Control< Rule >::success( in, st... );
+            auto n = std::move( state.back() );
+            state.pop_back();
+            n->template success< Rule >( in, st... );
+            transform< Selector< Rule > >( n, st... );
+            if( n ) {
+               state.back()->emplace_back( std::move( n ), st... );
+            }
+         }
+
+         template< typename Input, typename... States >
+         static void failure( const Input& in, state< Node >& state, States&&... st ) noexcept( noexcept( Control< Rule >::failure( in, st... ) ) && noexcept( std::declval< Node& >().template failure< Rule >( in, st... ) ) )
+         {
+            Control< Rule >::failure( in, st... );
+            state.back()->template failure< Rule >( in, st... );
+            state.pop_back();
+         }
+      };
+
+      template< typename >
+      using store_all = std::true_type;
+
+      template< typename >
+      struct selector;
+
+      template< typename T >
+      struct selector< std::tuple< T > >
+      {
+         using type = typename T::type;
+      };
+
+      template< typename... Ts >
+      struct selector< std::tuple< Ts... > >
+      {
+         static_assert( sizeof...( Ts ) == 0, "multiple matches found" );
+         using type = std::false_type;
+      };
+
+      template< typename T >
+      using selector_t = typename selector< T >::type;
+
+      template< typename Rule, typename Collection >
+      using select_tuple = std::conditional_t< Collection::template contains< Rule >, std::tuple< Collection >, std::tuple<> >;
+
+   }  // namespace internal
+
+   template< typename Rule, typename... Collections >
+   using selector = internal::selector_t< decltype( std::tuple_cat( std::declval< internal::select_tuple< Rule, Collections > >()... ) ) >;
+
+   template< typename Base >
+   struct apply
+      : std::true_type
+   {
+      template< typename... Rules >
+      struct on
+      {
+         using type = Base;
+
+         template< typename Rule >
+         static constexpr bool contains = ( std::is_same_v< Rule, Rules > || ... );
+      };
+   };
+
+   struct store_content
+      : apply< store_content >
+   {};
+
+   // some nodes don't need to store their content
+   struct remove_content
+      : apply< remove_content >
+   {
+      template< typename Node, typename... States >
+      static void transform( std::unique_ptr< Node >& n, States&&... st ) noexcept( noexcept( n->Node::remove_content( st... ) ) )
+      {
+         n->remove_content( st... );
+      }
+   };
+
+   // if a node has only one child, replace the node with its child, otherwise remove content
+   struct fold_one
+      : apply< fold_one >
+   {
+      template< typename Node, typename... States >
+      static void transform( std::unique_ptr< Node >& n, States&&... st ) noexcept( noexcept( n->children.size(), n->Node::remove_content( st... ) ) )
+      {
+         if( n->children.size() == 1 ) {
+            n = std::move( n->children.front() );
+         }
+         else {
+            n->remove_content( st... );
+         }
+      }
+   };
+
+   // if a node has no children, discard the node, otherwise remove content
+   struct discard_empty
+      : apply< discard_empty >
+   {
+      template< typename Node, typename... States >
+      static void transform( std::unique_ptr< Node >& n, States&&... st ) noexcept( noexcept( n->children.empty(), n->Node::remove_content( st... ) ) )
+      {
+         if( n->children.empty() ) {
+            n.reset();
+         }
+         else {
+            n->remove_content( st... );
+         }
+      }
+   };
+
+   template< typename Rule,
+             typename Node,
+             template< typename... > class Selector = internal::store_all,
+             template< typename... > class Action = nothing,
+             template< typename... > class Control = normal,
+             typename Input,
+             typename... States >
+   [[nodiscard]] std::unique_ptr< Node > parse( Input&& in, States&&... st )
+   {
+      internal::state< Node > state;
+      if( !TAO_PEGTL_NAMESPACE::parse< Rule, Action, internal::make_control< Node, Selector, Control >::template type >( in, st..., state ) ) {
+         return nullptr;
+      }
+      assert( state.stack.size() == 1 );
+      return std::move( state.back() );
+   }
+
+   template< typename Rule,
+             template< typename... > class Selector = internal::store_all,
+             template< typename... > class Action = nothing,
+             template< typename... > class Control = normal,
+             typename Input,
+             typename... States >
+   [[nodiscard]] std::unique_ptr< node > parse( Input&& in, States&&... st )
+   {
+      return parse< Rule, node, Selector, Action, Control >( in, st... );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::parse_tree
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/parse_tree_to_dot.hpp b/packages/PEGTL/include/tao/pegtl/contrib/parse_tree_to_dot.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..e9f15892f44925b11921313313f1498bfb8f1b91
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/contrib/parse_tree_to_dot.hpp
@@ -0,0 +1,48 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_CONTRIB_PARSE_TREE_TO_DOT_HPP
+#define TAO_PEGTL_CONTRIB_PARSE_TREE_TO_DOT_HPP
+
+#include <cassert>
+#include <ostream>
+#include <string>
+
+#include "parse_tree.hpp"
+
+namespace TAO_PEGTL_NAMESPACE::parse_tree
+{
+   namespace internal
+   {
+      void print_dot_node( std::ostream& os, const parse_tree::node& n, const std::string& s )
+      {
+         if( n.has_content() ) {
+            os << "  x" << &n << " [ label=\"" << s << "\\n\\\"" << n.string_view() << "\\\"\" ]\n";
+         }
+         else {
+            os << "  x" << &n << " [ label=\"" << s << "\" ]\n";
+         }
+         if( !n.children.empty() ) {
+            os << "  x" << &n << " -> { ";
+            for( auto& up : n.children ) {
+               os << "x" << up.get() << ( ( up == n.children.back() ) ? " }\n" : ", " );
+            }
+            for( auto& up : n.children ) {
+               print_dot_node( os, *up, up->name() );
+            }
+         }
+      }
+
+   }  // namespace internal
+
+   void print_dot( std::ostream& os, const parse_tree::node& n )
+   {
+      assert( n.is_root() );
+      os << "digraph parse_tree\n{\n";
+      internal::print_dot_node( os, n, "ROOT" );
+      os << "}\n";
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE::parse_tree
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/raw_string.hpp b/packages/PEGTL/include/tao/pegtl/contrib/raw_string.hpp
index 9936b81178bcd25a48e0f201baee53211216709d..968ebc791b1ee8579c88c23c86f29f32cab34f9c 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/raw_string.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/raw_string.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_RAW_STRING_HPP
@@ -16,208 +16,210 @@
 #include "../internal/eol.hpp"
 #include "../internal/must.hpp"
 #include "../internal/not_at.hpp"
-#include "../internal/rule_conjunction.hpp"
 #include "../internal/seq.hpp"
 #include "../internal/skip_control.hpp"
 #include "../internal/star.hpp"
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      namespace internal
+      template< char Open, char Marker >
+      struct raw_string_open
       {
-         template< char Open, char Marker >
-         struct raw_string_open
+         using analyze_t = analysis::generic< analysis::rule_type::any >;
+
+         template< apply_mode A,
+                   rewind_mode,
+                   template< typename... >
+                   class Action,
+                   template< typename... >
+                   class Control,
+                   typename Input,
+                   typename... States >
+         [[nodiscard]] static bool match( Input& in, std::size_t& marker_size, States&&... /*unused*/ ) noexcept( noexcept( in.size( 0 ) ) )
          {
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
-
-            template< apply_mode A,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input >
-            static bool match( Input& in, std::size_t& marker_size ) noexcept( noexcept( in.size( 0 ) ) )
-            {
-               if( in.empty() || ( in.peek_char( 0 ) != Open ) ) {
-                  return false;
-               }
-               for( std::size_t i = 1; i < in.size( i + 1 ); ++i ) {
-                  switch( const auto c = in.peek_char( i ) ) {
-                     case Open:
-                        marker_size = i + 1;
-                        in.bump_in_this_line( marker_size );
-                        eol::match( in );
-                        return true;
-                     case Marker:
-                        break;
-                     default:
-                        return false;
-                  }
-               }
+            if( in.empty() || ( in.peek_char( 0 ) != Open ) ) {
                return false;
             }
-         };
-
-         template< char Open, char Marker >
-         struct skip_control< raw_string_open< Open, Marker > > : std::true_type
-         {
-         };
-
-         template< char Marker, char Close >
-         struct at_raw_string_close
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT >;
-
-            template< apply_mode A,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input >
-            static bool match( Input& in, const std::size_t& marker_size ) noexcept( noexcept( in.size( 0 ) ) )
-            {
-               if( in.size( marker_size ) < marker_size ) {
-                  return false;
-               }
-               if( in.peek_char( 0 ) != Close ) {
-                  return false;
-               }
-               if( in.peek_char( marker_size - 1 ) != Close ) {
-                  return false;
-               }
-               for( std::size_t i = 0; i < ( marker_size - 2 ); ++i ) {
-                  if( in.peek_char( i + 1 ) != Marker ) {
+            for( std::size_t i = 1; i < in.size( i + 1 ); ++i ) {
+               switch( const auto c = in.peek_char( i ) ) {
+                  case Open:
+                     marker_size = i + 1;
+                     in.bump_in_this_line( marker_size );
+                     (void)eol::match( in );
+                     return true;
+                  case Marker:
+                     break;
+                  default:
                      return false;
-                  }
                }
-               return true;
             }
-         };
+            return false;
+         }
+      };
 
-         template< char Marker, char Close >
-         struct skip_control< at_raw_string_close< Marker, Close > > : std::true_type
-         {
-         };
+      template< char Open, char Marker >
+      inline constexpr bool skip_control< raw_string_open< Open, Marker > > = true;
 
-         template< typename Cond, typename... Rules >
-         struct raw_string_until;
+      template< char Marker, char Close >
+      struct at_raw_string_close
+      {
+         using analyze_t = analysis::generic< analysis::rule_type::opt >;
 
-         template< typename Cond >
-         struct raw_string_until< Cond >
+         template< apply_mode A,
+                   rewind_mode,
+                   template< typename... >
+                   class Action,
+                   template< typename... >
+                   class Control,
+                   typename Input,
+                   typename... States >
+         [[nodiscard]] static bool match( Input& in, const std::size_t& marker_size, States&&... /*unused*/ ) noexcept( noexcept( in.size( 0 ) ) )
          {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, star< not_at< Cond >, not_at< eof >, bytes< 1 > >, Cond >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, const std::size_t& marker_size, States&&... /*unused*/ )
-            {
-               auto m = in.template mark< M >();
-
-               while( !Control< Cond >::template match< A, rewind_mode::REQUIRED, Action, Control >( in, marker_size ) ) {
-                  if( in.empty() ) {
-                     return false;
-                  }
-                  in.bump();
+            if( in.size( marker_size ) < marker_size ) {
+               return false;
+            }
+            if( in.peek_char( 0 ) != Close ) {
+               return false;
+            }
+            if( in.peek_char( marker_size - 1 ) != Close ) {
+               return false;
+            }
+            for( std::size_t i = 0; i < ( marker_size - 2 ); ++i ) {
+               if( in.peek_char( i + 1 ) != Marker ) {
+                  return false;
                }
-               return m( true );
             }
-         };
+            return true;
+         }
+      };
+
+      template< char Marker, char Close >
+      inline constexpr bool skip_control< at_raw_string_close< Marker, Close > > = true;
+
+      template< typename Cond, typename... Rules >
+      struct raw_string_until;
+
+      template< typename Cond >
+      struct raw_string_until< Cond >
+      {
+         using analyze_t = analysis::generic< analysis::rule_type::seq, star< not_at< Cond >, not_at< eof >, bytes< 1 > >, Cond >;
 
-         template< typename Cond, typename... Rules >
-         struct raw_string_until
+         template< apply_mode A,
+                   rewind_mode M,
+                   template< typename... >
+                   class Action,
+                   template< typename... >
+                   class Control,
+                   typename Input,
+                   typename... States >
+         [[nodiscard]] static bool match( Input& in, const std::size_t& marker_size, States&&... st )
          {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, star< not_at< Cond >, not_at< eof >, Rules... >, Cond >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, const std::size_t& marker_size, States&&... st )
-            {
-               auto m = in.template mark< M >();
-               using m_t = decltype( m );
-
-               while( !Control< Cond >::template match< A, rewind_mode::REQUIRED, Action, Control >( in, marker_size ) ) {
-                  if( in.empty() || ( !rule_conjunction< Rules... >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) ) ) {
-                     return false;
-                  }
+            auto m = in.template mark< M >();
+
+            while( !Control< Cond >::template match< A, rewind_mode::required, Action, Control >( in, marker_size, st... ) ) {
+               if( in.empty() ) {
+                  return false;
                }
-               return m( true );
+               in.bump();
             }
-         };
+            return m( true );
+         }
+      };
 
-         template< typename Cond, typename... Rules >
-         struct skip_control< raw_string_until< Cond, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-      // raw_string matches Lua-style long literals.
-      //
-      // The following description was taken from the Lua documentation
-      // (see http://www.lua.org/docs.html):
-      //
-      // - An "opening long bracket of level n" is defined as an opening square
-      //   bracket followed by n equal signs followed by another opening square
-      //   bracket. So, an opening long bracket of level 0 is written as `[[`,
-      //   an opening long bracket of level 1 is written as `[=[`, and so on.
-      // - A "closing long bracket" is defined similarly; for instance, a closing
-      //   long bracket of level 4 is written as `]====]`.
-      // - A "long literal" starts with an opening long bracket of any level and
-      //   ends at the first closing long bracket of the same level. It can
-      //   contain any text except a closing bracket of the same level.
-      // - Literals in this bracketed form can run for several lines, do not
-      //   interpret any escape sequences, and ignore long brackets of any other
-      //   level.
-      // - For convenience, when the opening long bracket is immediately followed
-      //   by a newline, the newline is not included in the string.
-      //
-      // Note that unlike Lua's long literal, a raw_string is customizable to use
-      // other characters than `[`, `=` and `]` for matching. Also note that Lua
-      // introduced newline-specific replacements in Lua 5.2, which we do not
-      // support on the grammar level.
-
-      template< char Open, char Marker, char Close, typename... Contents >
-      struct raw_string
+      template< typename Cond, typename... Rules >
+      struct raw_string_until
       {
-         // This is used for binding the apply()-method and for error-reporting
-         // when a raw string is not closed properly or has invalid content.
-         struct content
-            : internal::raw_string_until< internal::at_raw_string_close< Marker, Close >, Contents... >
-         {
-         };
-
-         using analyze_t = typename internal::seq< internal::bytes< 1 >, content, internal::bytes< 1 > >::analyze_t;
+         using analyze_t = analysis::generic< analysis::rule_type::seq, star< not_at< Cond >, not_at< eof >, Rules... >, Cond >;
 
          template< apply_mode A,
                    rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control,
+                   template< typename... >
+                   class Action,
+                   template< typename... >
+                   class Control,
                    typename Input,
                    typename... States >
-         static bool match( Input& in, States&&... st )
+         [[nodiscard]] static bool match( Input& in, const std::size_t& marker_size, States&&... st )
          {
-            std::size_t marker_size;
-            if( internal::raw_string_open< Open, Marker >::template match< A, M, Action, Control >( in, marker_size ) ) {
-               internal::must< content >::template match< A, M, Action, Control >( in, marker_size, st... );
-               in.bump_in_this_line( marker_size );
-               return true;
+            auto m = in.template mark< M >();
+            using m_t = decltype( m );
+
+            while( !Control< Cond >::template match< A, rewind_mode::required, Action, Control >( in, marker_size, st... ) ) {
+               if( in.empty() || !( Control< Rules >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) && ... ) ) {
+                  return false;
+               }
             }
-            return false;
+            return m( true );
          }
       };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      template< typename Cond, typename... Rules >
+      inline constexpr bool skip_control< raw_string_until< Cond, Rules... > > = true;
+
+   }  // namespace internal
+
+   // raw_string matches Lua-style long literals.
+   //
+   // The following description was taken from the Lua documentation
+   // (see http://www.lua.org/docs.html):
+   //
+   // - An "opening long bracket of level n" is defined as an opening square
+   //   bracket followed by n equal signs followed by another opening square
+   //   bracket. So, an opening long bracket of level 0 is written as `[[`,
+   //   an opening long bracket of level 1 is written as `[=[`, and so on.
+   // - A "closing long bracket" is defined similarly; for instance, a closing
+   //   long bracket of level 4 is written as `]====]`.
+   // - A "long literal" starts with an opening long bracket of any level and
+   //   ends at the first closing long bracket of the same level. It can
+   //   contain any text except a closing bracket of the same level.
+   // - Literals in this bracketed form can run for several lines, do not
+   //   interpret any escape sequences, and ignore long brackets of any other
+   //   level.
+   // - For convenience, when the opening long bracket is eagerly followed
+   //   by a newline, the newline is not included in the string.
+   //
+   // Note that unlike Lua's long literal, a raw_string is customizable to use
+   // other characters than `[`, `=` and `]` for matching. Also note that Lua
+   // introduced newline-specific replacements in Lua 5.2, which we do not
+   // support on the grammar level.
+
+   template< char Open, char Marker, char Close, typename... Contents >
+   struct raw_string
+   {
+      // This is used for binding the apply()-method and for error-reporting
+      // when a raw string is not closed properly or has invalid content.
+      struct content
+         : internal::raw_string_until< internal::at_raw_string_close< Marker, Close >, Contents... >
+      {
+      };
+
+      using analyze_t = typename internal::seq< internal::bytes< 1 >, content, internal::bytes< 1 > >::analyze_t;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         std::size_t marker_size;
+         if( internal::raw_string_open< Open, Marker >::template match< A, M, Action, Control >( in, marker_size, st... ) ) {
+            // TODO: Do not rely on must<>
+            (void)internal::must< content >::template match< A, M, Action, Control >( in, marker_size, st... );
+            in.bump_in_this_line( marker_size );
+            return true;
+         }
+         return false;
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/rep_one_min_max.hpp b/packages/PEGTL/include/tao/pegtl/contrib/rep_one_min_max.hpp
index 99014d059287372b033630b179f6b2df0d5f9466..3f85f5817616705b9a10629ea11c8ca004810586 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/rep_one_min_max.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/rep_one_min_max.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_REP_ONE_MIN_MAX_HPP
@@ -13,60 +13,50 @@
 #include "../internal/bump_help.hpp"
 #include "../internal/skip_control.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      namespace internal
+      template< unsigned Min, unsigned Max, char C >
+      struct rep_one_min_max
       {
-         template< unsigned Min, unsigned Max, char C >
-         struct rep_one_min_max
-         {
-            using analyze_t = analysis::counted< analysis::rule_type::ANY, Min >;
+         using analyze_t = analysis::counted< analysis::rule_type::any, Min >;
 
-            static_assert( Min <= Max, "invalid rep_one_min_max rule (maximum number of repetitions smaller than minimum)" );
+         static_assert( Min <= Max );
 
-            template< typename Input >
-            static bool match( Input& in )
-            {
-               const auto size = in.size( Max + 1 );
-               if( size < Min ) {
-                  return false;
-               }
-               std::size_t i = 0;
-               while( ( i < size ) && ( in.peek_char( i ) == C ) ) {
-                  ++i;
-               }
-               if( ( Min <= i ) && ( i <= Max ) ) {
-                  bump_help< result_on_found::SUCCESS, Input, char, C >( in, i );
-                  return true;
-               }
+         template< typename Input >
+         [[nodiscard]] static bool match( Input& in )
+         {
+            const auto size = in.size( Max + 1 );
+            if( size < Min ) {
                return false;
             }
-         };
+            std::size_t i = 0;
+            while( ( i < size ) && ( in.peek_char( i ) == C ) ) {
+               ++i;
+            }
+            if( ( Min <= i ) && ( i <= Max ) ) {
+               bump_help< result_on_found::success, Input, char, C >( in, i );
+               return true;
+            }
+            return false;
+         }
+      };
 
-         template< unsigned Min, unsigned Max, char C >
-         struct skip_control< rep_one_min_max< Min, Max, C > > : std::true_type
-         {
-         };
+      template< unsigned Min, unsigned Max, char C >
+      inline constexpr bool skip_control< rep_one_min_max< Min, Max, C > > = true;
 
-      }  // namespace internal
+   }  // namespace internal
 
-      inline namespace ascii
+   inline namespace ascii
+   {
+      template< unsigned Min, unsigned Max, char C >
+      struct rep_one_min_max : internal::rep_one_min_max< Min, Max, C >
       {
-         template< unsigned Min, unsigned Max, char C >
-         struct rep_one_min_max : internal::rep_one_min_max< Min, Max, C >
-         {
-         };
-
-         struct ellipsis : internal::rep_one_min_max< 3, 3, '.' >
-         {
-         };
-
-      }  // namespace ascii
+      };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   }  // namespace ascii
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/rep_string.hpp b/packages/PEGTL/include/tao/pegtl/contrib/rep_string.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..bd699ce8efd28b099d07b2d15373008842b64324
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/contrib/rep_string.hpp
@@ -0,0 +1,44 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_CONTRIB_REP_STRING_HPP
+#define TAO_PEGTL_CONTRIB_REP_STRING_HPP
+
+#include <cstddef>
+
+#include "../config.hpp"
+#include "../internal/string.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   namespace internal
+   {
+      template< std::size_t, typename, char... >
+      struct make_rep_string;
+
+      template< char... Ss, char... Cs >
+      struct make_rep_string< 0, string< Ss... >, Cs... >
+      {
+         using type = string< Ss... >;
+      };
+
+      template< std::size_t N, char... Ss, char... Cs >
+      struct make_rep_string< N, string< Ss... >, Cs... >
+         : make_rep_string< N - 1, string< Ss..., Cs... >, Cs... >
+      {
+      };
+
+   }  // namespace internal
+
+   inline namespace ascii
+   {
+      template< std::size_t N, char... Cs >
+      struct rep_string
+         : internal::make_rep_string< N, internal::string<>, Cs... >::type
+      {};
+
+   }  // namespace ascii
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/to_string.hpp b/packages/PEGTL/include/tao/pegtl/contrib/to_string.hpp
index ff60aa0aa56a8326b6a59f92d76abf4ab77c1fa1..122ad57f3e8b805cbcc9a86a84bd0302b1ca624a 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/to_string.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/to_string.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_TO_STRING_HPP
@@ -8,35 +8,31 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      namespace internal
-      {
-         template< typename >
-         struct to_string;
+      template< typename >
+      struct to_string;
 
-         template< template< char... > class X, char... Cs >
-         struct to_string< X< Cs... > >
+      template< template< char... > class X, char... Cs >
+      struct to_string< X< Cs... > >
+      {
+         [[nodiscard]] static std::string get()
          {
-            static std::string get()
-            {
-               const char s[] = { Cs..., 0 };
-               return std::string( s, sizeof...( Cs ) );
-            }
-         };
+            const char s[] = { Cs..., 0 };  // NOLINT
+            return std::string( s, sizeof...( Cs ) );
+         }
+      };
 
-      }  // namespace internal
+   }  // namespace internal
 
-      template< typename T >
-      std::string to_string()
-      {
-         return internal::to_string< T >::get();
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename T >
+   [[nodiscard]] std::string to_string()
+   {
+      return internal::to_string< T >::get();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/tracer.hpp b/packages/PEGTL/include/tao/pegtl/contrib/tracer.hpp
index 05216f75b4a42cd7a6fb7638e77c5e513bcd2b38..3075b7467e9dff07f653a9e06318c66346e798db 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/tracer.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/tracer.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_TRACER_HPP
@@ -15,101 +15,144 @@
 
 #include "../internal/demangle.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      struct trace_state
+      template< typename Input >
+      void print_current( const Input& in )
       {
-         unsigned rule = 0;
-         unsigned line = 0;
-         std::vector< unsigned > stack;
-      };
+         if( in.empty() ) {
+            std::cerr << "<eof>";
+         }
+         else {
+            const auto c = in.peek_uint8();
+            switch( c ) {
+               case 0:
+                  std::cerr << "<nul> = ";
+                  break;
+               case 9:
+                  std::cerr << "<ht> = ";
+                  break;
+               case 10:
+                  std::cerr << "<lf> = ";
+                  break;
+               case 13:
+                  std::cerr << "<cr> = ";
+                  break;
+               default:
+                  if( isprint( c ) ) {
+                     std::cerr << '\'' << c << "' = ";
+                  }
+            }
+            std::cerr << "(char)" << unsigned( c );
+         }
+      }
 
+   }  // namespace internal
+
+   struct trace_state
+   {
+      unsigned rule = 0;
+      unsigned line = 0;
+      std::vector< unsigned > stack;
+   };
+
+   template< template< typename... > class Base >
+   struct trace
+   {
       template< typename Rule >
-      struct tracer
-         : normal< Rule >
+      struct control
+         : Base< Rule >
       {
          template< typename Input, typename... States >
-         static void start( const Input& in, States&&... /*unused*/ )
+         static void start( const Input& in, States&&... st )
          {
-            std::cerr << in.position() << "  start  " << internal::demangle< Rule >() << std::endl;
+            std::cerr << in.position() << "  start  " << internal::demangle< Rule >() << "; current ";
+            print_current( in );
+            std::cerr << std::endl;
+            Base< Rule >::start( in, st... );
          }
 
-         template< typename Input >
-         static void start( const Input& in, trace_state& ts )
+         template< typename Input, typename... States >
+         static void start( const Input& in, trace_state& ts, States&&... st )
          {
-            std::cerr << std::setw( 6 ) << ++ts.line << " " << std::setw( 6 ) << ++ts.rule << " " << in.position() << "  start  " << internal::demangle< Rule >() << std::endl;
+            std::cerr << std::setw( 6 ) << ++ts.line << " " << std::setw( 6 ) << ++ts.rule << " ";
+            start( in, st... );
             ts.stack.push_back( ts.rule );
          }
 
          template< typename Input, typename... States >
-         static void success( const Input& in, States&&... /*unused*/ )
+         static void success( const Input& in, States&&... st )
          {
-            std::cerr << in.position() << " success " << internal::demangle< Rule >() << std::endl;
+            std::cerr << in.position() << " success " << internal::demangle< Rule >() << "; next ";
+            print_current( in );
+            std::cerr << std::endl;
+            Base< Rule >::success( in, st... );
          }
 
-         template< typename Input >
-         static void success( const Input& in, trace_state& ts )
+         template< typename Input, typename... States >
+         static void success( const Input& in, trace_state& ts, States&&... st )
          {
             assert( !ts.stack.empty() );
-            std::cerr << std::setw( 6 ) << ++ts.line << " " << std::setw( 6 ) << ts.stack.back() << " " << in.position() << " success " << internal::demangle< Rule >() << std::endl;
+            std::cerr << std::setw( 6 ) << ++ts.line << " " << std::setw( 6 ) << ts.stack.back() << " ";
+            success( in, st... );
             ts.stack.pop_back();
          }
 
          template< typename Input, typename... States >
-         static void failure( const Input& in, States&&... /*unused*/ )
+         static void failure( const Input& in, States&&... st )
          {
             std::cerr << in.position() << " failure " << internal::demangle< Rule >() << std::endl;
+            Base< Rule >::failure( in, st... );
          }
 
-         template< typename Input >
-         static void failure( const Input& in, trace_state& ts )
+         template< typename Input, typename... States >
+         static void failure( const Input& in, trace_state& ts, States&&... st )
          {
             assert( !ts.stack.empty() );
-            std::cerr << std::setw( 6 ) << ++ts.line << " " << std::setw( 6 ) << ts.stack.back() << " " << in.position() << " failure " << internal::demangle< Rule >() << std::endl;
+            std::cerr << std::setw( 6 ) << ++ts.line << " " << std::setw( 6 ) << ts.stack.back() << " ";
+            failure( in, st... );
             ts.stack.pop_back();
          }
 
-         template< template< typename... > class Action, typename Input, typename... States >
-         static auto apply0( const Input& /*unused*/, States&&... st )
-            -> decltype( Action< Rule >::apply0( st... ) )
+         template< template< typename... > class Action, typename Iterator, typename Input, typename... States >
+         static auto apply( const Iterator& begin, const Input& in, States&&... st )
+            -> decltype( Base< Rule >::template apply< Action >( begin, in, st... ) )
          {
-            std::cerr << "apply0 " << internal::demangle< Action< Rule > >() << std::endl;
-            return Action< Rule >::apply0( st... );
+            std::cerr << in.position() << "  apply  " << internal::demangle< Rule >() << std::endl;
+            return Base< Rule >::template apply< Action >( begin, in, st... );
          }
 
-         template< template< typename... > class Action, typename Input >
-         static auto apply0( const Input& /*unused*/, trace_state& ts )
-            -> decltype( Action< Rule >::apply0( ts ) )
+         template< template< typename... > class Action, typename Iterator, typename Input, typename... States >
+         static auto apply( const Iterator& begin, const Input& in, trace_state& ts, States&&... st )
+            -> decltype( apply< Action >( begin, in, st... ) )
          {
-            std::cerr << std::setw( 6 ) << ++ts.line << "        " << internal::demangle< Action< Rule > >() << "::apply0()" << std::endl;
-            return Action< Rule >::apply0( ts );
+            std::cerr << std::setw( 6 ) << ++ts.line << "        ";
+            return apply< Action >( begin, in, st... );
          }
 
-         template< template< typename... > class Action, typename Iterator, typename Input, typename... States >
-         static auto apply( const Iterator& begin, const Input& in, States&&... st )
-            -> decltype( Action< Rule >::apply( std::declval< typename Input::action_t >(), st... ) )
+         template< template< typename... > class Action, typename Input, typename... States >
+         static auto apply0( const Input& in, States&&... st )
+            -> decltype( Base< Rule >::template apply0< Action >( in, st... ) )
          {
-            std::cerr << "apply " << internal::demangle< Action< Rule > >() << std::endl;
-            using action_t = typename Input::action_t;
-            const action_t action_input( begin, in );
-            return Action< Rule >::apply( action_input, st... );
+            std::cerr << in.position() << "  apply0 " << internal::demangle< Rule >() << std::endl;
+            return Base< Rule >::template apply0< Action >( in, st... );
          }
 
-         template< template< typename... > class Action, typename Iterator, typename Input >
-         static auto apply( const Iterator& begin, const Input& in, trace_state& ts )
-            -> decltype( Action< Rule >::apply( std::declval< typename Input::action_t >(), ts ) )
+         template< template< typename... > class Action, typename Input, typename... States >
+         static auto apply0( const Input& in, trace_state& ts, States&&... st )
+            -> decltype( apply0< Action >( in, st... ) )
          {
-            std::cerr << std::setw( 6 ) << ++ts.line << "        " << internal::demangle< Action< Rule > >() << "::apply()" << std::endl;
-            using action_t = typename Input::action_t;
-            const action_t action_input( begin, in );
-            return Action< Rule >::apply( action_input, ts );
+            std::cerr << std::setw( 6 ) << ++ts.line << "        ";
+            return apply0< Action >( in, st... );
          }
       };
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule >
+   using tracer = trace< normal >::control< Rule >;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/unescape.hpp b/packages/PEGTL/include/tao/pegtl/contrib/unescape.hpp
index 704ede62ab8f7e7a9b4f368419b4dc1418418745..ca3b57bcfbaf5c9b2c5949ca54fb1121e8a0b964 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/unescape.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/unescape.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_UNESCAPE_HPP
@@ -11,202 +11,189 @@
 #include "../config.hpp"
 #include "../parse_error.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::unescape
 {
-   namespace TAO_PEGTL_NAMESPACE
+   // Utility functions for the unescape actions.
+
+   [[nodiscard]] inline bool utf8_append_utf32( std::string& string, const unsigned utf32 )
    {
-      namespace unescape
-      {
-         struct state
-         {
-            std::string unescaped;
-         };
-
-         // Utility functions for the unescape actions.
-
-         inline bool utf8_append_utf32( std::string& string, const unsigned utf32 )
-         {
-            if( utf32 <= 0x7f ) {
-               string += char( utf32 & 0xff );
-               return true;
-            }
-            if( utf32 <= 0x7ff ) {
-               char tmp[] = { char( ( ( utf32 & 0x7c0 ) >> 6 ) | 0xc0 ),
-                              char( ( ( utf32 & 0x03f ) ) | 0x80 ) };
-               string.append( tmp, sizeof( tmp ) );
-               return true;
-            }
-            if( utf32 <= 0xffff ) {
-               if( utf32 >= 0xd800 && utf32 <= 0xdfff ) {
-                  // nope, this is a UTF-16 surrogate
-                  return false;
-               }
-               char tmp[] = { char( ( ( utf32 & 0xf000 ) >> 12 ) | 0xe0 ),
-                              char( ( ( utf32 & 0x0fc0 ) >> 6 ) | 0x80 ),
-                              char( ( ( utf32 & 0x003f ) ) | 0x80 ) };
-               string.append( tmp, sizeof( tmp ) );
-               return true;
-            }
-            if( utf32 <= 0x10ffff ) {
-               char tmp[] = { char( ( ( utf32 & 0x1c0000 ) >> 18 ) | 0xf0 ),
-                              char( ( ( utf32 & 0x03f000 ) >> 12 ) | 0x80 ),
-                              char( ( ( utf32 & 0x000fc0 ) >> 6 ) | 0x80 ),
-                              char( ( ( utf32 & 0x00003f ) ) | 0x80 ) };
-               string.append( tmp, sizeof( tmp ) );
-               return true;
-            }
+      if( utf32 <= 0x7f ) {
+         string += char( utf32 & 0xff );
+         return true;
+      }
+      if( utf32 <= 0x7ff ) {
+         char tmp[] = { char( ( ( utf32 & 0x7c0 ) >> 6 ) | 0xc0 ),  // NOLINT
+                        char( ( ( utf32 & 0x03f ) ) | 0x80 ) };
+         string.append( tmp, sizeof( tmp ) );
+         return true;
+      }
+      if( utf32 <= 0xffff ) {
+         if( utf32 >= 0xd800 && utf32 <= 0xdfff ) {
+            // nope, this is a UTF-16 surrogate
             return false;
          }
-
-         // This function MUST only be called for characters matching tao::TAO_PEGTL_NAMESPACE::ascii::xdigit!
-         template< typename I >
-         I unhex_char( const char c )
-         {
-            switch( c ) {
-               case '0':
-               case '1':
-               case '2':
-               case '3':
-               case '4':
-               case '5':
-               case '6':
-               case '7':
-               case '8':
-               case '9':
-                  return I( c - '0' );
-               case 'a':
-               case 'b':
-               case 'c':
-               case 'd':
-               case 'e':
-               case 'f':
-                  return I( c - 'a' + 10 );
-               case 'A':
-               case 'B':
-               case 'C':
-               case 'D':
-               case 'E':
-               case 'F':
-                  return I( c - 'A' + 10 );
-            }
+         char tmp[] = { char( ( ( utf32 & 0xf000 ) >> 12 ) | 0xe0 ),  // NOLINT
+                        char( ( ( utf32 & 0x0fc0 ) >> 6 ) | 0x80 ),
+                        char( ( ( utf32 & 0x003f ) ) | 0x80 ) };
+         string.append( tmp, sizeof( tmp ) );
+         return true;
+      }
+      if( utf32 <= 0x10ffff ) {
+         char tmp[] = { char( ( ( utf32 & 0x1c0000 ) >> 18 ) | 0xf0 ),  // NOLINT
+                        char( ( ( utf32 & 0x03f000 ) >> 12 ) | 0x80 ),
+                        char( ( ( utf32 & 0x000fc0 ) >> 6 ) | 0x80 ),
+                        char( ( ( utf32 & 0x00003f ) ) | 0x80 ) };
+         string.append( tmp, sizeof( tmp ) );
+         return true;
+      }
+      return false;
+   }
+
+   // This function MUST only be called for characters matching TAO_PEGTL_NAMESPACE::ascii::xdigit!
+   template< typename I >
+   [[nodiscard]] I unhex_char( const char c )
+   {
+      switch( c ) {
+         case '0':
+         case '1':
+         case '2':
+         case '3':
+         case '4':
+         case '5':
+         case '6':
+         case '7':
+         case '8':
+         case '9':
+            return I( c - '0' );
+         case 'a':
+         case 'b':
+         case 'c':
+         case 'd':
+         case 'e':
+         case 'f':
+            return I( c - 'a' + 10 );
+         case 'A':
+         case 'B':
+         case 'C':
+         case 'D':
+         case 'E':
+         case 'F':
+            return I( c - 'A' + 10 );
+         default:                                                      // LCOV_EXCL_LINE
             throw std::runtime_error( "invalid character in unhex" );  // NOLINT, LCOV_EXCL_LINE
-         }
+      }
+   }
 
-         template< typename I >
-         I unhex_string( const char* begin, const char* end )
-         {
-            I r = 0;
-            while( begin != end ) {
-               r <<= 4;
-               r += unhex_char< I >( *begin++ );
-            }
-            return r;
-         }
+   template< typename I >
+   [[nodiscard]] I unhex_string( const char* begin, const char* end )
+   {
+      I r = 0;
+      while( begin != end ) {
+         r <<= 4;
+         r += unhex_char< I >( *begin++ );
+      }
+      return r;
+   }
 
-         // Actions for common unescape situations.
+   // Actions for common unescape situations.
 
-         struct append_all
-         {
-            template< typename Input, typename State >
-            static void apply( const Input& in, State& st )
-            {
-               st.unescaped.append( in.begin(), in.size() );
-            }
-         };
-
-         // This action MUST be called for a character matching T which MUST be tao::TAO_PEGTL_NAMESPACE::one< ... >.
-         template< typename T, char... Rs >
-         struct unescape_c
-         {
-            template< typename Input, typename State >
-            static void apply( const Input& in, State& st )
-            {
-               assert( in.size() == 1 );
-               st.unescaped += apply_one( in, static_cast< const T* >( nullptr ) );
-            }
+   struct append_all
+   {
+      template< typename Input >
+      static void apply( const Input& in, std::string& s )
+      {
+         s.append( in.begin(), in.size() );
+      }
+   };
 
-            template< typename Input, char... Qs >
-            static char apply_one( const Input& in, const one< Qs... >* /*unused*/ )
-            {
-               static_assert( sizeof...( Qs ) == sizeof...( Rs ), "size mismatch between escaped characters and their mappings" );
-               return apply_two( in, { Qs... }, { Rs... } );
-            }
+   // This action MUST be called for a character matching T which MUST be TAO_PEGTL_NAMESPACE::one< ... >.
+   template< typename T, char... Rs >
+   struct unescape_c
+   {
+      template< typename Input >
+      static void apply( const Input& in, std::string& s )
+      {
+         assert( in.size() == 1 );
+         s += apply_one( in, static_cast< const T* >( nullptr ) );
+      }
 
-            template< typename Input >
-            static char apply_two( const Input& in, const std::initializer_list< char >& q, const std::initializer_list< char >& r )
-            {
-               const char c = *in.begin();
-               for( std::size_t i = 0; i < q.size(); ++i ) {
-                  if( *( q.begin() + i ) == c ) {
-                     return *( r.begin() + i );
-                  }
-               }
-               throw parse_error( "invalid character in unescape", in );  // NOLINT, LCOV_EXCL_LINE
+      template< typename Input, char... Qs >
+      [[nodiscard]] static char apply_one( const Input& in, const one< Qs... >* /*unused*/ )
+      {
+         static_assert( sizeof...( Qs ) == sizeof...( Rs ), "size mismatch between escaped characters and their mappings" );
+         return apply_two( in, { Qs... }, { Rs... } );
+      }
+
+      template< typename Input >
+      [[nodiscard]] static char apply_two( const Input& in, const std::initializer_list< char >& q, const std::initializer_list< char >& r )
+      {
+         const char c = *in.begin();
+         for( std::size_t i = 0; i < q.size(); ++i ) {
+            if( *( q.begin() + i ) == c ) {
+               return *( r.begin() + i );
             }
-         };
-
-         // See src/example/pegtl/unescape.cpp for why the following two actions
-         // skip the first input character. They also MUST be called
-         // with non-empty matched inputs!
-
-         struct unescape_u
-         {
-            template< typename Input, typename State >
-            static void apply( const Input& in, State& st )
-            {
-               assert( !in.empty() );  // First character MUST be present, usually 'u' or 'U'.
-               if( !utf8_append_utf32( st.unescaped, unhex_string< unsigned >( in.begin() + 1, in.end() ) ) ) {
-                  throw parse_error( "invalid escaped unicode code point", in );
+         }
+         throw parse_error( "invalid character in unescape", in );  // NOLINT, LCOV_EXCL_LINE
+      }
+   };
+
+   // See src/example/pegtl/unescape.cpp for why the following two actions
+   // skip the first input character. They also MUST be called
+   // with non-empty matched inputs!
+
+   struct unescape_u
+   {
+      template< typename Input >
+      static void apply( const Input& in, std::string& s )
+      {
+         assert( !in.empty() );  // First character MUST be present, usually 'u' or 'U'.
+         if( !utf8_append_utf32( s, unhex_string< unsigned >( in.begin() + 1, in.end() ) ) ) {
+            throw parse_error( "invalid escaped unicode code point", in );
+         }
+      }
+   };
+
+   struct unescape_x
+   {
+      template< typename Input >
+      static void apply( const Input& in, std::string& s )
+      {
+         assert( !in.empty() );  // First character MUST be present, usually 'x'.
+         s += unhex_string< char >( in.begin() + 1, in.end() );
+      }
+   };
+
+   // The unescape_j action is similar to unescape_u, however unlike
+   // unescape_u it
+   // (a) assumes exactly 4 hexdigits per escape sequence,
+   // (b) accepts multiple consecutive escaped 16-bit values.
+   // When applied to more than one escape sequence, unescape_j
+   // translates UTF-16 surrogate pairs in the input into a single
+   // UTF-8 sequence in s, as required for JSON by RFC 8259.
+
+   struct unescape_j
+   {
+      template< typename Input >
+      static void apply( const Input& in, std::string& s )
+      {
+         assert( ( ( in.size() + 1 ) % 6 ) == 0 );  // Expects multiple "\\u1234", starting with the first "u".
+         for( const char* b = in.begin() + 1; b < in.end(); b += 6 ) {
+            const auto c = unhex_string< unsigned >( b, b + 4 );
+            if( ( 0xd800 <= c ) && ( c <= 0xdbff ) && ( b + 6 < in.end() ) ) {
+               const auto d = unhex_string< unsigned >( b + 6, b + 10 );
+               if( ( 0xdc00 <= d ) && ( d <= 0xdfff ) ) {
+                  b += 6;
+                  (void)utf8_append_utf32( s, ( ( ( c & 0x03ff ) << 10 ) | ( d & 0x03ff ) ) + 0x10000 );
+                  continue;
                }
             }
-         };
-
-         struct unescape_x
-         {
-            template< typename Input, typename State >
-            static void apply( const Input& in, State& st )
-            {
-               assert( !in.empty() );  // First character MUST be present, usually 'x'.
-               st.unescaped += unhex_string< char >( in.begin() + 1, in.end() );
+            if( !utf8_append_utf32( s, c ) ) {
+               throw parse_error( "invalid escaped unicode code point", in );
             }
-         };
-
-         // The unescape_j action is similar to unescape_u, however unlike
-         // unescape_u it
-         // (a) assumes exactly 4 hexdigits per escape sequence,
-         // (b) accepts multiple consecutive escaped 16-bit values.
-         // When applied to more than one escape sequence, unescape_j
-         // translates UTF-16 surrogate pairs in the input into a single
-         // UTF-8 sequence in st.unescaped, as required for JSON by RFC 8259.
-
-         struct unescape_j
-         {
-            template< typename Input, typename State >
-            static void apply( const Input& in, State& st )
-            {
-               assert( ( ( in.size() + 1 ) % 6 ) == 0 );  // Expects multiple "\\u1234", starting with the first "u".
-               for( const char* b = in.begin() + 1; b < in.end(); b += 6 ) {
-                  const auto c = unhex_string< unsigned >( b, b + 4 );
-                  if( ( 0xd800 <= c ) && ( c <= 0xdbff ) && ( b + 6 < in.end() ) ) {
-                     const auto d = unhex_string< unsigned >( b + 6, b + 10 );
-                     if( ( 0xdc00 <= d ) && ( d <= 0xdfff ) ) {
-                        b += 6;
-                        // note: no need to check the result code, as we are always >= 0x10000 and < 0x110000.
-                        utf8_append_utf32( st.unescaped, ( ( ( c & 0x03ff ) << 10 ) | ( d & 0x03ff ) ) + 0x10000 );
-                        continue;
-                     }
-                  }
-                  if( !utf8_append_utf32( st.unescaped, c ) ) {
-                     throw parse_error( "invalid escaped unicode code point", in );
-                  }
-               }
-            }
-         };
-
-      }  // namespace unescape
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+         }
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::unescape
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/contrib/uri.hpp b/packages/PEGTL/include/tao/pegtl/contrib/uri.hpp
index 7f51fad79cf22962c2570299157353e4b79ec2d3..06f5e7cf86e1a36014de94a0549ea0cfa15e72cf 100644
--- a/packages/PEGTL/include/tao/pegtl/contrib/uri.hpp
+++ b/packages/PEGTL/include/tao/pegtl/contrib/uri.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CONTRIB_URI_HPP
@@ -11,105 +11,97 @@
 
 #include "abnf.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::uri
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace uri
-      {
-         // URI grammar according to RFC 3986.
+   // URI grammar according to RFC 3986.
 
-         // This grammar is a direct PEG translation of the original URI grammar.
-         // It should be considered experimental -- in case of any issues, in particular
-         // missing rules for attached actions, please contact the developers.
+   // This grammar is a direct PEG translation of the original URI grammar.
+   // It should be considered experimental -- in case of any issues, in particular
+   // missing rules for attached actions, please contact the developers.
 
-         // Note that this grammar has multiple top-level rules.
+   // Note that this grammar has multiple top-level rules.
 
-         using dot = one< '.' >;
-         using colon = one< ':' >;
+   using dot = one< '.' >;
+   using colon = one< ':' >;
 
-         // clang-format off
-         struct dec_octet : sor< one< '0' >,
-                                 rep_min_max< 1, 2, abnf::DIGIT >,
-                                 seq< one< '1' >, abnf::DIGIT, abnf::DIGIT >,
-                                 seq< one< '2' >, range< '0', '4' >, abnf::DIGIT >,
-                                 seq< string< '2', '5' >, range< '0', '5' > > > {};
+   // clang-format off
+   struct dec_octet : sor< one< '0' >,
+                           rep_min_max< 1, 2, abnf::DIGIT >,
+                           seq< one< '1' >, abnf::DIGIT, abnf::DIGIT >,
+                           seq< one< '2' >, range< '0', '4' >, abnf::DIGIT >,
+                           seq< string< '2', '5' >, range< '0', '5' > > > {};
 
-         struct IPv4address : seq< dec_octet, dot, dec_octet, dot, dec_octet, dot, dec_octet > {};
+   struct IPv4address : seq< dec_octet, dot, dec_octet, dot, dec_octet, dot, dec_octet > {};
 
-         struct h16 : rep_min_max< 1, 4, abnf::HEXDIG > {};
-         struct ls32 : sor< seq< h16, colon, h16 >, IPv4address > {};
+   struct h16 : rep_min_max< 1, 4, abnf::HEXDIG > {};
+   struct ls32 : sor< seq< h16, colon, h16 >, IPv4address > {};
 
-         struct dcolon : two< ':' > {};
+   struct dcolon : two< ':' > {};
 
-         struct IPv6address : sor< seq<                                               rep< 6, h16, colon >, ls32 >,
-                                   seq<                                       dcolon, rep< 5, h16, colon >, ls32 >,
-                                   seq< opt< h16                           >, dcolon, rep< 4, h16, colon >, ls32 >,
-                                   seq< opt< h16,     opt<    colon, h16 > >, dcolon, rep< 3, h16, colon >, ls32 >,
-                                   seq< opt< h16, rep_opt< 2, colon, h16 > >, dcolon, rep< 2, h16, colon >, ls32 >,
-                                   seq< opt< h16, rep_opt< 3, colon, h16 > >, dcolon,         h16, colon,   ls32 >,
-                                   seq< opt< h16, rep_opt< 4, colon, h16 > >, dcolon,                       ls32 >,
-                                   seq< opt< h16, rep_opt< 5, colon, h16 > >, dcolon,                       h16  >,
-                                   seq< opt< h16, rep_opt< 6, colon, h16 > >, dcolon                             > > {};
+   struct IPv6address : sor< seq<                                               rep< 6, h16, colon >, ls32 >,
+                             seq<                                       dcolon, rep< 5, h16, colon >, ls32 >,
+                             seq< opt< h16                           >, dcolon, rep< 4, h16, colon >, ls32 >,
+                             seq< opt< h16,     opt<    colon, h16 > >, dcolon, rep< 3, h16, colon >, ls32 >,
+                             seq< opt< h16, rep_opt< 2, colon, h16 > >, dcolon, rep< 2, h16, colon >, ls32 >,
+                             seq< opt< h16, rep_opt< 3, colon, h16 > >, dcolon,         h16, colon,   ls32 >,
+                             seq< opt< h16, rep_opt< 4, colon, h16 > >, dcolon,                       ls32 >,
+                             seq< opt< h16, rep_opt< 5, colon, h16 > >, dcolon,                       h16  >,
+                             seq< opt< h16, rep_opt< 6, colon, h16 > >, dcolon                             > > {};
 
-         struct gen_delims : one< ':', '/', '?', '#', '[', ']', '@' > {};
-         struct sub_delims : one< '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=' > {};
+   struct gen_delims : one< ':', '/', '?', '#', '[', ']', '@' > {};
+   struct sub_delims : one< '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=' > {};
 
-         struct unreserved : sor< abnf::ALPHA, abnf::DIGIT, one< '-', '.', '_', '~' > > {};
-         struct reserved : sor< gen_delims, sub_delims > {};
+   struct unreserved : sor< abnf::ALPHA, abnf::DIGIT, one< '-', '.', '_', '~' > > {};
+   struct reserved : sor< gen_delims, sub_delims > {};
 
-         struct IPvFuture : if_must< one< 'v' >, plus< abnf::HEXDIG >, dot, plus< sor< unreserved, sub_delims, colon > > > {};
+   struct IPvFuture : if_must< one< 'v', 'V' >, plus< abnf::HEXDIG >, dot, plus< sor< unreserved, sub_delims, colon > > > {};
 
-         struct IP_literal : if_must< one< '[' >, sor< IPvFuture, IPv6address >, one< ']' > > {};
+   struct IP_literal : if_must< one< '[' >, sor< IPvFuture, IPv6address >, one< ']' > > {};
 
-         struct pct_encoded : if_must< one< '%' >, abnf::HEXDIG, abnf::HEXDIG > {};
-         struct pchar : sor< unreserved, pct_encoded, sub_delims, one< ':', '@' > > {};
+   struct pct_encoded : if_must< one< '%' >, abnf::HEXDIG, abnf::HEXDIG > {};
+   struct pchar : sor< unreserved, pct_encoded, sub_delims, one< ':', '@' > > {};
 
-         struct query : star< sor< pchar, one< '/', '?' > > > {};
-         struct fragment : star< sor< pchar, one< '/', '?' > > > {};
+   struct query : star< sor< pchar, one< '/', '?' > > > {};
+   struct fragment : star< sor< pchar, one< '/', '?' > > > {};
 
-         struct segment : star< pchar > {};
-         struct segment_nz : plus< pchar > {};
-         struct segment_nz_nc : plus< sor< unreserved, pct_encoded, sub_delims, one< '@' > > > {}; // non-zero-length segment without any colon ":"
+   struct segment : star< pchar > {};
+   struct segment_nz : plus< pchar > {};
+   struct segment_nz_nc : plus< sor< unreserved, pct_encoded, sub_delims, one< '@' > > > {}; // non-zero-length segment without any colon ":"
 
-         struct path_abempty : star< one< '/' >, segment > {};
-         struct path_absolute : seq< one< '/' >, opt< segment_nz, star< one< '/' >, segment > > > {};
-         struct path_noscheme : seq< segment_nz_nc, star< one< '/' >, segment > > {};
-         struct path_rootless : seq< segment_nz, star< one< '/' >, segment > > {};
-         struct path_empty : success {};
+   struct path_abempty : star< one< '/' >, segment > {};
+   struct path_absolute : seq< one< '/' >, opt< segment_nz, star< one< '/' >, segment > > > {};
+   struct path_noscheme : seq< segment_nz_nc, star< one< '/' >, segment > > {};
+   struct path_rootless : seq< segment_nz, star< one< '/' >, segment > > {};
+   struct path_empty : success {};
 
-         struct path : sor< path_noscheme,     // begins with a non-colon segment
-                            path_rootless,     // begins with a segment
-                            path_absolute,     // begins with "/" but not "//"
-                            path_abempty > {}; // begins with "/" or is empty
+   struct path : sor< path_noscheme,     // begins with a non-colon segment
+                      path_rootless,     // begins with a segment
+                      path_absolute,     // begins with "/" but not "//"
+                      path_abempty > {}; // begins with "/" or is empty
 
-         struct reg_name : star< sor< unreserved, pct_encoded, sub_delims > > {};
+   struct reg_name : star< sor< unreserved, pct_encoded, sub_delims > > {};
 
-         struct port : star< abnf::DIGIT > {};
-         struct host : sor< IP_literal, IPv4address, reg_name > {};
-         struct userinfo : star< sor< unreserved, pct_encoded, sub_delims, colon > > {};
-         struct opt_userinfo : opt< userinfo, one< '@' > > {};
-         struct authority : seq< opt_userinfo, host, opt< colon, port > > {};
+   struct port : star< abnf::DIGIT > {};
+   struct host : sor< IP_literal, IPv4address, reg_name > {};
+   struct userinfo : star< sor< unreserved, pct_encoded, sub_delims, colon > > {};
+   struct opt_userinfo : opt< userinfo, one< '@' > > {};
+   struct authority : seq< opt_userinfo, host, opt< colon, port > > {};
 
-         struct scheme : seq< abnf::ALPHA, star< sor< abnf::ALPHA, abnf::DIGIT, one< '+', '-', '.' > > > > {};
+   struct scheme : seq< abnf::ALPHA, star< sor< abnf::ALPHA, abnf::DIGIT, one< '+', '-', '.' > > > > {};
 
-         using dslash = two< '/' >;
-         using opt_query = opt_must< one< '?' >, query >;
-         using opt_fragment = opt_must< one< '#' >, fragment >;
+   using dslash = two< '/' >;
+   using opt_query = opt_must< one< '?' >, query >;
+   using opt_fragment = opt_must< one< '#' >, fragment >;
 
-         struct hier_part : sor< if_must< dslash, authority, path_abempty >, path_rootless, path_absolute, path_empty > {};
-         struct relative_part : sor< if_must< dslash, authority, path_abempty >, path_noscheme, path_absolute, path_empty > {};
-         struct relative_ref : seq< relative_part, opt_query, opt_fragment > {};
+   struct hier_part : sor< if_must< dslash, authority, path_abempty >, path_rootless, path_absolute, path_empty > {};
+   struct relative_part : sor< if_must< dslash, authority, path_abempty >, path_noscheme, path_absolute, path_empty > {};
+   struct relative_ref : seq< relative_part, opt_query, opt_fragment > {};
 
-         struct URI : seq< scheme, one< ':' >, hier_part, opt_query, opt_fragment > {};
-         struct URI_reference : sor< URI, relative_ref > {};
-         struct absolute_URI : seq< scheme, one< ':' >, hier_part, opt_query > {};
-         // clang-format on
+   struct URI : seq< scheme, one< ':' >, hier_part, opt_query, opt_fragment > {};
+   struct URI_reference : sor< URI, relative_ref > {};
+   struct absolute_URI : seq< scheme, one< ':' >, hier_part, opt_query > {};
+   // clang-format on
 
-      }  // namespace uri
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::uri
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/cstream_input.hpp b/packages/PEGTL/include/tao/pegtl/cstream_input.hpp
index 88c1a8eadb5a0360a22259899f9d00d6e548f202..5a5aee72b7b5f2f235d9690cf3851333b1593136 100644
--- a/packages/PEGTL/include/tao/pegtl/cstream_input.hpp
+++ b/packages/PEGTL/include/tao/pegtl/cstream_input.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_CSTREAM_INPUT_HPP
@@ -12,28 +12,22 @@
 
 #include "internal/cstream_reader.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Eol = eol::lf_crlf, std::size_t Chunk = 64 >
+   struct cstream_input
+      : buffer_input< internal::cstream_reader, Eol, std::string, Chunk >
    {
-      template< typename Eol = eol::lf_crlf >
-      struct cstream_input
-         : buffer_input< internal::cstream_reader, Eol >
+      template< typename T >
+      cstream_input( std::FILE* in_stream, const std::size_t in_maximum, T&& in_source )  // NOLINT
+         : buffer_input< internal::cstream_reader, Eol, std::string, Chunk >( std::forward< T >( in_source ), in_maximum, in_stream )
       {
-         template< typename T >
-         cstream_input( std::FILE* in_stream, const std::size_t in_maximum, T&& in_source )
-            : buffer_input< internal::cstream_reader, Eol >( std::forward< T >( in_source ), in_maximum, in_stream )
-         {
-         }
-      };
-
-#ifdef __cpp_deduction_guides
-      template< typename... Ts >
-      cstream_input( Ts&&... )->cstream_input<>;
-#endif
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Ts >
+   cstream_input( Ts&&... )->cstream_input<>;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/disable_action.hpp b/packages/PEGTL/include/tao/pegtl/disable_action.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..1832625edb80eb47e0f2ffce6a4e8648032b6085
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/disable_action.hpp
@@ -0,0 +1,35 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_DISABLE_ACTION_HPP
+#define TAO_PEGTL_DISABLE_ACTION_HPP
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "match.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   struct disable_action
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         return TAO_PEGTL_NAMESPACE::match< Rule, apply_mode::nothing, M, Action, Control >( in, st... );
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/discard_input.hpp b/packages/PEGTL/include/tao/pegtl/discard_input.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..18d3c996a43fded8677bccd120e7834b499e1db4
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/discard_input.hpp
@@ -0,0 +1,37 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_DISCARD_INPUT_HPP
+#define TAO_PEGTL_DISCARD_INPUT_HPP
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "match.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   struct discard_input
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         const bool result = TAO_PEGTL_NAMESPACE::match< Rule, apply_mode::nothing, M, Action, Control >( in, st... );
+         in.discard();
+         return result;
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/discard_input_on_failure.hpp b/packages/PEGTL/include/tao/pegtl/discard_input_on_failure.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..4f9c99b5e27bdeb4b6bff7b1c1fb5bc1c5d25b27
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/discard_input_on_failure.hpp
@@ -0,0 +1,39 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_DISCARD_INPUT_ON_FAILURE_HPP
+#define TAO_PEGTL_DISCARD_INPUT_ON_FAILURE_HPP
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "match.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   struct discard_input_on_failure
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         const bool result = TAO_PEGTL_NAMESPACE::match< Rule, apply_mode::nothing, M, Action, Control >( in, st... );
+         if( !result ) {
+            in.discard();
+         }
+         return result;
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/discard_input_on_success.hpp b/packages/PEGTL/include/tao/pegtl/discard_input_on_success.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..b373d686033486eef0b39d566c35e1bc0716f0bd
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/discard_input_on_success.hpp
@@ -0,0 +1,39 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_DISCARD_INPUT_ON_SUCCESS_HPP
+#define TAO_PEGTL_DISCARD_INPUT_ON_SUCCESS_HPP
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "match.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   struct discard_input_on_success
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         const bool result = TAO_PEGTL_NAMESPACE::match< Rule, apply_mode::nothing, M, Action, Control >( in, st... );
+         if( result ) {
+            in.discard();
+         }
+         return result;
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/enable_action.hpp b/packages/PEGTL/include/tao/pegtl/enable_action.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..f0a52e6bfef77b6b082d064d1f85bbb62d85808e
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/enable_action.hpp
@@ -0,0 +1,35 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_ENABLE_ACTION_HPP
+#define TAO_PEGTL_ENABLE_ACTION_HPP
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "match.hpp"
+#include "nothing.hpp"
+#include "rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   struct enable_action
+      : maybe_nothing
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         return TAO_PEGTL_NAMESPACE::match< Rule, apply_mode::action, M, Action, Control >( in, st... );
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/eol.hpp b/packages/PEGTL/include/tao/pegtl/eol.hpp
index 29a8a8959e80ae2dafffa78c71a4e3600cf29e14..927cd3e5397ba91e2b3531fd7df5248b224d010f 100644
--- a/packages/PEGTL/include/tao/pegtl/eol.hpp
+++ b/packages/PEGTL/include/tao/pegtl/eol.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_EOL_HPP
@@ -14,28 +14,24 @@
 #include "internal/lf_crlf_eol.hpp"
 #include "internal/lf_eol.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   inline namespace ascii
    {
-      inline namespace ascii
+      // this is both a rule and a pseudo-namespace for eol::cr, ...
+      struct eol : internal::eol
       {
-         // this is both a rule and a pseudo-namespace for eol::cr, ...
-         struct eol : internal::eol
-         {
-            // clang-format off
-            struct cr : internal::cr_eol {};
-            struct cr_crlf : internal::cr_crlf_eol {};
-            struct crlf : internal::crlf_eol {};
-            struct lf : internal::lf_eol {};
-            struct lf_crlf : internal::lf_crlf_eol {};
-            // clang-format on
-         };
-
-      }  // namespace ascii
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         // clang-format off
+         struct cr : internal::cr_eol {};
+         struct cr_crlf : internal::cr_crlf_eol {};
+         struct crlf : internal::crlf_eol {};
+         struct lf : internal::lf_eol {};
+         struct lf_crlf : internal::lf_crlf_eol {};
+         // clang-format on
+      };
+
+   }  // namespace ascii
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/eol_pair.hpp b/packages/PEGTL/include/tao/pegtl/eol_pair.hpp
index 384bea1e5204b379d606dfa558a15c04e552a624..4c7f76c12120b4eae571ddda17ae9d28f1c2e08d 100644
--- a/packages/PEGTL/include/tao/pegtl/eol_pair.hpp
+++ b/packages/PEGTL/include/tao/pegtl/eol_pair.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_EOL_PAIR_HPP
@@ -9,14 +9,10 @@
 
 #include "config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      using eol_pair = std::pair< bool, std::size_t >;
+   using eol_pair = std::pair< bool, std::size_t >;
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/file_input.hpp b/packages/PEGTL/include/tao/pegtl/file_input.hpp
index 1959a095a2462309216fe0c08c12d8842c1583dd..3c04e9aca2c1b3d22fac8e1099872f4561a13e38 100644
--- a/packages/PEGTL/include/tao/pegtl/file_input.hpp
+++ b/packages/PEGTL/include/tao/pegtl/file_input.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_FILE_INPUT_HPP
@@ -18,33 +18,27 @@
 #include "read_input.hpp"
 #endif
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
 #if defined( _POSIX_MAPPED_FILES ) || defined( _WIN32 )
-      template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
-      struct file_input
-         : mmap_input< P, Eol >
-      {
-         using mmap_input< P, Eol >::mmap_input;
-      };
+   template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
+   struct file_input
+      : mmap_input< P, Eol >
+   {
+      using mmap_input< P, Eol >::mmap_input;
+   };
 #else
-      template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
-      struct file_input
-         : read_input< P, Eol >
-      {
-         using read_input< P, Eol >::read_input;
-      };
-#endif
-
-#ifdef __cpp_deduction_guides
-      template< typename... Ts >
-      explicit file_input( Ts&&... )->file_input<>;
+   template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
+   struct file_input
+      : read_input< P, Eol >
+   {
+      using read_input< P, Eol >::read_input;
+   };
 #endif
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Ts >
+   explicit file_input( Ts&&... )->file_input<>;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/input_error.hpp b/packages/PEGTL/include/tao/pegtl/input_error.hpp
deleted file mode 100644
index eb302c9f7967675a592b315fa6bc57666553a37a..0000000000000000000000000000000000000000
--- a/packages/PEGTL/include/tao/pegtl/input_error.hpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
-// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
-
-#ifndef TAO_PEGTL_INPUT_ERROR_HPP
-#define TAO_PEGTL_INPUT_ERROR_HPP
-
-#include <cerrno>
-#include <sstream>
-#include <stdexcept>
-
-#include "config.hpp"
-
-namespace tao
-{
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      struct input_error
-         : std::runtime_error
-      {
-         input_error( const std::string& message, const int in_errorno )
-            : std::runtime_error( message ),
-              errorno( in_errorno )
-         {
-         }
-
-         int errorno;
-      };
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
-
-#define TAO_PEGTL_INTERNAL_UNWRAP( ... ) __VA_ARGS__
-
-#define TAO_PEGTL_THROW_INPUT_ERROR( MESSAGE )                                          \
-   do {                                                                                 \
-      const int errorno = errno;                                                        \
-      std::ostringstream oss;                                                           \
-      oss << "pegtl: " << TAO_PEGTL_INTERNAL_UNWRAP( MESSAGE ) << " errno " << errorno; \
-      throw tao::TAO_PEGTL_NAMESPACE::input_error( oss.str(), errorno );                \
-   } while( false )
-
-#define TAO_PEGTL_THROW_INPUT_WIN32_ERROR( MESSAGE )                                             \
-   do {                                                                                          \
-      const int errorno = GetLastError();                                                        \
-      std::ostringstream oss;                                                                    \
-      oss << "pegtl: " << TAO_PEGTL_INTERNAL_UNWRAP( MESSAGE ) << " GetLastError() " << errorno; \
-      throw tao::TAO_PEGTL_NAMESPACE::input_error( oss.str(), errorno );                         \
-   } while( false )
-
-#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/action.hpp b/packages/PEGTL/include/tao/pegtl/internal/action.hpp
index b7a4f6ac111b4b068521bae679feed6e5544b47e..c6cd4d1d302130201ccdae93c58a11b8d696b2a1 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/action.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/action.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ACTION_HPP
@@ -15,38 +15,30 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< template< typename... > class Action, typename... Rules >
+   struct action
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::seq, Rules... >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< template< typename... > class Action, typename... Rules >
-         struct action
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, Rules... >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return duseltronik< seq< Rules... >, A, M, Action, Control >::match( in, st... );
-            }
-         };
-
-         template< template< typename... > class Action, typename... Rules >
-         struct skip_control< action< Action, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         return duseltronik< seq< Rules... >, A, M, Action, Control >::match( in, st... );
+      }
+   };
+
+   template< template< typename... > class Action, typename... Rules >
+   inline constexpr bool skip_control< action< Action, Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/action_input.hpp b/packages/PEGTL/include/tao/pegtl/internal/action_input.hpp
index ec15ea1096a4ab328edcf0d405b49a79154ab170..84a97a3f62031e11c0da6378a3f795c83cde13fc 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/action_input.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/action_input.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ACTION_INPUT_HPP
@@ -7,108 +7,101 @@
 #include <cstddef>
 #include <cstdint>
 #include <string>
+#include <string_view>
 
 #include "iterator.hpp"
 
 #include "../config.hpp"
 #include "../position.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Input >
+   class action_input
    {
-      namespace internal
+   public:
+      using input_t = Input;
+      using iterator_t = typename Input::iterator_t;
+
+      action_input( const iterator_t& in_begin, const Input& in_input ) noexcept
+         : m_begin( in_begin ),
+           m_input( in_input )
       {
-         inline const char* begin_c_ptr( const char* p ) noexcept
-         {
-            return p;
-         }
+      }
+
+      action_input( const action_input& ) = delete;
+      action_input( action_input&& ) = delete;
+
+      ~action_input() = default;
+
+      action_input& operator=( const action_input& ) = delete;
+      action_input& operator=( action_input&& ) = delete;
+
+      [[nodiscard]] const iterator_t& iterator() const noexcept
+      {
+         return m_begin;
+      }
 
-         inline const char* begin_c_ptr( const iterator& it ) noexcept
-         {
-            return it.data;
+      [[nodiscard]] const Input& input() const noexcept
+      {
+         return m_input;
+      }
+
+      [[nodiscard]] const char* begin() const noexcept
+      {
+         if constexpr( std::is_same_v< iterator_t, const char* > ) {
+            return iterator();
+         }
+         else {  // NOLINT
+            return iterator().data;
          }
+      }
+
+      [[nodiscard]] const char* end() const noexcept
+      {
+         return input().current();
+      }
+
+      [[nodiscard]] bool empty() const noexcept
+      {
+         return begin() == end();
+      }
+
+      [[nodiscard]] std::size_t size() const noexcept
+      {
+         return std::size_t( end() - begin() );
+      }
+
+      [[nodiscard]] std::string string() const
+      {
+         return std::string( begin(), end() );
+      }
+
+      [[nodiscard]] std::string_view string_view() const noexcept
+      {
+         return std::string_view( begin(), size() );
+      }
+
+      [[nodiscard]] char peek_char( const std::size_t offset = 0 ) const noexcept
+      {
+         return begin()[ offset ];
+      }
+
+      [[nodiscard]] std::uint8_t peek_uint8( const std::size_t offset = 0 ) const noexcept
+      {
+         return static_cast< std::uint8_t >( peek_char( offset ) );
+      }
+
+      [[nodiscard]] TAO_PEGTL_NAMESPACE::position position() const
+      {
+         return input().position( iterator() );  // NOTE: Not efficient with lazy inputs.
+      }
+
+   protected:
+      const iterator_t m_begin;
+      const Input& m_input;
+   };
 
-         template< typename Input >
-         class action_input
-         {
-         public:
-            using input_t = Input;
-            using iterator_t = typename Input::iterator_t;
-
-            action_input( const iterator_t& in_begin, const Input& in_input ) noexcept
-               : m_begin( in_begin ),
-                 m_input( in_input )
-            {
-            }
-
-            action_input( const action_input& ) = delete;
-            action_input( action_input&& ) = delete;
-
-            ~action_input() = default;
-
-            action_input& operator=( const action_input& ) = delete;
-            action_input& operator=( action_input&& ) = delete;
-
-            const iterator_t& iterator() const noexcept
-            {
-               return m_begin;
-            }
-
-            const Input& input() const noexcept
-            {
-               return m_input;
-            }
-
-            const char* begin() const noexcept
-            {
-               return begin_c_ptr( iterator() );
-            }
-
-            const char* end() const noexcept
-            {
-               return input().current();
-            }
-
-            bool empty() const noexcept
-            {
-               return begin() == end();
-            }
-
-            std::size_t size() const noexcept
-            {
-               return std::size_t( end() - begin() );
-            }
-
-            std::string string() const
-            {
-               return std::string( begin(), end() );
-            }
-
-            char peek_char( const std::size_t offset = 0 ) const noexcept
-            {
-               return begin()[ offset ];
-            }
-
-            std::uint8_t peek_byte( const std::size_t offset = 0 ) const noexcept
-            {
-               return static_cast< std::uint8_t >( peek_char( offset ) );
-            }
-
-            TAO_PEGTL_NAMESPACE::position position() const
-            {
-               return input().position( iterator() );  // NOTE: Not efficient with LAZY inputs.
-            }
-
-         protected:
-            const iterator_t m_begin;
-            const Input& m_input;
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/alnum.hpp b/packages/PEGTL/include/tao/pegtl/internal/alnum.hpp
index f42fa1a2a145ed67235beb37625707ad8d5b23d3..459fd3aab91b3a62bf6a3c8f4be653f10d45fdfa 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/alnum.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/alnum.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ALNUM_HPP
@@ -9,18 +9,10 @@
 #include "peek_char.hpp"
 #include "ranges.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         using alnum = ranges< peek_char, 'a', 'z', 'A', 'Z', '0', '9' >;
+   using alnum = ranges< peek_char, 'a', 'z', 'A', 'Z', '0', '9' >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/alpha.hpp b/packages/PEGTL/include/tao/pegtl/internal/alpha.hpp
index b55d1ed633197aee479227938d786bfa2c6e7976..ddc7cf5fb210389bead2cbb036228515a7e7d5aa 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/alpha.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/alpha.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ALPHA_HPP
@@ -9,18 +9,10 @@
 #include "peek_char.hpp"
 #include "ranges.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         using alpha = ranges< peek_char, 'a', 'z', 'A', 'Z' >;
+   using alpha = ranges< peek_char, 'a', 'z', 'A', 'Z' >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/always_false.hpp b/packages/PEGTL/include/tao/pegtl/internal/always_false.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..339ab498bf0d39437b05c40bbbed89f493418dcf
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/internal/always_false.hpp
@@ -0,0 +1,21 @@
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_INTERNAL_ALWAYS_FALSE_HPP
+#define TAO_PEGTL_INTERNAL_ALWAYS_FALSE_HPP
+
+#include "../config.hpp"
+
+#include <type_traits>
+
+namespace TAO_PEGTL_NAMESPACE::internal
+{
+   template< typename... >
+   struct always_false
+      : std::false_type
+   {
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/any.hpp b/packages/PEGTL/include/tao/pegtl/internal/any.hpp
index 4c962d74708a610505b423b6bb7e0670c73398c0..e20c55bc5d7cd77b545fca4f34bf8586734c2a1b 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/any.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/any.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ANY_HPP
@@ -11,58 +11,48 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename Peek >
-         struct any;
-
-         template<>
-         struct any< peek_char >
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
+   template< typename Peek >
+   struct any;
 
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.empty() ) )
-            {
-               if( !in.empty() ) {
-                  in.bump();
-                  return true;
-               }
-               return false;
-            }
-         };
+   template<>
+   struct any< peek_char >
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
 
-         template< typename Peek >
-         struct any
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.empty() ) )
+      {
+         if( !in.empty() ) {
+            in.bump();
+            return true;
+         }
+         return false;
+      }
+   };
+
+   template< typename Peek >
+   struct any
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
 
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.empty() ) )
-            {
-               if( !in.empty() ) {
-                  if( const auto t = Peek::peek( in ) ) {
-                     in.bump( t.size );
-                     return true;
-                  }
-               }
-               return false;
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( Peek::max_input_size ) ) )
+      {
+         if( const std::size_t s = in.size( Peek::max_input_size ); s >= Peek::min_input_size ) {
+            if( const auto t = Peek::peek( in, s ) ) {
+               in.bump( t.size );
+               return true;
             }
-         };
-
-         template< typename Peek >
-         struct skip_control< any< Peek > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+         }
+         return false;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename Peek >
+   inline constexpr bool skip_control< any< Peek > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/apply.hpp b/packages/PEGTL/include/tao/pegtl/internal/apply.hpp
index 7954f2fabdbf9d59ef8c712a58cf31e70060191f..11616fcad9303b497aa5444ca5908f746dc83bea 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/apply.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/apply.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_APPLY_HPP
@@ -13,80 +13,41 @@
 #include "../apply_mode.hpp"
 #include "../rewind_mode.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename... Actions >
+   struct apply
    {
-      namespace internal
+      using analyze_t = analysis::counted< analysis::rule_type::any, 0 >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< apply_mode A, typename... Actions >
-         struct apply_impl;
-
-         template<>
-         struct apply_impl< apply_mode::ACTION >
-         {
-            template< typename Input, typename... States >
-            static bool match( Input& /*unused*/, States&&... /*unused*/ )
-            {
-               return true;
-            }
-         };
-
-         template< typename... Actions >
-         struct apply_impl< apply_mode::ACTION, Actions... >
-         {
-            template< typename Input, typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               using action_t = typename Input::action_t;
-               const action_t i2( in.iterator(), in );  // No data -- range is from begin to begin.
-#ifdef __cpp_fold_expressions
-               return ( apply_single< Actions >::match( i2, st... ) && ... );
-#else
-               bool result = true;
-               using swallow = bool[];
-               (void)swallow{ result = result && apply_single< Actions >::match( i2, st... )... };
-               return result;
+         if constexpr( ( A == apply_mode::action ) && ( sizeof...( Actions ) > 0 ) ) {
+            using action_t = typename Input::action_t;
+            const action_t i2( in.iterator(), in );  // No data -- range is from begin to begin.
+            return ( apply_single< Actions >::match( i2, st... ) && ... );
+         }
+         else {  // NOLINT
+#if defined( _MSC_VER )
+            (void)in;
+            (void)( (void)st, ... );
 #endif
-            }
-         };
-
-         template< typename... Actions >
-         struct apply_impl< apply_mode::NOTHING, Actions... >
-         {
-            template< typename Input, typename... States >
-            static bool match( Input& /*unused*/, States&&... /*unused*/ )
-            {
-               return true;
-            }
-         };
-
-         template< typename... Actions >
-         struct apply
-         {
-            using analyze_t = analysis::counted< analysis::rule_type::ANY, 0 >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return apply_impl< A, Actions... >::match( in, st... );
-            }
-         };
-
-         template< typename... Actions >
-         struct skip_control< apply< Actions... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+            return true;
+         }
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Actions >
+   inline constexpr bool skip_control< apply< Actions... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/apply0.hpp b/packages/PEGTL/include/tao/pegtl/internal/apply0.hpp
index 5a13f6d67553f235468f7b6404dbec3d98f74009..417ed7a61197440f6e7a2b169e1406ca2c0eeea0 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/apply0.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/apply0.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_APPLY0_HPP
@@ -13,78 +13,38 @@
 #include "../apply_mode.hpp"
 #include "../rewind_mode.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename... Actions >
+   struct apply0
    {
-      namespace internal
+      using analyze_t = analysis::counted< analysis::rule_type::any, 0 >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& /*unused*/, States&&... st )
       {
-         template< apply_mode A, typename... Actions >
-         struct apply0_impl;
-
-         template<>
-         struct apply0_impl< apply_mode::ACTION >
-         {
-            template< typename... States >
-            static bool match( States&&... /*unused*/ ) noexcept
-            {
-               return true;
-            }
-         };
-
-         template< typename... Actions >
-         struct apply0_impl< apply_mode::ACTION, Actions... >
-         {
-            template< typename... States >
-            static bool match( States&&... st )
-            {
-#ifdef __cpp_fold_expressions
-               return ( apply0_single< Actions >::match( st... ) && ... );
-#else
-               bool result = true;
-               using swallow = bool[];
-               (void)swallow{ result = result && apply0_single< Actions >::match( st... )... };
-               return result;
+         if constexpr( A == apply_mode::action ) {
+            return ( apply0_single< Actions >::match( st... ) && ... );
+         }
+         else {  // NOLINT
+#if defined( _MSC_VER )
+            (void)( (void)st, ... );
 #endif
-            }
-         };
-
-         template< typename... Actions >
-         struct apply0_impl< apply_mode::NOTHING, Actions... >
-         {
-            template< typename... States >
-            static bool match( States&&... /*unused*/ ) noexcept
-            {
-               return true;
-            }
-         };
-
-         template< typename... Actions >
-         struct apply0
-         {
-            using analyze_t = analysis::counted< analysis::rule_type::ANY, 0 >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& /*unused*/, States&&... st )
-            {
-               return apply0_impl< A, Actions... >::match( st... );
-            }
-         };
-
-         template< typename... Actions >
-         struct skip_control< apply0< Actions... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+            return true;
+         }
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Actions >
+   inline constexpr bool skip_control< apply0< Actions... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/apply0_single.hpp b/packages/PEGTL/include/tao/pegtl/internal/apply0_single.hpp
index 06bae4f284b6613c96a2c7813953325690d82a55..73a6f1ac081b275322765d4fd903e2d3d85ee6f6 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/apply0_single.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/apply0_single.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_APPLY0_SINGLE_HPP
@@ -8,35 +8,27 @@
 
 #include <type_traits>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Action >
+   struct apply0_single
    {
-      namespace internal
+      template< typename... States >
+      [[nodiscard]] static auto match( States&&... st ) noexcept( noexcept( Action::apply0( st... ) ) )
+         -> std::enable_if_t< std::is_same_v< decltype( Action::apply0( st... ) ), void >, bool >
       {
-         template< typename Action >
-         struct apply0_single
-         {
-            template< typename... States >
-            static auto match( States&&... st )
-               -> typename std::enable_if< std::is_same< decltype( Action::apply0( st... ) ), void >::value, bool >::type
-            {
-               Action::apply0( st... );
-               return true;
-            }
+         Action::apply0( st... );
+         return true;
+      }
 
-            template< typename... States >
-            static auto match( States&&... st )
-               -> typename std::enable_if< std::is_same< decltype( Action::apply0( st... ) ), bool >::value, bool >::type
-            {
-               return Action::apply0( st... );
-            }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+      template< typename... States >
+      [[nodiscard]] static auto match( States&&... st ) noexcept( noexcept( Action::apply0( st... ) ) )
+         -> std::enable_if_t< std::is_same_v< decltype( Action::apply0( st... ) ), bool >, bool >
+      {
+         return Action::apply0( st... );
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/apply_single.hpp b/packages/PEGTL/include/tao/pegtl/internal/apply_single.hpp
index 99072343270f4301ccf4b87d30655bb42238312b..85dc0b598fd389d8df1227986e0a10c11c3752c1 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/apply_single.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/apply_single.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_APPLY_SINGLE_HPP
@@ -8,35 +8,27 @@
 
 #include <type_traits>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Action >
+   struct apply_single
    {
-      namespace internal
+      template< typename Input, typename... States >
+      [[nodiscard]] static auto match( const Input& in, States&&... st ) noexcept( noexcept( Action::apply( in, st... ) ) )
+         -> std::enable_if_t< std::is_same_v< decltype( Action::apply( in, st... ) ), void >, bool >
       {
-         template< typename Action >
-         struct apply_single
-         {
-            template< typename Input, typename... States >
-            static auto match( const Input& i2, States&&... st )
-               -> typename std::enable_if< std::is_same< decltype( Action::apply( i2, st... ) ), void >::value, bool >::type
-            {
-               Action::apply( i2, st... );
-               return true;
-            }
+         Action::apply( in, st... );
+         return true;
+      }
 
-            template< typename Input, typename... States >
-            static auto match( const Input& i2, States&&... st )
-               -> typename std::enable_if< std::is_same< decltype( Action::apply( i2, st... ) ), bool >::value, bool >::type
-            {
-               return Action::apply( i2, st... );
-            }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+      template< typename Input, typename... States >
+      [[nodiscard]] static auto match( const Input& in, States&&... st ) noexcept( noexcept( Action::apply( in, st... ) ) )
+         -> std::enable_if_t< std::is_same_v< decltype( Action::apply( in, st... ) ), bool >, bool >
+      {
+         return Action::apply( in, st... );
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/at.hpp b/packages/PEGTL/include/tao/pegtl/internal/at.hpp
index b4997c9c7bd01b2ba641635dd60d16d95621c8b0..e46a857502665407bc9acb97da468e58c4c72829 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/at.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/at.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_AT_HPP
@@ -6,7 +6,6 @@
 
 #include "../config.hpp"
 
-#include "rule_conjunction.hpp"
 #include "skip_control.hpp"
 #include "trivial.hpp"
 
@@ -15,48 +14,40 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   struct at;
+
+   template<>
+   struct at<>
+      : trivial< true >
+   {
+   };
+
+   template< typename... Rules >
+   struct at
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::opt, Rules... >;
+
+      template< apply_mode,
+                rewind_mode,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< typename... Rules >
-         struct at;
-
-         template<>
-         struct at<>
-            : trivial< true >
-         {
-         };
-
-         template< typename... Rules >
-         struct at
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT, Rules... >;
-
-            template< apply_mode,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               const auto m = in.template mark< rewind_mode::REQUIRED >();
-               return rule_conjunction< Rules... >::template match< apply_mode::NOTHING, rewind_mode::ACTIVE, Action, Control >( in, st... );
-            }
-         };
-
-         template< typename... Rules >
-         struct skip_control< at< Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         const auto m = in.template mark< rewind_mode::required >();
+         return ( Control< Rules >::template match< apply_mode::nothing, rewind_mode::active, Action, Control >( in, st... ) && ... );
+      }
+   };
+
+   template< typename... Rules >
+   inline constexpr bool skip_control< at< Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/bof.hpp b/packages/PEGTL/include/tao/pegtl/internal/bof.hpp
index b6c9c2177df9c748119c7f7d1ebd950b887ca27f..53b8e59c488d30882419e5f27c9567369daff85a 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/bof.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/bof.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_BOF_HPP
@@ -10,32 +10,22 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct bof
    {
-      namespace internal
-      {
-         struct bof
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT >;
-
-            template< typename Input >
-            static bool match( Input& in ) noexcept
-            {
-               return in.byte() == 0;
-            }
-         };
+      using analyze_t = analysis::generic< analysis::rule_type::opt >;
 
-         template<>
-         struct skip_control< bof > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept
+      {
+         return in.byte() == 0;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template<>
+   inline constexpr bool skip_control< bof > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/bol.hpp b/packages/PEGTL/include/tao/pegtl/internal/bol.hpp
index dda3179292de8d92f14b1d307458f920924f16bc..e58d239f3ce53c50e7430eddf6422c5b594c1208 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/bol.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/bol.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_BOL_HPP
@@ -10,32 +10,22 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct bol
    {
-      namespace internal
-      {
-         struct bol
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT >;
-
-            template< typename Input >
-            static bool match( Input& in ) noexcept
-            {
-               return in.byte_in_line() == 0;
-            }
-         };
+      using analyze_t = analysis::generic< analysis::rule_type::opt >;
 
-         template<>
-         struct skip_control< bol > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept
+      {
+         return in.byte_in_line() == 0;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template<>
+   inline constexpr bool skip_control< bol > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/bump.hpp b/packages/PEGTL/include/tao/pegtl/internal/bump.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..293b1bbfd86761c049f93e7367d7e0d6bf12413b
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/internal/bump.hpp
@@ -0,0 +1,45 @@
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_INTERNAL_BUMP_HPP
+#define TAO_PEGTL_INTERNAL_BUMP_HPP
+
+#include "../config.hpp"
+
+#include "iterator.hpp"
+
+namespace TAO_PEGTL_NAMESPACE::internal
+{
+   inline void bump( iterator& iter, const std::size_t count, const int ch ) noexcept
+   {
+      for( std::size_t i = 0; i < count; ++i ) {
+         if( iter.data[ i ] == ch ) {
+            ++iter.line;
+            iter.byte_in_line = 0;
+         }
+         else {
+            ++iter.byte_in_line;
+         }
+      }
+      iter.byte += count;
+      iter.data += count;
+   }
+
+   inline void bump_in_this_line( iterator& iter, const std::size_t count ) noexcept
+   {
+      iter.data += count;
+      iter.byte += count;
+      iter.byte_in_line += count;
+   }
+
+   inline void bump_to_next_line( iterator& iter, const std::size_t count ) noexcept
+   {
+      ++iter.line;
+      iter.byte += count;
+      iter.byte_in_line = 0;
+      iter.data += count;
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/bump_help.hpp b/packages/PEGTL/include/tao/pegtl/internal/bump_help.hpp
index b09f2edac6c228494471692ead88657a06080a4d..37b60cd2f14adfb8325218bd8ef091b4cd366ee4 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/bump_help.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/bump_help.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_BUMP_HELP_HPP
@@ -11,53 +11,19 @@
 
 #include "result_on_found.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< result_on_found R, typename Input, typename Char, Char... Cs >
+   void bump_help( Input& in, const std::size_t count ) noexcept
    {
-      namespace internal
-      {
-         template< bool >
-         struct bump_impl;
-
-         template<>
-         struct bump_impl< true >
-         {
-            template< typename Input >
-            static void bump( Input& in, const std::size_t count ) noexcept
-            {
-               in.bump( count );
-            }
-         };
-
-         template<>
-         struct bump_impl< false >
-         {
-            template< typename Input >
-            static void bump( Input& in, const std::size_t count ) noexcept
-            {
-               in.bump_in_this_line( count );
-            }
-         };
-
-         template< bool... >
-         struct bool_list
-         {
-         };
-
-         template< bool... Bs >
-         using bool_and = std::is_same< bool_list< Bs..., true >, bool_list< true, Bs... > >;
-
-         template< result_on_found R, typename Input, typename Char, Char... Cs >
-         void bump_help( Input& in, const std::size_t count ) noexcept
-         {
-            bump_impl< bool_and< ( Cs != Input::eol_t::ch )... >::value != bool( R ) >::bump( in, count );
-         }
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      if constexpr( ( ( Cs != Input::eol_t::ch ) && ... ) != bool( R ) ) {
+         in.bump( count );
+      }
+      else {
+         in.bump_in_this_line( count );
+      }
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/bump_impl.hpp b/packages/PEGTL/include/tao/pegtl/internal/bump_impl.hpp
deleted file mode 100644
index ffd904d46c385b9550634649fe92059fdf0867af..0000000000000000000000000000000000000000
--- a/packages/PEGTL/include/tao/pegtl/internal/bump_impl.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
-// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
-
-#ifndef TAO_PEGTL_INTERNAL_BUMP_IMPL_HPP
-#define TAO_PEGTL_INTERNAL_BUMP_IMPL_HPP
-
-#include "../config.hpp"
-
-#include "iterator.hpp"
-
-namespace tao
-{
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         inline void bump( iterator& iter, const std::size_t count, const int ch ) noexcept
-         {
-            for( std::size_t i = 0; i < count; ++i ) {
-               if( iter.data[ i ] == ch ) {
-                  ++iter.line;
-                  iter.byte_in_line = 0;
-               }
-               else {
-                  ++iter.byte_in_line;
-               }
-            }
-            iter.byte += count;
-            iter.data += count;
-         }
-
-         inline void bump_in_this_line( iterator& iter, const std::size_t count ) noexcept
-         {
-            iter.data += count;
-            iter.byte += count;
-            iter.byte_in_line += count;
-         }
-
-         inline void bump_to_next_line( iterator& iter, const std::size_t count ) noexcept
-         {
-            ++iter.line;
-            iter.byte += count;
-            iter.byte_in_line = 0;
-            iter.data += count;
-         }
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
-
-#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/bytes.hpp b/packages/PEGTL/include/tao/pegtl/internal/bytes.hpp
index 789224c331838747bee398b5e2b4fb066cb17195..9289d0f42a18f61176cee47ebc64d2719d93961e 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/bytes.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/bytes.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_BYTES_HPP
@@ -10,37 +10,27 @@
 
 #include "../analysis/counted.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< unsigned Num >
+   struct bytes
    {
-      namespace internal
+      using analyze_t = analysis::counted< analysis::rule_type::any, Num >;
+
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( 0 ) ) )
       {
-         template< unsigned Num >
-         struct bytes
-         {
-            using analyze_t = analysis::counted< analysis::rule_type::ANY, Num >;
-
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.size( 0 ) ) )
-            {
-               if( in.size( Num ) >= Num ) {
-                  in.bump( Num );
-                  return true;
-               }
-               return false;
-            }
-         };
-
-         template< unsigned Num >
-         struct skip_control< bytes< Num > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         if( in.size( Num ) >= Num ) {
+            in.bump( Num );
+            return true;
+         }
+         return false;
+      }
+   };
+
+   template< unsigned Num >
+   inline constexpr bool skip_control< bytes< Num > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/conditional.hpp b/packages/PEGTL/include/tao/pegtl/internal/conditional.hpp
deleted file mode 100644
index dbf356da1c061a057de4c8991d344ceb48d89f98..0000000000000000000000000000000000000000
--- a/packages/PEGTL/include/tao/pegtl/internal/conditional.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
-// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
-
-#ifndef TAO_PEGTL_INTERNAL_CONDITIONAL_HPP
-#define TAO_PEGTL_INTERNAL_CONDITIONAL_HPP
-
-#include "../config.hpp"
-
-namespace tao
-{
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< bool >
-         struct conditional;
-
-         template<>
-         struct conditional< true >
-         {
-            template< typename T, typename >
-            using type = T;
-         };
-
-         template<>
-         struct conditional< false >
-         {
-            template< typename, typename T >
-            using type = T;
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
-
-#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/control.hpp b/packages/PEGTL/include/tao/pegtl/internal/control.hpp
index 88cc5a18a6799cad0eac46c1fc7245492f16599c..afc30a675082d2aa95cdfe00454d1bfde9f0aa8d 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/control.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/control.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_CONTROL_HPP
@@ -15,38 +15,30 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< template< typename... > class Control, typename... Rules >
+   struct control
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::seq, Rules... >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< template< typename... > class Control, typename... Rules >
-         struct control
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, Rules... >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return duseltronik< seq< Rules... >, A, M, Action, Control >::match( in, st... );
-            }
-         };
-
-         template< template< typename... > class Control, typename... Rules >
-         struct skip_control< control< Control, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         return duseltronik< seq< Rules... >, A, M, Action, Control >::match( in, st... );
+      }
+   };
+
+   template< template< typename... > class Control, typename... Rules >
+   inline constexpr bool skip_control< control< Control, Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/cr_crlf_eol.hpp b/packages/PEGTL/include/tao/pegtl/internal/cr_crlf_eol.hpp
index 8b83e24806ec975220927103e107c40dd84d8e92..ff902142cbc05b0be135b80a9ee6a8b1e4833adc 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/cr_crlf_eol.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/cr_crlf_eol.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_CR_CRLF_EOL_HPP
@@ -7,34 +7,26 @@
 #include "../config.hpp"
 #include "../eol_pair.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct cr_crlf_eol
    {
-      namespace internal
-      {
-         struct cr_crlf_eol
-         {
-            static constexpr int ch = '\r';
+      static constexpr int ch = '\r';
 
-            template< typename Input >
-            static eol_pair match( Input& in ) noexcept( noexcept( in.size( 2 ) ) )
-            {
-               eol_pair p = { false, in.size( 2 ) };
-               if( p.second ) {
-                  if( in.peek_char() == '\r' ) {
-                     in.bump_to_next_line( 1 + ( ( p.second > 1 ) && ( in.peek_char( 1 ) == '\n' ) ) );
-                     p.first = true;
-                  }
-               }
-               return p;
+      template< typename Input >
+      [[nodiscard]] static eol_pair match( Input& in ) noexcept( noexcept( in.size( 2 ) ) )
+      {
+         eol_pair p = { false, in.size( 2 ) };
+         if( p.second ) {
+            if( in.peek_char() == '\r' ) {
+               in.bump_to_next_line( 1 + ( ( p.second > 1 ) && ( in.peek_char( 1 ) == '\n' ) ) );
+               p.first = true;
             }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+         }
+         return p;
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/cr_eol.hpp b/packages/PEGTL/include/tao/pegtl/internal/cr_eol.hpp
index ad2bb5e718feb7ec42dd79af09ee2a9c12aa03f8..cf7d7e07fb8b7720e2639bab9511b927d9a362eb 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/cr_eol.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/cr_eol.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_CR_EOL_HPP
@@ -7,34 +7,26 @@
 #include "../config.hpp"
 #include "../eol_pair.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct cr_eol
    {
-      namespace internal
-      {
-         struct cr_eol
-         {
-            static constexpr int ch = '\r';
+      static constexpr int ch = '\r';
 
-            template< typename Input >
-            static eol_pair match( Input& in ) noexcept( noexcept( in.size( 1 ) ) )
-            {
-               eol_pair p = { false, in.size( 1 ) };
-               if( p.second ) {
-                  if( in.peek_char() == '\r' ) {
-                     in.bump_to_next_line();
-                     p.first = true;
-                  }
-               }
-               return p;
+      template< typename Input >
+      [[nodiscard]] static eol_pair match( Input& in ) noexcept( noexcept( in.size( 1 ) ) )
+      {
+         eol_pair p = { false, in.size( 1 ) };
+         if( p.second ) {
+            if( in.peek_char() == '\r' ) {
+               in.bump_to_next_line();
+               p.first = true;
             }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+         }
+         return p;
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/crlf_eol.hpp b/packages/PEGTL/include/tao/pegtl/internal/crlf_eol.hpp
index 308eca99fee67d8212182511d8617f1f51bc0fa9..017076f6ddd2c040fc7d8abe6252a882d20d1f47 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/crlf_eol.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/crlf_eol.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_CRLF_EOL_HPP
@@ -7,34 +7,26 @@
 #include "../config.hpp"
 #include "../eol_pair.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct crlf_eol
    {
-      namespace internal
-      {
-         struct crlf_eol
-         {
-            static constexpr int ch = '\n';
+      static constexpr int ch = '\n';
 
-            template< typename Input >
-            static eol_pair match( Input& in ) noexcept( noexcept( in.size( 2 ) ) )
-            {
-               eol_pair p = { false, in.size( 2 ) };
-               if( p.second > 1 ) {
-                  if( ( in.peek_char() == '\r' ) && ( in.peek_char( 1 ) == '\n' ) ) {
-                     in.bump_to_next_line( 2 );
-                     p.first = true;
-                  }
-               }
-               return p;
+      template< typename Input >
+      [[nodiscard]] static eol_pair match( Input& in ) noexcept( noexcept( in.size( 2 ) ) )
+      {
+         eol_pair p = { false, in.size( 2 ) };
+         if( p.second > 1 ) {
+            if( ( in.peek_char() == '\r' ) && ( in.peek_char( 1 ) == '\n' ) ) {
+               in.bump_to_next_line( 2 );
+               p.first = true;
             }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+         }
+         return p;
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/cstream_reader.hpp b/packages/PEGTL/include/tao/pegtl/internal/cstream_reader.hpp
index 756bc546d3df1c66459b02777ded3eb8ca047f27..1d436eaf5ceacbd646d5873c1f5b415825f150a3 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/cstream_reader.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/cstream_reader.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_CSTREAM_READER_HPP
@@ -8,43 +8,42 @@
 #include <cstddef>
 #include <cstdio>
 
+#include <system_error>
+
 #include "../config.hpp"
-#include "../input_error.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct cstream_reader
    {
-      namespace internal
+      explicit cstream_reader( std::FILE* s ) noexcept
+         : m_cstream( s )
+      {
+         assert( m_cstream != nullptr );
+      }
+
+      [[nodiscard]] std::size_t operator()( char* buffer, const std::size_t length )
       {
-         struct cstream_reader
-         {
-            explicit cstream_reader( std::FILE* s ) noexcept
-               : m_cstream( s )
-            {
-               assert( m_cstream != nullptr );
-            }
-
-            std::size_t operator()( char* buffer, const std::size_t length )
-            {
-               if( const auto r = std::fread( buffer, 1, length, m_cstream ) ) {
-                  return r;
-               }
-               if( std::feof( m_cstream ) != 0 ) {
-                  return 0;
-               }
-               // Please contact us if you know how to provoke the following exception.
-               // The example on cppreference.com doesn't work, at least not on macOS.
-               TAO_PEGTL_THROW_INPUT_ERROR( "error in fread() from cstream" );  // LCOV_EXCL_LINE
-            }
-
-            std::FILE* m_cstream;
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         if( const auto r = std::fread( buffer, 1, length, m_cstream ) ) {
+            return r;
+         }
+         if( std::feof( m_cstream ) != 0 ) {
+            return 0;
+         }
+
+         // Please contact us if you know how to provoke the following exception.
+         // The example on cppreference.com doesn't work, at least not on macOS.
+
+         // LCOV_EXCL_START
+         const auto ec = std::ferror( m_cstream );
+         assert( ec != 0 );
+         throw std::system_error( ec, std::system_category(), "fread() failed" );
+         // LCOV_EXCL_STOP
+      }
+
+      std::FILE* m_cstream;
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/cstring_reader.hpp b/packages/PEGTL/include/tao/pegtl/internal/cstring_reader.hpp
index e745921346421c109726752d63b9c5875e97f0ad..a1f2db454aeca30ddf8aef34f3d708310443f36d 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/cstring_reader.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/cstring_reader.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_CSTRING_READER_HPP
@@ -8,42 +8,33 @@
 #include <cstddef>
 
 #include "../config.hpp"
-#include "../input_error.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct cstring_reader
    {
-      namespace internal
+      explicit cstring_reader( const char* zero_terminated ) noexcept
+         : m_cstring( zero_terminated )
       {
-         struct cstring_reader
-         {
-            explicit cstring_reader( const char* zero_terminated ) noexcept
-               : m_cstring( zero_terminated )
-            {
-               assert( m_cstring != nullptr );
-            }
-
-            std::size_t operator()( char* buffer, const std::size_t length ) noexcept
-            {
-               std::size_t i = 0;
-               char c;
-
-               while( ( i < length ) && ( ( c = m_cstring[ i ] ) != 0 ) ) {
-                  *buffer++ = c;
-                  ++i;
-               }
-               m_cstring += i;
-               return i;
-            }
-
-            const char* m_cstring;
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         assert( m_cstring != nullptr );
+      }
+
+      [[nodiscard]] std::size_t operator()( char* buffer, const std::size_t length ) noexcept
+      {
+         std::size_t i = 0;
+         char c;
+
+         while( ( i < length ) && ( ( c = m_cstring[ i ] ) != 0 ) ) {
+            *buffer++ = c;
+            ++i;
+         }
+         m_cstring += i;
+         return i;
+      }
+
+      const char* m_cstring;
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/demangle.hpp b/packages/PEGTL/include/tao/pegtl/internal/demangle.hpp
index 9795f71dc3539b066307e5b371ca1e71ceb12601..07e55b837065e3314fbf168805a29eed39d08310 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/demangle.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/demangle.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_DEMANGLE_HPP
@@ -9,34 +9,20 @@
 
 #include "../config.hpp"
 
-#if defined( __GLIBCXX__ )
+#if defined( __GLIBCXX__ ) || ( defined( __has_include ) && __has_include( <cxxabi.h> ) )
 #include "demangle_cxxabi.hpp"
-#elif defined( __has_include )
-#if __has_include( <cxxabi.h> )
-#include "demangle_cxxabi.hpp"
-#else
-#include "demangle_nop.hpp"
-#endif
 #else
 #include "demangle_nop.hpp"
 #endif
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename T >
+   [[nodiscard]] std::string demangle()
    {
-      namespace internal
-      {
-         template< typename T >
-         std::string demangle()
-         {
-            return demangle( typeid( T ).name() );
-         }
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+      return demangle( typeid( T ).name() );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/demangle_cxxabi.hpp b/packages/PEGTL/include/tao/pegtl/internal/demangle_cxxabi.hpp
index e5ecbf908b7ad59913657caccd0f848fa0231dea..a7e5bc7bb16466c6b3c75bdece882e49a33a2661 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/demangle_cxxabi.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/demangle_cxxabi.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_DEMANGLE_CXXABI_HPP
@@ -13,29 +13,21 @@
 
 #include "demangle_sanitise.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   [[nodiscard]] inline std::string demangle( const char* symbol )
    {
-      namespace internal
-      {
-         inline std::string demangle( const char* symbol )
-         {
-            const std::unique_ptr< char, decltype( &std::free ) > demangled( abi::__cxa_demangle( symbol, nullptr, nullptr, nullptr ), &std::free );
-            if( !demangled ) {
-               return symbol;
-            }
-            std::string result( demangled.get() );
-#ifdef TAO_PEGTL_PRETTY_DEMANGLE
-            demangle_sanitise_chars( result );  // LCOV_EXCL_LINE
+      const std::unique_ptr< char, decltype( &std::free ) > demangled( abi::__cxa_demangle( symbol, nullptr, nullptr, nullptr ), &std::free );
+      if( !demangled ) {
+         return symbol;
+      }
+      std::string result( demangled.get() );
+#if defined( TAO_PEGTL_PRETTY_DEMANGLE )
+      demangle_sanitise_chars( result );  // LCOV_EXCL_LINE
 #endif
-            return result;
-         }
+      return result;
+   }
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/demangle_nop.hpp b/packages/PEGTL/include/tao/pegtl/internal/demangle_nop.hpp
index fe72b88b3a807fec8026954056d7d9de4a11e44a..b178f040cae75662b753751ad95dc6580a82391b 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/demangle_nop.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/demangle_nop.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_DEMANGLE_NOP_HPP
@@ -8,21 +8,13 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   [[nodiscard]] inline std::string demangle( const char* symbol )
    {
-      namespace internal
-      {
-         inline std::string demangle( const char* symbol )
-         {
-            return symbol;
-         }
+      return symbol;
+   }
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/demangle_sanitise.hpp b/packages/PEGTL/include/tao/pegtl/internal/demangle_sanitise.hpp
index 7dfb599561711696d9f853f073479b93a8b8b9fd..47f7549c6540e32bbb5ef24f01010315885c37f6 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/demangle_sanitise.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/demangle_sanitise.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_DEMANGLE_SANITISE_HPP
@@ -8,41 +8,33 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   inline void demangle_sanitise_chars( std::string& s )
    {
-      namespace internal
-      {
-         inline void demangle_sanitise_chars( std::string& s )
-         {
-            std::string::size_type p;
-            while( ( p = s.find( "(char)" ) ) != std::string::npos ) {
-               int c = 0;
-               std::string::size_type q;
-               for( q = p + 6; ( q < s.size() ) && ( s[ q ] >= '0' ) && ( s[ q ] <= '9' ); ++q ) {
-                  c *= 10;
-                  c += s[ q ] - '0';
-               }
-               if( c == '\'' ) {
-                  s.replace( p, q - p, "'\\''" );
-               }
-               else if( c == '\\' ) {
-                  s.replace( p, q - p, "'\\\\'" );
-               }
-               else if( ( c < 32 ) || ( c > 126 ) ) {
-                  s.replace( p, 6, std::string() );
-               }
-               else {
-                  s.replace( p, q - p, std::string( 1, '\'' ) + char( c ) + '\'' );
-               }
-            }
+      std::string::size_type p;
+      while( ( p = s.find( "(char)" ) ) != std::string::npos ) {
+         int c = 0;
+         std::string::size_type q;
+         for( q = p + 6; ( q < s.size() ) && ( s[ q ] >= '0' ) && ( s[ q ] <= '9' ); ++q ) {
+            c *= 10;
+            c += s[ q ] - '0';
          }
+         if( c == '\'' ) {
+            s.replace( p, q - p, "'\\''" );
+         }
+         else if( c == '\\' ) {
+            s.replace( p, q - p, "'\\\\'" );
+         }
+         else if( ( c < 32 ) || ( c > 126 ) ) {
+            s.replace( p, 6, std::string() );
+         }
+         else {
+            s.replace( p, q - p, std::string( 1, '\'' ) + char( c ) + '\'' );
+         }
+      }
+   }
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/disable.hpp b/packages/PEGTL/include/tao/pegtl/internal/disable.hpp
index 90ae99b31cc5a2909e1db13c7c14bfd458512e87..10e878d31f0378867c564a789065f41c4eb6a0b3 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/disable.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/disable.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_DISABLE_HPP
@@ -15,38 +15,30 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   struct disable
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::seq, Rules... >;
+
+      template< apply_mode,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< typename... Rules >
-         struct disable
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, Rules... >;
-
-            template< apply_mode,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return duseltronik< seq< Rules... >, apply_mode::NOTHING, M, Action, Control >::match( in, st... );
-            }
-         };
-
-         template< typename... Rules >
-         struct skip_control< disable< Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         return duseltronik< seq< Rules... >, apply_mode::nothing, M, Action, Control >::match( in, st... );
+      }
+   };
+
+   template< typename... Rules >
+   inline constexpr bool skip_control< disable< Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/discard.hpp b/packages/PEGTL/include/tao/pegtl/internal/discard.hpp
index 89cb2f16c1e95bfa7c1fb0e8e9f28ba577ae3cd0..ffd5ff431fc9136f67ee056a570798e4ecbdb06b 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/discard.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/discard.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_DISCARD_HPP
@@ -10,34 +10,24 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct discard
    {
-      namespace internal
-      {
-         struct discard
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT >;
-
-            template< typename Input >
-            static bool match( Input& in ) noexcept
-            {
-               static_assert( noexcept( in.discard() ), "an input's discard()-method must be noexcept" );
-               in.discard();
-               return true;
-            }
-         };
+      using analyze_t = analysis::generic< analysis::rule_type::opt >;
 
-         template<>
-         struct skip_control< discard > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept
+      {
+         static_assert( noexcept( in.discard() ) );
+         in.discard();
+         return true;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template<>
+   inline constexpr bool skip_control< discard > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/dusel_mode.hpp b/packages/PEGTL/include/tao/pegtl/internal/dusel_mode.hpp
index 9fc7a58d602b30241ccc0d9e89eeecaa3a95deb9..3a40eba3a67545802215919a84642b7143c9a96f 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/dusel_mode.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/dusel_mode.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_DUSEL_MODE_HPP
@@ -6,22 +6,18 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   enum class dusel_mode : char
    {
-      enum class dusel_mode : char
-      {
-         NOTHING = 0,
-         CONTROL = 1,
-         CONTROL_AND_APPLY_VOID = 2,
-         CONTROL_AND_APPLY_BOOL = 3,
-         CONTROL_AND_APPLY0_VOID = 4,
-         CONTROL_AND_APPLY0_BOOL = 5
-      };
+      nothing = 0,
+      control = 1,
+      control_and_apply_void = 2,
+      control_and_apply_bool = 3,
+      control_and_apply0_void = 4,
+      control_and_apply0_bool = 5
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/duseltronik.hpp b/packages/PEGTL/include/tao/pegtl/internal/duseltronik.hpp
index 20099a477e760cb4144b205cc896d0d9bc908411..6f1ca814e076e1d2f5dcf3ecee80622b4ea33059 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/duseltronik.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/duseltronik.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_DUSELTRONIK_HPP
@@ -10,165 +10,169 @@
 
 #include "dusel_mode.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control,
+             dusel_mode = dusel_mode::nothing >
+   struct duseltronik;
+
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control >
+   struct duseltronik< Rule, A, M, Action, Control, dusel_mode::nothing >
    {
-      namespace internal
+      template< typename Input, typename... States >
+      [[nodiscard]] static auto match( Input& in, States&&... st )
+         -> decltype( Rule::template match< A, M, Action, Control >( in, st... ) )
       {
-         template< typename Rule,
-                   apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control,
-                   dusel_mode = dusel_mode::NOTHING >
-         struct duseltronik;
-
-         template< typename Rule,
-                   apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control >
-         struct duseltronik< Rule, A, M, Action, Control, dusel_mode::NOTHING >
-         {
-            template< typename Input, typename... States >
-            static auto match( Input& in, States&&... st )
-               -> decltype( Rule::template match< A, M, Action, Control >( in, st... ), true )
-            {
-               return Rule::template match< A, M, Action, Control >( in, st... );
-            }
+         return Rule::template match< A, M, Action, Control >( in, st... );
+      }
 
-            // NOTE: The additional "int = 0" is a work-around for missing expression SFINAE in VS2015.
+      template< typename Input, typename... States, int = 1 >
+      [[nodiscard]] static auto match( Input& in, States&&... /*unused*/ )
+         -> decltype( Rule::match( in ) )
+      {
+         return Rule::match( in );
+      }
+   };
+
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control >
+   struct duseltronik< Rule, A, M, Action, Control, dusel_mode::control >
+   {
+      template< typename Input, typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         Control< Rule >::start( static_cast< const Input& >( in ), st... );
+
+         if( duseltronik< Rule, A, M, Action, Control, dusel_mode::nothing >::match( in, st... ) ) {
+            Control< Rule >::success( static_cast< const Input& >( in ), st... );
+            return true;
+         }
+         Control< Rule >::failure( static_cast< const Input& >( in ), st... );
+         return false;
+      }
+   };
+
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control >
+   struct duseltronik< Rule, A, M, Action, Control, dusel_mode::control_and_apply_void >
+   {
+      template< typename Input, typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         auto m = in.template mark< rewind_mode::required >();
+
+         Control< Rule >::start( static_cast< const Input& >( in ), st... );
+
+         if( duseltronik< Rule, A, rewind_mode::active, Action, Control, dusel_mode::nothing >::match( in, st... ) ) {
+            Control< Rule >::template apply< Action >( m.iterator(), static_cast< const Input& >( in ), st... );
+            Control< Rule >::success( static_cast< const Input& >( in ), st... );
+            return m( true );
+         }
+         Control< Rule >::failure( static_cast< const Input& >( in ), st... );
+         return false;
+      }
+   };
+
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control >
+   struct duseltronik< Rule, A, M, Action, Control, dusel_mode::control_and_apply_bool >
+   {
+      template< typename Input, typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         auto m = in.template mark< rewind_mode::required >();
 
-            template< typename Input, typename... States, int = 0 >
-            static auto match( Input& in, States&&... /*unused*/ )
-               -> decltype( Rule::match( in ), true )
-            {
-               return Rule::match( in );
-            }
-         };
-
-         template< typename Rule,
-                   apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control >
-         struct duseltronik< Rule, A, M, Action, Control, dusel_mode::CONTROL >
-         {
-            template< typename Input, typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               Control< Rule >::start( static_cast< const Input& >( in ), st... );
-
-               if( duseltronik< Rule, A, M, Action, Control, dusel_mode::NOTHING >::match( in, st... ) ) {
-                  Control< Rule >::success( static_cast< const Input& >( in ), st... );
-                  return true;
-               }
-               Control< Rule >::failure( static_cast< const Input& >( in ), st... );
-               return false;
-            }
-         };
-
-         template< typename Rule,
-                   apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control >
-         struct duseltronik< Rule, A, M, Action, Control, dusel_mode::CONTROL_AND_APPLY_VOID >
-         {
-            template< typename Input, typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< rewind_mode::REQUIRED >();
-
-               Control< Rule >::start( static_cast< const Input& >( in ), st... );
-
-               if( duseltronik< Rule, A, rewind_mode::ACTIVE, Action, Control, dusel_mode::NOTHING >::match( in, st... ) ) {
-                  Control< Rule >::template apply< Action >( m.iterator(), static_cast< const Input& >( in ), st... );
-                  Control< Rule >::success( static_cast< const Input& >( in ), st... );
-                  return m( true );
-               }
-               Control< Rule >::failure( static_cast< const Input& >( in ), st... );
-               return false;
-            }
-         };
-
-         template< typename Rule,
-                   apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control >
-         struct duseltronik< Rule, A, M, Action, Control, dusel_mode::CONTROL_AND_APPLY_BOOL >
-         {
-            template< typename Input, typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< rewind_mode::REQUIRED >();
-
-               Control< Rule >::start( static_cast< const Input& >( in ), st... );
-
-               if( duseltronik< Rule, A, rewind_mode::ACTIVE, Action, Control, dusel_mode::NOTHING >::match( in, st... ) ) {
-                  if( Control< Rule >::template apply< Action >( m.iterator(), static_cast< const Input& >( in ), st... ) ) {
-                     Control< Rule >::success( static_cast< const Input& >( in ), st... );
-                     return m( true );
-                  }
-               }
-               Control< Rule >::failure( static_cast< const Input& >( in ), st... );
-               return false;
-            }
-         };
-
-         template< typename Rule,
-                   apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control >
-         struct duseltronik< Rule, A, M, Action, Control, dusel_mode::CONTROL_AND_APPLY0_VOID >
-         {
-            template< typename Input, typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               Control< Rule >::start( static_cast< const Input& >( in ), st... );
-
-               if( duseltronik< Rule, A, M, Action, Control, dusel_mode::NOTHING >::match( in, st... ) ) {
-                  Control< Rule >::template apply0< Action >( static_cast< const Input& >( in ), st... );
-                  Control< Rule >::success( static_cast< const Input& >( in ), st... );
-                  return true;
-               }
-               Control< Rule >::failure( static_cast< const Input& >( in ), st... );
-               return false;
-            }
-         };
-
-         template< typename Rule,
-                   apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control >
-         struct duseltronik< Rule, A, M, Action, Control, dusel_mode::CONTROL_AND_APPLY0_BOOL >
-         {
-            template< typename Input, typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< rewind_mode::REQUIRED >();
-
-               Control< Rule >::start( static_cast< const Input& >( in ), st... );
-
-               if( duseltronik< Rule, A, rewind_mode::ACTIVE, Action, Control, dusel_mode::NOTHING >::match( in, st... ) ) {
-                  if( Control< Rule >::template apply0< Action >( static_cast< const Input& >( in ), st... ) ) {
-                     Control< Rule >::success( static_cast< const Input& >( in ), st... );
-                     return m( true );
-                  }
-               }
-               Control< Rule >::failure( static_cast< const Input& >( in ), st... );
-               return false;
+         Control< Rule >::start( static_cast< const Input& >( in ), st... );
+
+         if( duseltronik< Rule, A, rewind_mode::active, Action, Control, dusel_mode::nothing >::match( in, st... ) ) {
+            if( Control< Rule >::template apply< Action >( m.iterator(), static_cast< const Input& >( in ), st... ) ) {
+               Control< Rule >::success( static_cast< const Input& >( in ), st... );
+               return m( true );
             }
-         };
+         }
+         Control< Rule >::failure( static_cast< const Input& >( in ), st... );
+         return false;
+      }
+   };
+
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control >
+   struct duseltronik< Rule, A, M, Action, Control, dusel_mode::control_and_apply0_void >
+   {
+      template< typename Input, typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         Control< Rule >::start( static_cast< const Input& >( in ), st... );
+
+         if( duseltronik< Rule, A, M, Action, Control, dusel_mode::nothing >::match( in, st... ) ) {
+            Control< Rule >::template apply0< Action >( static_cast< const Input& >( in ), st... );
+            Control< Rule >::success( static_cast< const Input& >( in ), st... );
+            return true;
+         }
+         Control< Rule >::failure( static_cast< const Input& >( in ), st... );
+         return false;
+      }
+   };
+
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control >
+   struct duseltronik< Rule, A, M, Action, Control, dusel_mode::control_and_apply0_bool >
+   {
+      template< typename Input, typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         auto m = in.template mark< rewind_mode::required >();
 
-      }  // namespace internal
+         Control< Rule >::start( static_cast< const Input& >( in ), st... );
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+         if( duseltronik< Rule, A, rewind_mode::active, Action, Control, dusel_mode::nothing >::match( in, st... ) ) {
+            if( Control< Rule >::template apply0< Action >( static_cast< const Input& >( in ), st... ) ) {
+               Control< Rule >::success( static_cast< const Input& >( in ), st... );
+               return m( true );
+            }
+         }
+         Control< Rule >::failure( static_cast< const Input& >( in ), st... );
+         return false;
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/enable.hpp b/packages/PEGTL/include/tao/pegtl/internal/enable.hpp
index da490c6efad9948a4f4c5fcfcb052ee45122b1e7..7da5fb80e519867f01fbdc84ec7c5af6c3e45bc7 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/enable.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/enable.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ENABLE_HPP
@@ -15,38 +15,30 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   struct enable
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::seq, Rules... >;
+
+      template< apply_mode,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< typename... Rules >
-         struct enable
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, Rules... >;
-
-            template< apply_mode,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return duseltronik< seq< Rules... >, apply_mode::ACTION, M, Action, Control >::match( in, st... );
-            }
-         };
-
-         template< typename... Rules >
-         struct skip_control< enable< Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         return duseltronik< seq< Rules... >, apply_mode::action, M, Action, Control >::match( in, st... );
+      }
+   };
+
+   template< typename... Rules >
+   inline constexpr bool skip_control< enable< Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/endian.hpp b/packages/PEGTL/include/tao/pegtl/internal/endian.hpp
index b70775cc78ffc9c8023da9cc67fd2bcba19bcbee..733248ec8bca5096607381cef98394d44738d9c8 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/endian.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/endian.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ENDIAN_HPP
@@ -15,56 +15,48 @@
 #include "endian_gcc.hpp"
 #endif
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename N >
+   [[nodiscard]] N h_to_be( const N n ) noexcept
    {
-      namespace internal
-      {
-         template< typename N >
-         N h_to_be( const N n ) noexcept
-         {
-            return N( to_and_from_be< sizeof( N ) >::convert( n ) );
-         }
+      return N( to_and_from_be< sizeof( N ) >::convert( n ) );
+   }
 
-         template< typename N >
-         N be_to_h( const N n ) noexcept
-         {
-            return h_to_be( n );
-         }
-
-         template< typename N >
-         N be_to_h( const void* p ) noexcept
-         {
-            N n;
-            std::memcpy( &n, p, sizeof( n ) );
-            return internal::be_to_h( n );
-         }
-
-         template< typename N >
-         N h_to_le( const N n ) noexcept
-         {
-            return N( to_and_from_le< sizeof( N ) >::convert( n ) );
-         }
+   template< typename N >
+   [[nodiscard]] N be_to_h( const N n ) noexcept
+   {
+      return h_to_be( n );
+   }
 
-         template< typename N >
-         N le_to_h( const N n ) noexcept
-         {
-            return h_to_le( n );
-         }
+   template< typename N >
+   [[nodiscard]] N be_to_h( const void* p ) noexcept
+   {
+      N n;
+      std::memcpy( &n, p, sizeof( n ) );
+      return internal::be_to_h( n );
+   }
 
-         template< typename N >
-         N le_to_h( const void* p ) noexcept
-         {
-            N n;
-            std::memcpy( &n, p, sizeof( n ) );
-            return internal::le_to_h( n );
-         }
+   template< typename N >
+   [[nodiscard]] N h_to_le( const N n ) noexcept
+   {
+      return N( to_and_from_le< sizeof( N ) >::convert( n ) );
+   }
 
-      }  // namespace internal
+   template< typename N >
+   [[nodiscard]] N le_to_h( const N n ) noexcept
+   {
+      return h_to_le( n );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename N >
+   [[nodiscard]] N le_to_h( const void* p ) noexcept
+   {
+      N n;
+      std::memcpy( &n, p, sizeof( n ) );
+      return internal::le_to_h( n );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/endian_gcc.hpp b/packages/PEGTL/include/tao/pegtl/internal/endian_gcc.hpp
index a8c514f8dd5d85b071b361ff7308bb64d97b3d50..0079e3de5bc63251e416015c825a02d4a962525e 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/endian_gcc.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/endian_gcc.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ENDIAN_GCC_HPP
@@ -7,103 +7,98 @@
 #include <cstdint>
 #include <cstring>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+#if !defined( __BYTE_ORDER__ )
+#error No byte order defined!
+#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+
+   template< unsigned S >
+   struct to_and_from_be
    {
-      namespace internal
+      template< typename T >
+      [[nodiscard]] static T convert( const T n ) noexcept
       {
+         return n;
+      }
+   };
 
-#if not defined( __BYTE_ORDER__ )
-#error No byte order defined!
-#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
+   template< unsigned S >
+   struct to_and_from_le;
+
+   template<>
+   struct to_and_from_le< 1 >
+   {
+      [[nodiscard]] static std::uint8_t convert( const std::uint8_t n ) noexcept
+      {
+         return n;
+      }
+
+      [[nodiscard]] static std::int8_t convert( const std::int8_t n ) noexcept
+      {
+         return n;
+      }
+   };
 
-         template< unsigned S >
-         struct to_and_from_be
-         {
-            template< typename T >
-            static T convert( const T n ) noexcept
-            {
-               return n;
-            }
-         };
-
-         template< unsigned S >
-         struct to_and_from_le;
-
-         template<>
-         struct to_and_from_le< 1 >
-         {
-            static std::uint8_t convert( const std::uint8_t n ) noexcept
-            {
-               return n;
-            }
-
-            static std::int8_t convert( const std::int8_t n ) noexcept
-            {
-               return n;
-            }
-         };
-
-         template<>
-         struct to_and_from_le< 2 >
-         {
-            static std::int16_t convert( const std::int16_t n ) noexcept
-            {
-               return __builtin_bswap16( n );
-            }
-
-            static std::uint16_t convert( const std::uint16_t n ) noexcept
-            {
-               return __builtin_bswap16( n );
-            }
-         };
-
-         template<>
-         struct to_and_from_le< 4 >
-         {
-            static float convert( float n ) noexcept
-            {
-               std::uint32_t u;
-               std::memcpy( &u, &n, 4 );
-               u = convert( u );
-               std::memcpy( &n, &u, 4 );
-               return n;
-            }
-
-            static std::int32_t convert( const std::int32_t n ) noexcept
-            {
-               return __builtin_bswap32( n );
-            }
-
-            static std::uint32_t convert( const std::uint32_t n ) noexcept
-            {
-               return __builtin_bswap32( n );
-            }
-         };
-
-         template<>
-         struct to_and_from_le< 8 >
-         {
-            static double convert( double n ) noexcept
-            {
-               std::uint64_t u;
-               std::memcpy( &u, &n, 8 );
-               u = convert( u );
-               std::memcpy( &n, &u, 8 );
-               return n;
-            }
-
-            static std::int64_t convert( const std::int64_t n ) noexcept
-            {
-               return __builtin_bswap64( n );
-            }
-
-            static std::uint64_t convert( const std::uint64_t n ) noexcept
-            {
-               return __builtin_bswap64( n );
-            }
-         };
+   template<>
+   struct to_and_from_le< 2 >
+   {
+      [[nodiscard]] static std::int16_t convert( const std::int16_t n ) noexcept
+      {
+         return __builtin_bswap16( n );
+      }
+
+      [[nodiscard]] static std::uint16_t convert( const std::uint16_t n ) noexcept
+      {
+         return __builtin_bswap16( n );
+      }
+   };
+
+   template<>
+   struct to_and_from_le< 4 >
+   {
+      [[nodiscard]] static float convert( float n ) noexcept
+      {
+         std::uint32_t u;
+         std::memcpy( &u, &n, 4 );
+         u = convert( u );
+         std::memcpy( &n, &u, 4 );
+         return n;
+      }
+
+      [[nodiscard]] static std::int32_t convert( const std::int32_t n ) noexcept
+      {
+         return __builtin_bswap32( n );
+      }
+
+      [[nodiscard]] static std::uint32_t convert( const std::uint32_t n ) noexcept
+      {
+         return __builtin_bswap32( n );
+      }
+   };
+
+   template<>
+   struct to_and_from_le< 8 >
+   {
+      [[nodiscard]] static double convert( double n ) noexcept
+      {
+         std::uint64_t u;
+         std::memcpy( &u, &n, 8 );
+         u = convert( u );
+         std::memcpy( &n, &u, 8 );
+         return n;
+      }
+
+      [[nodiscard]] static std::int64_t convert( const std::int64_t n ) noexcept
+      {
+         return __builtin_bswap64( n );
+      }
+
+      [[nodiscard]] static std::uint64_t convert( const std::uint64_t n ) noexcept
+      {
+         return __builtin_bswap64( n );
+      }
+   };
 
 #define TAO_PEGTL_NATIVE_ORDER be
 #define TAO_PEGTL_NATIVE_UTF16 utf16_be
@@ -111,92 +106,92 @@ namespace tao
 
 #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 
-         template< unsigned S >
-         struct to_and_from_le
-         {
-            template< typename T >
-            static T convert( const T n ) noexcept
-            {
-               return n;
-            }
-         };
-
-         template< unsigned S >
-         struct to_and_from_be;
-
-         template<>
-         struct to_and_from_be< 1 >
-         {
-            static std::int8_t convert( const std::int8_t n ) noexcept
-            {
-               return n;
-            }
-
-            static std::uint8_t convert( const std::uint8_t n ) noexcept
-            {
-               return n;
-            }
-         };
-
-         template<>
-         struct to_and_from_be< 2 >
-         {
-            static std::int16_t convert( const std::int16_t n ) noexcept
-            {
-               return __builtin_bswap16( n );
-            }
-
-            static std::uint16_t convert( const std::uint16_t n ) noexcept
-            {
-               return __builtin_bswap16( n );
-            }
-         };
-
-         template<>
-         struct to_and_from_be< 4 >
-         {
-            static float convert( float n ) noexcept
-            {
-               std::uint32_t u;
-               std::memcpy( &u, &n, 4 );
-               u = convert( u );
-               std::memcpy( &n, &u, 4 );
-               return n;
-            }
-
-            static std::int32_t convert( const std::int32_t n ) noexcept
-            {
-               return __builtin_bswap32( n );
-            }
-
-            static std::uint32_t convert( const std::uint32_t n ) noexcept
-            {
-               return __builtin_bswap32( n );
-            }
-         };
-
-         template<>
-         struct to_and_from_be< 8 >
-         {
-            static double convert( double n ) noexcept
-            {
-               std::uint64_t u;
-               std::memcpy( &u, &n, 8 );
-               u = convert( u );
-               std::memcpy( &n, &u, 8 );
-               return n;
-            }
-
-            static std::uint64_t convert( const std::uint64_t n ) noexcept
-            {
-               return __builtin_bswap64( n );
-            }
-
-            static std::int64_t convert( const std::int64_t n ) noexcept
-            {
-               return __builtin_bswap64( n );
-            }
-         };
+   template< unsigned S >
+   struct to_and_from_le
+   {
+      template< typename T >
+      [[nodiscard]] static T convert( const T n ) noexcept
+      {
+         return n;
+      }
+   };
+
+   template< unsigned S >
+   struct to_and_from_be;
+
+   template<>
+   struct to_and_from_be< 1 >
+   {
+      [[nodiscard]] static std::int8_t convert( const std::int8_t n ) noexcept
+      {
+         return n;
+      }
+
+      [[nodiscard]] static std::uint8_t convert( const std::uint8_t n ) noexcept
+      {
+         return n;
+      }
+   };
+
+   template<>
+   struct to_and_from_be< 2 >
+   {
+      [[nodiscard]] static std::int16_t convert( const std::int16_t n ) noexcept
+      {
+         return __builtin_bswap16( n );
+      }
+
+      [[nodiscard]] static std::uint16_t convert( const std::uint16_t n ) noexcept
+      {
+         return __builtin_bswap16( n );
+      }
+   };
+
+   template<>
+   struct to_and_from_be< 4 >
+   {
+      [[nodiscard]] static float convert( float n ) noexcept
+      {
+         std::uint32_t u;
+         std::memcpy( &u, &n, 4 );
+         u = convert( u );
+         std::memcpy( &n, &u, 4 );
+         return n;
+      }
+
+      [[nodiscard]] static std::int32_t convert( const std::int32_t n ) noexcept
+      {
+         return __builtin_bswap32( n );
+      }
+
+      [[nodiscard]] static std::uint32_t convert( const std::uint32_t n ) noexcept
+      {
+         return __builtin_bswap32( n );
+      }
+   };
+
+   template<>
+   struct to_and_from_be< 8 >
+   {
+      [[nodiscard]] static double convert( double n ) noexcept
+      {
+         std::uint64_t u;
+         std::memcpy( &u, &n, 8 );
+         u = convert( u );
+         std::memcpy( &n, &u, 8 );
+         return n;
+      }
+
+      [[nodiscard]] static std::uint64_t convert( const std::uint64_t n ) noexcept
+      {
+         return __builtin_bswap64( n );
+      }
+
+      [[nodiscard]] static std::int64_t convert( const std::int64_t n ) noexcept
+      {
+         return __builtin_bswap64( n );
+      }
+   };
 
 #define TAO_PEGTL_NATIVE_ORDER le
 #define TAO_PEGTL_NATIVE_UTF16 utf16_le
@@ -206,10 +201,6 @@ namespace tao
 #error Unknown host byte order!
 #endif
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/endian_win.hpp b/packages/PEGTL/include/tao/pegtl/internal/endian_win.hpp
index 6b89f5f9d9056a7af71bcf739a63f5e3bbba92a0..63e92ff2df667aa906679cd8a325fbdf33521250 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/endian_win.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/endian_win.hpp
@@ -1,115 +1,106 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ENDIAN_WIN_HPP
 #define TAO_PEGTL_INTERNAL_ENDIAN_WIN_HPP
 
 #include <cstdint>
+#include <cstdlib>
 #include <cstring>
 
-#include <stdlib.h>
-
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< unsigned S >
+   struct to_and_from_le
+   {
+      template< typename T >
+      [[nodiscard]] static T convert( const T t ) noexcept
+      {
+         return t;
+      }
+   };
+
+   template< unsigned S >
+   struct to_and_from_be;
+
+   template<>
+   struct to_and_from_be< 1 >
+   {
+      [[nodiscard]] static std::int8_t convert( const std::int8_t n ) noexcept
+      {
+         return n;
+      }
+
+      [[nodiscard]] static std::uint8_t convert( const std::uint8_t n ) noexcept
+      {
+         return n;
+      }
+   };
+
+   template<>
+   struct to_and_from_be< 2 >
+   {
+      [[nodiscard]] static std::int16_t convert( const std::int16_t n ) noexcept
+      {
+         return std::int16_t( _byteswap_ushort( std::uint16_t( n ) ) );
+      }
+
+      [[nodiscard]] static std::uint16_t convert( const std::uint16_t n ) noexcept
+      {
+         return _byteswap_ushort( n );
+      }
+   };
+
+   template<>
+   struct to_and_from_be< 4 >
    {
-      namespace internal
+      [[nodiscard]] static float convert( float n ) noexcept
       {
-         template< unsigned S >
-         struct to_and_from_le
-         {
-            template< typename T >
-            static T convert( const T t ) noexcept
-            {
-               return t;
-            }
-         };
-
-         template< unsigned S >
-         struct to_and_from_be;
-
-         template<>
-         struct to_and_from_be< 1 >
-         {
-            static std::int8_t convert( const std::int8_t n ) noexcept
-            {
-               return n;
-            }
-
-            static std::uint8_t convert( const std::uint8_t n ) noexcept
-            {
-               return n;
-            }
-         };
-
-         template<>
-         struct to_and_from_be< 2 >
-         {
-            static std::int16_t convert( const std::int16_t n ) noexcept
-            {
-               return std::int16_t( _byteswap_ushort( std::uint16_t( n ) ) );
-            }
-
-            static std::uint16_t convert( const std::uint16_t n ) noexcept
-            {
-               return _byteswap_ushort( n );
-            }
-         };
-
-         template<>
-         struct to_and_from_be< 4 >
-         {
-            static float convert( float n ) noexcept
-            {
-               std::uint32_t u;
-               std::memcpy( &u, &n, 4 );
-               u = convert( u );
-               std::memcpy( &n, &u, 4 );
-               return n;
-            }
-
-            static std::int32_t convert( const std::int32_t n ) noexcept
-            {
-               return std::int32_t( _byteswap_ulong( std::uint32_t( n ) ) );
-            }
-
-            static std::uint32_t convert( const std::uint32_t n ) noexcept
-            {
-               return _byteswap_ulong( n );
-            }
-         };
-
-         template<>
-         struct to_and_from_be< 8 >
-         {
-            static double convert( double n ) noexcept
-            {
-               std::uint64_t u;
-               std::memcpy( &u, &n, 8 );
-               u = convert( u );
-               std::memcpy( &n, &u, 8 );
-               return n;
-            }
-
-            static std::int64_t convert( const std::int64_t n ) noexcept
-            {
-               return std::int64_t( _byteswap_uint64( std::uint64_t( n ) ) );
-            }
-
-            static std::uint64_t convert( const std::uint64_t n ) noexcept
-            {
-               return _byteswap_uint64( n );
-            }
-         };
+         std::uint32_t u;
+         std::memcpy( &u, &n, 4 );
+         u = convert( u );
+         std::memcpy( &n, &u, 4 );
+         return n;
+      }
+
+      [[nodiscard]] static std::int32_t convert( const std::int32_t n ) noexcept
+      {
+         return std::int32_t( _byteswap_ulong( std::uint32_t( n ) ) );
+      }
+
+      [[nodiscard]] static std::uint32_t convert( const std::uint32_t n ) noexcept
+      {
+         return _byteswap_ulong( n );
+      }
+   };
+
+   template<>
+   struct to_and_from_be< 8 >
+   {
+      [[nodiscard]] static double convert( double n ) noexcept
+      {
+         std::uint64_t u;
+         std::memcpy( &u, &n, 8 );
+         u = convert( u );
+         std::memcpy( &n, &u, 8 );
+         return n;
+      }
+
+      [[nodiscard]] static std::int64_t convert( const std::int64_t n ) noexcept
+      {
+         return std::int64_t( _byteswap_uint64( std::uint64_t( n ) ) );
+      }
+
+      [[nodiscard]] static std::uint64_t convert( const std::uint64_t n ) noexcept
+      {
+         return _byteswap_uint64( n );
+      }
+   };
 
 #define TAO_PEGTL_NATIVE_ORDER le
 #define TAO_PEGTL_NATIVE_UTF16 utf16_le
 #define TAO_PEGTL_NATIVE_UTF32 utf32_le
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/eof.hpp b/packages/PEGTL/include/tao/pegtl/internal/eof.hpp
index 51ac283ca635d2b7befddecde742f3def6f8080c..bce5fe267066c5691a3d711e0b855b28e912fa47 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/eof.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/eof.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_EOF_HPP
@@ -10,32 +10,22 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct eof
    {
-      namespace internal
-      {
-         struct eof
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT >;
-
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.empty() ) )
-            {
-               return in.empty();
-            }
-         };
+      using analyze_t = analysis::generic< analysis::rule_type::opt >;
 
-         template<>
-         struct skip_control< eof > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.empty() ) )
+      {
+         return in.empty();
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template<>
+   inline constexpr bool skip_control< eof > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/eol.hpp b/packages/PEGTL/include/tao/pegtl/internal/eol.hpp
index 9aae616a7cdef4895e157cee08727c8a525f015d..d764bccc0238adcbaf703372da1e6d97dee135d0 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/eol.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/eol.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_EOL_HPP
@@ -10,32 +10,22 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct eol
    {
-      namespace internal
-      {
-         struct eol
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
-
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( Input::eol_t::match( in ) ) )
-            {
-               return Input::eol_t::match( in ).first;
-            }
-         };
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
 
-         template<>
-         struct skip_control< eol > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( Input::eol_t::match( in ) ) )
+      {
+         return Input::eol_t::match( in ).first;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template<>
+   inline constexpr bool skip_control< eol > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/eolf.hpp b/packages/PEGTL/include/tao/pegtl/internal/eolf.hpp
index 777b814b889fa8b529d881960c04daafa888888d..6e9299686812b07bf87110d06b11aa1078d4830a 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/eolf.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/eolf.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_EOLF_HPP
@@ -10,33 +10,23 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct eolf
    {
-      namespace internal
-      {
-         struct eolf
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT >;
-
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( Input::eol_t::match( in ) ) )
-            {
-               const auto p = Input::eol_t::match( in );
-               return p.first || ( !p.second );
-            }
-         };
+      using analyze_t = analysis::generic< analysis::rule_type::opt >;
 
-         template<>
-         struct skip_control< eolf > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( Input::eol_t::match( in ) ) )
+      {
+         const auto p = Input::eol_t::match( in );
+         return p.first || ( !p.second );
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template<>
+   inline constexpr bool skip_control< eolf > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/file_mapper_posix.hpp b/packages/PEGTL/include/tao/pegtl/internal/file_mapper_posix.hpp
index ef7ad8ee06fe5fc42cd72fd60107dd5e11880269..b639f052e214ba942a9dd8a58e91d02dd822a65b 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/file_mapper_posix.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/file_mapper_posix.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_FILE_MAPPER_POSIX_HPP
@@ -7,89 +7,77 @@
 #include <sys/mman.h>
 #include <unistd.h>
 
+#include <system_error>
+
 #include "../config.hpp"
 
 #include "file_opener.hpp"
 
-#include "../input_error.hpp"
-
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   class file_mapper
    {
-      namespace internal
+   public:
+      explicit file_mapper( const char* filename )
+         : file_mapper( file_opener( filename ) )
+      {
+      }
+
+      explicit file_mapper( const file_opener& reader )
+         : m_size( reader.size() ),
+           m_data( static_cast< const char* >( ::mmap( nullptr, m_size, PROT_READ, MAP_PRIVATE, reader.m_fd, 0 ) ) )
       {
-         class file_mapper
-         {
-         public:
-            explicit file_mapper( const char* filename )
-               : file_mapper( file_opener( filename ) )
-            {
-            }
-
-            explicit file_mapper( const file_opener& reader )
-               : m_size( reader.size() ),
-                 m_data( static_cast< const char* >(::mmap( nullptr, m_size, PROT_READ, MAP_PRIVATE, reader.m_fd, 0 ) ) )
-            {
-               if( ( m_size != 0 ) && ( intptr_t( m_data ) == -1 ) ) {
-                  TAO_PEGTL_THROW_INPUT_ERROR( "unable to mmap() file " << reader.m_source << " descriptor " << reader.m_fd );
-               }
-            }
-
-            file_mapper( const file_mapper& ) = delete;
-            file_mapper( file_mapper&& ) = delete;
-
-            ~file_mapper() noexcept
-            {
-               // Legacy C interface requires pointer-to-mutable but does not write through the pointer.
-               ::munmap( const_cast< char* >( m_data ), m_size );  // NOLINT
-            }
-
-            void operator=( const file_mapper& ) = delete;
-            void operator=( file_mapper&& ) = delete;
-
-            bool empty() const noexcept
-            {
-               return m_size == 0;
-            }
-
-            std::size_t size() const noexcept
-            {
-               return m_size;
-            }
-
-            using iterator = const char*;
-            using const_iterator = const char*;
-
-            iterator data() const noexcept
-            {
-               return m_data;
-            }
-
-            iterator begin() const noexcept
-            {
-               return m_data;
-            }
-
-            iterator end() const noexcept
-            {
-               return m_data + m_size;
-            }
-
-            std::string string() const
-            {
-               return std::string( m_data, m_size );
-            }
-
-         private:
-            const std::size_t m_size;
-            const char* const m_data;
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         if( ( m_size != 0 ) && ( intptr_t( m_data ) == -1 ) ) {
+            const auto ec = errno;
+            throw std::system_error( ec, std::system_category(), reader.m_source );
+         }
+      }
+
+      file_mapper( const file_mapper& ) = delete;
+      file_mapper( file_mapper&& ) = delete;
+
+      ~file_mapper() noexcept
+      {
+         // Legacy C interface requires pointer-to-mutable but does not write through the pointer.
+         ::munmap( const_cast< char* >( m_data ), m_size );  // NOLINT
+      }
+
+      void operator=( const file_mapper& ) = delete;
+      void operator=( file_mapper&& ) = delete;
+
+      [[nodiscard]] bool empty() const noexcept
+      {
+         return m_size == 0;
+      }
+
+      [[nodiscard]] std::size_t size() const noexcept
+      {
+         return m_size;
+      }
+
+      using iterator = const char*;
+      using const_iterator = const char*;
+
+      [[nodiscard]] iterator data() const noexcept
+      {
+         return m_data;
+      }
+
+      [[nodiscard]] iterator begin() const noexcept
+      {
+         return m_data;
+      }
+
+      [[nodiscard]] iterator end() const noexcept
+      {
+         return m_data + m_size;
+      }
+
+   private:
+      const std::size_t m_size;
+      const char* const m_data;
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/file_mapper_win32.hpp b/packages/PEGTL/include/tao/pegtl/internal/file_mapper_win32.hpp
index 0f4d8f2b6c0586227da0aa95b39495bb0fd88074..a705da097e7d887b29f30a298a3147d168d53634 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/file_mapper_win32.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/file_mapper_win32.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_FILE_MAPPER_WIN32_HPP
@@ -10,8 +10,8 @@
 #endif
 
 #if !defined( WIN32_LEAN_AND_MEAN )
-#define WIN32_MEAN_AND_LEAN
-#define TAO_PEGTL_WIN32_MEAN_AND_LEAN_WAS_DEFINED
+#define WIN32_LEAN_AND_MEAN
+#define TAO_PEGTL_WIN32_LEAN_AND_MEAN_WAS_DEFINED
 #endif
 
 #include <windows.h>
@@ -21,192 +21,199 @@
 #undef TAO_PEGTL_NOMINMAX_WAS_DEFINED
 #endif
 
-#if defined( TAO_PEGTL_WIN32_MEAN_AND_LEAN_WAS_DEFINED )
-#undef WIN32_MEAN_AND_LEAN
-#undef TAO_PEGTL_WIN32_MEAN_AND_LEAN_WAS_DEFINED
+#if defined( TAO_PEGTL_WIN32_LEAN_AND_MEAN_WAS_DEFINED )
+#undef WIN32_LEAN_AND_MEAN
+#undef TAO_PEGTL_WIN32_LEAN_AND_MEAN_WAS_DEFINED
 #endif
 
+#include <system_error>
+
 #include "../config.hpp"
-#include "../input_error.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct win32_file_opener
+   {
+      explicit win32_file_opener( const char* filename )
+         : m_source( filename ),
+           m_handle( open() )
+      {
+      }
+
+      win32_file_opener( const win32_file_opener& ) = delete;
+      win32_file_opener( win32_file_opener&& ) = delete;
+
+      ~win32_file_opener() noexcept
+      {
+         ::CloseHandle( m_handle );
+      }
+
+      void operator=( const win32_file_opener& ) = delete;
+      void operator=( win32_file_opener&& ) = delete;
+
+      [[nodiscard]] std::size_t size() const
+      {
+         LARGE_INTEGER size;
+         if( !::GetFileSizeEx( m_handle, &size ) ) {
+            const auto ec = ::GetLastError();
+            throw std::system_error( ec, std::system_category(), std::string( "GetFileSizeEx(): " ) + m_source );
+         }
+         return std::size_t( size.QuadPart );
+      }
+
+      const char* const m_source;
+      const HANDLE m_handle;
+
+   private:
+      [[nodiscard]] HANDLE open() const
+      {
+         SetLastError( 0 );
+         std::wstring ws( m_source, m_source + strlen( m_source ) );
+
+#if( _WIN32_WINNT >= 0x0602 )
+         const HANDLE handle = ::CreateFile2( ws.c_str(),
+                                              GENERIC_READ,
+                                              FILE_SHARE_READ,
+                                              OPEN_EXISTING,
+                                              nullptr );
+         if( handle != INVALID_HANDLE_VALUE ) {
+            return handle;
+         }
+         const auto ec = ::GetLastError();
+         throw std::system_error( ec, std::system_category(), std::string( "CreateFile2(): " ) + m_source );
+#else
+         const HANDLE handle = ::CreateFileW( ws.c_str(),
+                                              GENERIC_READ,
+                                              FILE_SHARE_READ,
+                                              nullptr,
+                                              OPEN_EXISTING,
+                                              FILE_ATTRIBUTE_NORMAL,
+                                              nullptr );
+         if( handle != INVALID_HANDLE_VALUE ) {
+            return handle;
+         }
+         const auto ec = ::GetLastError();
+         throw std::system_error( ec, std::system_category(), std::string( "CreateFileW(): " ) + m_source );
+#endif
+      }
+   };
+
+   struct win32_file_mapper
+   {
+      explicit win32_file_mapper( const char* filename )
+         : win32_file_mapper( win32_file_opener( filename ) )
+      {
+      }
+
+      explicit win32_file_mapper( const win32_file_opener& reader )
+         : m_size( reader.size() ),
+           m_handle( open( reader ) )
+      {
+      }
+
+      win32_file_mapper( const win32_file_mapper& ) = delete;
+      win32_file_mapper( win32_file_mapper&& ) = delete;
+
+      ~win32_file_mapper() noexcept
+      {
+         ::CloseHandle( m_handle );
+      }
+
+      void operator=( const win32_file_mapper& ) = delete;
+      void operator=( win32_file_mapper&& ) = delete;
+
+      const size_t m_size;
+      const HANDLE m_handle;
+
+   private:
+      [[nodiscard]] HANDLE open( const win32_file_opener& reader ) const
+      {
+         const uint64_t file_size = reader.size();
+         SetLastError( 0 );
+         // Use `CreateFileMappingW` because a) we're not specifying a
+         // mapping name, so the character type is of no consequence, and
+         // b) it's defined in `memoryapi.h`, unlike
+         // `CreateFileMappingA`(?!)
+         const HANDLE handle = ::CreateFileMappingW( reader.m_handle,
+                                                     nullptr,
+                                                     PAGE_READONLY,
+                                                     DWORD( file_size >> 32 ),
+                                                     DWORD( file_size & 0xffffffff ),
+                                                     nullptr );
+         if( handle != NULL || file_size == 0 ) {
+            return handle;
+         }
+         const auto ec = ::GetLastError();
+         throw std::system_error( ec, std::system_category(), std::string( "CreateFileMappingW(): " ) + reader.m_source );
+      }
+   };
+
+   class file_mapper
    {
-      namespace internal
-      {
-         struct win32_file_opener
-         {
-            explicit win32_file_opener( const char* filename )
-               : m_source( filename ),
-                 m_handle( open() )
-            {
-            }
-
-            win32_file_opener( const win32_file_opener& ) = delete;
-            win32_file_opener( win32_file_opener&& ) = delete;
-
-            ~win32_file_opener() noexcept
-            {
-               ::CloseHandle( m_handle );
-            }
-
-            void operator=( const win32_file_opener& ) = delete;
-            void operator=( win32_file_opener&& ) = delete;
-
-            std::size_t size() const
-            {
-               LARGE_INTEGER size;
-               if( !::GetFileSizeEx( m_handle, &size ) ) {
-                  TAO_PEGTL_THROW_INPUT_WIN32_ERROR( "unable to GetFileSizeEx() file " << m_source << " handle " << m_handle );
-               }
-               return std::size_t( size.QuadPart );
-            }
-
-            const char* const m_source;
-            const HANDLE m_handle;
-
-         private:
-            HANDLE open() const
-            {
-               SetLastError( 0 );
-               const HANDLE handle = ::CreateFileA( m_source,
-                                                    GENERIC_READ,
-                                                    FILE_SHARE_READ,
-                                                    nullptr,
-                                                    OPEN_EXISTING,
-                                                    FILE_ATTRIBUTE_NORMAL,
-                                                    nullptr );
-               if( handle != INVALID_HANDLE_VALUE ) {
-                  return handle;
-               }
-               TAO_PEGTL_THROW_INPUT_WIN32_ERROR( "unable to CreateFileA() file " << m_source << " for reading" );
-            }
-         };
-
-         struct win32_file_mapper
-         {
-            explicit win32_file_mapper( const char* filename )
-               : win32_file_mapper( win32_file_opener( filename ) )
-            {
-            }
-
-            explicit win32_file_mapper( const win32_file_opener& reader )
-               : m_size( reader.size() ),
-                 m_handle( open( reader ) )
-            {
-            }
-
-            win32_file_mapper( const win32_file_mapper& ) = delete;
-            win32_file_mapper( win32_file_mapper&& ) = delete;
-
-            ~win32_file_mapper() noexcept
-            {
-               ::CloseHandle( m_handle );
-            }
-
-            void operator=( const win32_file_mapper& ) = delete;
-            void operator=( win32_file_mapper&& ) = delete;
-
-            const size_t m_size;
-            const HANDLE m_handle;
-
-         private:
-            HANDLE open( const win32_file_opener& reader ) const
-            {
-               const uint64_t file_size = reader.size();
-               SetLastError( 0 );
-               // Use `CreateFileMappingW` because a) we're not specifying a
-               // mapping name, so the character type is of no consequence, and
-               // b) it's defined in `memoryapi.h`, unlike
-               // `CreateFileMappingA`(?!)
-               const HANDLE handle = ::CreateFileMappingW( reader.m_handle,
-                                                           nullptr,
-                                                           PAGE_READONLY,
-                                                           DWORD( file_size >> 32 ),
-                                                           DWORD( file_size & 0xffffffff ),
-                                                           nullptr );
-               if( handle != NULL || file_size == 0 ) {
-                  return handle;
-               }
-               TAO_PEGTL_THROW_INPUT_WIN32_ERROR( "unable to CreateFileMappingW() file " << reader.m_source << " for reading" );
-            }
-         };
-
-         class file_mapper
-         {
-         public:
-            explicit file_mapper( const char* filename )
-               : file_mapper( win32_file_mapper( filename ) )
-            {
-            }
-
-            explicit file_mapper( const win32_file_mapper& mapper )
-               : m_size( mapper.m_size ),
-                 m_data( static_cast< const char* const >(::MapViewOfFile( mapper.m_handle,
-                                                                           FILE_MAP_READ,
-                                                                           0,
-                                                                           0,
-                                                                           0 ) ) )
-            {
-               if( ( m_size != 0 ) && ( intptr_t( m_data ) == 0 ) ) {
-                  TAO_PEGTL_THROW_INPUT_WIN32_ERROR( "unable to MapViewOfFile() file mapping object with handle " << mapper.m_handle );
-               }
-            }
-
-            file_mapper( const file_mapper& ) = delete;
-            file_mapper( file_mapper&& ) = delete;
-
-            ~file_mapper() noexcept
-            {
-               ::UnmapViewOfFile( LPCVOID( m_data ) );
-            }
-
-            void operator=( const file_mapper& ) = delete;
-            void operator=( file_mapper&& ) = delete;
-
-            bool empty() const noexcept
-            {
-               return m_size == 0;
-            }
-
-            std::size_t size() const noexcept
-            {
-               return m_size;
-            }
-
-            using iterator = const char*;
-            using const_iterator = const char*;
-
-            iterator data() const noexcept
-            {
-               return m_data;
-            }
-
-            iterator begin() const noexcept
-            {
-               return m_data;
-            }
-
-            iterator end() const noexcept
-            {
-               return m_data + m_size;
-            }
-
-            std::string string() const
-            {
-               return std::string( m_data, m_size );
-            }
-
-         private:
-            const std::size_t m_size;
-            const char* const m_data;
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+   public:
+      explicit file_mapper( const char* filename )
+         : file_mapper( win32_file_mapper( filename ) )
+      {
+      }
+
+      explicit file_mapper( const win32_file_mapper& mapper )
+         : m_size( mapper.m_size ),
+           m_data( static_cast< const char* >( ::MapViewOfFile( mapper.m_handle,
+                                                                FILE_MAP_READ,
+                                                                0,
+                                                                0,
+                                                                0 ) ) )
+      {
+         if( ( m_size != 0 ) && ( intptr_t( m_data ) == 0 ) ) {
+            const auto ec = ::GetLastError();
+            throw std::system_error( ec, std::system_category(), "MapViewOfFile()" );
+         }
+      }
+
+      file_mapper( const file_mapper& ) = delete;
+      file_mapper( file_mapper&& ) = delete;
+
+      ~file_mapper() noexcept
+      {
+         ::UnmapViewOfFile( LPCVOID( m_data ) );
+      }
+
+      void operator=( const file_mapper& ) = delete;
+      void operator=( file_mapper&& ) = delete;
+
+      [[nodiscard]] bool empty() const noexcept
+      {
+         return m_size == 0;
+      }
+
+      [[nodiscard]] std::size_t size() const noexcept
+      {
+         return m_size;
+      }
+
+      using iterator = const char*;
+      using const_iterator = const char*;
+
+      [[nodiscard]] iterator data() const noexcept
+      {
+         return m_data;
+      }
+
+      [[nodiscard]] iterator begin() const noexcept
+      {
+         return m_data;
+      }
+
+      [[nodiscard]] iterator end() const noexcept
+      {
+         return m_data + m_size;
+      }
+
+   private:
+      const std::size_t m_size;
+      const char* const m_data;
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/file_opener.hpp b/packages/PEGTL/include/tao/pegtl/internal/file_opener.hpp
index 478f5fcb9d4bc68d4d493a499be3645dad3aac45..3ab1be783c3920eadd03513a0268ce58703662d4 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/file_opener.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/file_opener.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_FILE_OPENER_HPP
@@ -9,70 +9,64 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include <system_error>
 #include <utility>
 
 #include "../config.hpp"
-#include "../input_error.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct file_opener
    {
-      namespace internal
+      explicit file_opener( const char* filename )
+         : m_source( filename ),
+           m_fd( open() )
       {
-         struct file_opener
-         {
-            explicit file_opener( const char* filename )
-               : m_source( filename ),
-                 m_fd( open() )
-            {
-            }
+      }
 
-            file_opener( const file_opener& ) = delete;
-            file_opener( file_opener&& ) = delete;
+      file_opener( const file_opener& ) = delete;
+      file_opener( file_opener&& ) = delete;
 
-            ~file_opener() noexcept
-            {
-               ::close( m_fd );
-            }
+      ~file_opener() noexcept
+      {
+         ::close( m_fd );
+      }
 
-            void operator=( const file_opener& ) = delete;
-            void operator=( file_opener&& ) = delete;
+      void operator=( const file_opener& ) = delete;
+      void operator=( file_opener&& ) = delete;
 
-            std::size_t size() const
-            {
-               struct stat st;  // NOLINT
-               errno = 0;
-               if(::fstat( m_fd, &st ) < 0 ) {
-                  TAO_PEGTL_THROW_INPUT_ERROR( "unable to fstat() file " << m_source << " descriptor " << m_fd );
-               }
-               return std::size_t( st.st_size );
-            }
+      [[nodiscard]] std::size_t size() const
+      {
+         struct stat st;  // NOLINT
+         errno = 0;
+         if( ::fstat( m_fd, &st ) < 0 ) {
+            const auto ec = errno;
+            throw std::system_error( ec, std::system_category(), m_source );
+         }
+         return std::size_t( st.st_size );
+      }
 
-            const char* const m_source;
-            const int m_fd;
+      const char* const m_source;
+      const int m_fd;
 
-         private:
-            int open() const
-            {
-               errno = 0;
-               const int fd = ::open( m_source,  // NOLINT
-                                      O_RDONLY
-#ifdef O_CLOEXEC
-                                         | O_CLOEXEC
+   private:
+      [[nodiscard]] int open() const
+      {
+         errno = 0;
+         const int fd = ::open( m_source,  // NOLINT
+                                O_RDONLY
+#if defined( O_CLOEXEC )
+                                   | O_CLOEXEC
 #endif
-               );
-               if( fd >= 0 ) {
-                  return fd;
-               }
-               TAO_PEGTL_THROW_INPUT_ERROR( "unable to open() file " << m_source << " for reading" );
-            }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+         );
+         if( fd >= 0 ) {
+            return fd;
+         }
+         const auto ec = errno;
+         throw std::system_error( ec, std::system_category(), m_source );
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/file_reader.hpp b/packages/PEGTL/include/tao/pegtl/internal/file_reader.hpp
index 6d95f8b1fca4c2877588cc8b9a96acd06a54884d..5b48f4bb08b907f797d821c988538ae6adcbe243 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/file_reader.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/file_reader.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_FILE_READER_HPP
@@ -7,103 +7,108 @@
 #include <cstdio>
 #include <memory>
 #include <string>
+#include <system_error>
 #include <utility>
 
 #include "../config.hpp"
-#include "../input_error.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   [[nodiscard]] inline std::FILE* file_open( const char* filename )
    {
-      namespace internal
-      {
-         inline std::FILE* file_open( const char* filename )
-         {
-            errno = 0;
+      errno = 0;
 #if defined( _MSC_VER )
-            std::FILE* file;
-            if(::fopen_s( &file, filename, "rb" ) == 0 )
+      std::FILE* file;
+      if( ::fopen_s( &file, filename, "rb" ) == 0 )
 #elif defined( __MINGW32__ )
-            if( auto* file = std::fopen( filename, "rb" ) )  // NOLINT(cppcoreguidelines-owning-memory)
+      if( auto* file = std::fopen( filename, "rb" ) )  // NOLINT(cppcoreguidelines-owning-memory)
 #else
-            if( auto* file = std::fopen( filename, "rbe" ) )  // NOLINT(cppcoreguidelines-owning-memory)
+      if( auto* file = std::fopen( filename, "rbe" ) )  // NOLINT(cppcoreguidelines-owning-memory)
 #endif
-            {
-               return file;
-            }
-            TAO_PEGTL_THROW_INPUT_ERROR( "unable to fopen() file " << filename << " for reading" );
-         }
-
-         struct file_close
-         {
-            void operator()( FILE* f ) const noexcept
-            {
-               std::fclose( f );  // NOLINT(cppcoreguidelines-owning-memory)
-            }
-         };
-
-         class file_reader
-         {
-         public:
-            explicit file_reader( const char* filename )
-               : m_source( filename ),
-                 m_file( file_open( m_source ) )
-            {
-            }
+      {
+         return file;
+      }
+      const auto ec = errno;
+      throw std::system_error( ec, std::system_category(), filename );
+   }
 
-            file_reader( FILE* file, const char* filename ) noexcept
-               : m_source( filename ),
-                 m_file( file )
-            {
-            }
+   struct file_close
+   {
+      void operator()( FILE* f ) const noexcept
+      {
+         std::fclose( f );  // NOLINT(cppcoreguidelines-owning-memory)
+      }
+   };
 
-            file_reader( const file_reader& ) = delete;
-            file_reader( file_reader&& ) = delete;
+   class file_reader
+   {
+   public:
+      explicit file_reader( const char* filename )
+         : m_source( filename ),
+           m_file( file_open( m_source ) )
+      {
+      }
 
-            ~file_reader() = default;
+      file_reader( FILE* file, const char* filename ) noexcept
+         : m_source( filename ),
+           m_file( file )
+      {
+      }
 
-            void operator=( const file_reader& ) = delete;
-            void operator=( file_reader&& ) = delete;
+      file_reader( const file_reader& ) = delete;
+      file_reader( file_reader&& ) = delete;
 
-            std::size_t size() const
-            {
-               errno = 0;
-               if( std::fseek( m_file.get(), 0, SEEK_END ) != 0 ) {
-                  TAO_PEGTL_THROW_INPUT_ERROR( "unable to fseek() to end of file " << m_source );  // LCOV_EXCL_LINE
-               }
-               errno = 0;
-               const auto s = std::ftell( m_file.get() );
-               if( s < 0 ) {
-                  TAO_PEGTL_THROW_INPUT_ERROR( "unable to ftell() file size of file " << m_source );  // LCOV_EXCL_LINE
-               }
-               errno = 0;
-               if( std::fseek( m_file.get(), 0, SEEK_SET ) != 0 ) {
-                  TAO_PEGTL_THROW_INPUT_ERROR( "unable to fseek() to beginning of file " << m_source );  // LCOV_EXCL_LINE
-               }
-               return std::size_t( s );
-            }
+      ~file_reader() = default;
 
-            std::string read() const
-            {
-               std::string nrv;
-               nrv.resize( size() );
-               errno = 0;
-               if( !nrv.empty() && ( std::fread( &nrv[ 0 ], nrv.size(), 1, m_file.get() ) != 1 ) ) {
-                  TAO_PEGTL_THROW_INPUT_ERROR( "unable to fread() file " << m_source << " size " << nrv.size() );  // LCOV_EXCL_LINE
-               }
-               return nrv;
-            }
+      void operator=( const file_reader& ) = delete;
+      void operator=( file_reader&& ) = delete;
 
-         private:
-            const char* const m_source;
-            const std::unique_ptr< std::FILE, file_close > m_file;
-         };
+      [[nodiscard]] std::size_t size() const
+      {
+         errno = 0;
+         if( std::fseek( m_file.get(), 0, SEEK_END ) != 0 ) {
+            // LCOV_EXCL_START
+            const auto ec = errno;
+            throw std::system_error( ec, std::system_category(), m_source );
+            // LCOV_EXCL_STOP
+         }
+         errno = 0;
+         const auto s = std::ftell( m_file.get() );
+         if( s < 0 ) {
+            // LCOV_EXCL_START
+            const auto ec = errno;
+            throw std::system_error( ec, std::system_category(), m_source );
+            // LCOV_EXCL_STOP
+         }
+         errno = 0;
+         if( std::fseek( m_file.get(), 0, SEEK_SET ) != 0 ) {
+            // LCOV_EXCL_START
+            const auto ec = errno;
+            throw std::system_error( ec, std::system_category(), m_source );
+            // LCOV_EXCL_STOP
+         }
+         return std::size_t( s );
+      }
 
-      }  // namespace internal
+      [[nodiscard]] std::string read() const
+      {
+         std::string nrv;
+         nrv.resize( size() );
+         errno = 0;
+         if( !nrv.empty() && ( std::fread( &nrv[ 0 ], nrv.size(), 1, m_file.get() ) != 1 ) ) {
+            // LCOV_EXCL_START
+            const auto ec = errno;
+            throw std::system_error( ec, std::system_category(), m_source );
+            // LCOV_EXCL_STOP
+         }
+         return nrv;
+      }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   private:
+      const char* const m_source;
+      const std::unique_ptr< std::FILE, file_close > m_file;
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/has_apply.hpp b/packages/PEGTL/include/tao/pegtl/internal/has_apply.hpp
index 4a4f8db280f4ae631980c955f8d076fdde9e2f18..2c91aed89df884df58e26578dc63061491bccc84 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/has_apply.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/has_apply.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_HAS_APPLY_HPP
@@ -8,26 +8,18 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename, typename, typename... >
-         struct has_apply : std::false_type
-         {
-         };
+   template< typename, typename, template< typename... > class, typename... >
+   struct has_apply
+      : std::false_type
+   {};
 
-         template< typename A, typename... S >
-         struct has_apply< A, decltype( A::apply( std::declval< S >()... ) ), S... > : std::true_type
-         {
-         };
+   template< typename C, template< typename... > class Action, typename... S >
+   struct has_apply< C, decltype( C::template apply< Action >( std::declval< S >()... ) ), Action, S... >
+      : std::true_type
+   {};
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/has_apply0.hpp b/packages/PEGTL/include/tao/pegtl/internal/has_apply0.hpp
index 6b1e486d9ba6b9ddc9da90cecc9abd66653f85fe..b2319e8cef2e919f217dcdeb9ed8fc819bdb1832 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/has_apply0.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/has_apply0.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_HAS_APPLY0_HPP
@@ -8,26 +8,18 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename, typename, typename... >
-         struct has_apply0 : std::false_type
-         {
-         };
+   template< typename, typename, template< typename... > class, typename... >
+   struct has_apply0
+      : std::false_type
+   {};
 
-         template< typename A, typename... S >
-         struct has_apply0< A, decltype( A::apply0( std::declval< S >()... ) ), S... > : std::true_type
-         {
-         };
+   template< typename C, template< typename... > class Action, typename... S >
+   struct has_apply0< C, decltype( C::template apply0< Action >( std::declval< S >()... ) ), Action, S... >
+      : std::true_type
+   {};
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/has_match.hpp b/packages/PEGTL/include/tao/pegtl/internal/has_match.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..08186d622838fb105edb03ec16c77f760df67649
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/internal/has_match.hpp
@@ -0,0 +1,56 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_INTERNAL_HAS_MATCH_HPP
+#define TAO_PEGTL_INTERNAL_HAS_MATCH_HPP
+
+#include <type_traits>
+#include <utility>
+
+#include "../apply_mode.hpp"
+#include "../config.hpp"
+#include "../rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE::internal
+{
+   template< typename,
+             typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control,
+             typename Input,
+             typename... States >
+   struct has_match
+      : std::false_type
+   {};
+
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control,
+             typename Input,
+             typename... States >
+   struct has_match< decltype( (void)Action< Rule >::template match< Rule, A, M, Action, Control >( std::declval< Input& >(), std::declval< States&& >()... ), void() ), Rule, A, M, Action, Control, Input, States... >
+      : std::true_type
+   {};
+
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control,
+             typename Input,
+             typename... States >
+   inline constexpr bool has_match_v = has_match< void, Rule, A, M, Action, Control, Input, States... >::value;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/identifier.hpp b/packages/PEGTL/include/tao/pegtl/internal/identifier.hpp
index 59f62188fcb005249e20ad2d8d69864bdc8227a7..ce666df2b97a4c85f22ff3ca72bfd6c926af95ed 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/identifier.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/identifier.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_IDENTIFIER_HPP
@@ -11,20 +11,12 @@
 #include "seq.hpp"
 #include "star.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         using identifier_first = ranges< peek_char, 'a', 'z', 'A', 'Z', '_' >;
-         using identifier_other = ranges< peek_char, 'a', 'z', 'A', 'Z', '0', '9', '_' >;
-         using identifier = seq< identifier_first, star< identifier_other > >;
+   using identifier_first = ranges< peek_char, 'a', 'z', 'A', 'Z', '_' >;
+   using identifier_other = ranges< peek_char, 'a', 'z', 'A', 'Z', '0', '9', '_' >;
+   using identifier = seq< identifier_first, star< identifier_other > >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/if_apply.hpp b/packages/PEGTL/include/tao/pegtl/internal/if_apply.hpp
index 58d0e97ab2474db403e006621a90317397099e65..342d94447f00ff27bb5e31761cf087cadaeefd17 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/if_apply.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/if_apply.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_IF_APPLY_HPP
@@ -13,98 +13,41 @@
 #include "../apply_mode.hpp"
 #include "../rewind_mode.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule, typename... Actions >
+   struct if_apply
    {
-      namespace internal
+      using analyze_t = typename Rule::analyze_t;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< apply_mode A, typename Rule, typename... Actions >
-         struct if_apply_impl;
-
-         template< typename Rule >
-         struct if_apply_impl< apply_mode::ACTION, Rule >
-         {
-            template< rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return Control< Rule >::template match< apply_mode::ACTION, M, Action, Control >( in, st... );
-            }
-         };
-
-         template< typename Rule, typename... Actions >
-         struct if_apply_impl< apply_mode::ACTION, Rule, Actions... >
-         {
-            template< rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               using action_t = typename Input::action_t;
-
-               auto m = in.template mark< rewind_mode::REQUIRED >();
-
-               if( Control< Rule >::template match< apply_mode::ACTION, rewind_mode::ACTIVE, Action, Control >( in, st... ) ) {
-                  const action_t i2( m.iterator(), in );
-#ifdef __cpp_fold_expressions
-                  return m( ( apply_single< Actions >::match( i2, st... ) && ... ) );
-#else
-                  bool result = true;
-                  using swallow = bool[];
-                  (void)swallow{ result = result && apply_single< Actions >::match( i2, st... )... };
-                  return m( result );
-#endif
-               }
-               return false;
-            }
-         };
-
-         template< typename Rule, typename... Actions >
-         struct if_apply_impl< apply_mode::NOTHING, Rule, Actions... >
-         {
-            template< rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return Control< Rule >::template match< apply_mode::NOTHING, M, Action, Control >( in, st... );
+         if constexpr( ( A == apply_mode::action ) && ( sizeof...( Actions ) != 0 ) ) {
+            using action_t = typename Input::action_t;
+            auto m = in.template mark< rewind_mode::required >();
+            if( Control< Rule >::template match< apply_mode::action, rewind_mode::active, Action, Control >( in, st... ) ) {
+               const action_t i2( m.iterator(), in );
+               return m( ( apply_single< Actions >::match( i2, st... ) && ... ) );
             }
-         };
-
-         template< typename Rule, typename... Actions >
-         struct if_apply
-         {
-            using analyze_t = typename Rule::analyze_t;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return if_apply_impl< A, Rule, Actions... >::template match< M, Action, Control >( in, st... );
-            }
-         };
-
-         template< typename Rule, typename... Actions >
-         struct skip_control< if_apply< Rule, Actions... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+            return false;
+         }
+         else {  // NOLINT
+            return Control< Rule >::template match< A, M, Action, Control >( in, st... );
+         }
+      }
+   };
+
+   template< typename Rule, typename... Actions >
+   inline constexpr bool skip_control< if_apply< Rule, Actions... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/if_must.hpp b/packages/PEGTL/include/tao/pegtl/internal/if_must.hpp
index f81fee47b193267e0aa0d827e589f3dd74038f52..8b4bf328d707f486e789a464b4eea84e402ee568 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/if_must.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/if_must.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_IF_MUST_HPP
@@ -7,7 +7,6 @@
 #include "../config.hpp"
 
 #include "must.hpp"
-#include "rule_conjunction.hpp"
 #include "skip_control.hpp"
 #include "trivial.hpp"
 
@@ -16,42 +15,34 @@
 
 #include "../analysis/counted.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< bool Default, typename Cond, typename... Rules >
+   struct if_must
    {
-      namespace internal
+      using analyze_t = analysis::counted< analysis::rule_type::seq, Default ? 0 : 1, Cond, must< Rules... > >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< bool Default, typename Cond, typename... Rules >
-         struct if_must
-         {
-            using analyze_t = analysis::counted< analysis::rule_type::SEQ, Default ? 0 : 1, Cond, must< Rules... > >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               if( Control< Cond >::template match< A, M, Action, Control >( in, st... ) ) {
-                  rule_conjunction< must< Rules >... >::template match< A, M, Action, Control >( in, st... );
-                  return true;
-               }
-               return Default;
-            }
-         };
-
-         template< bool Default, typename Cond, typename... Rules >
-         struct skip_control< if_must< Default, Cond, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         if( Control< Cond >::template match< A, M, Action, Control >( in, st... ) ) {
+            (void)( Control< must< Rules > >::template match< A, M, Action, Control >( in, st... ) && ... );
+            return true;
+         }
+         return Default;
+      }
+   };
+
+   template< bool Default, typename Cond, typename... Rules >
+   inline constexpr bool skip_control< if_must< Default, Cond, Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/if_must_else.hpp b/packages/PEGTL/include/tao/pegtl/internal/if_must_else.hpp
index f049bcbfdbe095cb0fb70f0af0ce3586b6a627bd..932ed2ac1172587c688d16ac1df2cb856f83ac71 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/if_must_else.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/if_must_else.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_IF_MUST_ELSE_HPP
@@ -9,19 +9,11 @@
 #include "if_then_else.hpp"
 #include "must.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename Cond, typename Then, typename Else >
-         using if_must_else = if_then_else< Cond, must< Then >, must< Else > >;
+   template< typename Cond, typename Then, typename Else >
+   using if_must_else = if_then_else< Cond, must< Then >, must< Else > >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/if_then_else.hpp b/packages/PEGTL/include/tao/pegtl/internal/if_then_else.hpp
index 5e851d83925957d902aad5610698c7282c3d19dd..88a8893116af9255e93e0b22beb6e75e92f1bb3d 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/if_then_else.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/if_then_else.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_IF_THEN_ELSE_HPP
@@ -16,44 +16,36 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Cond, typename Then, typename Else >
+   struct if_then_else
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::sor, seq< Cond, Then >, seq< not_at< Cond >, Else > >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< typename Cond, typename Then, typename Else >
-         struct if_then_else
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SOR, seq< Cond, Then >, seq< not_at< Cond >, Else > >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< M >();
-               using m_t = decltype( m );
-
-               if( Control< Cond >::template match< A, rewind_mode::REQUIRED, Action, Control >( in, st... ) ) {
-                  return m( Control< Then >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) );
-               }
-               return m( Control< Else >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) );
-            }
-         };
-
-         template< typename Cond, typename Then, typename Else >
-         struct skip_control< if_then_else< Cond, Then, Else > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         auto m = in.template mark< M >();
+         using m_t = decltype( m );
+
+         if( Control< Cond >::template match< A, rewind_mode::required, Action, Control >( in, st... ) ) {
+            return m( Control< Then >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) );
+         }
+         return m( Control< Else >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) );
+      }
+   };
+
+   template< typename Cond, typename Then, typename Else >
+   inline constexpr bool skip_control< if_then_else< Cond, Then, Else > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/input_pair.hpp b/packages/PEGTL/include/tao/pegtl/internal/input_pair.hpp
index 362b07c18d2edbea00fa664e79013d2db0940438..976e3eb53983297e654adaef3bf193d98123d2f0 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/input_pair.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/input_pair.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_INPUT_PAIR_HPP
@@ -8,30 +8,22 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Data >
+   struct input_pair
    {
-      namespace internal
-      {
-         template< typename Data >
-         struct input_pair
-         {
-            Data data;
-            std::uint8_t size;
-
-            using data_t = Data;
+      Data data;
+      std::uint8_t size;
 
-            explicit operator bool() const noexcept
-            {
-               return size > 0;
-            }
-         };
+      using data_t = Data;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+      explicit operator bool() const noexcept
+      {
+         return size > 0;
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/integer_sequence.hpp b/packages/PEGTL/include/tao/pegtl/internal/integer_sequence.hpp
deleted file mode 100644
index 29aeff69dfc65c2798bbb8460a229c62eee93941..0000000000000000000000000000000000000000
--- a/packages/PEGTL/include/tao/pegtl/internal/integer_sequence.hpp
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
-// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
-
-#ifndef TAO_PEGTL_INTERNAL_INTEGER_SEQUENCE_HPP
-#define TAO_PEGTL_INTERNAL_INTEGER_SEQUENCE_HPP
-
-#include <cstddef>
-#include <type_traits>
-#include <utility>
-
-#include "../config.hpp"
-
-namespace tao
-{
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename T, T... Ns >
-         struct integer_sequence
-         {
-            using value_type = T;
-
-            static constexpr std::size_t size() noexcept
-            {
-               return sizeof...( Ns );
-            }
-         };
-
-         template< std::size_t... Ns >
-         using index_sequence = integer_sequence< std::size_t, Ns... >;
-
-         template< bool V, bool E >
-         struct generate_sequence;
-
-         template<>
-         struct generate_sequence< false, true >
-         {
-            template< typename T, T M, T N, std::size_t S, T... Ns >
-            using f = integer_sequence< T, Ns... >;
-         };
-
-         template<>
-         struct generate_sequence< true, true >
-         {
-            template< typename T, T M, T N, std::size_t S, T... Ns >
-            using f = integer_sequence< T, Ns..., S >;
-         };
-
-         template<>
-         struct generate_sequence< false, false >
-         {
-            template< typename T, T M, T N, std::size_t S, T... Ns >
-            using f = typename generate_sequence< ( N & ( M / 2 ) ) != 0, ( M / 2 ) == 0 >::template f< T, M / 2, N, 2 * S, Ns..., ( Ns + S )... >;
-         };
-
-         template<>
-         struct generate_sequence< true, false >
-         {
-            template< typename T, T M, T N, std::size_t S, T... Ns >
-            using f = typename generate_sequence< ( N & ( M / 2 ) ) != 0, ( M / 2 ) == 0 >::template f< T, M / 2, N, 2 * S + 1, Ns..., ( Ns + S )..., 2 * S >;
-         };
-
-         template< typename T, T N >
-         struct memoize_sequence
-         {
-            static_assert( N < T( 1 << 20 ), "N too large" );
-            using type = typename generate_sequence< false, false >::template f< T, ( N < T( 1 << 1 ) ) ? T( 1 << 1 ) : ( N < T( 1 << 2 ) ) ? T( 1 << 2 ) : ( N < T( 1 << 3 ) ) ? T( 1 << 3 ) : ( N < T( 1 << 4 ) ) ? T( 1 << 4 ) : ( N < T( 1 << 5 ) ) ? T( 1 << 5 ) : ( N < T( 1 << 6 ) ) ? T( 1 << 6 ) : ( N < T( 1 << 7 ) ) ? T( 1 << 7 ) : ( N < T( 1 << 8 ) ) ? T( 1 << 8 ) : ( N < T( 1 << 9 ) ) ? T( 1 << 9 ) : ( N < T( 1 << 10 ) ) ? T( 1 << 10 ) : ( N < T( 1 << 11 ) ) ? T( 1 << 11 ) : ( N < T( 1 << 12 ) ) ? T( 1 << 12 ) : ( N < T( 1 << 13 ) ) ? T( 1 << 13 ) : ( N < T( 1 << 14 ) ) ? T( 1 << 14 ) : ( N < T( 1 << 15 ) ) ? T( 1 << 15 ) : ( N < T( 1 << 16 ) ) ? T( 1 << 16 ) : ( N < T( 1 << 17 ) ) ? T( 1 << 17 ) : ( N < T( 1 << 18 ) ) ? T( 1 << 18 ) : ( N < T( 1 << 19 ) ) ? T( 1 << 19 ) : T( 1 << 20 ), N, 0 >;
-         };
-
-         template< typename T, T N >
-         using make_integer_sequence = typename memoize_sequence< T, N >::type;
-
-         template< std::size_t N >
-         using make_index_sequence = make_integer_sequence< std::size_t, N >;
-
-         template< typename... Ts >
-         using index_sequence_for = make_index_sequence< sizeof...( Ts ) >;
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
-
-#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/istream_reader.hpp b/packages/PEGTL/include/tao/pegtl/internal/istream_reader.hpp
index 592c15e6ac64c6f009a68f5981ca542206591530..b928a48a1758e6db355ba5f772fa21f179b71acf 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/istream_reader.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/istream_reader.hpp
@@ -1,47 +1,40 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ISTREAM_READER_HPP
 #define TAO_PEGTL_INTERNAL_ISTREAM_READER_HPP
 
 #include <istream>
+#include <system_error>
 
 #include "../config.hpp"
-#include "../input_error.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct istream_reader
    {
-      namespace internal
+      explicit istream_reader( std::istream& s ) noexcept
+         : m_istream( s )
       {
-         struct istream_reader
-         {
-            explicit istream_reader( std::istream& s ) noexcept
-               : m_istream( s )
-            {
-            }
-
-            std::size_t operator()( char* buffer, const std::size_t length )
-            {
-               m_istream.read( buffer, std::streamsize( length ) );
-
-               if( const auto r = m_istream.gcount() ) {
-                  return std::size_t( r );
-               }
-               if( m_istream.eof() ) {
-                  return 0;
-               }
-               TAO_PEGTL_THROW_INPUT_ERROR( "error in istream.read()" );
-            }
-
-            std::istream& m_istream;
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      }
+
+      [[nodiscard]] std::size_t operator()( char* buffer, const std::size_t length )
+      {
+         m_istream.read( buffer, std::streamsize( length ) );
+
+         if( const auto r = m_istream.gcount() ) {
+            return std::size_t( r );
+         }
+         if( m_istream.eof() ) {
+            return 0;
+         }
+         const auto ec = errno;
+         throw std::system_error( ec, std::system_category(), "std::istream::read() failed" );
+      }
+
+      std::istream& m_istream;
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/istring.hpp b/packages/PEGTL/include/tao/pegtl/internal/istring.hpp
index 5c8c4ab3a1fae115c6be7a93a49df5c845a026a0..4e9ce895d0dd1e7cde4e131af89a255fd7d9bde0 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/istring.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/istring.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ISTRING_HPP
@@ -15,93 +15,58 @@
 
 #include "../analysis/counted.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< char C >
-         using is_alpha = std::integral_constant< bool, ( ( 'a' <= C ) && ( C <= 'z' ) ) || ( ( 'A' <= C ) && ( C <= 'Z' ) ) >;
+   template< char C >
+   inline constexpr bool is_alpha = ( ( 'a' <= C ) && ( C <= 'z' ) ) || ( ( 'A' <= C ) && ( C <= 'Z' ) );
 
-         template< char C, bool A = is_alpha< C >::value >
-         struct ichar_equal;
+   template< char C >
+   [[nodiscard]] bool ichar_equal( const char c ) noexcept
+   {
+      if constexpr( is_alpha< C > ) {
+         return ( C | 0x20 ) == ( c | 0x20 );
+      }
+      else {  // NOLINT
+         return c == C;
+      }
+   }
+
+   template< char... Cs >
+   [[nodiscard]] bool istring_equal( const char* r ) noexcept
+   {
+      return ( ichar_equal< Cs >( *r++ ) && ... );
+   }
 
-         template< char C >
-         struct ichar_equal< C, true >
-         {
-            static bool match( const char c ) noexcept
-            {
-               return ( C | 0x20 ) == ( c | 0x20 );
-            }
-         };
+   template< char... Cs >
+   struct istring;
 
-         template< char C >
-         struct ichar_equal< C, false >
-         {
-            static bool match( const char c ) noexcept
-            {
-               return c == C;
-            }
-         };
+   template<>
+   struct istring<>
+      : trivial< true >
+   {
+   };
 
-         template< char... Cs >
-         struct istring_equal;
+   template< char... Cs >
+   struct istring
+   {
+      using analyze_t = analysis::counted< analysis::rule_type::any, sizeof...( Cs ) >;
 
-         template<>
-         struct istring_equal<>
-         {
-            static bool match( const char* /*unused*/ ) noexcept
-            {
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( 0 ) ) )
+      {
+         if( in.size( sizeof...( Cs ) ) >= sizeof...( Cs ) ) {
+            if( istring_equal< Cs... >( in.current() ) ) {
+               bump_help< result_on_found::success, Input, char, Cs... >( in, sizeof...( Cs ) );
                return true;
             }
-         };
-
-         template< char C, char... Cs >
-         struct istring_equal< C, Cs... >
-         {
-            static bool match( const char* r ) noexcept
-            {
-               return ichar_equal< C >::match( *r ) && istring_equal< Cs... >::match( r + 1 );
-            }
-         };
-
-         template< char... Cs >
-         struct istring;
-
-         template<>
-         struct istring<>
-            : trivial< true >
-         {
-         };
-
-         template< char... Cs >
-         struct istring
-         {
-            using analyze_t = analysis::counted< analysis::rule_type::ANY, sizeof...( Cs ) >;
-
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.size( 0 ) ) )
-            {
-               if( in.size( sizeof...( Cs ) ) >= sizeof...( Cs ) ) {
-                  if( istring_equal< Cs... >::match( in.current() ) ) {
-                     bump_help< result_on_found::SUCCESS, Input, char, Cs... >( in, sizeof...( Cs ) );
-                     return true;
-                  }
-               }
-               return false;
-            }
-         };
-
-         template< char... Cs >
-         struct skip_control< istring< Cs... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+         }
+         return false;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< char... Cs >
+   inline constexpr bool skip_control< istring< Cs... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/iterator.hpp b/packages/PEGTL/include/tao/pegtl/internal/iterator.hpp
index 4bc46f398c89214ae94e5d3eda75141c9238138a..490a8c7335c53022c7f63e4d56960e3c863bb2c0 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/iterator.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/iterator.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ITERATOR_HPP
@@ -8,53 +8,45 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct iterator
    {
-      namespace internal
-      {
-         struct iterator
-         {
-            iterator() noexcept = default;
-
-            explicit iterator( const char* in_data ) noexcept
-               : data( in_data )
-            {
-            }
-
-            iterator( const char* in_data, const std::size_t in_byte, const std::size_t in_line, const std::size_t in_byte_in_line ) noexcept
-               : data( in_data ),
-                 byte( in_byte ),
-                 line( in_line ),
-                 byte_in_line( in_byte_in_line )
-            {
-            }
+      iterator() noexcept = default;
 
-            iterator( const iterator& ) = default;
-            iterator( iterator&& ) = default;
+      explicit iterator( const char* in_data ) noexcept
+         : data( in_data )
+      {
+      }
 
-            ~iterator() = default;
+      iterator( const char* in_data, const std::size_t in_byte, const std::size_t in_line, const std::size_t in_byte_in_line ) noexcept
+         : data( in_data ),
+           byte( in_byte ),
+           line( in_line ),
+           byte_in_line( in_byte_in_line )
+      {
+      }
 
-            iterator& operator=( const iterator& ) = default;
-            iterator& operator=( iterator&& ) = default;
+      iterator( const iterator& ) = default;
+      iterator( iterator&& ) = default;
 
-            void reset() noexcept
-            {
-               *this = iterator();
-            }
+      ~iterator() = default;
 
-            const char* data = nullptr;
+      iterator& operator=( const iterator& ) = default;
+      iterator& operator=( iterator&& ) = default;
 
-            std::size_t byte = 0;
-            std::size_t line = 1;
-            std::size_t byte_in_line = 0;
-         };
+      void reset() noexcept
+      {
+         *this = iterator();
+      }
 
-      }  // namespace internal
+      const char* data = nullptr;
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      std::size_t byte = 0;
+      std::size_t line = 1;
+      std::size_t byte_in_line = 0;
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/lf_crlf_eol.hpp b/packages/PEGTL/include/tao/pegtl/internal/lf_crlf_eol.hpp
index 27a47c4caac7c85db5fdd02ca891db3788d8374b..d510f9c2f00f1de22d23bea35beb7d64a30f9a40 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/lf_crlf_eol.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/lf_crlf_eol.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_LF_CRLF_EOL_HPP
@@ -7,39 +7,31 @@
 #include "../config.hpp"
 #include "../eol_pair.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct lf_crlf_eol
    {
-      namespace internal
-      {
-         struct lf_crlf_eol
-         {
-            static constexpr int ch = '\n';
+      static constexpr int ch = '\n';
 
-            template< typename Input >
-            static eol_pair match( Input& in ) noexcept( noexcept( in.size( 2 ) ) )
-            {
-               eol_pair p = { false, in.size( 2 ) };
-               if( p.second ) {
-                  const auto a = in.peek_char();
-                  if( a == '\n' ) {
-                     in.bump_to_next_line();
-                     p.first = true;
-                  }
-                  else if( ( a == '\r' ) && ( p.second > 1 ) && ( in.peek_char( 1 ) == '\n' ) ) {
-                     in.bump_to_next_line( 2 );
-                     p.first = true;
-                  }
-               }
-               return p;
+      template< typename Input >
+      [[nodiscard]] static eol_pair match( Input& in ) noexcept( noexcept( in.size( 2 ) ) )
+      {
+         eol_pair p = { false, in.size( 2 ) };
+         if( p.second ) {
+            const auto a = in.peek_char();
+            if( a == '\n' ) {
+               in.bump_to_next_line();
+               p.first = true;
             }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+            else if( ( a == '\r' ) && ( p.second > 1 ) && ( in.peek_char( 1 ) == '\n' ) ) {
+               in.bump_to_next_line( 2 );
+               p.first = true;
+            }
+         }
+         return p;
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/lf_eol.hpp b/packages/PEGTL/include/tao/pegtl/internal/lf_eol.hpp
index 0104126d54747759e02877e5761f0eb3e6cbef97..439ba51d01aedc88a409d7a5837a5a493ddce42c 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/lf_eol.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/lf_eol.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_LF_EOL_HPP
@@ -7,34 +7,26 @@
 #include "../config.hpp"
 #include "../eol_pair.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct lf_eol
    {
-      namespace internal
-      {
-         struct lf_eol
-         {
-            static constexpr int ch = '\n';
+      static constexpr int ch = '\n';
 
-            template< typename Input >
-            static eol_pair match( Input& in ) noexcept( noexcept( in.size( 1 ) ) )
-            {
-               eol_pair p = { false, in.size( 1 ) };
-               if( p.second ) {
-                  if( in.peek_char() == '\n' ) {
-                     in.bump_to_next_line();
-                     p.first = true;
-                  }
-               }
-               return p;
+      template< typename Input >
+      [[nodiscard]] static eol_pair match( Input& in ) noexcept( noexcept( in.size( 1 ) ) )
+      {
+         eol_pair p = { false, in.size( 1 ) };
+         if( p.second ) {
+            if( in.peek_char() == '\n' ) {
+               in.bump_to_next_line();
+               p.first = true;
             }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+         }
+         return p;
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/list.hpp b/packages/PEGTL/include/tao/pegtl/internal/list.hpp
index 7068d9cec6147a51475ca7df296c76faf3a892fe..83d87de1f25c7e22f88aa66169f3db2c67ff5f74 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/list.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/list.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_LIST_HPP
@@ -9,19 +9,11 @@
 #include "seq.hpp"
 #include "star.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename Rule, typename Sep >
-         using list = seq< Rule, star< Sep, Rule > >;
+   template< typename Rule, typename Sep >
+   using list = seq< Rule, star< Sep, Rule > >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/list_must.hpp b/packages/PEGTL/include/tao/pegtl/internal/list_must.hpp
index c473f2daa5ada731ab94c2653d9b904f71a1a0c8..2c5a617cc04773b9616594383eee68715864f5cf 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/list_must.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/list_must.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_LIST_MUST_HPP
@@ -10,19 +10,11 @@
 #include "seq.hpp"
 #include "star.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename Rule, typename Sep >
-         using list_must = seq< Rule, star< Sep, must< Rule > > >;
+   template< typename Rule, typename Sep >
+   using list_must = seq< Rule, star< Sep, must< Rule > > >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/list_tail.hpp b/packages/PEGTL/include/tao/pegtl/internal/list_tail.hpp
index e651df80b46f3302700d96c7adea387aa7fd6f06..26b16c395197db06e2d391d8b4bf10a956061cfd 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/list_tail.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/list_tail.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_LIST_TAIL_HPP
@@ -10,19 +10,11 @@
 #include "opt.hpp"
 #include "seq.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename Rule, typename Sep >
-         using list_tail = seq< list< Rule, Sep >, opt< Sep > >;
+   template< typename Rule, typename Sep >
+   using list_tail = seq< list< Rule, Sep >, opt< Sep > >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/list_tail_pad.hpp b/packages/PEGTL/include/tao/pegtl/internal/list_tail_pad.hpp
index 291bcadefece0c238c041d2852455f0d9e2f24bb..28f2f4394ad03173044ca9ed71f398cbb5416c63 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/list_tail_pad.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/list_tail_pad.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_LIST_TAIL_PAD_HPP
@@ -12,19 +12,11 @@
 #include "seq.hpp"
 #include "star.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename Rule, typename Sep, typename Pad >
-         using list_tail_pad = seq< list< Rule, pad< Sep, Pad > >, opt< star< Pad >, Sep > >;
+   template< typename Rule, typename Sep, typename Pad >
+   using list_tail_pad = seq< list< Rule, pad< Sep, Pad > >, opt< star< Pad >, Sep > >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/marker.hpp b/packages/PEGTL/include/tao/pegtl/internal/marker.hpp
index c11ad49be11c227d18a7f421faad4f87142838fc..2834be3723659038a57cc552b2bb06dd2982ec36 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/marker.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/marker.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_MARKER_HPP
@@ -7,93 +7,76 @@
 #include "../config.hpp"
 #include "../rewind_mode.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Iterator, rewind_mode M >
+   class marker
    {
-      namespace internal
+   public:
+      static constexpr rewind_mode next_rewind_mode = M;
+
+      explicit marker( const Iterator& /*unused*/ ) noexcept
+      {
+      }
+
+      marker( const marker& ) = delete;
+      marker( marker&& ) = delete;
+
+      ~marker() = default;
+
+      void operator=( const marker& ) = delete;
+      void operator=( marker&& ) = delete;
+
+      [[nodiscard]] bool operator()( const bool result ) const noexcept
+      {
+         return result;
+      }
+   };
+
+   template< typename Iterator >
+   class marker< Iterator, rewind_mode::required >
+   {
+   public:
+      static constexpr rewind_mode next_rewind_mode = rewind_mode::active;
+
+      explicit marker( Iterator& i ) noexcept
+         : m_saved( i ),
+           m_input( &i )
       {
-         template< typename Iterator, rewind_mode M >
-         class marker
-         {
-         public:
-            static constexpr rewind_mode next_rewind_mode = M;
-
-            explicit marker( const Iterator& /*unused*/ ) noexcept
-            {
-            }
-
-            marker( const marker& ) = delete;
-
-            marker( marker&& /*unused*/ ) noexcept
-            {
-            }
-
-            ~marker() = default;
-
-            void operator=( const marker& ) = delete;
-            void operator=( marker&& ) = delete;
-
-            bool operator()( const bool result ) const noexcept
-            {
-               return result;
-            }
-         };
-
-         template< typename Iterator >
-         class marker< Iterator, rewind_mode::REQUIRED >
-         {
-         public:
-            static constexpr rewind_mode next_rewind_mode = rewind_mode::ACTIVE;
-
-            explicit marker( Iterator& i ) noexcept
-               : m_saved( i ),
-                 m_input( &i )
-            {
-            }
-
-            marker( const marker& ) = delete;
-
-            marker( marker&& i ) noexcept
-               : m_saved( i.m_saved ),
-                 m_input( i.m_input )
-            {
-               i.m_input = nullptr;
-            }
-
-            ~marker() noexcept
-            {
-               if( m_input != nullptr ) {
-                  ( *m_input ) = m_saved;
-               }
-            }
-
-            void operator=( const marker& ) = delete;
-            void operator=( marker&& ) = delete;
-
-            bool operator()( const bool result ) noexcept
-            {
-               if( result ) {
-                  m_input = nullptr;
-                  return true;
-               }
-               return false;
-            }
-
-            const Iterator& iterator() const noexcept
-            {
-               return m_saved;
-            }
-
-         private:
-            const Iterator m_saved;
-            Iterator* m_input;
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      }
+
+      marker( const marker& ) = delete;
+      marker( marker&& ) = delete;
+
+      ~marker() noexcept
+      {
+         if( m_input != nullptr ) {
+            ( *m_input ) = m_saved;
+         }
+      }
+
+      void operator=( const marker& ) = delete;
+      void operator=( marker&& ) = delete;
+
+      [[nodiscard]] bool operator()( const bool result ) noexcept
+      {
+         if( result ) {
+            m_input = nullptr;
+            return true;
+         }
+         return false;
+      }
+
+      [[nodiscard]] const Iterator& iterator() const noexcept
+      {
+         return m_saved;
+      }
+
+   private:
+      const Iterator m_saved;
+      Iterator* m_input;
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/minus.hpp b/packages/PEGTL/include/tao/pegtl/internal/minus.hpp
deleted file mode 100644
index 9481c827b2d41c2df10501df8ec4a67b49f0bda5..0000000000000000000000000000000000000000
--- a/packages/PEGTL/include/tao/pegtl/internal/minus.hpp
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
-// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
-
-#ifndef TAO_PEGTL_INTERNAL_MINUS_HPP
-#define TAO_PEGTL_INTERNAL_MINUS_HPP
-
-#include "../config.hpp"
-
-#include "skip_control.hpp"
-
-#include "../apply_mode.hpp"
-#include "../memory_input.hpp"
-#include "../rewind_mode.hpp"
-
-namespace tao
-{
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         inline const char* source_pointer( const char* source ) noexcept
-         {
-            return source;
-         }
-
-         inline const char* source_pointer( const std::string& source ) noexcept
-         {
-            return source.c_str();
-         }
-
-         template< typename R, typename S >
-         struct minus
-         {
-            using analyze_t = typename R::analyze_t;  // NOTE: S is currently ignored for analyze().
-
-            template< apply_mode A,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< rewind_mode::REQUIRED >();
-
-               if( !Control< R >::template match< A, rewind_mode::ACTIVE, Action, Control >( in, st... ) ) {
-                  return false;
-               }
-               memory_input< tracking_mode::LAZY, typename Input::eol_t, const char* > i2( m.iterator(), in.current(), source_pointer( in.source() ) );
-
-               if( !Control< S >::template match< apply_mode::NOTHING, rewind_mode::ACTIVE, Action, Control >( i2, st... ) ) {
-                  return m( true );
-               }
-               return m( !i2.empty() );
-            }
-         };
-
-         template< typename R, typename S >
-         struct skip_control< minus< R, S > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
-
-#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/missing_apply.hpp b/packages/PEGTL/include/tao/pegtl/internal/missing_apply.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..c4e33d16e6a5501ce269ded84d3344159f99c027
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/internal/missing_apply.hpp
@@ -0,0 +1,25 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_INTERNAL_MISSING_APPLY_HPP
+#define TAO_PEGTL_INTERNAL_MISSING_APPLY_HPP
+
+#include "../config.hpp"
+#include "../rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE::internal
+{
+   template< typename Control,
+             template< typename... >
+             class Action,
+             typename Input,
+             typename... States >
+   void missing_apply( Input& in, States&&... st )
+   {
+      auto m = in.template mark< rewind_mode::required >();
+      (void)Control::template apply< Action >( m.iterator(), in, st... );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/missing_apply0.hpp b/packages/PEGTL/include/tao/pegtl/internal/missing_apply0.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..db58f5d6f8a738c2c839c3e1e2478390cb9b934b
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/internal/missing_apply0.hpp
@@ -0,0 +1,23 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_INTERNAL_MISSING_APPLY0_HPP
+#define TAO_PEGTL_INTERNAL_MISSING_APPLY0_HPP
+
+#include "../config.hpp"
+
+namespace TAO_PEGTL_NAMESPACE::internal
+{
+   template< typename Control,
+             template< typename... >
+             class Action,
+             typename Input,
+             typename... States >
+   void missing_apply0( Input& in, States&&... st )
+   {
+      (void)Control::template apply0< Action >( in, st... );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/must.hpp b/packages/PEGTL/include/tao/pegtl/internal/must.hpp
index 9f37243efd58be527c837246e51d70ebbedc024d..f4e0902160e50a21b41da00b8f8f933352e43c83 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/must.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/must.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_MUST_HPP
@@ -7,7 +7,6 @@
 #include "../config.hpp"
 
 #include "raise.hpp"
-#include "rule_conjunction.hpp"
 #include "skip_control.hpp"
 
 #include "../apply_mode.hpp"
@@ -15,65 +14,59 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   // The general case applies must<> to each of the
+   // rules in the 'Rules' parameter pack individually.
+
+   template< typename... Rules >
+   struct must
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::seq, Rules... >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         // The general case applies must<> to each of the
-         // rules in the 'Rules' parameter pack individually.
-
-         template< typename... Rules >
-         struct must
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, Rules... >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return rule_conjunction< must< Rules >... >::template match< A, M, Action, Control >( in, st... );
-            }
-         };
-
-         // While in theory the implementation for a single rule could
-         // be simplified to must< Rule > = sor< Rule, raise< Rule > >, this
-         // would result in some unnecessary run-time overhead.
+         return ( Control< must< Rules > >::template match< A, M, Action, Control >( in, st... ) && ... );
+      }
+   };
 
-         template< typename Rule >
-         struct must< Rule >
-         {
-            using analyze_t = typename Rule::analyze_t;
+   // While in theory the implementation for a single rule could
+   // be simplified to must< Rule > = sor< Rule, raise< Rule > >, this
+   // would result in some unnecessary run-time overhead.
 
-            template< apply_mode A,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               if( !Control< Rule >::template match< A, rewind_mode::DONTCARE, Action, Control >( in, st... ) ) {
-                  raise< Rule >::template match< A, rewind_mode::DONTCARE, Action, Control >( in, st... );
-               }
-               return true;
-            }
-         };
-
-         template< typename... Rules >
-         struct skip_control< must< Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+   template< typename Rule >
+   struct must< Rule >
+   {
+      using analyze_t = typename Rule::analyze_t;
+
+      template< apply_mode A,
+                rewind_mode,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         if( !Control< Rule >::template match< A, rewind_mode::dontcare, Action, Control >( in, st... ) ) {
+            (void)raise< Rule >::template match< A, rewind_mode::dontcare, Action, Control >( in, st... );
+         }
+         return true;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   inline constexpr bool skip_control< must< Rules... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/not_at.hpp b/packages/PEGTL/include/tao/pegtl/internal/not_at.hpp
index d47932079738792507ec425400493aa67611007c..0ab7fcf848d3d282db0e9ced3c88d10fac23b198 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/not_at.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/not_at.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_NOT_AT_HPP
@@ -6,7 +6,6 @@
 
 #include "../config.hpp"
 
-#include "rule_conjunction.hpp"
 #include "skip_control.hpp"
 #include "trivial.hpp"
 
@@ -15,48 +14,40 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   struct not_at;
+
+   template<>
+   struct not_at<>
+      : trivial< false >
+   {
+   };
+
+   template< typename... Rules >
+   struct not_at
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::opt, Rules... >;
+
+      template< apply_mode,
+                rewind_mode,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< typename... Rules >
-         struct not_at;
-
-         template<>
-         struct not_at<>
-            : trivial< false >
-         {
-         };
-
-         template< typename... Rules >
-         struct not_at
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT, Rules... >;
-
-            template< apply_mode,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               const auto m = in.template mark< rewind_mode::REQUIRED >();
-               return !rule_conjunction< Rules... >::template match< apply_mode::NOTHING, rewind_mode::ACTIVE, Action, Control >( in, st... );
-            }
-         };
-
-         template< typename... Rules >
-         struct skip_control< not_at< Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         const auto m = in.template mark< rewind_mode::required >();
+         return !( Control< Rules >::template match< apply_mode::nothing, rewind_mode::active, Action, Control >( in, st... ) && ... );
+      }
+   };
+
+   template< typename... Rules >
+   inline constexpr bool skip_control< not_at< Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/one.hpp b/packages/PEGTL/include/tao/pegtl/internal/one.hpp
index 8d29d5118b15619df819feb9caee730f4b6f5793..451140d036a555e0754d9573098df5f2d42a37e5 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/one.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/one.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_ONE_HPP
@@ -15,67 +15,57 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Char >
+   [[nodiscard]] bool contains( const Char c, const std::initializer_list< Char >& l ) noexcept
    {
-      namespace internal
-      {
-         template< typename Char >
-         bool contains( const Char c, const std::initializer_list< Char >& l ) noexcept
-         {
-            return std::find( l.begin(), l.end(), c ) != l.end();
-         }
+      return std::find( l.begin(), l.end(), c ) != l.end();
+   }
 
-         template< result_on_found R, typename Peek, typename Peek::data_t... Cs >
-         struct one
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
+   template< result_on_found R, typename Peek, typename Peek::data_t... Cs >
+   struct one
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
 
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.empty() ) )
-            {
-               if( !in.empty() ) {
-                  if( const auto t = Peek::peek( in ) ) {
-                     if( contains( t.data, { Cs... } ) == bool( R ) ) {
-                        bump_help< R, Input, typename Peek::data_t, Cs... >( in, t.size );
-                        return true;
-                     }
-                  }
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( Peek::max_input_size ) ) )
+      {
+         if( const std::size_t s = in.size( Peek::max_input_size ); s >= Peek::min_input_size ) {
+            if( const auto t = Peek::peek( in, s ) ) {
+               if( contains( t.data, { Cs... } ) == bool( R ) ) {
+                  bump_help< R, Input, typename Peek::data_t, Cs... >( in, t.size );
+                  return true;
                }
-               return false;
             }
-         };
+         }
+         return false;
+      }
+   };
 
-         template< result_on_found R, typename Peek, typename Peek::data_t C >
-         struct one< R, Peek, C >
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
+   template< result_on_found R, typename Peek, typename Peek::data_t C >
+   struct one< R, Peek, C >
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
 
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.empty() ) )
-            {
-               if( !in.empty() ) {
-                  if( const auto t = Peek::peek( in ) ) {
-                     if( ( t.data == C ) == bool( R ) ) {
-                        bump_help< R, Input, typename Peek::data_t, C >( in, t.size );
-                        return true;
-                     }
-                  }
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( Peek::max_input_size ) ) )
+      {
+         if( const std::size_t s = in.size( Peek::max_input_size ); s >= Peek::min_input_size ) {
+            if( const auto t = Peek::peek( in, s ) ) {
+               if( ( t.data == C ) == bool( R ) ) {
+                  bump_help< R, Input, typename Peek::data_t, C >( in, t.size );
+                  return true;
                }
-               return false;
             }
-         };
-
-         template< result_on_found R, typename Peek, typename Peek::data_t... Cs >
-         struct skip_control< one< R, Peek, Cs... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+         }
+         return false;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< result_on_found R, typename Peek, typename Peek::data_t... Cs >
+   inline constexpr bool skip_control< one< R, Peek, Cs... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/opt.hpp b/packages/PEGTL/include/tao/pegtl/internal/opt.hpp
index f27046a47b03ae6f64ae5e7d2bc829b209bd7d81..df6da2d222c3c20540c262f9b9a8c3fdecab5dae 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/opt.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/opt.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_OPT_HPP
@@ -18,48 +18,40 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename... Rules >
-         struct opt;
-
-         template<>
-         struct opt<>
-            : trivial< true >
-         {
-         };
-
-         template< typename... Rules >
-         struct opt
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT, Rules... >;
+   template< typename... Rules >
+   struct opt;
 
-            template< apply_mode A,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               duseltronik< seq< Rules... >, A, rewind_mode::REQUIRED, Action, Control >::match( in, st... );
-               return true;
-            }
-         };
-
-         template< typename... Rules >
-         struct skip_control< opt< Rules... > > : std::true_type
-         {
-         };
+   template<>
+   struct opt<>
+      : trivial< true >
+   {
+   };
 
-      }  // namespace internal
+   template< typename... Rules >
+   struct opt
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::opt, Rules... >;
+
+      template< apply_mode A,
+                rewind_mode,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         (void)duseltronik< seq< Rules... >, A, rewind_mode::required, Action, Control >::match( in, st... );
+         return true;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   inline constexpr bool skip_control< opt< Rules... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/pad.hpp b/packages/PEGTL/include/tao/pegtl/internal/pad.hpp
index 8aa586d54d4e6a079af53eedda01f6570368130d..db23e38a4565e228d7986a5a77bccc814be23991 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/pad.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/pad.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PAD_HPP
@@ -9,19 +9,11 @@
 #include "seq.hpp"
 #include "star.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename Rule, typename Pad1, typename Pad2 = Pad1 >
-         using pad = seq< star< Pad1 >, Rule, star< Pad2 > >;
+   template< typename Rule, typename Pad1, typename Pad2 = Pad1 >
+   using pad = seq< star< Pad1 >, Rule, star< Pad2 > >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/pad_opt.hpp b/packages/PEGTL/include/tao/pegtl/internal/pad_opt.hpp
index bdd0f669300b5b430f0d45106727ea6a53f0e4f5..2a14a535490b6fbe054fcae8a138cdda7ecc285d 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/pad_opt.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/pad_opt.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PAD_OPT_HPP
@@ -10,19 +10,11 @@
 #include "seq.hpp"
 #include "star.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename Rule, typename Pad >
-         using pad_opt = seq< star< Pad >, opt< Rule, star< Pad > > >;
+   template< typename Rule, typename Pad >
+   using pad_opt = seq< star< Pad >, opt< Rule, star< Pad > > >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/peek_char.hpp b/packages/PEGTL/include/tao/pegtl/internal/peek_char.hpp
index f7eaf907ed4f3c3969fa8f2dec21cb27c0ef39a3..8383698d4f5b51fe852e157d74e9b00242052462 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/peek_char.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/peek_char.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PEEK_CHAR_HPP
@@ -10,28 +10,23 @@
 
 #include "input_pair.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct peek_char
    {
-      namespace internal
-      {
-         struct peek_char
-         {
-            using data_t = char;
-            using pair_t = input_pair< char >;
-
-            template< typename Input >
-            static pair_t peek( Input& in, const std::size_t o = 0 ) noexcept( noexcept( in.Input::peek_char( 0 ) ) )
-            {
-               return { in.peek_char( o ), 1 };
-            }
-         };
+      using data_t = char;
+      using pair_t = input_pair< char >;
 
-      }  // namespace internal
+      static constexpr std::size_t min_input_size = 1;
+      static constexpr std::size_t max_input_size = 1;
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      template< typename Input >
+      [[nodiscard]] static pair_t peek( const Input& in, const std::size_t /*unused*/ = 1 ) noexcept
+      {
+         return { in.peek_char(), 1 };
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/peek_mask_uint.hpp b/packages/PEGTL/include/tao/pegtl/internal/peek_mask_uint.hpp
index b5709d6a71cfa72fcc63d02668bd780f4994b62c..d99addf78af14bc51f5477a87a512f123a9464f0 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/peek_mask_uint.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/peek_mask_uint.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PEEK_MASK_UINT_HPP
@@ -12,52 +12,43 @@
 #include "input_pair.hpp"
 #include "read_uint.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename R, typename R::type M >
+   struct peek_mask_uint_impl
    {
-      namespace internal
-      {
-         template< typename R, typename R::type M >
-         struct peek_mask_uint_impl
-         {
-            using data_t = typename R::type;
-            using pair_t = input_pair< data_t >;
-
-            template< typename Input >
-            static pair_t peek( Input& in ) noexcept( noexcept( in.size( sizeof( data_t ) ) ) )
-            {
-               const std::size_t s = in.size( sizeof( data_t ) );
-               if( s >= sizeof( data_t ) ) {
-                  const data_t data = R::read( in.current() ) & M;
-                  return { data, sizeof( data_t ) };
-               }
-               return { 0, 0 };
-            }
-         };
+      using data_t = typename R::type;
+      using pair_t = input_pair< data_t >;
 
-         template< std::uint16_t M >
-         using peek_mask_uint16_be = peek_mask_uint_impl< read_uint16_be, M >;
+      static constexpr std::size_t min_input_size = sizeof( data_t );
+      static constexpr std::size_t max_input_size = sizeof( data_t );
 
-         template< std::uint16_t M >
-         using peek_mask_uint16_le = peek_mask_uint_impl< read_uint16_le, M >;
+      template< typename Input >
+      [[nodiscard]] static pair_t peek( const Input& in, const std::size_t /*unused*/ ) noexcept
+      {
+         const data_t data = R::read( in.current() ) & M;
+         return { data, sizeof( data_t ) };
+      }
+   };
 
-         template< std::uint32_t M >
-         using peek_mask_uint32_be = peek_mask_uint_impl< read_uint32_be, M >;
+   template< std::uint16_t M >
+   using peek_mask_uint16_be = peek_mask_uint_impl< read_uint16_be, M >;
 
-         template< std::uint32_t M >
-         using peek_mask_uint32_le = peek_mask_uint_impl< read_uint32_le, M >;
+   template< std::uint16_t M >
+   using peek_mask_uint16_le = peek_mask_uint_impl< read_uint16_le, M >;
 
-         template< std::uint64_t M >
-         using peek_mask_uint64_be = peek_mask_uint_impl< read_uint64_be, M >;
+   template< std::uint32_t M >
+   using peek_mask_uint32_be = peek_mask_uint_impl< read_uint32_be, M >;
 
-         template< std::uint64_t M >
-         using peek_mask_uint64_le = peek_mask_uint_impl< read_uint64_le, M >;
+   template< std::uint32_t M >
+   using peek_mask_uint32_le = peek_mask_uint_impl< read_uint32_le, M >;
 
-      }  // namespace internal
+   template< std::uint64_t M >
+   using peek_mask_uint64_be = peek_mask_uint_impl< read_uint64_be, M >;
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< std::uint64_t M >
+   using peek_mask_uint64_le = peek_mask_uint_impl< read_uint64_le, M >;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/peek_mask_uint8.hpp b/packages/PEGTL/include/tao/pegtl/internal/peek_mask_uint8.hpp
index 8711918e7a3b95bc83e00206a1fcdc9ee5e0a56a..ef50097e4958fcfcc88e3e4477c8843f430abca6 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/peek_mask_uint8.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/peek_mask_uint8.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PEEK_MASK_UINT8_HPP
@@ -11,29 +11,24 @@
 
 #include "input_pair.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< std::uint8_t M >
+   struct peek_mask_uint8
    {
-      namespace internal
-      {
-         template< std::uint8_t M >
-         struct peek_mask_uint8
-         {
-            using data_t = std::uint8_t;
-            using pair_t = input_pair< std::uint8_t >;
-
-            template< typename Input >
-            static pair_t peek( Input& in, const std::size_t o = 0 ) noexcept( noexcept( in.peek_byte( 0 ) ) )
-            {
-               return { std::uint8_t( in.peek_byte( o ) & M ), 1 };
-            }
-         };
+      using data_t = std::uint8_t;
+      using pair_t = input_pair< std::uint8_t >;
 
-      }  // namespace internal
+      static constexpr std::size_t min_input_size = 1;
+      static constexpr std::size_t max_input_size = 1;
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      template< typename Input >
+      [[nodiscard]] static pair_t peek( const Input& in, const std::size_t /*unused*/ = 1 ) noexcept
+      {
+         return { std::uint8_t( in.peek_uint8() & M ), 1 };
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/peek_uint.hpp b/packages/PEGTL/include/tao/pegtl/internal/peek_uint.hpp
index 4a0fd8901615fadbc4b0c52e34eb1147c39d1652..83b3eaad538b4d2bca7f10decba9266d0e51d3f4 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/peek_uint.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/peek_uint.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PEEK_UINT_HPP
@@ -12,43 +12,34 @@
 #include "input_pair.hpp"
 #include "read_uint.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename R >
+   struct peek_uint_impl
    {
-      namespace internal
+      using data_t = typename R::type;
+      using pair_t = input_pair< data_t >;
+
+      static constexpr std::size_t min_input_size = sizeof( data_t );
+      static constexpr std::size_t max_input_size = sizeof( data_t );
+
+      template< typename Input >
+      [[nodiscard]] static pair_t peek( const Input& in, const std::size_t /*unused*/ ) noexcept
       {
-         template< typename R >
-         struct peek_uint_impl
-         {
-            using data_t = typename R::type;
-            using pair_t = input_pair< data_t >;
-
-            template< typename Input >
-            static pair_t peek( Input& in ) noexcept( noexcept( in.size( sizeof( data_t ) ) ) )
-            {
-               const std::size_t s = in.size( sizeof( data_t ) );
-               if( s >= sizeof( data_t ) ) {
-                  const data_t data = R::read( in.current() );
-                  return { data, sizeof( data_t ) };
-               }
-               return { 0, 0 };
-            }
-         };
-
-         using peek_uint16_be = peek_uint_impl< read_uint16_be >;
-         using peek_uint16_le = peek_uint_impl< read_uint16_le >;
-
-         using peek_uint32_be = peek_uint_impl< read_uint32_be >;
-         using peek_uint32_le = peek_uint_impl< read_uint32_le >;
-
-         using peek_uint64_be = peek_uint_impl< read_uint64_be >;
-         using peek_uint64_le = peek_uint_impl< read_uint64_le >;
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         const data_t data = R::read( in.current() );
+         return { data, sizeof( data_t ) };
+      }
+   };
+
+   using peek_uint16_be = peek_uint_impl< read_uint16_be >;
+   using peek_uint16_le = peek_uint_impl< read_uint16_le >;
+
+   using peek_uint32_be = peek_uint_impl< read_uint32_be >;
+   using peek_uint32_le = peek_uint_impl< read_uint32_le >;
+
+   using peek_uint64_be = peek_uint_impl< read_uint64_be >;
+   using peek_uint64_le = peek_uint_impl< read_uint64_le >;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/peek_uint8.hpp b/packages/PEGTL/include/tao/pegtl/internal/peek_uint8.hpp
index aebe1b22ecb2f39e66f9f6906724fa4f09b22187..d5f78af62e99004f6333444902f2c0c837d8b0f9 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/peek_uint8.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/peek_uint8.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PEEK_UINT8_HPP
@@ -11,28 +11,23 @@
 
 #include "input_pair.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct peek_uint8
    {
-      namespace internal
-      {
-         struct peek_uint8
-         {
-            using data_t = std::uint8_t;
-            using pair_t = input_pair< std::uint8_t >;
-
-            template< typename Input >
-            static pair_t peek( Input& in, const std::size_t o = 0 ) noexcept( noexcept( in.peek_byte( 0 ) ) )
-            {
-               return { in.peek_byte( o ), 1 };
-            }
-         };
+      using data_t = std::uint8_t;
+      using pair_t = input_pair< std::uint8_t >;
 
-      }  // namespace internal
+      static constexpr std::size_t min_input_size = 1;
+      static constexpr std::size_t max_input_size = 1;
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      template< typename Input >
+      [[nodiscard]] static pair_t peek( const Input& in, const std::size_t /*unused*/ = 1 ) noexcept
+      {
+         return { in.peek_uint8(), 1 };
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/peek_utf16.hpp b/packages/PEGTL/include/tao/pegtl/internal/peek_utf16.hpp
index 8d88e42e04d63135236623e41af074b5f49075e6..4552c64f622b48671a187ed27768c9fa3e89f0d5 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/peek_utf16.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/peek_utf16.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PEEK_UTF16_HPP
@@ -11,53 +11,44 @@
 #include "input_pair.hpp"
 #include "read_uint.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename R >
+   struct peek_utf16_impl
    {
-      namespace internal
+      using data_t = char32_t;
+      using pair_t = input_pair< char32_t >;
+
+      using short_t = std::make_unsigned< char16_t >::type;
+
+      static_assert( sizeof( short_t ) == 2 );
+      static_assert( sizeof( char16_t ) == 2 );
+
+      static constexpr std::size_t min_input_size = 2;
+      static constexpr std::size_t max_input_size = 4;
+
+      template< typename Input >
+      [[nodiscard]] static pair_t peek( const Input& in, const std::size_t s ) noexcept
       {
-         template< typename R >
-         struct peek_utf16_impl
-         {
-            using data_t = char32_t;
-            using pair_t = input_pair< char32_t >;
-
-            using short_t = std::make_unsigned< char16_t >::type;
-
-            static_assert( sizeof( short_t ) == 2, "expected size 2 for 16bit value" );
-            static_assert( sizeof( char16_t ) == 2, "expected size 2 for 16bit value" );
-
-            template< typename Input >
-            static pair_t peek( Input& in ) noexcept( noexcept( in.size( 4 ) ) )
-            {
-               const std::size_t s = in.size( 4 );
-               if( s < 2 ) {
-                  return { 0, 0 };
-               }
-               const char32_t t = R::read( in.current() );
-               if( ( t < 0xd800 ) || ( t > 0xdfff ) ) {
-                  return { t, 2 };
-               }
-               if( ( t >= 0xdc00 ) || ( s < 4 ) ) {
-                  return { 0, 0 };
-               }
-               const char32_t u = R::read( in.current() + 2 );
-               if( ( u >= 0xdc00 ) && ( u <= 0xdfff ) ) {
-                  const auto cp = ( ( ( t & 0x03ff ) << 10 ) | ( u & 0x03ff ) ) + 0x10000;
-                  return { cp, 4 };
-               }
-               return { 0, 0 };
-            }
-         };
-
-         using peek_utf16_be = peek_utf16_impl< read_uint16_be >;
-         using peek_utf16_le = peek_utf16_impl< read_uint16_le >;
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         const char32_t t = R::read( in.current() );
+         if( ( t < 0xd800 ) || ( t > 0xdfff ) ) {
+            return { t, 2 };
+         }
+         if( ( t >= 0xdc00 ) || ( s < 4 ) ) {
+            return { 0, 0 };
+         }
+         const char32_t u = R::read( in.current() + 2 );
+         if( ( u >= 0xdc00 ) && ( u <= 0xdfff ) ) {
+            const auto cp = ( ( ( t & 0x03ff ) << 10 ) | ( u & 0x03ff ) ) + 0x10000;
+            return { cp, 4 };
+         }
+         return { 0, 0 };
+      }
+   };
+
+   using peek_utf16_be = peek_utf16_impl< read_uint16_be >;
+   using peek_utf16_le = peek_utf16_impl< read_uint16_le >;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/peek_utf32.hpp b/packages/PEGTL/include/tao/pegtl/internal/peek_utf32.hpp
index 7d720b125e487a16ef621baf0674414ca95a37ab..293d38fbad569e7e9ba32e278ff2aa010d9af3e2 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/peek_utf32.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/peek_utf32.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PEEK_UTF32_HPP
@@ -11,41 +11,33 @@
 #include "input_pair.hpp"
 #include "read_uint.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename R >
+   struct peek_utf32_impl
    {
-      namespace internal
+      using data_t = char32_t;
+      using pair_t = input_pair< char32_t >;
+
+      static_assert( sizeof( char32_t ) == 4 );
+
+      static constexpr std::size_t min_input_size = 4;
+      static constexpr std::size_t max_input_size = 4;
+
+      template< typename Input >
+      [[nodiscard]] static pair_t peek( const Input& in, const std::size_t /*unused*/ ) noexcept
       {
-         template< typename R >
-         struct peek_utf32_impl
-         {
-            using data_t = char32_t;
-            using pair_t = input_pair< char32_t >;
-
-            static_assert( sizeof( char32_t ) == 4, "expected size 4 for 32bit value" );
-
-            template< typename Input >
-            static pair_t peek( Input& in ) noexcept( noexcept( in.size( 4 ) ) )
-            {
-               const std::size_t s = in.size( 4 );
-               if( s >= 4 ) {
-                  const char32_t t = R::read( in.current() );
-                  if( ( 0 <= t ) && ( t <= 0x10ffff ) && !( t >= 0xd800 && t <= 0xdfff ) ) {
-                     return { t, 4 };
-                  }
-               }
-               return { 0, 0 };
-            }
-         };
-
-         using peek_utf32_be = peek_utf32_impl< read_uint32_be >;
-         using peek_utf32_le = peek_utf32_impl< read_uint32_le >;
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         const char32_t t = R::read( in.current() );
+         if( ( 0 <= t ) && ( t <= 0x10ffff ) && !( t >= 0xd800 && t <= 0xdfff ) ) {
+            return { t, 4 };
+         }
+         return { 0, 0 };
+      }
+   };
+
+   using peek_utf32_be = peek_utf32_impl< read_uint32_be >;
+   using peek_utf32_le = peek_utf32_impl< read_uint32_le >;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/peek_utf8.hpp b/packages/PEGTL/include/tao/pegtl/internal/peek_utf8.hpp
index 2b11f7533092b4876c9a2563f81b24ae71d54f4a..aa8a617b7b78d31707f17ea7314d90d58b6d08d4 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/peek_utf8.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/peek_utf8.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PEEK_UTF8_HPP
@@ -8,81 +8,83 @@
 
 #include "input_pair.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct peek_utf8
    {
-      namespace internal
+      using data_t = char32_t;
+      using pair_t = input_pair< char32_t >;
+
+      static constexpr std::size_t min_input_size = 1;
+      static constexpr std::size_t max_input_size = 4;
+
+      template< typename Input >
+      [[nodiscard]] static pair_t peek( const Input& in, const std::size_t s ) noexcept
       {
-         struct peek_utf8
-         {
-            using data_t = char32_t;
-            using pair_t = input_pair< char32_t >;
+         char32_t c0 = in.peek_uint8();
 
-            template< typename Input >
-            static pair_t peek( Input& in ) noexcept( noexcept( in.size( 4 ) ) )
-            {
-               char32_t c0 = in.peek_byte();
+         if( ( c0 & 0x80 ) == 0 ) {
+            return { c0, 1 };
+         }
+         return peek_impl( in, c0, s );
+      }
 
-               if( ( c0 & 0x80 ) == 0 ) {
-                  return { c0, 1 };
-               }
-               if( ( c0 & 0xE0 ) == 0xC0 ) {
-                  if( in.size( 2 ) >= 2 ) {
-                     const char32_t c1 = in.peek_byte( 1 );
-                     if( ( c1 & 0xC0 ) == 0x80 ) {
-                        c0 &= 0x1F;
-                        c0 <<= 6;
-                        c0 |= ( c1 & 0x3F );
-                        if( c0 >= 0x80 ) {
-                           return { c0, 2 };
-                        }
-                     }
+   private:
+      template< typename Input >
+      [[nodiscard]] static pair_t peek_impl( const Input& in, char32_t c0, const std::size_t s ) noexcept
+      {
+         if( ( c0 & 0xE0 ) == 0xC0 ) {
+            if( s >= 2 ) {
+               const char32_t c1 = in.peek_uint8( 1 );
+               if( ( c1 & 0xC0 ) == 0x80 ) {
+                  c0 &= 0x1F;
+                  c0 <<= 6;
+                  c0 |= ( c1 & 0x3F );
+                  if( c0 >= 0x80 ) {
+                     return { c0, 2 };
                   }
                }
-               else if( ( c0 & 0xF0 ) == 0xE0 ) {
-                  if( in.size( 3 ) >= 3 ) {
-                     const char32_t c1 = in.peek_byte( 1 );
-                     const char32_t c2 = in.peek_byte( 2 );
-                     if( ( ( c1 & 0xC0 ) == 0x80 ) && ( ( c2 & 0xC0 ) == 0x80 ) ) {
-                        c0 &= 0x0F;
-                        c0 <<= 6;
-                        c0 |= ( c1 & 0x3F );
-                        c0 <<= 6;
-                        c0 |= ( c2 & 0x3F );
-                        if( c0 >= 0x800 && !( c0 >= 0xD800 && c0 <= 0xDFFF ) ) {
-                           return { c0, 3 };
-                        }
-                     }
+            }
+         }
+         else if( ( c0 & 0xF0 ) == 0xE0 ) {
+            if( s >= 3 ) {
+               const char32_t c1 = in.peek_uint8( 1 );
+               const char32_t c2 = in.peek_uint8( 2 );
+               if( ( ( c1 & 0xC0 ) == 0x80 ) && ( ( c2 & 0xC0 ) == 0x80 ) ) {
+                  c0 &= 0x0F;
+                  c0 <<= 6;
+                  c0 |= ( c1 & 0x3F );
+                  c0 <<= 6;
+                  c0 |= ( c2 & 0x3F );
+                  if( c0 >= 0x800 && !( c0 >= 0xD800 && c0 <= 0xDFFF ) ) {
+                     return { c0, 3 };
                   }
                }
-               else if( ( c0 & 0xF8 ) == 0xF0 ) {
-                  if( in.size( 4 ) >= 4 ) {
-                     const char32_t c1 = in.peek_byte( 1 );
-                     const char32_t c2 = in.peek_byte( 2 );
-                     const char32_t c3 = in.peek_byte( 3 );
-                     if( ( ( c1 & 0xC0 ) == 0x80 ) && ( ( c2 & 0xC0 ) == 0x80 ) && ( ( c3 & 0xC0 ) == 0x80 ) ) {
-                        c0 &= 0x07;
-                        c0 <<= 6;
-                        c0 |= ( c1 & 0x3F );
-                        c0 <<= 6;
-                        c0 |= ( c2 & 0x3F );
-                        c0 <<= 6;
-                        c0 |= ( c3 & 0x3F );
-                        if( c0 >= 0x10000 && c0 <= 0x10FFFF ) {
-                           return { c0, 4 };
-                        }
-                     }
+            }
+         }
+         else if( ( c0 & 0xF8 ) == 0xF0 ) {
+            if( s >= 4 ) {
+               const char32_t c1 = in.peek_uint8( 1 );
+               const char32_t c2 = in.peek_uint8( 2 );
+               const char32_t c3 = in.peek_uint8( 3 );
+               if( ( ( c1 & 0xC0 ) == 0x80 ) && ( ( c2 & 0xC0 ) == 0x80 ) && ( ( c3 & 0xC0 ) == 0x80 ) ) {
+                  c0 &= 0x07;
+                  c0 <<= 6;
+                  c0 |= ( c1 & 0x3F );
+                  c0 <<= 6;
+                  c0 |= ( c2 & 0x3F );
+                  c0 <<= 6;
+                  c0 |= ( c3 & 0x3F );
+                  if( c0 >= 0x10000 && c0 <= 0x10FFFF ) {
+                     return { c0, 4 };
                   }
                }
-               return { 0, 0 };
             }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+         }
+         return { 0, 0 };
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/pegtl_string.hpp b/packages/PEGTL/include/tao/pegtl/internal/pegtl_string.hpp
index 5928d73307590b5eb9fb8b8dfeb511c65a862259..b523d66ca77d05182c5aad5f9c6774b96a82a978 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/pegtl_string.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/pegtl_string.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PEGTL_STRING_HPP
@@ -10,66 +10,58 @@
 #include "../ascii.hpp"
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   // Inspired by https://github.com/irrequietus/typestring
+   // Rewritten and reduced to what is needed for the PEGTL
+   // and to work with Visual Studio 2015.
+
+   template< typename, typename, typename, typename, typename, typename, typename, typename >
+   struct string_join;
+
+   template< template< char... > class S, char... C0s, char... C1s, char... C2s, char... C3s, char... C4s, char... C5s, char... C6s, char... C7s >
+   struct string_join< S< C0s... >, S< C1s... >, S< C2s... >, S< C3s... >, S< C4s... >, S< C5s... >, S< C6s... >, S< C7s... > >
+   {
+      using type = S< C0s..., C1s..., C2s..., C3s..., C4s..., C5s..., C6s..., C7s... >;
+   };
+
+   template< template< char... > class S, char, bool >
+   struct string_at
+   {
+      using type = S<>;
+   };
+
+   template< template< char... > class S, char C >
+   struct string_at< S, C, true >
+   {
+      using type = S< C >;
+   };
+
+   template< typename T, std::size_t S >
+   struct string_max_length
    {
-      // Inspired by https://github.com/irrequietus/typestring
-      // Rewritten and reduced to what is needed for the PEGTL
-      // and to work with Visual Studio 2015.
-
-      namespace internal
-      {
-         template< typename, typename, typename, typename, typename, typename, typename, typename >
-         struct string_join;
-
-         template< template< char... > class S, char... C0s, char... C1s, char... C2s, char... C3s, char... C4s, char... C5s, char... C6s, char... C7s >
-         struct string_join< S< C0s... >, S< C1s... >, S< C2s... >, S< C3s... >, S< C4s... >, S< C5s... >, S< C6s... >, S< C7s... > >
-         {
-            using type = S< C0s..., C1s..., C2s..., C3s..., C4s..., C5s..., C6s..., C7s... >;
-         };
-
-         template< template< char... > class S, char, bool >
-         struct string_at
-         {
-            using type = S<>;
-         };
-
-         template< template< char... > class S, char C >
-         struct string_at< S, C, true >
-         {
-            using type = S< C >;
-         };
-
-         template< typename T, std::size_t S >
-         struct string_max_length
-         {
-            static_assert( S <= 512, "String longer than 512 (excluding terminating \\0)!" );
-            using type = T;
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      static_assert( S <= 512, "String longer than 512 (excluding terminating \\0)!" );
+      using type = T;
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #define TAO_PEGTL_INTERNAL_EMPTY()
 #define TAO_PEGTL_INTERNAL_DEFER( X ) X TAO_PEGTL_INTERNAL_EMPTY()
 #define TAO_PEGTL_INTERNAL_EXPAND( ... ) __VA_ARGS__
 
 #define TAO_PEGTL_INTERNAL_STRING_AT( S, x, n ) \
-   tao::TAO_PEGTL_NAMESPACE::internal::string_at< S, ( 0##n < sizeof( x ) ) ? ( x )[ 0##n ] : 0, ( 0##n < sizeof( x ) - 1 ) >::type
-
-#define TAO_PEGTL_INTERNAL_JOIN_8( M, S, x, n )                                                  \
-   tao::TAO_PEGTL_NAMESPACE::internal::string_join< TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##0 ), \
-                                                    TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##1 ), \
-                                                    TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##2 ), \
-                                                    TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##3 ), \
-                                                    TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##4 ), \
-                                                    TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##5 ), \
-                                                    TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##6 ), \
-                                                    TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##7 ) >::type
+   TAO_PEGTL_NAMESPACE::internal::string_at< S, ( 0##n < sizeof( x ) ) ? ( x )[ 0##n ] : 0, ( 0##n < sizeof( x ) - 1 ) >::type
+
+#define TAO_PEGTL_INTERNAL_JOIN_8( M, S, x, n )                                             \
+   TAO_PEGTL_NAMESPACE::internal::string_join< TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##0 ), \
+                                               TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##1 ), \
+                                               TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##2 ), \
+                                               TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##3 ), \
+                                               TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##4 ), \
+                                               TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##5 ), \
+                                               TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##6 ), \
+                                               TAO_PEGTL_INTERNAL_DEFER( M )( S, x, n##7 ) >::type
 
 #define TAO_PEGTL_INTERNAL_STRING_8( S, x, n ) \
    TAO_PEGTL_INTERNAL_JOIN_8( TAO_PEGTL_INTERNAL_STRING_AT, S, x, n )
@@ -84,20 +76,15 @@ namespace tao
    TAO_PEGTL_INTERNAL_EXPAND(             \
       TAO_PEGTL_INTERNAL_EXPAND(          \
          TAO_PEGTL_INTERNAL_EXPAND(       \
-            tao::TAO_PEGTL_NAMESPACE::internal::string_max_length< TAO_PEGTL_INTERNAL_STRING_512( S, x, ), sizeof( x ) - 1 >::type ) ) )
+            TAO_PEGTL_NAMESPACE::internal::string_max_length< TAO_PEGTL_INTERNAL_STRING_512( S, x, ), sizeof( x ) - 1 >::type ) ) )
 
 #define TAO_PEGTL_STRING( x ) \
-   TAO_PEGTL_INTERNAL_STRING( tao::TAO_PEGTL_NAMESPACE::ascii::string, x )
+   TAO_PEGTL_INTERNAL_STRING( TAO_PEGTL_NAMESPACE::ascii::string, x )
 
 #define TAO_PEGTL_ISTRING( x ) \
-   TAO_PEGTL_INTERNAL_STRING( tao::TAO_PEGTL_NAMESPACE::ascii::istring, x )
+   TAO_PEGTL_INTERNAL_STRING( TAO_PEGTL_NAMESPACE::ascii::istring, x )
 
 #define TAO_PEGTL_KEYWORD( x ) \
-   TAO_PEGTL_INTERNAL_STRING( tao::TAO_PEGTL_NAMESPACE::ascii::keyword, x )
-
-// Compatibility, remove with 3.0
-#define TAOCPP_PEGTL_STRING( x ) TAO_PEGTL_STRING( x )
-#define TAOCPP_PEGTL_ISTRING( x ) TAO_PEGTL_ISTRING( x )
-#define TAOCPP_PEGTL_KEYWORD( x ) TAO_PEGTL_KEYWORD( x )
+   TAO_PEGTL_INTERNAL_STRING( TAO_PEGTL_NAMESPACE::ascii::keyword, x )
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/plus.hpp b/packages/PEGTL/include/tao/pegtl/internal/plus.hpp
index 5ebd23bf1ebf4a59a553b7829afb7390aee92970..815d2beab2a7aab73180a68c7ec44b0d0bda14e1 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/plus.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/plus.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_PLUS_HPP
@@ -19,43 +19,35 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   // While plus<> could easily be implemented with
+   // seq< Rule, Rules ..., star< Rule, Rules ... > > we
+   // provide an explicit implementation to optimise away
+   // the otherwise created input mark.
+
+   template< typename Rule, typename... Rules >
+   struct plus
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::seq, Rule, Rules..., opt< plus > >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         // While plus<> could easily be implemented with
-         // seq< Rule, Rules ..., star< Rule, Rules ... > > we
-         // provide an explicit implementation to optimise away
-         // the otherwise created input mark.
-
-         template< typename Rule, typename... Rules >
-         struct plus
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, Rule, Rules..., opt< plus > >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return seq< Rule, Rules... >::template match< A, M, Action, Control >( in, st... ) && star< Rule, Rules... >::template match< A, M, Action, Control >( in, st... );
-            }
-         };
-
-         template< typename Rule, typename... Rules >
-         struct skip_control< plus< Rule, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         return seq< Rule, Rules... >::template match< A, M, Action, Control >( in, st... ) && star< Rule, Rules... >::template match< A, M, Action, Control >( in, st... );
+      }
+   };
+
+   template< typename Rule, typename... Rules >
+   inline constexpr bool skip_control< plus< Rule, Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/raise.hpp b/packages/PEGTL/include/tao/pegtl/internal/raise.hpp
index 7a76dd2b80e08f7f0dd502b6feb22388b370cabd..356ffcbd7de76f8769bbbb59bc6b02800a0cfc5d 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/raise.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/raise.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_RAISE_HPP
@@ -16,46 +16,38 @@
 #include "../apply_mode.hpp"
 #include "../rewind_mode.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename T >
+   struct raise
    {
-      namespace internal
-      {
-         template< typename T >
-         struct raise
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
 
-#ifdef _MSC_VER
+#if defined( _MSC_VER )
 #pragma warning( push )
 #pragma warning( disable : 4702 )
 #endif
-            template< apply_mode,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               Control< T >::raise( static_cast< const Input& >( in ), st... );
-               throw std::logic_error( "code should be unreachable: Control< T >::raise() did not throw an exception" );  // NOLINT, LCOV_EXCL_LINE
-#ifdef _MSC_VER
+      template< apply_mode,
+                rewind_mode,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         Control< T >::raise( static_cast< const Input& >( in ), st... );
+         throw std::logic_error( "code should be unreachable: Control< T >::raise() did not throw an exception" );  // NOLINT, LCOV_EXCL_LINE
+#if defined( _MSC_VER )
 #pragma warning( pop )
 #endif
-            }
-         };
-
-         template< typename T >
-         struct skip_control< raise< T > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename T >
+   inline constexpr bool skip_control< raise< T > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/range.hpp b/packages/PEGTL/include/tao/pegtl/internal/range.hpp
index 3964463ecd7cf05a8498881d4514407eac27bf6d..2780377bbedf83a91128d6ac3cd2aa43c90f3b4b 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/range.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/range.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_RANGE_HPP
@@ -6,55 +6,46 @@
 
 #include "../config.hpp"
 
-#include "bump_help.hpp"
 #include "result_on_found.hpp"
 #include "skip_control.hpp"
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< result_on_found R, typename Peek, typename Peek::data_t Lo, typename Peek::data_t Hi >
+   struct range
    {
-      namespace internal
+      static_assert( Lo <= Hi, "invalid range detected" );
+
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
+
+      template< int Eol >
+      static constexpr bool can_match_eol = ( ( ( Lo <= Eol ) && ( Eol <= Hi ) ) == bool( R ) );
+
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( Peek::max_input_size ) ) )
       {
-         template< result_on_found R, typename Peek, typename Peek::data_t Lo, typename Peek::data_t Hi >
-         struct range
-         {
-            static_assert( Lo <= Hi, "invalid range detected" );
-
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
-
-            template< int Eol >
-            struct can_match_eol
-            {
-               static constexpr bool value = ( ( ( Lo <= Eol ) && ( Eol <= Hi ) ) == bool( R ) );
-            };
-
-            template< typename Input >
-            static bool match( Input& in )
-            {
-               if( !in.empty() ) {
-                  if( const auto t = Peek::peek( in ) ) {
-                     if( ( ( Lo <= t.data ) && ( t.data <= Hi ) ) == bool( R ) ) {
-                        bump_impl< can_match_eol< Input::eol_t::ch >::value >::bump( in, t.size );
-                        return true;
-                     }
+         if( const std::size_t s = in.size( Peek::max_input_size ); s >= Peek::min_input_size ) {
+            if( const auto t = Peek::peek( in, s ) ) {
+               if( ( ( Lo <= t.data ) && ( t.data <= Hi ) ) == bool( R ) ) {
+                  if constexpr( can_match_eol< Input::eol_t::ch > ) {
+                     in.bump( t.size );
                   }
+                  else {
+                     in.bump_in_this_line( t.size );
+                  }
+                  return true;
                }
-               return false;
             }
-         };
-
-         template< result_on_found R, typename Peek, typename Peek::data_t Lo, typename Peek::data_t Hi >
-         struct skip_control< range< R, Peek, Lo, Hi > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+         }
+         return false;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< result_on_found R, typename Peek, typename Peek::data_t Lo, typename Peek::data_t Hi >
+   inline constexpr bool skip_control< range< R, Peek, Lo, Hi > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/ranges.hpp b/packages/PEGTL/include/tao/pegtl/internal/ranges.hpp
index d91f433dd76ba2bf269238ffa957123d55fdc821..f815aceb6b24d4ac979ed02c47f938c603b020ee 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/ranges.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/ranges.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_RANGES_HPP
@@ -6,97 +6,88 @@
 
 #include "../config.hpp"
 
-#include "bump_help.hpp"
 #include "range.hpp"
 #include "skip_control.hpp"
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< int Eol, typename Char, Char... Cs >
+   struct ranges_impl;
+
+   template< int Eol, typename Char >
+   struct ranges_impl< Eol, Char >
    {
-      namespace internal
+      static constexpr bool can_match_eol = false;
+
+      [[nodiscard]] static bool match( const Char /*unused*/ ) noexcept
       {
-         template< int Eol, typename Char, Char... Cs >
-         struct ranges_impl;
+         return false;
+      }
+   };
 
-         template< int Eol, typename Char >
-         struct ranges_impl< Eol, Char >
-         {
-            static constexpr bool can_match_eol = false;
+   template< int Eol, typename Char, Char Eq >
+   struct ranges_impl< Eol, Char, Eq >
+   {
+      static constexpr bool can_match_eol = ( Eq == Eol );
 
-            static bool match( const Char /*unused*/ ) noexcept
-            {
-               return false;
-            }
-         };
+      [[nodiscard]] static bool match( const Char c ) noexcept
+      {
+         return c == Eq;
+      }
+   };
 
-         template< int Eol, typename Char, Char Eq >
-         struct ranges_impl< Eol, Char, Eq >
-         {
-            static constexpr bool can_match_eol = ( Eq == Eol );
+   template< int Eol, typename Char, Char Lo, Char Hi, Char... Cs >
+   struct ranges_impl< Eol, Char, Lo, Hi, Cs... >
+   {
+      static_assert( Lo <= Hi, "invalid range detected" );
 
-            static bool match( const Char c ) noexcept
-            {
-               return c == Eq;
-            }
-         };
+      static constexpr bool can_match_eol = ( ( ( Lo <= Eol ) && ( Eol <= Hi ) ) || ranges_impl< Eol, Char, Cs... >::can_match_eol );
 
-         template< int Eol, typename Char, Char Lo, Char Hi, Char... Cs >
-         struct ranges_impl< Eol, Char, Lo, Hi, Cs... >
-         {
-            static_assert( Lo <= Hi, "invalid range detected" );
+      [[nodiscard]] static bool match( const Char c ) noexcept
+      {
+         return ( ( Lo <= c ) && ( c <= Hi ) ) || ranges_impl< Eol, Char, Cs... >::match( c );
+      }
+   };
 
-            static constexpr bool can_match_eol = ( ( ( Lo <= Eol ) && ( Eol <= Hi ) ) || ranges_impl< Eol, Char, Cs... >::can_match_eol );
+   template< typename Peek, typename Peek::data_t... Cs >
+   struct ranges
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
 
-            static bool match( const Char c ) noexcept
-            {
-               return ( ( Lo <= c ) && ( c <= Hi ) ) || ranges_impl< Eol, Char, Cs... >::match( c );
-            }
-         };
-
-         template< typename Peek, typename Peek::data_t... Cs >
-         struct ranges
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
-
-            template< int Eol >
-            struct can_match_eol
-            {
-               static constexpr bool value = ranges_impl< Eol, typename Peek::data_t, Cs... >::can_match_eol;
-            };
-
-            template< typename Input >
-            static bool match( Input& in )
-            {
-               if( !in.empty() ) {
-                  if( const auto t = Peek::peek( in ) ) {
-                     if( ranges_impl< Input::eol_t::ch, typename Peek::data_t, Cs... >::match( t.data ) ) {
-                        bump_impl< can_match_eol< Input::eol_t::ch >::value >::bump( in, t.size );
-                        return true;
-                     }
+      template< int Eol >
+      static constexpr bool can_match_eol = ranges_impl< Eol, typename Peek::data_t, Cs... >::can_match_eol;
+
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( Peek::max_input_size ) ) )
+      {
+         if( const std::size_t s = in.size( Peek::max_input_size ); s >= Peek::min_input_size ) {
+            if( const auto t = Peek::peek( in, s ) ) {
+               if( ranges_impl< Input::eol_t::ch, typename Peek::data_t, Cs... >::match( t.data ) ) {
+                  if constexpr( can_match_eol< Input::eol_t::ch > ) {
+                     in.bump( t.size );
+                  }
+                  else {
+                     in.bump_in_this_line( t.size );
                   }
+                  return true;
                }
-               return false;
             }
-         };
-
-         template< typename Peek, typename Peek::data_t Lo, typename Peek::data_t Hi >
-         struct ranges< Peek, Lo, Hi >
-            : range< result_on_found::SUCCESS, Peek, Lo, Hi >
-         {
-         };
-
-         template< typename Peek, typename Peek::data_t... Cs >
-         struct skip_control< ranges< Peek, Cs... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+         }
+         return false;
+      }
+   };
+
+   template< typename Peek, typename Peek::data_t Lo, typename Peek::data_t Hi >
+   struct ranges< Peek, Lo, Hi >
+      : range< result_on_found::success, Peek, Lo, Hi >
+   {
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename Peek, typename Peek::data_t... Cs >
+   inline constexpr bool skip_control< ranges< Peek, Cs... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/read_uint.hpp b/packages/PEGTL/include/tao/pegtl/internal/read_uint.hpp
index 6e9d3aeb694e3426fccd1dd1a14fa5ae825c227e..96fbcc73da4973c48c1091cc48e98ca44eaeea64 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/read_uint.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/read_uint.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_READ_UINT_HPP
@@ -10,76 +10,68 @@
 
 #include "endian.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct read_uint16_be
    {
-      namespace internal
+      using type = std::uint16_t;
+
+      [[nodiscard]] static std::uint16_t read( const void* d ) noexcept
+      {
+         return be_to_h< std::uint16_t >( d );
+      }
+   };
+
+   struct read_uint16_le
+   {
+      using type = std::uint16_t;
+
+      [[nodiscard]] static std::uint16_t read( const void* d ) noexcept
+      {
+         return le_to_h< std::uint16_t >( d );
+      }
+   };
+
+   struct read_uint32_be
+   {
+      using type = std::uint32_t;
+
+      [[nodiscard]] static std::uint32_t read( const void* d ) noexcept
+      {
+         return be_to_h< std::uint32_t >( d );
+      }
+   };
+
+   struct read_uint32_le
+   {
+      using type = std::uint32_t;
+
+      [[nodiscard]] static std::uint32_t read( const void* d ) noexcept
+      {
+         return le_to_h< std::uint32_t >( d );
+      }
+   };
+
+   struct read_uint64_be
+   {
+      using type = std::uint64_t;
+
+      [[nodiscard]] static std::uint64_t read( const void* d ) noexcept
       {
-         struct read_uint16_be
-         {
-            using type = std::uint16_t;
-
-            static std::uint16_t read( const void* d ) noexcept
-            {
-               return be_to_h< std::uint16_t >( d );
-            }
-         };
-
-         struct read_uint16_le
-         {
-            using type = std::uint16_t;
-
-            static std::uint16_t read( const void* d ) noexcept
-            {
-               return le_to_h< std::uint16_t >( d );
-            }
-         };
-
-         struct read_uint32_be
-         {
-            using type = std::uint32_t;
-
-            static std::uint32_t read( const void* d ) noexcept
-            {
-               return be_to_h< std::uint32_t >( d );
-            }
-         };
-
-         struct read_uint32_le
-         {
-            using type = std::uint32_t;
-
-            static std::uint32_t read( const void* d ) noexcept
-            {
-               return le_to_h< std::uint32_t >( d );
-            }
-         };
-
-         struct read_uint64_be
-         {
-            using type = std::uint64_t;
-
-            static std::uint64_t read( const void* d ) noexcept
-            {
-               return be_to_h< std::uint64_t >( d );
-            }
-         };
-
-         struct read_uint64_le
-         {
-            using type = std::uint64_t;
-
-            static std::uint64_t read( const void* d ) noexcept
-            {
-               return le_to_h< std::uint64_t >( d );
-            }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         return be_to_h< std::uint64_t >( d );
+      }
+   };
+
+   struct read_uint64_le
+   {
+      using type = std::uint64_t;
+
+      [[nodiscard]] static std::uint64_t read( const void* d ) noexcept
+      {
+         return le_to_h< std::uint64_t >( d );
+      }
+   };
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/rematch.hpp b/packages/PEGTL/include/tao/pegtl/internal/rematch.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..5d713266bc0747151e2999b9509ea3b103c47bfd
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/internal/rematch.hpp
@@ -0,0 +1,69 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_INTERNAL_REMATCH_HPP
+#define TAO_PEGTL_INTERNAL_REMATCH_HPP
+
+#include "../config.hpp"
+
+#include "skip_control.hpp"
+
+#include "../apply_mode.hpp"
+#include "../memory_input.hpp"
+#include "../rewind_mode.hpp"
+
+namespace TAO_PEGTL_NAMESPACE::internal
+{
+   template< typename Head, typename... Rules >
+   struct rematch;
+
+   template< typename Head >
+   struct rematch< Head >
+   {
+      using analyze_t = typename Head::analyze_t;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         return Control< Head >::template match< A, M, Action, Control >( in, st... );
+      }
+   };
+
+   template< typename Head, typename Rule, typename... Rules >
+   struct rematch< Head, Rule, Rules... >
+   {
+      using analyze_t = typename Head::analyze_t;  // NOTE: Rule and Rules are ignored for analyze().
+
+      template< apply_mode A,
+                rewind_mode,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         auto m = in.template mark< rewind_mode::required >();
+
+         if( Control< Head >::template match< A, rewind_mode::active, Action, Control >( in, st... ) ) {
+            memory_input< Input::tracking_mode_v, typename Input::eol_t, typename Input::source_t > i2( m.iterator(), in.current(), in.source() );
+            return m( ( Control< Rule >::template match< A, rewind_mode::active, Action, Control >( i2, st... ) && ... && ( i2.restart( m ), Control< Rules >::template match< A, rewind_mode::active, Action, Control >( i2, st... ) ) ) );
+         }
+         return false;
+      }
+   };
+
+   template< typename Head, typename... Rules >
+   inline constexpr bool skip_control< rematch< Head, Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/rep.hpp b/packages/PEGTL/include/tao/pegtl/internal/rep.hpp
index 1e7e600da768c8c06812cfde68ffa7d93eb85472..782929da70ff9c4830214ff64a510e6536e450eb 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/rep.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/rep.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_REP_HPP
@@ -6,7 +6,6 @@
 
 #include "../config.hpp"
 
-#include "rule_conjunction.hpp"
 #include "skip_control.hpp"
 #include "trivial.hpp"
 
@@ -15,61 +14,53 @@
 
 #include "../analysis/counted.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< unsigned Num, typename... Rules >
-         struct rep;
-
-         template< unsigned Num >
-         struct rep< Num >
-            : trivial< true >
-         {
-         };
+   template< unsigned Num, typename... Rules >
+   struct rep;
 
-         template< typename Rule, typename... Rules >
-         struct rep< 0, Rule, Rules... >
-            : trivial< true >
-         {
-         };
+   template< unsigned Num >
+   struct rep< Num >
+      : trivial< true >
+   {
+   };
 
-         template< unsigned Num, typename... Rules >
-         struct rep
-         {
-            using analyze_t = analysis::counted< analysis::rule_type::SEQ, Num, Rules... >;
+   template< typename Rule, typename... Rules >
+   struct rep< 0, Rule, Rules... >
+      : trivial< true >
+   {
+   };
 
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< M >();
-               using m_t = decltype( m );
+   template< unsigned Num, typename... Rules >
+   struct rep
+   {
+      using analyze_t = analysis::counted< analysis::rule_type::seq, Num, Rules... >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         auto m = in.template mark< M >();
+         using m_t = decltype( m );
 
-               for( unsigned i = 0; i != Num; ++i ) {
-                  if( !rule_conjunction< Rules... >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) ) {
-                     return false;
-                  }
-               }
-               return m( true );
+         for( unsigned i = 0; i != Num; ++i ) {
+            if( !( Control< Rules >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) && ... ) ) {
+               return false;
             }
-         };
-
-         template< unsigned Num, typename... Rules >
-         struct skip_control< rep< Num, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+         }
+         return m( true );
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< unsigned Num, typename... Rules >
+   inline constexpr bool skip_control< rep< Num, Rules... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/rep_min.hpp b/packages/PEGTL/include/tao/pegtl/internal/rep_min.hpp
index f48b542a667e6f36f113a638802bf5cd5543cb4f..fe6f6a772822e4f575c276c642c0448c65204945 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/rep_min.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/rep_min.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_REP_MIN_HPP
@@ -10,19 +10,11 @@
 #include "seq.hpp"
 #include "star.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< unsigned Min, typename Rule, typename... Rules >
-         using rep_min = seq< rep< Min, Rule, Rules... >, star< Rule, Rules... > >;
+   template< unsigned Min, typename Rule, typename... Rules >
+   using rep_min = seq< rep< Min, Rule, Rules... >, star< Rule, Rules... > >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/rep_min_max.hpp b/packages/PEGTL/include/tao/pegtl/internal/rep_min_max.hpp
index d50a47f351a62e749eebc3b7b36daa41a53f5862..6264dd17510bb375e9a309bc6a976fd6bc282d79 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/rep_min_max.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/rep_min_max.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_REP_MIN_MAX_HPP
@@ -10,7 +10,6 @@
 
 #include "duseltronik.hpp"
 #include "not_at.hpp"
-#include "rule_conjunction.hpp"
 #include "seq.hpp"
 #include "skip_control.hpp"
 #include "trivial.hpp"
@@ -20,69 +19,61 @@
 
 #include "../analysis/counted.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< unsigned Min, unsigned Max, typename... Rules >
+   struct rep_min_max;
+
+   template< unsigned Min, unsigned Max >
+   struct rep_min_max< Min, Max >
+      : trivial< false >
    {
-      namespace internal
-      {
-         template< unsigned Min, unsigned Max, typename... Rules >
-         struct rep_min_max;
-
-         template< unsigned Min, unsigned Max >
-         struct rep_min_max< Min, Max >
-            : trivial< false >
-         {
-            static_assert( Min <= Max, "invalid rep_min_max rule (maximum number of repetitions smaller than minimum)" );
-         };
-
-         template< typename Rule, typename... Rules >
-         struct rep_min_max< 0, 0, Rule, Rules... >
-            : not_at< Rule, Rules... >
-         {
-         };
-
-         template< unsigned Min, unsigned Max, typename... Rules >
-         struct rep_min_max
-         {
-            using analyze_t = analysis::counted< analysis::rule_type::SEQ, Min, Rules... >;
-
-            static_assert( Min <= Max, "invalid rep_min_max rule (maximum number of repetitions smaller than minimum)" );
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< M >();
-               using m_t = decltype( m );
-
-               for( unsigned i = 0; i != Min; ++i ) {
-                  if( !rule_conjunction< Rules... >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) ) {
-                     return false;
-                  }
-               }
-               for( unsigned i = Min; i != Max; ++i ) {
-                  if( !duseltronik< seq< Rules... >, A, rewind_mode::REQUIRED, Action, Control >::match( in, st... ) ) {
-                     return m( true );
-                  }
-               }
-               return m( duseltronik< not_at< Rules... >, A, m_t::next_rewind_mode, Action, Control >::match( in, st... ) );  // NOTE that not_at<> will always rewind.
-            }
-         };
+      static_assert( Min <= Max );
+   };
 
-         template< unsigned Min, unsigned Max, typename... Rules >
-         struct skip_control< rep_min_max< Min, Max, Rules... > > : std::true_type
-         {
-         };
+   template< typename Rule, typename... Rules >
+   struct rep_min_max< 0, 0, Rule, Rules... >
+      : not_at< Rule, Rules... >
+   {
+   };
 
-      }  // namespace internal
+   template< unsigned Min, unsigned Max, typename... Rules >
+   struct rep_min_max
+   {
+      using analyze_t = analysis::counted< analysis::rule_type::seq, Min, Rules... >;
+
+      static_assert( Min <= Max );
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         auto m = in.template mark< M >();
+         using m_t = decltype( m );
+
+         for( unsigned i = 0; i != Min; ++i ) {
+            if( !( Control< Rules >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) && ... ) ) {
+               return false;
+            }
+         }
+         for( unsigned i = Min; i != Max; ++i ) {
+            if( !duseltronik< seq< Rules... >, A, rewind_mode::required, Action, Control >::match( in, st... ) ) {
+               return m( true );
+            }
+         }
+         return m( duseltronik< not_at< Rules... >, A, m_t::next_rewind_mode, Action, Control >::match( in, st... ) );  // NOTE that not_at<> will always rewind.
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< unsigned Min, unsigned Max, typename... Rules >
+   inline constexpr bool skip_control< rep_min_max< Min, Max, Rules... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/rep_opt.hpp b/packages/PEGTL/include/tao/pegtl/internal/rep_opt.hpp
index 3553f896775f0d5c720d538c4ded94a281ef2d18..4df310d24e9aee4b29dc54291c98359b989d9fd2 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/rep_opt.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/rep_opt.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_REP_OPT_HPP
@@ -15,40 +15,32 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< unsigned Max, typename... Rules >
+   struct rep_opt
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::opt, Rules... >;
+
+      template< apply_mode A,
+                rewind_mode,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< unsigned Max, typename... Rules >
-         struct rep_opt
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT, Rules... >;
-
-            template< apply_mode A,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               for( unsigned i = 0; ( i != Max ) && duseltronik< seq< Rules... >, A, rewind_mode::REQUIRED, Action, Control >::match( in, st... ); ++i ) {
-               }
-               return true;
-            }
-         };
-
-         template< unsigned Max, typename... Rules >
-         struct skip_control< rep_opt< Max, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         for( unsigned i = 0; ( i != Max ) && duseltronik< seq< Rules... >, A, rewind_mode::required, Action, Control >::match( in, st... ); ++i ) {
+         }
+         return true;
+      }
+   };
+
+   template< unsigned Max, typename... Rules >
+   inline constexpr bool skip_control< rep_opt< Max, Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/require.hpp b/packages/PEGTL/include/tao/pegtl/internal/require.hpp
index f03821e46f344523bab4aa73dfd419b992536dd0..b746feff062a1f8310901ccd96ed729e057ed77e 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/require.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/require.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_REQUIRE_HPP
@@ -11,42 +11,32 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< unsigned Amount >
-         struct require;
-
-         template<>
-         struct require< 0 >
-            : trivial< true >
-         {
-         };
-
-         template< unsigned Amount >
-         struct require
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT >;
+   template< unsigned Amount >
+   struct require;
 
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.size( 0 ) ) )
-            {
-               return in.size( Amount ) >= Amount;
-            }
-         };
+   template<>
+   struct require< 0 >
+      : trivial< true >
+   {
+   };
 
-         template< unsigned Amount >
-         struct skip_control< require< Amount > > : std::true_type
-         {
-         };
+   template< unsigned Amount >
+   struct require
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::opt >;
 
-      }  // namespace internal
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( 0 ) ) )
+      {
+         return in.size( Amount ) >= Amount;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< unsigned Amount >
+   inline constexpr bool skip_control< require< Amount > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/result_on_found.hpp b/packages/PEGTL/include/tao/pegtl/internal/result_on_found.hpp
index 13ec9891c2614ecbfd1d1c31a59d0147c9cf472d..e2ed0a63b95349d9a51f228196790e098566052d 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/result_on_found.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/result_on_found.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_RESULT_ON_FOUND_HPP
@@ -6,22 +6,14 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   enum class result_on_found : bool
    {
-      namespace internal
-      {
-         enum class result_on_found : bool
-         {
-            SUCCESS = true,
-            FAILURE = false
-         };
+      success = true,
+      failure = false
+   };
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/rule_conjunction.hpp b/packages/PEGTL/include/tao/pegtl/internal/rule_conjunction.hpp
deleted file mode 100644
index d4dd3d171b4f905fda75f178b4b14205ae0f24f6..0000000000000000000000000000000000000000
--- a/packages/PEGTL/include/tao/pegtl/internal/rule_conjunction.hpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
-// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
-
-#ifndef TAO_PEGTL_INTERNAL_RULE_CONJUNCTION_HPP
-#define TAO_PEGTL_INTERNAL_RULE_CONJUNCTION_HPP
-
-#include "../apply_mode.hpp"
-#include "../config.hpp"
-#include "../rewind_mode.hpp"
-
-namespace tao
-{
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename... Rules >
-         struct rule_conjunction;
-
-         template<>
-         struct rule_conjunction<>
-         {
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& /*unused*/, States&&... /*unused*/ ) noexcept
-            {
-               return true;
-            }
-         };
-
-         template< typename... Rules >
-         struct rule_conjunction
-         {
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-#ifdef __cpp_fold_expressions
-               return ( Control< Rules >::template match< A, M, Action, Control >( in, st... ) && ... );
-#else
-               bool result = true;
-               using swallow = bool[];
-               (void)swallow{ result = result && Control< Rules >::template match< A, M, Action, Control >( in, st... )... };
-               return result;
-#endif
-            }
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
-
-#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/rules.hpp b/packages/PEGTL/include/tao/pegtl/internal/rules.hpp
index 6f72c0e5cec6c79bb0d5e8f4fd8bd6816a7e46cb..613c4eacd8f2b1258ad88a243991077cc2c7674e 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/rules.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/rules.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_RULES_HPP
@@ -31,7 +31,6 @@
 #include "list_must.hpp"
 #include "list_tail.hpp"
 #include "list_tail_pad.hpp"
-#include "minus.hpp"
 #include "must.hpp"
 #include "not_at.hpp"
 #include "one.hpp"
@@ -42,6 +41,7 @@
 #include "raise.hpp"
 #include "range.hpp"
 #include "ranges.hpp"
+#include "rematch.hpp"
 #include "rep.hpp"
 #include "rep_min.hpp"
 #include "rep_min_max.hpp"
@@ -54,10 +54,8 @@
 #include "star_must.hpp"
 #include "state.hpp"
 #include "string.hpp"
-#include "three.hpp"
 #include "trivial.hpp"
 #include "try_catch_type.hpp"
-#include "two.hpp"
 #include "until.hpp"
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/seq.hpp b/packages/PEGTL/include/tao/pegtl/internal/seq.hpp
index 4c751c406fa0e745580a9286e1f4e8d98a8b6a96..eccf791e7765b1be6772a1d05241d607a49342a2 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/seq.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/seq.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_SEQ_HPP
@@ -6,7 +6,6 @@
 
 #include "../config.hpp"
 
-#include "rule_conjunction.hpp"
 #include "skip_control.hpp"
 #include "trivial.hpp"
 
@@ -15,66 +14,60 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename... Rules >
-         struct seq;
-
-         template<>
-         struct seq<>
-            : trivial< true >
-         {
-         };
-
-         template< typename Rule >
-         struct seq< Rule >
-         {
-            using analyze_t = typename Rule::analyze_t;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               return Control< Rule >::template match< A, M, Action, Control >( in, st... );
-            }
-         };
-
-         template< typename... Rules >
-         struct seq
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, Rules... >;
+   template< typename... Rules >
+   struct seq;
 
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< M >();
-               using m_t = decltype( m );
-               return m( rule_conjunction< Rules... >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) );
-            }
-         };
+   template<>
+   struct seq<>
+      : trivial< true >
+   {
+   };
 
-         template< typename... Rules >
-         struct skip_control< seq< Rules... > > : std::true_type
-         {
-         };
+   template< typename Rule >
+   struct seq< Rule >
+   {
+      using analyze_t = typename Rule::analyze_t;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         return Control< Rule >::template match< A, M, Action, Control >( in, st... );
+      }
+   };
 
-      }  // namespace internal
+   template< typename... Rules >
+   struct seq
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::seq, Rules... >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         auto m = in.template mark< M >();
+         using m_t = decltype( m );
+         return m( ( Control< Rules >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) && ... ) );
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   inline constexpr bool skip_control< seq< Rules... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/skip_control.hpp b/packages/PEGTL/include/tao/pegtl/internal/skip_control.hpp
index 29ce86f07ec8b7a41b50576a73f6042bf86b9aeb..a3b7704632fe48e4ac6ef5ba4a28cbb69ac31af2 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/skip_control.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/skip_control.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_SKIP_CONTROL_HPP
@@ -8,28 +8,18 @@
 
 #include "../config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         // This class is a simple tagging mechanism.
-         // By default, skip_control< Rule >::value
-         // is 'false'. Each internal (!) rule that should
-         // be hidden from the control and action class'
-         // callbacks simply specializes skip_control<>
-         // to return 'true' for the above expression.
+   // This class is a simple tagging mechanism.
+   // By default, skip_control< Rule > is  'false'.
+   // Each internal (!) rule that should be hidden
+   // from the control and action class' callbacks
+   // simply specializes skip_control<> to return
+   // 'true' for the above expression.
 
-         template< typename Rule >
-         struct skip_control : std::false_type
-         {
-         };
+   template< typename Rule >
+   inline constexpr bool skip_control = false;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/sor.hpp b/packages/PEGTL/include/tao/pegtl/internal/sor.hpp
index 3108a649df09d09bc020ccb11b26d41fd4e25726..b43a9652775878193dbf4e39f849ac93df5b1bd4 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/sor.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/sor.hpp
@@ -1,12 +1,13 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_SOR_HPP
 #define TAO_PEGTL_INTERNAL_SOR_HPP
 
+#include <utility>
+
 #include "../config.hpp"
 
-#include "integer_sequence.hpp"
 #include "skip_control.hpp"
 #include "trivial.hpp"
 
@@ -15,60 +16,45 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename... Rules >
-         struct sor;
-
-         template<>
-         struct sor<>
-            : trivial< false >
-         {
-         };
-
-         template< typename... Rules >
-         struct sor
-            : sor< index_sequence_for< Rules... >, Rules... >
-         {
-         };
-
-         template< std::size_t... Indices, typename... Rules >
-         struct sor< index_sequence< Indices... >, Rules... >
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SOR, Rules... >;
+   template< typename... Rules >
+   struct sor;
 
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-#ifdef __cpp_fold_expressions
-               return ( Control< Rules >::template match < A, ( Indices == ( sizeof...( Rules ) - 1 ) ) ? M : rewind_mode::REQUIRED, Action, Control > ( in, st... ) || ... );
-#else
-               bool result = false;
-               using swallow = bool[];
-               (void)swallow{ result = result || Control< Rules >::template match < A, ( Indices == ( sizeof...( Rules ) - 1 ) ) ? M : rewind_mode::REQUIRED, Action, Control > ( in, st... )... };
-               return result;
-#endif
-            }
-         };
+   template<>
+   struct sor<>
+      : trivial< false >
+   {
+   };
 
-         template< typename... Rules >
-         struct skip_control< sor< Rules... > > : std::true_type
-         {
-         };
+   template< typename... Rules >
+   struct sor
+      : sor< std::index_sequence_for< Rules... >, Rules... >
+   {
+   };
 
-      }  // namespace internal
+   template< std::size_t... Indices, typename... Rules >
+   struct sor< std::index_sequence< Indices... >, Rules... >
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::sor, Rules... >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         return ( Control< Rules >::template match< A, ( ( Indices == ( sizeof...( Rules ) - 1 ) ) ? M : rewind_mode::required ), Action, Control >( in, st... ) || ... );
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   inline constexpr bool skip_control< sor< Rules... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/star.hpp b/packages/PEGTL/include/tao/pegtl/internal/star.hpp
index cfa3c8a56216559f71ebe699b60792b587a6a06e..e785fa73f12c8ef450caf27d685b07bd51965e7a 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/star.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/star.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_STAR_HPP
@@ -8,7 +8,6 @@
 
 #include "../config.hpp"
 
-#include "duseltronik.hpp"
 #include "seq.hpp"
 #include "skip_control.hpp"
 
@@ -17,40 +16,32 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule, typename... Rules >
+   struct star
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::opt, Rule, Rules..., star >;
+
+      template< apply_mode A,
+                rewind_mode,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< typename Rule, typename... Rules >
-         struct star
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::OPT, Rule, Rules..., star >;
-
-            template< apply_mode A,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               while( seq< Rule, Rules... >::template match< A, rewind_mode::REQUIRED, Action, Control >( in, st... ) ) {
-               }
-               return true;
-            }
-         };
-
-         template< typename Rule, typename... Rules >
-         struct skip_control< star< Rule, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         while( seq< Rule, Rules... >::template match< A, rewind_mode::required, Action, Control >( in, st... ) ) {
+         }
+         return true;
+      }
+   };
+
+   template< typename Rule, typename... Rules >
+   inline constexpr bool skip_control< star< Rule, Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/star_must.hpp b/packages/PEGTL/include/tao/pegtl/internal/star_must.hpp
index 41b06575f10915f88140d3e006fd3642759171a6..9852828f4fa07e37b58780749552889787dccfdb 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/star_must.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/star_must.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_STAR_MUST_HPP
@@ -9,19 +9,11 @@
 #include "if_must.hpp"
 #include "star.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename Cond, typename... Rules >
-         using star_must = star< if_must< false, Cond, Rules... > >;
+   template< typename Cond, typename... Rules >
+   using star_must = star< if_must< false, Cond, Rules... > >;
 
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/state.hpp b/packages/PEGTL/include/tao/pegtl/internal/state.hpp
index 0d8b92afb23a5714628dafd2a85e6eb00a155fe6..76c0f6f4f20bb9fb1858bfe92a869db1f258e90f 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/state.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/state.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_STATE_HPP
@@ -15,71 +15,35 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename State, typename... Rules >
+   struct state
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::seq, Rules... >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< typename State, typename... Rules >
-         struct state
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, Rules... >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static auto success( State& s, const Input& in, States&&... st )
-               -> decltype( s.template success< A, M, Action, Control >( in, st... ), void() )
-            {
-               s.template success< A, M, Action, Control >( in, st... );
-            }
-
-            // NOTE: The additional "int = 0" is a work-around for missing expression SFINAE in VS2015.
-
-            template< apply_mode,
-                      rewind_mode,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States,
-                      int = 0 >
-            static auto success( State& s, const Input& in, States&&... st )
-               -> decltype( s.success( in, st... ), void() )
-            {
-               s.success( in, st... );
-            }
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               State s( static_cast< const Input& >( in ), st... );
-
-               if( duseltronik< seq< Rules... >, A, M, Action, Control >::match( in, s ) ) {
-                  success< A, M, Action, Control >( s, in, st... );
-                  return true;
-               }
-               return false;
-            }
-         };
-
-         template< typename State, typename... Rules >
-         struct skip_control< state< State, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+         State s( static_cast< const Input& >( in ), st... );
+         if( duseltronik< seq< Rules... >, A, M, Action, Control >::match( in, s ) ) {
+            s.success( static_cast< const Input& >( in ), st... );
+            return true;
+         }
+         return false;
+      }
+   };
+
+   template< typename State, typename... Rules >
+   inline constexpr bool skip_control< state< State, Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/string.hpp b/packages/PEGTL/include/tao/pegtl/internal/string.hpp
index 49cdf8f3b56e4b1b5253cbb423c7d8aa6e7a459e..9ff22d05415b3197132be26d5e9b024f94a2e9f9 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/string.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/string.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_STRING_HPP
@@ -16,53 +16,43 @@
 
 #include "../analysis/counted.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   [[nodiscard]] inline bool unsafe_equals( const char* s, const std::initializer_list< char >& l ) noexcept
    {
-      namespace internal
-      {
-         inline bool unsafe_equals( const char* s, const std::initializer_list< char >& l ) noexcept
-         {
-            return std::memcmp( s, &*l.begin(), l.size() ) == 0;
-         }
+      return std::memcmp( s, &*l.begin(), l.size() ) == 0;
+   }
 
-         template< char... Cs >
-         struct string;
+   template< char... Cs >
+   struct string;
 
-         template<>
-         struct string<>
-            : trivial< true >
-         {
-         };
+   template<>
+   struct string<>
+      : trivial< true >
+   {
+   };
 
-         template< char... Cs >
-         struct string
-         {
-            using analyze_t = analysis::counted< analysis::rule_type::ANY, sizeof...( Cs ) >;
+   template< char... Cs >
+   struct string
+   {
+      using analyze_t = analysis::counted< analysis::rule_type::any, sizeof...( Cs ) >;
 
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.size( 0 ) ) )
-            {
-               if( in.size( sizeof...( Cs ) ) >= sizeof...( Cs ) ) {
-                  if( unsafe_equals( in.current(), { Cs... } ) ) {
-                     bump_help< result_on_found::SUCCESS, Input, char, Cs... >( in, sizeof...( Cs ) );
-                     return true;
-                  }
-               }
-               return false;
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& in ) noexcept( noexcept( in.size( 0 ) ) )
+      {
+         if( in.size( sizeof...( Cs ) ) >= sizeof...( Cs ) ) {
+            if( unsafe_equals( in.current(), { Cs... } ) ) {
+               bump_help< result_on_found::success, Input, char, Cs... >( in, sizeof...( Cs ) );
+               return true;
             }
-         };
-
-         template< char... Cs >
-         struct skip_control< string< Cs... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+         }
+         return false;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< char... Cs >
+   inline constexpr bool skip_control< string< Cs... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/three.hpp b/packages/PEGTL/include/tao/pegtl/internal/three.hpp
deleted file mode 100644
index bd6fe525dc2173ad399cbc05668e9c91eb1c4a32..0000000000000000000000000000000000000000
--- a/packages/PEGTL/include/tao/pegtl/internal/three.hpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
-// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
-
-#ifndef TAO_PEGTL_INTERNAL_THREE_HPP
-#define TAO_PEGTL_INTERNAL_THREE_HPP
-
-#include <utility>
-
-#include "../config.hpp"
-
-#include "bump_help.hpp"
-#include "result_on_found.hpp"
-#include "skip_control.hpp"
-
-#include "../analysis/generic.hpp"
-
-namespace tao
-{
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< char C >
-         struct three
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
-
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.size( 3 ) ) )
-            {
-               if( in.size( 3 ) >= 3 ) {
-                  if( ( in.peek_char( 0 ) == C ) && ( in.peek_char( 1 ) == C ) && ( in.peek_char( 2 ) == C ) ) {
-                     bump_help< result_on_found::SUCCESS, Input, char, C >( in, 3 );
-                     return true;
-                  }
-               }
-               return false;
-            }
-         };
-
-         template< char C >
-         struct skip_control< three< C > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
-
-#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/trivial.hpp b/packages/PEGTL/include/tao/pegtl/internal/trivial.hpp
index 38479d27365765018ebe19e794987f5fb5b45e60..0fa6bb017d1900e2c2e1a7fd1728ae0c9827d329 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/trivial.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/trivial.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_TRIVIAL_HPP
@@ -10,33 +10,23 @@
 
 #include "../analysis/counted.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< bool Result >
+   struct trivial
    {
-      namespace internal
-      {
-         template< bool Result >
-         struct trivial
-         {
-            using analyze_t = analysis::counted< analysis::rule_type::ANY, unsigned( !Result ) >;
-
-            template< typename Input >
-            static bool match( Input& /*unused*/ ) noexcept
-            {
-               return Result;
-            }
-         };
+      using analyze_t = analysis::counted< analysis::rule_type::any, unsigned( !Result ) >;
 
-         template< bool Result >
-         struct skip_control< trivial< Result > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+      template< typename Input >
+      [[nodiscard]] static bool match( Input& /*unused*/ ) noexcept
+      {
+         return Result;
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< bool Result >
+   inline constexpr bool skip_control< trivial< Result > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/try_catch_type.hpp b/packages/PEGTL/include/tao/pegtl/internal/try_catch_type.hpp
index e70e432efb177cbeeff3098311395320a970c085..eca0db6917adf1123bb08b7bfad13bacd92b9465 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/try_catch_type.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/try_catch_type.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_TRY_CATCH_TYPE_HPP
@@ -18,55 +18,47 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< typename Exception, typename... Rules >
-         struct try_catch_type;
-
-         template< typename Exception >
-         struct try_catch_type< Exception >
-            : trivial< true >
-         {
-         };
-
-         template< typename Exception, typename... Rules >
-         struct try_catch_type
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, Rules... >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< M >();
-               using m_t = decltype( m );
-
-               try {
-                  return m( duseltronik< seq< Rules... >, A, m_t::next_rewind_mode, Action, Control >::match( in, st... ) );
-               }
-               catch( const Exception& ) {
-                  return false;
-               }
-            }
-         };
+   template< typename Exception, typename... Rules >
+   struct try_catch_type;
 
-         template< typename Exception, typename... Rules >
-         struct skip_control< try_catch_type< Exception, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename Exception >
+   struct try_catch_type< Exception >
+      : trivial< true >
+   {
+   };
 
-}  // namespace tao
+   template< typename Exception, typename... Rules >
+   struct try_catch_type
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::seq, Rules... >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         auto m = in.template mark< M >();
+         using m_t = decltype( m );
+
+         try {
+            return m( duseltronik< seq< Rules... >, A, m_t::next_rewind_mode, Action, Control >::match( in, st... ) );
+         }
+         catch( const Exception& ) {
+            return false;
+         }
+      }
+   };
+
+   template< typename Exception, typename... Rules >
+   inline constexpr bool skip_control< try_catch_type< Exception, Rules... > > = true;
+
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/two.hpp b/packages/PEGTL/include/tao/pegtl/internal/two.hpp
deleted file mode 100644
index 69eaf4b65b3df54803417f06b64e505c4f7e7695..0000000000000000000000000000000000000000
--- a/packages/PEGTL/include/tao/pegtl/internal/two.hpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
-// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
-
-#ifndef TAO_PEGTL_INTERNAL_TWO_HPP
-#define TAO_PEGTL_INTERNAL_TWO_HPP
-
-#include <utility>
-
-#include "../config.hpp"
-
-#include "bump_help.hpp"
-#include "result_on_found.hpp"
-#include "skip_control.hpp"
-
-#include "../analysis/generic.hpp"
-
-namespace tao
-{
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace internal
-      {
-         template< char C >
-         struct two
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::ANY >;
-
-            template< typename Input >
-            static bool match( Input& in ) noexcept( noexcept( in.size( 2 ) ) )
-            {
-               if( in.size( 2 ) >= 2 ) {
-                  if( ( in.peek_char( 0 ) == C ) && ( in.peek_char( 1 ) == C ) ) {
-                     bump_help< result_on_found::SUCCESS, Input, char, C >( in, 2 );
-                     return true;
-                  }
-               }
-               return false;
-            }
-         };
-
-         template< char C >
-         struct skip_control< two< C > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
-
-#endif
diff --git a/packages/PEGTL/include/tao/pegtl/internal/until.hpp b/packages/PEGTL/include/tao/pegtl/internal/until.hpp
index c6a002ee8e3bb730a5e40432011d81cf1eb999bf..c48b6dd32ec6a1c6439cd13afcc7b43895f245ef 100644
--- a/packages/PEGTL/include/tao/pegtl/internal/until.hpp
+++ b/packages/PEGTL/include/tao/pegtl/internal/until.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_INTERNAL_UNTIL_HPP
@@ -9,7 +9,6 @@
 #include "bytes.hpp"
 #include "eof.hpp"
 #include "not_at.hpp"
-#include "rule_conjunction.hpp"
 #include "skip_control.hpp"
 #include "star.hpp"
 
@@ -18,74 +17,68 @@
 
 #include "../analysis/generic.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::internal
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Cond, typename... Rules >
+   struct until;
+
+   template< typename Cond >
+   struct until< Cond >
    {
-      namespace internal
+      using analyze_t = analysis::generic< analysis::rule_type::seq, star< not_at< Cond >, not_at< eof >, bytes< 1 > >, Cond >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
       {
-         template< typename Cond, typename... Rules >
-         struct until;
-
-         template< typename Cond >
-         struct until< Cond >
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, star< not_at< Cond >, not_at< eof >, bytes< 1 > >, Cond >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< M >();
+         auto m = in.template mark< M >();
 
-               while( !Control< Cond >::template match< A, rewind_mode::REQUIRED, Action, Control >( in, st... ) ) {
-                  if( in.empty() ) {
-                     return false;
-                  }
-                  in.bump();
-               }
-               return m( true );
+         while( !Control< Cond >::template match< A, rewind_mode::required, Action, Control >( in, st... ) ) {
+            if( in.empty() ) {
+               return false;
             }
-         };
-
-         template< typename Cond, typename... Rules >
-         struct until
-         {
-            using analyze_t = analysis::generic< analysis::rule_type::SEQ, star< not_at< Cond >, not_at< eof >, Rules... >, Cond >;
-
-            template< apply_mode A,
-                      rewind_mode M,
-                      template< typename... > class Action,
-                      template< typename... > class Control,
-                      typename Input,
-                      typename... States >
-            static bool match( Input& in, States&&... st )
-            {
-               auto m = in.template mark< M >();
-               using m_t = decltype( m );
+            in.bump();
+         }
+         return m( true );
+      }
+   };
+
+   template< typename Cond, typename... Rules >
+   struct until
+   {
+      using analyze_t = analysis::generic< analysis::rule_type::seq, star< not_at< Cond >, not_at< eof >, Rules... >, Cond >;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         auto m = in.template mark< M >();
+         using m_t = decltype( m );
 
-               while( !Control< Cond >::template match< A, rewind_mode::REQUIRED, Action, Control >( in, st... ) ) {
-                  if( !rule_conjunction< Rules... >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) ) {
-                     return false;
-                  }
-               }
-               return m( true );
+         while( !Control< Cond >::template match< A, rewind_mode::required, Action, Control >( in, st... ) ) {
+            if( !( Control< Rules >::template match< A, m_t::next_rewind_mode, Action, Control >( in, st... ) && ... ) ) {
+               return false;
             }
-         };
-
-         template< typename Cond, typename... Rules >
-         struct skip_control< until< Cond, Rules... > > : std::true_type
-         {
-         };
-
-      }  // namespace internal
+         }
+         return m( true );
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename Cond, typename... Rules >
+   inline constexpr bool skip_control< until< Cond, Rules... > > = true;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::internal
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/istream_input.hpp b/packages/PEGTL/include/tao/pegtl/istream_input.hpp
index f598753b273ca9e08442f6f2904472cd80517a13..55f559e24c6ce042587899e4549e58bf3e081ae3 100644
--- a/packages/PEGTL/include/tao/pegtl/istream_input.hpp
+++ b/packages/PEGTL/include/tao/pegtl/istream_input.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_ISTREAM_INPUT_HPP
@@ -12,28 +12,22 @@
 
 #include "internal/istream_reader.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Eol = eol::lf_crlf, std::size_t Chunk = 64 >
+   struct istream_input
+      : buffer_input< internal::istream_reader, Eol, std::string, Chunk >
    {
-      template< typename Eol = eol::lf_crlf >
-      struct istream_input
-         : buffer_input< internal::istream_reader, Eol >
+      template< typename T >
+      istream_input( std::istream& in_stream, const std::size_t in_maximum, T&& in_source )  // NOLINT
+         : buffer_input< internal::istream_reader, Eol, std::string, Chunk >( std::forward< T >( in_source ), in_maximum, in_stream )
       {
-         template< typename T >
-         istream_input( std::istream& in_stream, const std::size_t in_maximum, T&& in_source )
-            : buffer_input< internal::istream_reader, Eol >( std::forward< T >( in_source ), in_maximum, in_stream )
-         {
-         }
-      };
-
-#ifdef __cpp_deduction_guides
-      template< typename... Ts >
-      istream_input( Ts&&... )->istream_input<>;
-#endif
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Ts >
+   istream_input( Ts&&... )->istream_input<>;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/match.hpp b/packages/PEGTL/include/tao/pegtl/match.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..74058f9979eda58d5a0ad2d6c8bd23e75c892413
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/match.hpp
@@ -0,0 +1,73 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_MATCH_HPP
+#define TAO_PEGTL_MATCH_HPP
+
+#include <type_traits>
+
+#include "apply_mode.hpp"
+#include "config.hpp"
+#include "nothing.hpp"
+#include "require_apply.hpp"
+#include "require_apply0.hpp"
+#include "rewind_mode.hpp"
+
+#include "internal/dusel_mode.hpp"
+#include "internal/duseltronik.hpp"
+#include "internal/has_apply.hpp"
+#include "internal/has_apply0.hpp"
+#include "internal/missing_apply.hpp"
+#include "internal/missing_apply0.hpp"
+#include "internal/skip_control.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   template< typename Rule,
+             apply_mode A,
+             rewind_mode M,
+             template< typename... >
+             class Action,
+             template< typename... >
+             class Control,
+             typename Input,
+             typename... States >
+   [[nodiscard]] bool match( Input& in, States&&... st )
+   {
+      constexpr bool enable_control = !internal::skip_control< Rule >;
+      constexpr bool enable_action = enable_control && ( A == apply_mode::action );
+
+      using iterator_t = typename Input::iterator_t;
+      constexpr bool has_apply_void = enable_action && internal::has_apply< Control< Rule >, void, Action, const iterator_t&, const Input&, States... >::value;
+      constexpr bool has_apply_bool = enable_action && internal::has_apply< Control< Rule >, bool, Action, const iterator_t&, const Input&, States... >::value;
+      constexpr bool has_apply = has_apply_void || has_apply_bool;
+
+      constexpr bool has_apply0_void = enable_action && internal::has_apply0< Control< Rule >, void, Action, const Input&, States... >::value;
+      constexpr bool has_apply0_bool = enable_action && internal::has_apply0< Control< Rule >, bool, Action, const Input&, States... >::value;
+      constexpr bool has_apply0 = has_apply0_void || has_apply0_bool;
+
+      static_assert( !( has_apply && has_apply0 ), "both apply() and apply0() defined" );
+
+      constexpr bool is_nothing = std::is_base_of_v< nothing< Rule >, Action< Rule > >;
+      static_assert( !( has_apply && is_nothing ), "unexpected apply() defined" );
+      static_assert( !( has_apply0 && is_nothing ), "unexpected apply0() defined" );
+
+      if constexpr( !has_apply && std::is_base_of_v< require_apply, Action< Rule > > ) {
+         internal::missing_apply< Control< Rule >, Action >( in, st... );
+      }
+
+      if constexpr( !has_apply0 && std::is_base_of_v< require_apply0, Action< Rule > > ) {
+         internal::missing_apply0< Control< Rule >, Action >( in, st... );
+      }
+
+      constexpr bool validate_nothing = std::is_base_of_v< maybe_nothing, Action< void > >;
+      constexpr bool is_maybe_nothing = std::is_base_of_v< maybe_nothing, Action< Rule > >;
+      static_assert( !enable_action || !validate_nothing || is_nothing || is_maybe_nothing || has_apply || has_apply0, "either apply() or apply0() must be defined" );
+
+      constexpr auto mode = static_cast< internal::dusel_mode >( enable_control + has_apply_void + 2 * has_apply_bool + 3 * has_apply0_void + 4 * has_apply0_bool );
+      return internal::duseltronik< Rule, A, M, Action, Control, mode >::match( in, st... );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/memory_input.hpp b/packages/PEGTL/include/tao/pegtl/memory_input.hpp
index 021b21142fe42bd955b36577df8e8068ab47dbaa..1380d9a7967868b74515b78189a65f482089e22a 100644
--- a/packages/PEGTL/include/tao/pegtl/memory_input.hpp
+++ b/packages/PEGTL/include/tao/pegtl/memory_input.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_MEMORY_INPUT_HPP
@@ -8,6 +8,7 @@
 #include <cstdint>
 #include <cstring>
 #include <string>
+#include <string_view>
 #include <type_traits>
 #include <utility>
 
@@ -20,347 +21,361 @@
 
 #include "internal/action_input.hpp"
 #include "internal/at.hpp"
-#include "internal/bump_impl.hpp"
+#include "internal/bump.hpp"
 #include "internal/eolf.hpp"
 #include "internal/iterator.hpp"
 #include "internal/marker.hpp"
 #include "internal/until.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      namespace internal
-      {
-         template< tracking_mode, typename Eol, typename Source >
-         class memory_input_base;
+      template< tracking_mode, typename Eol, typename Source >
+      class memory_input_base;
 
-         template< typename Eol, typename Source >
-         class memory_input_base< tracking_mode::IMMEDIATE, Eol, Source >
-         {
-         public:
-            using iterator_t = internal::iterator;
-
-            template< typename T >
-            memory_input_base( const iterator_t& in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible< Source, T&& >::value )
-               : m_begin( in_begin.data ),
-                 m_current( in_begin ),
-                 m_end( in_end ),
-                 m_source( std::forward< T >( in_source ) )
-            {
-            }
-
-            template< typename T >
-            memory_input_base( const char* in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible< Source, T&& >::value )
-               : m_begin( in_begin ),
-                 m_current( in_begin ),
-                 m_end( in_end ),
-                 m_source( std::forward< T >( in_source ) )
-            {
-            }
-
-            memory_input_base( const memory_input_base& ) = delete;
-            memory_input_base( memory_input_base&& ) = delete;
-
-            ~memory_input_base() = default;
-
-            memory_input_base operator=( const memory_input_base& ) = delete;
-            memory_input_base operator=( memory_input_base&& ) = delete;
-
-            const char* current() const noexcept
-            {
-               return m_current.data;
-            }
-
-            const char* begin() const noexcept
-            {
-               return m_begin;
-            }
-
-            const char* end( const std::size_t /*unused*/ = 0 ) const noexcept
-            {
-               return m_end;
-            }
-
-            std::size_t byte() const noexcept
-            {
-               return m_current.byte;
-            }
-
-            std::size_t line() const noexcept
-            {
-               return m_current.line;
-            }
-
-            std::size_t byte_in_line() const noexcept
-            {
-               return m_current.byte_in_line;
-            }
-
-            void bump( const std::size_t in_count = 1 ) noexcept
-            {
-               internal::bump( m_current, in_count, Eol::ch );
-            }
-
-            void bump_in_this_line( const std::size_t in_count = 1 ) noexcept
-            {
-               internal::bump_in_this_line( m_current, in_count );
-            }
-
-            void bump_to_next_line( const std::size_t in_count = 1 ) noexcept
-            {
-               internal::bump_to_next_line( m_current, in_count );
-            }
-
-            TAO_PEGTL_NAMESPACE::position position( const iterator_t& it ) const
-            {
-               return TAO_PEGTL_NAMESPACE::position( it, m_source );
-            }
-
-            void restart( const std::size_t in_byte = 0, const std::size_t in_line = 1, const std::size_t in_byte_in_line = 0 )
-            {
-               m_current.data = m_begin;
-               m_current.byte = in_byte;
-               m_current.line = in_line;
-               m_current.byte_in_line = in_byte_in_line;
-            }
-
-         protected:
-            const char* const m_begin;
-            iterator_t m_current;
-            const char* const m_end;
-            const Source m_source;
-         };
-
-         template< typename Eol, typename Source >
-         class memory_input_base< tracking_mode::LAZY, Eol, Source >
-         {
-         public:
-            using iterator_t = const char*;
-
-            template< typename T >
-            memory_input_base( const internal::iterator& in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible< Source, T&& >::value )
-               : m_begin( in_begin ),
-                 m_current( in_begin.data ),
-                 m_end( in_end ),
-                 m_source( std::forward< T >( in_source ) )
-            {
-            }
-
-            template< typename T >
-            memory_input_base( const char* in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible< Source, T&& >::value )
-               : m_begin( in_begin ),
-                 m_current( in_begin ),
-                 m_end( in_end ),
-                 m_source( std::forward< T >( in_source ) )
-            {
-            }
-
-            memory_input_base( const memory_input_base& ) = delete;
-            memory_input_base( memory_input_base&& ) = delete;
-
-            ~memory_input_base() = default;
-
-            memory_input_base operator=( const memory_input_base& ) = delete;
-            memory_input_base operator=( memory_input_base&& ) = delete;
-
-            const char* current() const noexcept
-            {
-               return m_current;
-            }
-
-            const char* begin() const noexcept
-            {
-               return m_begin.data;
-            }
-
-            const char* end( const std::size_t /*unused*/ = 0 ) const noexcept
-            {
-               return m_end;
-            }
-
-            std::size_t byte() const noexcept
-            {
-               return std::size_t( current() - m_begin.data );
-            }
-
-            void bump( const std::size_t in_count = 1 ) noexcept
-            {
-               m_current += in_count;
-            }
-
-            void bump_in_this_line( const std::size_t in_count = 1 ) noexcept
-            {
-               m_current += in_count;
-            }
-
-            void bump_to_next_line( const std::size_t in_count = 1 ) noexcept
-            {
-               m_current += in_count;
-            }
-
-            TAO_PEGTL_NAMESPACE::position position( const iterator_t it ) const
-            {
-               internal::iterator c( m_begin );
-               internal::bump( c, std::size_t( it - m_begin.data ), Eol::ch );
-               return TAO_PEGTL_NAMESPACE::position( c, m_source );
-            }
-
-            void restart()
-            {
-               m_current = m_begin.data;
-            }
-
-         protected:
-            const internal::iterator m_begin;
-            iterator_t m_current;
-            const char* const m_end;
-            const Source m_source;
-         };
-
-      }  // namespace internal
-
-      template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf, typename Source = std::string >
-      class memory_input
-         : public internal::memory_input_base< P, Eol, Source >
+      template< typename Eol, typename Source >
+      class memory_input_base< tracking_mode::eager, Eol, Source >
       {
       public:
-         static constexpr tracking_mode tracking_mode_v = P;
+         using iterator_t = internal::iterator;
+
+         template< typename T >
+         memory_input_base( const iterator_t& in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
+            : m_begin( in_begin.data ),
+              m_current( in_begin ),
+              m_end( in_end ),
+              m_source( std::forward< T >( in_source ) )
+         {
+         }
 
-         using eol_t = Eol;
-         using source_t = Source;
+         template< typename T >
+         memory_input_base( const char* in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
+            : m_begin( in_begin ),
+              m_current( in_begin ),
+              m_end( in_end ),
+              m_source( std::forward< T >( in_source ) )
+         {
+         }
 
-         using typename internal::memory_input_base< P, Eol, Source >::iterator_t;
+         memory_input_base( const memory_input_base& ) = delete;
+         memory_input_base( memory_input_base&& ) = delete;
 
-         using action_t = internal::action_input< memory_input >;
+         ~memory_input_base() = default;
 
-         using internal::memory_input_base< P, Eol, Source >::memory_input_base;
+         memory_input_base operator=( const memory_input_base& ) = delete;
+         memory_input_base operator=( memory_input_base&& ) = delete;
 
-         template< typename T >
-         memory_input( const char* in_begin, const std::size_t in_size, T&& in_source ) noexcept( std::is_nothrow_constructible< Source, T&& >::value )
-            : memory_input( in_begin, in_begin + in_size, std::forward< T >( in_source ) )
+         [[nodiscard]] const char* current() const noexcept
          {
+            return m_current.data;
          }
 
-         template< typename T >
-         memory_input( const std::string& in_string, T&& in_source ) noexcept( std::is_nothrow_constructible< Source, T&& >::value )
-            : memory_input( in_string.data(), in_string.size(), std::forward< T >( in_source ) )
+         [[nodiscard]] const char* begin() const noexcept
          {
+            return m_begin;
          }
 
-         template< typename T >
-         memory_input( std::string&&, T&& ) = delete;
+         [[nodiscard]] const char* end( const std::size_t /*unused*/ = 0 ) const noexcept
+         {
+            return m_end;
+         }
 
-         template< typename T >
-         memory_input( const char* in_begin, T&& in_source ) noexcept( std::is_nothrow_constructible< Source, T&& >::value )
-            : memory_input( in_begin, std::strlen( in_begin ), std::forward< T >( in_source ) )
+         [[nodiscard]] std::size_t byte() const noexcept
          {
+            return m_current.byte;
          }
 
-         template< typename T >
-         memory_input( const char* in_begin, const char* in_end, T&& in_source, const std::size_t in_byte, const std::size_t in_line, const std::size_t in_byte_in_line ) noexcept( std::is_nothrow_constructible< Source, T&& >::value )
-            : memory_input( { in_begin, in_byte, in_line, in_byte_in_line }, in_end, std::forward< T >( in_source ) )
+         [[nodiscard]] std::size_t line() const noexcept
          {
+            return m_current.line;
          }
 
-         memory_input( const memory_input& ) = delete;
-         memory_input( memory_input&& ) = delete;
+         [[nodiscard]] std::size_t byte_in_line() const noexcept
+         {
+            return m_current.byte_in_line;
+         }
 
-         ~memory_input() = default;
+         void bump( const std::size_t in_count = 1 ) noexcept
+         {
+            internal::bump( m_current, in_count, Eol::ch );
+         }
 
-         memory_input operator=( const memory_input& ) = delete;
-         memory_input operator=( memory_input&& ) = delete;
+         void bump_in_this_line( const std::size_t in_count = 1 ) noexcept
+         {
+            internal::bump_in_this_line( m_current, in_count );
+         }
 
-         const Source& source() const noexcept
+         void bump_to_next_line( const std::size_t in_count = 1 ) noexcept
          {
-            return this->m_source;
+            internal::bump_to_next_line( m_current, in_count );
          }
 
-         bool empty() const noexcept
+         [[nodiscard]] TAO_PEGTL_NAMESPACE::position position( const iterator_t& it ) const
          {
-            return this->current() == this->end();
+            return TAO_PEGTL_NAMESPACE::position( it, m_source );
          }
 
-         std::size_t size( const std::size_t /*unused*/ = 0 ) const noexcept
+         void restart( const std::size_t in_byte = 0, const std::size_t in_line = 1, const std::size_t in_byte_in_line = 0 )
          {
-            return std::size_t( this->end() - this->current() );
+            m_current.data = m_begin;
+            m_current.byte = in_byte;
+            m_current.line = in_line;
+            m_current.byte_in_line = in_byte_in_line;
          }
 
-         char peek_char( const std::size_t offset = 0 ) const noexcept
+         template< rewind_mode M >
+         void restart( const internal::marker< iterator_t, M >& m )
          {
-            return this->current()[ offset ];
+            m_current.data = m.iterator().data;
+            m_current.byte = m.iterator().byte;
+            m_current.line = m.iterator().line;
+            m_current.byte_in_line = m.iterator().byte_in_line;
          }
 
-         std::uint8_t peek_byte( const std::size_t offset = 0 ) const noexcept
+      protected:
+         const char* const m_begin;
+         iterator_t m_current;
+         const char* const m_end;
+         const Source m_source;
+      };
+
+      template< typename Eol, typename Source >
+      class memory_input_base< tracking_mode::lazy, Eol, Source >
+      {
+      public:
+         using iterator_t = const char*;
+
+         template< typename T >
+         memory_input_base( const internal::iterator& in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
+            : m_begin( in_begin ),
+              m_current( in_begin.data ),
+              m_end( in_end ),
+              m_source( std::forward< T >( in_source ) )
          {
-            return static_cast< std::uint8_t >( peek_char( offset ) );
          }
 
-         iterator_t& iterator() noexcept
+         template< typename T >
+         memory_input_base( const char* in_begin, const char* in_end, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
+            : m_begin( in_begin ),
+              m_current( in_begin ),
+              m_end( in_end ),
+              m_source( std::forward< T >( in_source ) )
          {
-            return this->m_current;
          }
 
-         const iterator_t& iterator() const noexcept
+         memory_input_base( const memory_input_base& ) = delete;
+         memory_input_base( memory_input_base&& ) = delete;
+
+         ~memory_input_base() = default;
+
+         memory_input_base operator=( const memory_input_base& ) = delete;
+         memory_input_base operator=( memory_input_base&& ) = delete;
+
+         [[nodiscard]] const char* current() const noexcept
          {
-            return this->m_current;
+            return m_current;
          }
 
-         using internal::memory_input_base< P, Eol, Source >::position;
+         [[nodiscard]] const char* begin() const noexcept
+         {
+            return m_begin.data;
+         }
 
-         TAO_PEGTL_NAMESPACE::position position() const
+         [[nodiscard]] const char* end( const std::size_t /*unused*/ = 0 ) const noexcept
          {
-            return position( iterator() );
+            return m_end;
          }
 
-         void discard() const noexcept
+         [[nodiscard]] std::size_t byte() const noexcept
          {
+            return std::size_t( current() - m_begin.data );
          }
 
-         void require( const std::size_t /*unused*/ ) const noexcept
+         void bump( const std::size_t in_count = 1 ) noexcept
          {
+            m_current += in_count;
          }
 
-         template< rewind_mode M >
-         internal::marker< iterator_t, M > mark() noexcept
+         void bump_in_this_line( const std::size_t in_count = 1 ) noexcept
          {
-            return internal::marker< iterator_t, M >( iterator() );
+            m_current += in_count;
          }
 
-         const char* at( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
+         void bump_to_next_line( const std::size_t in_count = 1 ) noexcept
          {
-            return this->begin() + p.byte;
+            m_current += in_count;
          }
 
-         const char* begin_of_line( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
+         [[nodiscard]] TAO_PEGTL_NAMESPACE::position position( const iterator_t it ) const
          {
-            return at( p ) - p.byte_in_line;
+            internal::iterator c( m_begin );
+            internal::bump( c, std::size_t( it - m_begin.data ), Eol::ch );
+            return TAO_PEGTL_NAMESPACE::position( c, m_source );
          }
 
-         const char* end_of_line( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
+         void restart()
          {
-            using input_t = memory_input< tracking_mode::LAZY, Eol, const char* >;
-            input_t in( at( p ), this->end(), "" );
-            using grammar = internal::until< internal::at< internal::eolf > >;
-            normal< grammar >::match< apply_mode::NOTHING, rewind_mode::DONTCARE, nothing, normal >( in );
-            return in.current();
+            m_current = m_begin.data;
          }
 
-         std::string line_as_string( const TAO_PEGTL_NAMESPACE::position& p ) const
+         template< rewind_mode M >
+         void restart( const internal::marker< iterator_t, M >& m )
          {
-            return std::string( begin_of_line( p ), end_of_line( p ) );
+            m_current = m.iterator();
          }
 
-         void* internal_state = nullptr;
+      protected:
+         const internal::iterator m_begin;
+         iterator_t m_current;
+         const char* const m_end;
+         const Source m_source;
       };
 
-#ifdef __cpp_deduction_guides
-      template< typename... Ts >
-      memory_input( Ts&&... )->memory_input<>;
-#endif
+   }  // namespace internal
+
+   template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf, typename Source = std::string >
+   class memory_input
+      : public internal::memory_input_base< P, Eol, Source >
+   {
+   public:
+      static constexpr tracking_mode tracking_mode_v = P;
+
+      using eol_t = Eol;
+      using source_t = Source;
+
+      using typename internal::memory_input_base< P, Eol, Source >::iterator_t;
+
+      using action_t = internal::action_input< memory_input >;
+
+      using internal::memory_input_base< P, Eol, Source >::memory_input_base;
+
+      template< typename T >
+      memory_input( const char* in_begin, const std::size_t in_size, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )  // NOLINT
+         : memory_input( in_begin, in_begin + in_size, std::forward< T >( in_source ) )
+      {
+      }
+
+      template< typename T >
+      memory_input( const std::string& in_string, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
+         : memory_input( in_string.data(), in_string.size(), std::forward< T >( in_source ) )
+      {
+      }
+
+      template< typename T >
+      memory_input( const std::string_view in_string, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )  // NOLINT
+         : memory_input( in_string.data(), in_string.size(), std::forward< T >( in_source ) )
+      {
+      }
+
+      template< typename T >
+      memory_input( std::string&&, T&& ) = delete;
+
+      template< typename T >
+      memory_input( const char* in_begin, T&& in_source ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )
+         : memory_input( in_begin, std::strlen( in_begin ), std::forward< T >( in_source ) )
+      {
+      }
+
+      template< typename T >
+      memory_input( const char* in_begin, const char* in_end, T&& in_source, const std::size_t in_byte, const std::size_t in_line, const std::size_t in_byte_in_line ) noexcept( std::is_nothrow_constructible_v< Source, T&& > )  // NOLINT
+         : memory_input( { in_begin, in_byte, in_line, in_byte_in_line }, in_end, std::forward< T >( in_source ) )
+      {
+      }
+
+      memory_input( const memory_input& ) = delete;
+      memory_input( memory_input&& ) = delete;
+
+      ~memory_input() = default;
+
+      memory_input operator=( const memory_input& ) = delete;
+      memory_input operator=( memory_input&& ) = delete;
+
+      [[nodiscard]] const Source& source() const noexcept
+      {
+         return this->m_source;
+      }
+
+      [[nodiscard]] bool empty() const noexcept
+      {
+         return this->current() == this->end();
+      }
+
+      [[nodiscard]] std::size_t size( const std::size_t /*unused*/ = 0 ) const noexcept
+      {
+         return std::size_t( this->end() - this->current() );
+      }
+
+      [[nodiscard]] char peek_char( const std::size_t offset = 0 ) const noexcept
+      {
+         return this->current()[ offset ];
+      }
+
+      [[nodiscard]] std::uint8_t peek_uint8( const std::size_t offset = 0 ) const noexcept
+      {
+         return static_cast< std::uint8_t >( peek_char( offset ) );
+      }
+
+      [[nodiscard]] iterator_t& iterator() noexcept
+      {
+         return this->m_current;
+      }
+
+      [[nodiscard]] const iterator_t& iterator() const noexcept
+      {
+         return this->m_current;
+      }
+
+      using internal::memory_input_base< P, Eol, Source >::position;
+
+      [[nodiscard]] TAO_PEGTL_NAMESPACE::position position() const
+      {
+         return position( iterator() );
+      }
+
+      void discard() const noexcept
+      {
+      }
+
+      void require( const std::size_t /*unused*/ ) const noexcept
+      {
+      }
+
+      template< rewind_mode M >
+      [[nodiscard]] internal::marker< iterator_t, M > mark() noexcept
+      {
+         return internal::marker< iterator_t, M >( iterator() );
+      }
+
+      [[nodiscard]] const char* at( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
+      {
+         return this->begin() + p.byte;
+      }
+
+      [[nodiscard]] const char* begin_of_line( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
+      {
+         return at( p ) - p.byte_in_line;
+      }
+
+      [[nodiscard]] const char* end_of_line( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
+      {
+         using input_t = memory_input< tracking_mode::lazy, Eol, const char* >;
+         input_t in( at( p ), this->end(), "" );
+         using grammar = internal::until< internal::at< internal::eolf > >;
+         (void)normal< grammar >::match< apply_mode::nothing, rewind_mode::dontcare, nothing, normal >( in );
+         return in.current();
+      }
+
+      [[nodiscard]] std::string_view line_at( const TAO_PEGTL_NAMESPACE::position& p ) const noexcept
+      {
+         const char* b = begin_of_line( p );
+         return std::string_view( b, end_of_line( p ) - b );
+      }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Ts >
+   memory_input( Ts&&... )->memory_input<>;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/mmap_input.hpp b/packages/PEGTL/include/tao/pegtl/mmap_input.hpp
index 92c38f69790d27dfcf3c3987897502b723bd0c68..1b9d067d2b65884bf1f515d328fd781160778745 100644
--- a/packages/PEGTL/include/tao/pegtl/mmap_input.hpp
+++ b/packages/PEGTL/include/tao/pegtl/mmap_input.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_MMAP_INPUT_HPP
@@ -23,63 +23,57 @@
 #else
 #endif
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      namespace internal
+      struct mmap_holder
       {
-         struct mmap_holder
-         {
-            const std::string filename;
-            const file_mapper data;
+         const std::string filename;
+         const file_mapper data;
 
-            template< typename T >
-            explicit mmap_holder( T&& in_filename )
-               : filename( std::forward< T >( in_filename ) ),
-                 data( filename.c_str() )
-            {
-            }
+         template< typename T >
+         explicit mmap_holder( T&& in_filename )
+            : filename( std::forward< T >( in_filename ) ),
+              data( filename.c_str() )
+         {
+         }
 
-            mmap_holder( const mmap_holder& ) = delete;
-            mmap_holder( mmap_holder&& ) = delete;
+         mmap_holder( const mmap_holder& ) = delete;
+         mmap_holder( mmap_holder&& ) = delete;
 
-            ~mmap_holder() = default;
+         ~mmap_holder() = default;
 
-            void operator=( const mmap_holder& ) = delete;
-            void operator=( mmap_holder&& ) = delete;
-         };
+         void operator=( const mmap_holder& ) = delete;
+         void operator=( mmap_holder&& ) = delete;
+      };
 
-      }  // namespace internal
+   }  // namespace internal
 
-      template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
-      struct mmap_input
-         : private internal::mmap_holder,
-           public memory_input< P, Eol, const char* >
+   template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
+   struct mmap_input
+      : private internal::mmap_holder,
+        public memory_input< P, Eol, const char* >
+   {
+      template< typename T >
+      explicit mmap_input( T&& in_filename )
+         : internal::mmap_holder( std::forward< T >( in_filename ) ),
+           memory_input< P, Eol, const char* >( data.begin(), data.end(), filename.c_str() )
       {
-         template< typename T >
-         explicit mmap_input( T&& in_filename )
-            : internal::mmap_holder( std::forward< T >( in_filename ) ),
-              memory_input< P, Eol, const char* >( data.begin(), data.end(), filename.c_str() )
-         {
-         }
+      }
 
-         mmap_input( const mmap_input& ) = delete;
-         mmap_input( mmap_input&& ) = delete;
+      mmap_input( const mmap_input& ) = delete;
+      mmap_input( mmap_input&& ) = delete;
 
-         ~mmap_input() = default;
+      ~mmap_input() = default;
 
-         void operator=( const mmap_input& ) = delete;
-         void operator=( mmap_input&& ) = delete;
-      };
-
-#ifdef __cpp_deduction_guides
-      template< typename... Ts >
-      explicit mmap_input( Ts&&... )->mmap_input<>;
-#endif
+      void operator=( const mmap_input& ) = delete;
+      void operator=( mmap_input&& ) = delete;
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Ts >
+   explicit mmap_input( Ts&&... )->mmap_input<>;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/normal.hpp b/packages/PEGTL/include/tao/pegtl/normal.hpp
index 8f7949aae4f5664feb3e28e2bacb3acea51c08ff..b7b323534139ce3ea97855b1f5324dd1470a5c12 100644
--- a/packages/PEGTL/include/tao/pegtl/normal.hpp
+++ b/packages/PEGTL/include/tao/pegtl/normal.hpp
@@ -1,90 +1,86 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_NORMAL_HPP
 #define TAO_PEGTL_NORMAL_HPP
 
+#include <type_traits>
 #include <utility>
 
 #include "apply_mode.hpp"
 #include "config.hpp"
-#include "nothing.hpp"
+#include "match.hpp"
 #include "parse_error.hpp"
 #include "rewind_mode.hpp"
 
 #include "internal/demangle.hpp"
-#include "internal/dusel_mode.hpp"
-#include "internal/duseltronik.hpp"
-#include "internal/has_apply.hpp"
-#include "internal/has_apply0.hpp"
-#include "internal/skip_control.hpp"
+#include "internal/has_match.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule >
+   struct normal
    {
-      template< typename Rule >
-      struct normal
+      template< typename Input, typename... States >
+      static void start( const Input& /*unused*/, States&&... /*unused*/ ) noexcept
       {
-         template< typename Input, typename... States >
-         static void start( const Input& /*unused*/, States&&... /*unused*/ ) noexcept
-         {
-         }
+      }
 
-         template< typename Input, typename... States >
-         static void success( const Input& /*unused*/, States&&... /*unused*/ ) noexcept
-         {
-         }
+      template< typename Input, typename... States >
+      static void success( const Input& /*unused*/, States&&... /*unused*/ ) noexcept
+      {
+      }
 
-         template< typename Input, typename... States >
-         static void failure( const Input& /*unused*/, States&&... /*unused*/ ) noexcept
-         {
-         }
+      template< typename Input, typename... States >
+      static void failure( const Input& /*unused*/, States&&... /*unused*/ ) noexcept
+      {
+      }
 
-         template< typename Input, typename... States >
-         static void raise( const Input& in, States&&... /*unused*/ )
-         {
-            throw parse_error( "parse error matching " + internal::demangle< Rule >(), in );
-         }
+      template< typename Input, typename... States >
+      static void raise( const Input& in, States&&... /*unused*/ )
+      {
+         throw parse_error( "parse error matching " + internal::demangle< Rule >(), in );
+      }
 
-         template< template< typename... > class Action, typename Input, typename... States >
-         static auto apply0( const Input& /*unused*/, States&&... st )
-            -> decltype( Action< Rule >::apply0( st... ) )
-         {
-            return Action< Rule >::apply0( st... );
-         }
+      template< template< typename... > class Action,
+                typename Iterator,
+                typename Input,
+                typename... States >
+      static auto apply( const Iterator& begin, const Input& in, States&&... st ) noexcept( noexcept( Action< Rule >::apply( std::declval< const typename Input::action_t& >(), st... ) ) )
+         -> decltype( Action< Rule >::apply( std::declval< const typename Input::action_t& >(), st... ) )
+      {
+         const typename Input::action_t action_input( begin, in );
+         return Action< Rule >::apply( action_input, st... );
+      }
 
-         template< template< typename... > class Action, typename Iterator, typename Input, typename... States >
-         static auto apply( const Iterator& begin, const Input& in, States&&... st )
-            -> decltype( Action< Rule >::apply( std::declval< typename Input::action_t >(), st... ) )
-         {
-            const typename Input::action_t action_input( begin, in );
-            return Action< Rule >::apply( action_input, st... );
-         }
+      template< template< typename... > class Action,
+                typename Input,
+                typename... States >
+      static auto apply0( const Input& /*unused*/, States&&... st ) noexcept( noexcept( Action< Rule >::apply0( st... ) ) )
+         -> decltype( Action< Rule >::apply0( st... ) )
+      {
+         return Action< Rule >::apply0( st... );
+      }
 
-         template< apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control,
-                   typename Input,
-                   typename... States >
-         static bool match( Input& in, States&&... st )
-         {
-            constexpr char use_control = !internal::skip_control< Rule >::value;
-            constexpr char use_action = use_control && ( A == apply_mode::ACTION ) && ( !is_nothing< Action, Rule >::value );
-            constexpr char use_apply_void = use_action && internal::has_apply< Action< Rule >, void, typename Input::action_t, States... >::value;
-            constexpr char use_apply_bool = use_action && internal::has_apply< Action< Rule >, bool, typename Input::action_t, States... >::value;
-            constexpr char use_apply0_void = use_action && internal::has_apply0< Action< Rule >, void, States... >::value;
-            constexpr char use_apply0_bool = use_action && internal::has_apply0< Action< Rule >, bool, States... >::value;
-            static_assert( !use_action || use_apply_bool || use_apply_void || use_apply0_bool || use_apply0_void, "actions not disabled but no apply() or apply0() found" );
-            static_assert( use_apply_void + use_apply_bool + use_apply0_void + use_apply0_bool < 2, "both apply() and apply0() defined" );
-            constexpr auto mode = static_cast< dusel_mode >( use_control + use_apply_void + 2 * use_apply_bool + 3 * use_apply0_void + 4 * use_apply0_bool );
-            return internal::duseltronik< Rule, A, M, Action, Control, mode >::match( in, st... );
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... st )
+      {
+         if constexpr( internal::has_match_v< Rule, A, M, Action, Control, Input, States... > ) {
+            return Action< Rule >::template match< Rule, A, M, Action, Control >( in, st... );
          }
-      };
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+         else {  // NOLINT
+            return TAO_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in, st... );
+         }
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/nothing.hpp b/packages/PEGTL/include/tao/pegtl/nothing.hpp
index 9d2ae16c3c225560c730bc5fa30ac07b26e4fa29..20c23c2b9e1459be88e8a599140ee2a02d466818 100644
--- a/packages/PEGTL/include/tao/pegtl/nothing.hpp
+++ b/packages/PEGTL/include/tao/pegtl/nothing.hpp
@@ -1,27 +1,20 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_NOTHING_HPP
 #define TAO_PEGTL_NOTHING_HPP
 
-#include <type_traits>
-
 #include "config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule >
+   struct nothing
    {
-      template< typename Rule >
-      struct nothing
-      {
-      };
-
-      template< template< typename... > class Action, typename Rule >
-      using is_nothing = std::is_base_of< nothing< Rule >, Action< Rule > >;
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   using maybe_nothing = nothing< void >;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/parse.hpp b/packages/PEGTL/include/tao/pegtl/parse.hpp
index 1f3254964e9452dce820435d9232ca0ec1d85eb9..d566eaeccfc3e602b6f22d2f5ff00fab8189878c 100644
--- a/packages/PEGTL/include/tao/pegtl/parse.hpp
+++ b/packages/PEGTL/include/tao/pegtl/parse.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_PARSE_HPP
@@ -15,70 +15,39 @@
 
 #include "internal/action_input.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule,
+             template< typename... > class Action = nothing,
+             template< typename... > class Control = normal,
+             apply_mode A = apply_mode::action,
+             rewind_mode M = rewind_mode::required,
+             typename Input,
+             typename... States >
+   bool parse( Input&& in, States&&... st )
    {
-      namespace internal
-      {
-         template< typename From >
-         struct copy_internals
-         {
-            template< typename To >
-            static void apply( const From& from, To& to ) noexcept
-            {
-               assert( to.internal_state == nullptr );
-               to.internal_state = from.internal_state;
-            }
-         };
-
-         template< typename Input >
-         struct copy_internals< action_input< Input > >
-         {
-            template< typename To >
-            static void apply( const action_input< Input >& from, To& to ) noexcept
-            {
-               assert( to.internal_state == nullptr );
-               to.internal_state = from.input().internal_state;
-            }
-         };
-
-      }  // namespace internal
-
-      template< typename Rule,
-                template< typename... > class Action = nothing,
-                template< typename... > class Control = normal,
-                apply_mode A = apply_mode::ACTION,
-                rewind_mode M = rewind_mode::REQUIRED,
-                typename Input,
-                typename... States >
-      bool parse( Input&& in, States&&... st )
-      {
-         return Control< Rule >::template match< A, M, Action, Control >( in, st... );
+      return Control< Rule >::template match< A, M, Action, Control >( in, st... );
+   }
+
+   template< typename Rule,
+             template< typename... > class Action = nothing,
+             template< typename... > class Control = normal,
+             apply_mode A = apply_mode::action,
+             rewind_mode M = rewind_mode::required,
+             typename Outer,
+             typename Input,
+             typename... States >
+   bool parse_nested( const Outer& oi, Input&& in, States&&... st )
+   {
+      try {
+         return parse< Rule, Action, Control, A, M >( in, st... );
       }
-
-      template< typename Rule,
-                template< typename... > class Action = nothing,
-                template< typename... > class Control = normal,
-                apply_mode A = apply_mode::ACTION,
-                rewind_mode M = rewind_mode::REQUIRED,
-                typename Outer,
-                typename Input,
-                typename... States >
-      bool parse_nested( const Outer& oi, Input&& in, States&&... st )
-      {
-         try {
-            internal::copy_internals< Outer >::apply( oi, in );
-            return parse< Rule, Action, Control, A, M >( in, st... );
-         }
-         catch( parse_error& e ) {
-            e.positions.push_back( oi.position() );
-            throw;
-         }
+      catch( parse_error& e ) {
+         e.positions.push_back( oi.position() );
+         throw;
       }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/parse_error.hpp b/packages/PEGTL/include/tao/pegtl/parse_error.hpp
index 4d62811f2dbce758495f9be187bafbc7f6913551..eee0ec686693a02207a230a0a3683ce0eb1afc99 100644
--- a/packages/PEGTL/include/tao/pegtl/parse_error.hpp
+++ b/packages/PEGTL/include/tao/pegtl/parse_error.hpp
@@ -1,45 +1,76 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_PARSE_ERROR_HPP
 #define TAO_PEGTL_PARSE_ERROR_HPP
 
+#include <ostream>
+#include <sstream>
 #include <stdexcept>
+#include <string>
+#include <utility>
 #include <vector>
 
 #include "config.hpp"
 #include "position.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct parse_error
+      : public std::runtime_error
    {
-      struct parse_error
-         : public std::runtime_error
+      template< typename Msg >
+      parse_error( Msg&& msg, const std::vector< position >& in_positions )
+         : std::runtime_error( std::forward< Msg >( msg ) ),
+           positions( in_positions )
       {
-         parse_error( const std::string& msg, std::vector< position >&& in_positions )
-            : std::runtime_error( msg ),
-              positions( std::move( in_positions ) )
-         {
-         }
-
-         template< typename Input >
-         parse_error( const std::string& msg, const Input& in )
-            : parse_error( msg, in.position() )
-         {
-         }
-
-         parse_error( const std::string& msg, const position& pos )
-            : std::runtime_error( to_string( pos ) + ": " + msg ),
-              positions( 1, pos )
-         {
-         }
-
-         std::vector< position > positions;
-      };
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      }
+
+      template< typename Msg >
+      parse_error( Msg&& msg, std::vector< position >&& in_positions )
+         : std::runtime_error( std::forward< Msg >( msg ) ),
+           positions( std::move( in_positions ) )
+      {
+      }
+
+      template< typename Msg >
+      parse_error( Msg&& msg, const position& pos )
+         : std::runtime_error( std::forward< Msg >( msg ) ),
+           positions( 1, pos )
+      {
+      }
+
+      template< typename Msg >
+      parse_error( Msg&& msg, position&& pos )
+         : std::runtime_error( std::forward< Msg >( msg ) )
+      {
+         positions.emplace_back( std::move( pos ) );
+      }
+
+      template< typename Msg, typename Input >
+      parse_error( Msg&& msg, const Input& in )
+         : parse_error( std::forward< Msg >( msg ), in.position() )
+      {
+      }
+
+      std::vector< position > positions;
+   };
+
+   inline std::ostream& operator<<( std::ostream& o, const parse_error& e )
+   {
+      for( auto it = e.positions.rbegin(); it != e.positions.rend(); ++it ) {
+         o << *it << ": ";
+      }
+      return o << e.what();
+   }
+
+   [[nodiscard]] inline std::string to_string( const parse_error& e )
+   {
+      std::ostringstream o;
+      o << e;
+      return o.str();
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/position.hpp b/packages/PEGTL/include/tao/pegtl/position.hpp
index a7fe2b38fa75dcc28370059213e22eeec5657e4f..c14446f73ed21bb812b403691e2fcb4e2ef0072b 100644
--- a/packages/PEGTL/include/tao/pegtl/position.hpp
+++ b/packages/PEGTL/include/tao/pegtl/position.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_POSITION_HPP
@@ -14,41 +14,37 @@
 
 #include "internal/iterator.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct position
    {
-      struct position
+      template< typename T >
+      position( const internal::iterator& in_iter, T&& in_source )
+         : byte( in_iter.byte ),
+           line( in_iter.line ),
+           byte_in_line( in_iter.byte_in_line ),
+           source( std::forward< T >( in_source ) )
       {
-         template< typename T >
-         position( const internal::iterator& in_iter, T&& in_source )
-            : byte( in_iter.byte ),
-              line( in_iter.line ),
-              byte_in_line( in_iter.byte_in_line ),
-              source( std::forward< T >( in_source ) )
-         {
-         }
-
-         std::size_t byte;
-         std::size_t line;
-         std::size_t byte_in_line;
-         std::string source;
-      };
-
-      inline std::ostream& operator<<( std::ostream& o, const position& p )
-      {
-         return o << p.source << ':' << p.line << ':' << p.byte_in_line << '(' << p.byte << ')';
       }
 
-      inline std::string to_string( const position& p )
-      {
-         std::ostringstream o;
-         o << p;
-         return o.str();
-      }
+      std::size_t byte;
+      std::size_t line;
+      std::size_t byte_in_line;
+      std::string source;
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   inline std::ostream& operator<<( std::ostream& o, const position& p )
+   {
+      return o << p.source << ':' << p.line << ':' << p.byte_in_line << '(' << p.byte << ')';
+   }
+
+   [[nodiscard]] inline std::string to_string( const position& p )
+   {
+      std::ostringstream o;
+      o << p;
+      return o.str();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/read_input.hpp b/packages/PEGTL/include/tao/pegtl/read_input.hpp
index 8d7eb0481f5f62655f4059bec5503e06a13ca530..72be702fdceb4fd41e8049e9994f272372f51210 100644
--- a/packages/PEGTL/include/tao/pegtl/read_input.hpp
+++ b/packages/PEGTL/include/tao/pegtl/read_input.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_READ_INPUT_HPP
@@ -13,68 +13,62 @@
 
 #include "internal/file_reader.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      namespace internal
+      struct filename_holder
       {
-         struct filename_holder
-         {
-            const std::string filename;
+         const std::string filename;
 
-            template< typename T >
-            explicit filename_holder( T&& in_filename )
-               : filename( std::forward< T >( in_filename ) )
-            {
-            }
+         template< typename T >
+         explicit filename_holder( T&& in_filename )
+            : filename( std::forward< T >( in_filename ) )
+         {
+         }
 
-            filename_holder( const filename_holder& ) = delete;
-            filename_holder( filename_holder&& ) = delete;
+         filename_holder( const filename_holder& ) = delete;
+         filename_holder( filename_holder&& ) = delete;
 
-            ~filename_holder() = default;
+         ~filename_holder() = default;
 
-            void operator=( const filename_holder& ) = delete;
-            void operator=( filename_holder&& ) = delete;
-         };
+         void operator=( const filename_holder& ) = delete;
+         void operator=( filename_holder&& ) = delete;
+      };
 
-      }  // namespace internal
+   }  // namespace internal
 
-      template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
-      struct read_input
-         : private internal::filename_holder,
-           public string_input< P, Eol, const char* >
+   template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
+   struct read_input
+      : private internal::filename_holder,
+        public string_input< P, Eol, const char* >
+   {
+      template< typename T >
+      explicit read_input( T&& in_filename )
+         : internal::filename_holder( std::forward< T >( in_filename ) ),
+           string_input< P, Eol, const char* >( internal::file_reader( filename.c_str() ).read(), filename.c_str() )
       {
-         template< typename T >
-         explicit read_input( T&& in_filename )
-            : internal::filename_holder( std::forward< T >( in_filename ) ),
-              string_input< P, Eol, const char* >( internal::file_reader( filename.c_str() ).read(), filename.c_str() )
-         {
-         }
-
-         template< typename T >
-         read_input( FILE* in_file, T&& in_filename )
-            : internal::filename_holder( std::forward< T >( in_filename ) ),
-              string_input< P, Eol, const char* >( internal::file_reader( in_file, filename.c_str() ).read(), filename.c_str() )
-         {
-         }
+      }
 
-         read_input( const read_input& ) = delete;
-         read_input( read_input&& ) = delete;
+      template< typename T >
+      read_input( FILE* in_file, T&& in_filename )
+         : internal::filename_holder( std::forward< T >( in_filename ) ),
+           string_input< P, Eol, const char* >( internal::file_reader( in_file, filename.c_str() ).read(), filename.c_str() )
+      {
+      }
 
-         ~read_input() = default;
+      read_input( const read_input& ) = delete;
+      read_input( read_input&& ) = delete;
 
-         void operator=( const read_input& ) = delete;
-         void operator=( read_input&& ) = delete;
-      };
+      ~read_input() = default;
 
-#ifdef __cpp_deduction_guides
-      template< typename... Ts >
-      explicit read_input( Ts&&... )->read_input<>;
-#endif
+      void operator=( const read_input& ) = delete;
+      void operator=( read_input&& ) = delete;
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Ts >
+   explicit read_input( Ts&&... )->read_input<>;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/require_apply.hpp b/packages/PEGTL/include/tao/pegtl/require_apply.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..66d46715dc6c82d25d769318f24a279a31a58e67
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/require_apply.hpp
@@ -0,0 +1,16 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_REQUIRE_APPLY_HPP
+#define TAO_PEGTL_REQUIRE_APPLY_HPP
+
+#include "config.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   struct require_apply
+   {};
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/require_apply0.hpp b/packages/PEGTL/include/tao/pegtl/require_apply0.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..af95110b3f8b68c29c4fe78c4f2112d7168dc022
--- /dev/null
+++ b/packages/PEGTL/include/tao/pegtl/require_apply0.hpp
@@ -0,0 +1,16 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#ifndef TAO_PEGTL_REQUIRE_APPLY0_HPP
+#define TAO_PEGTL_REQUIRE_APPLY0_HPP
+
+#include "config.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   struct require_apply0
+   {};
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#endif
diff --git a/packages/PEGTL/include/tao/pegtl/rewind_mode.hpp b/packages/PEGTL/include/tao/pegtl/rewind_mode.hpp
index c12fddc88a8401dd95b3c42d43ebd5de79e4a06e..0d9ad32c0edf7f8f75eace944590cce630ef55f3 100644
--- a/packages/PEGTL/include/tao/pegtl/rewind_mode.hpp
+++ b/packages/PEGTL/include/tao/pegtl/rewind_mode.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_REWIND_MODE_HPP
@@ -6,19 +6,15 @@
 
 #include "config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   enum class rewind_mode : char
    {
-      enum class rewind_mode : char
-      {
-         ACTIVE,
-         REQUIRED,
-         DONTCARE
-      };
+      active,
+      required,
+      dontcare
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/rules.hpp b/packages/PEGTL/include/tao/pegtl/rules.hpp
index 53364a40c75e269b608b301da0291dccc9508006..7ec5b8494ea3894adb7ea9cc15221e51c7b3448b 100644
--- a/packages/PEGTL/include/tao/pegtl/rules.hpp
+++ b/packages/PEGTL/include/tao/pegtl/rules.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_RULES_HPP
@@ -9,62 +9,59 @@
 
 #include "internal/rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      // clang-format off
-      template< typename... Actions > struct apply : internal::apply< Actions... > {};
-      template< typename... Actions > struct apply0 : internal::apply0< Actions... > {};
-      template< template< typename... > class Action, typename... Rules > struct action : internal::action< Action, Rules... > {};
-      template< typename... Rules > struct at : internal::at< Rules... > {};
-      struct bof : internal::bof {};
-      struct bol : internal::bol {};
-      template< unsigned Num > struct bytes : internal::bytes< Num > {};
-      template< template< typename... > class Control, typename... Rules > struct control : internal::control< Control, Rules... > {};
-      template< typename... Rules > struct disable : internal::disable< Rules... > {};
-      struct discard : internal::discard {};
-      template< typename... Rules > struct enable : internal::enable< Rules... > {};
-      struct eof : internal::eof {};
-      struct failure : internal::trivial< false > {};
-      template< typename Rule, typename... Actions > struct if_apply : internal::if_apply< Rule, Actions... > {};
-      template< typename Cond, typename... Thens > struct if_must : internal::if_must< false, Cond, Thens... > {};
-      template< typename Cond, typename Then, typename Else > struct if_must_else : internal::if_must_else< Cond, Then, Else > {};
-      template< typename Cond, typename Then, typename Else > struct if_then_else : internal::if_then_else< Cond, Then, Else > {};
-      template< typename Rule, typename Sep, typename Pad = void > struct list : internal::list< Rule, internal::pad< Sep, Pad > > {};
-      template< typename Rule, typename Sep > struct list< Rule, Sep, void > : internal::list< Rule, Sep > {};
-      template< typename Rule, typename Sep, typename Pad = void > struct list_must : internal::list_must< Rule, internal::pad< Sep, Pad > > {};
-      template< typename Rule, typename Sep > struct list_must< Rule, Sep, void > : internal::list_must< Rule, Sep > {};
-      template< typename Rule, typename Sep, typename Pad = void > struct list_tail : internal::list_tail_pad< Rule, Sep, Pad > {};
-      template< typename Rule, typename Sep > struct list_tail< Rule, Sep, void > : internal::list_tail< Rule, Sep > {};
-      template< typename M, typename S > struct minus : internal::minus< M, S > {};
-      template< typename... Rules > struct must : internal::must< Rules... > {};
-      template< typename... Rules > struct not_at : internal::not_at< Rules... > {};
-      template< typename... Rules > struct opt : internal::opt< Rules... > {};
-      template< typename Cond, typename... Rules > struct opt_must : internal::if_must< true, Cond, Rules... > {};
-      template< typename Rule, typename Pad1, typename Pad2 = Pad1 > struct pad : internal::pad< Rule, Pad1, Pad2 > {};
-      template< typename Rule, typename Pad > struct pad_opt : internal::pad_opt< Rule, Pad > {};
-      template< typename Rule, typename... Rules > struct plus : internal::plus< Rule, Rules... > {};
-      template< typename Exception > struct raise : internal::raise< Exception > {};
-      template< unsigned Num, typename... Rules > struct rep : internal::rep< Num, Rules... > {};
-      template< unsigned Max, typename... Rules > struct rep_max : internal::rep_min_max< 0, Max, Rules... > {};
-      template< unsigned Min, typename Rule, typename... Rules > struct rep_min : internal::rep_min< Min, Rule, Rules... > {};
-      template< unsigned Min, unsigned Max, typename... Rules > struct rep_min_max : internal::rep_min_max< Min, Max, Rules... > {};
-      template< unsigned Max, typename... Rules > struct rep_opt : internal::rep_opt< Max, Rules... > {};
-      template< unsigned Amount > struct require : internal::require< Amount > {};
-      template< typename... Rules > struct seq : internal::seq< Rules... > {};
-      template< typename... Rules > struct sor : internal::sor< Rules... > {};
-      template< typename Rule, typename... Rules > struct star : internal::star< Rule, Rules... > {};
-      template< typename Cond, typename... Rules > struct star_must : internal::star_must< Cond, Rules... > {};
-      template< typename State, typename... Rules > struct state : internal::state< State, Rules... > {};
-      struct success : internal::trivial< true > {};
-      template< typename... Rules > struct try_catch : internal::try_catch_type< parse_error, Rules... > {};
-      template< typename Exception, typename... Rules > struct try_catch_type : internal::try_catch_type< Exception, Rules... > {};
-      template< typename Cond, typename... Rules > struct until : internal::until< Cond, Rules... > {};
-      // clang-format on
+   // clang-format off
+   template< typename... Actions > struct apply : internal::apply< Actions... > {};
+   template< typename... Actions > struct apply0 : internal::apply0< Actions... > {};
+   template< template< typename... > class Action, typename... Rules > struct action : internal::action< Action, Rules... > {};
+   template< typename... Rules > struct at : internal::at< Rules... > {};
+   struct bof : internal::bof {};
+   struct bol : internal::bol {};
+   template< unsigned Num > struct bytes : internal::bytes< Num > {};
+   template< template< typename... > class Control, typename... Rules > struct control : internal::control< Control, Rules... > {};
+   template< typename... Rules > struct disable : internal::disable< Rules... > {};
+   struct discard : internal::discard {};
+   template< typename... Rules > struct enable : internal::enable< Rules... > {};
+   struct eof : internal::eof {};
+   struct failure : internal::trivial< false > {};
+   template< typename Rule, typename... Actions > struct if_apply : internal::if_apply< Rule, Actions... > {};
+   template< typename Cond, typename... Thens > struct if_must : internal::if_must< false, Cond, Thens... > {};
+   template< typename Cond, typename Then, typename Else > struct if_must_else : internal::if_must_else< Cond, Then, Else > {};
+   template< typename Cond, typename Then, typename Else > struct if_then_else : internal::if_then_else< Cond, Then, Else > {};
+   template< typename Rule, typename Sep, typename Pad = void > struct list : internal::list< Rule, internal::pad< Sep, Pad > > {};
+   template< typename Rule, typename Sep > struct list< Rule, Sep, void > : internal::list< Rule, Sep > {};
+   template< typename Rule, typename Sep, typename Pad = void > struct list_must : internal::list_must< Rule, internal::pad< Sep, Pad > > {};
+   template< typename Rule, typename Sep > struct list_must< Rule, Sep, void > : internal::list_must< Rule, Sep > {};
+   template< typename Rule, typename Sep, typename Pad = void > struct list_tail : internal::list_tail_pad< Rule, Sep, Pad > {};
+   template< typename Rule, typename Sep > struct list_tail< Rule, Sep, void > : internal::list_tail< Rule, Sep > {};
+   template< typename M, typename S > struct minus : internal::rematch< M, internal::not_at< S, internal::eof > > {};
+   template< typename... Rules > struct must : internal::must< Rules... > {};
+   template< typename... Rules > struct not_at : internal::not_at< Rules... > {};
+   template< typename... Rules > struct opt : internal::opt< Rules... > {};
+   template< typename Cond, typename... Rules > struct opt_must : internal::if_must< true, Cond, Rules... > {};
+   template< typename Rule, typename Pad1, typename Pad2 = Pad1 > struct pad : internal::pad< Rule, Pad1, Pad2 > {};
+   template< typename Rule, typename Pad > struct pad_opt : internal::pad_opt< Rule, Pad > {};
+   template< typename Rule, typename... Rules > struct plus : internal::plus< Rule, Rules... > {};
+   template< typename Exception > struct raise : internal::raise< Exception > {};
+   template< typename Head, typename... Rules > struct rematch : internal::rematch< Head, Rules... > {};
+   template< unsigned Num, typename... Rules > struct rep : internal::rep< Num, Rules... > {};
+   template< unsigned Max, typename... Rules > struct rep_max : internal::rep_min_max< 0, Max, Rules... > {};
+   template< unsigned Min, typename Rule, typename... Rules > struct rep_min : internal::rep_min< Min, Rule, Rules... > {};
+   template< unsigned Min, unsigned Max, typename... Rules > struct rep_min_max : internal::rep_min_max< Min, Max, Rules... > {};
+   template< unsigned Max, typename... Rules > struct rep_opt : internal::rep_opt< Max, Rules... > {};
+   template< unsigned Amount > struct require : internal::require< Amount > {};
+   template< typename... Rules > struct seq : internal::seq< Rules... > {};
+   template< typename... Rules > struct sor : internal::sor< Rules... > {};
+   template< typename Rule, typename... Rules > struct star : internal::star< Rule, Rules... > {};
+   template< typename Cond, typename... Rules > struct star_must : internal::star_must< Cond, Rules... > {};
+   template< typename State, typename... Rules > struct state : internal::state< State, Rules... > {};
+   struct success : internal::trivial< true > {};
+   template< typename... Rules > struct try_catch : internal::try_catch_type< parse_error, Rules... > {};
+   template< typename Exception, typename... Rules > struct try_catch_type : internal::try_catch_type< Exception, Rules... > {};
+   template< typename Cond, typename... Rules > struct until : internal::until< Cond, Rules... > {};
+   // clang-format on
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/string_input.hpp b/packages/PEGTL/include/tao/pegtl/string_input.hpp
index ebce2361f9d943d4257e85ee3cfed21686fc6a50..f1b59b1281d268b7534d9392616420dc6ed8aa42 100644
--- a/packages/PEGTL/include/tao/pegtl/string_input.hpp
+++ b/packages/PEGTL/include/tao/pegtl/string_input.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_STRING_INPUT_HPP
@@ -12,61 +12,55 @@
 #include "memory_input.hpp"
 #include "tracking_mode.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace internal
    {
-      namespace internal
+      struct string_holder
       {
-         struct string_holder
-         {
-            const std::string data;
+         const std::string data;
 
-            template< typename T >
-            explicit string_holder( T&& in_data )
-               : data( std::forward< T >( in_data ) )
-            {
-            }
+         template< typename T >
+         explicit string_holder( T&& in_data )
+            : data( std::forward< T >( in_data ) )
+         {
+         }
 
-            string_holder( const string_holder& ) = delete;
-            string_holder( string_holder&& ) = delete;
+         string_holder( const string_holder& ) = delete;
+         string_holder( string_holder&& ) = delete;
 
-            ~string_holder() = default;
+         ~string_holder() = default;
 
-            void operator=( const string_holder& ) = delete;
-            void operator=( string_holder&& ) = delete;
-         };
+         void operator=( const string_holder& ) = delete;
+         void operator=( string_holder&& ) = delete;
+      };
 
-      }  // namespace internal
+   }  // namespace internal
 
-      template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf, typename Source = std::string >
-      struct string_input
-         : private internal::string_holder,
-           public memory_input< P, Eol, Source >
+   template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf, typename Source = std::string >
+   struct string_input
+      : private internal::string_holder,
+        public memory_input< P, Eol, Source >
+   {
+      template< typename V, typename T, typename... Ts >
+      explicit string_input( V&& in_data, T&& in_source, Ts&&... ts )
+         : internal::string_holder( std::forward< V >( in_data ) ),
+           memory_input< P, Eol, Source >( data.data(), data.size(), std::forward< T >( in_source ), std::forward< Ts >( ts )... )
       {
-         template< typename V, typename T, typename... Ts >
-         explicit string_input( V&& in_data, T&& in_source, Ts&&... ts )
-            : internal::string_holder( std::forward< V >( in_data ) ),
-              memory_input< P, Eol, Source >( data.data(), data.size(), std::forward< T >( in_source ), std::forward< Ts >( ts )... )
-         {
-         }
+      }
 
-         string_input( const string_input& ) = delete;
-         string_input( string_input&& ) = delete;
+      string_input( const string_input& ) = delete;
+      string_input( string_input&& ) = delete;
 
-         ~string_input() = default;
+      ~string_input() = default;
 
-         void operator=( const string_input& ) = delete;
-         void operator=( string_input&& ) = delete;
-      };
-
-#ifdef __cpp_deduction_guides
-      template< typename... Ts >
-      explicit string_input( Ts&&... )->string_input<>;
-#endif
+      void operator=( const string_input& ) = delete;
+      void operator=( string_input&& ) = delete;
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Ts >
+   explicit string_input( Ts&&... )->string_input<>;
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/tracking_mode.hpp b/packages/PEGTL/include/tao/pegtl/tracking_mode.hpp
index c470042d52f638865e37dfd088e3050e560e3415..ba58b5c07761a1a99e74c7b7244a3ad15d299bbe 100644
--- a/packages/PEGTL/include/tao/pegtl/tracking_mode.hpp
+++ b/packages/PEGTL/include/tao/pegtl/tracking_mode.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_TRACKING_MODE_HPP
@@ -6,18 +6,14 @@
 
 #include "config.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   enum class tracking_mode : bool
    {
-      enum class tracking_mode : bool
-      {
-         IMMEDIATE,
-         LAZY
-      };
+      eager,
+      lazy
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/uint16.hpp b/packages/PEGTL/include/tao/pegtl/uint16.hpp
index d913ed2f6381ffe14fdeeeb10483a1e289edcd2f..80be64908e0dd671c55d97d3de6dc7d8f3718851 100644
--- a/packages/PEGTL/include/tao/pegtl/uint16.hpp
+++ b/packages/PEGTL/include/tao/pegtl/uint16.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_UINT16_HPP
@@ -11,56 +11,52 @@
 #include "internal/result_on_found.hpp"
 #include "internal/rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace uint16_be
    {
-      namespace uint16_be
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_uint16_be > {};
-
-         template< std::uint16_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_uint16_be, Cs... > {};
-         template< std::uint16_t Lo, std::uint16_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_uint16_be, Lo, Hi > {};
-         template< std::uint16_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_uint16_be, Cs... > {};
-         template< std::uint16_t Lo, std::uint16_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_uint16_be, Lo, Hi > {};
-         template< std::uint16_t... Cs > struct ranges : internal::ranges< internal::peek_uint16_be, Cs... > {};
-         template< std::uint16_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_uint16_be, Cs >... > {};
-
-         template< std::uint16_t M, std::uint16_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_mask_uint16_be< M >, Cs... > {};
-         template< std::uint16_t M, std::uint16_t Lo, std::uint16_t Hi > struct mask_not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_mask_uint16_be< M >, Lo, Hi > {};
-         template< std::uint16_t M, std::uint16_t... Cs > struct mask_one : internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint16_be< M >, Cs... > {};
-         template< std::uint16_t M, std::uint16_t Lo, std::uint16_t Hi > struct mask_range : internal::range< internal::result_on_found::SUCCESS, internal::peek_mask_uint16_be< M >, Lo, Hi > {};
-         template< std::uint16_t M, std::uint16_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint16_be< M >, Cs... > {};
-         template< std::uint16_t M, std::uint16_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint16_be< M >, Cs >... > {};
-         // clang-format on
-
-      }  // namespace uint16_be
-
-      namespace uint16_le
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_uint16_le > {};
-
-         template< std::uint16_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_uint16_le, Cs... > {};
-         template< std::uint16_t Lo, std::uint16_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_uint16_le, Lo, Hi > {};
-         template< std::uint16_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_uint16_le, Cs... > {};
-         template< std::uint16_t Lo, std::uint16_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_uint16_le, Lo, Hi > {};
-         template< std::uint16_t... Cs > struct ranges : internal::ranges< internal::peek_uint16_le, Cs... > {};
-         template< std::uint16_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_uint16_le, Cs >... > {};
-
-         template< std::uint16_t M, std::uint16_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_mask_uint16_le< M >, Cs... > {};
-         template< std::uint16_t M, std::uint16_t Lo, std::uint16_t Hi > struct mask_not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_mask_uint16_le< M >, Lo, Hi > {};
-         template< std::uint16_t M, std::uint16_t... Cs > struct mask_one : internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint16_le< M >, Cs... > {};
-         template< std::uint16_t M, std::uint16_t Lo, std::uint16_t Hi > struct mask_range : internal::range< internal::result_on_found::SUCCESS, internal::peek_mask_uint16_le< M >, Lo, Hi > {};
-         template< std::uint16_t M, std::uint16_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint16_le< M >, Cs... > {};
-         template< std::uint16_t M, std::uint16_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint16_le< M >, Cs >... > {};
-         // clang-format on
-
-      }  // namespace uint16_le
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      // clang-format off
+      struct any : internal::any< internal::peek_uint16_be > {};
+
+      template< std::uint16_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_uint16_be, Cs... > {};
+      template< std::uint16_t Lo, std::uint16_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_uint16_be, Lo, Hi > {};
+      template< std::uint16_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_uint16_be, Cs... > {};
+      template< std::uint16_t Lo, std::uint16_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_uint16_be, Lo, Hi > {};
+      template< std::uint16_t... Cs > struct ranges : internal::ranges< internal::peek_uint16_be, Cs... > {};
+      template< std::uint16_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_uint16_be, Cs >... > {};
+
+      template< std::uint16_t M, std::uint16_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::failure, internal::peek_mask_uint16_be< M >, Cs... > {};
+      template< std::uint16_t M, std::uint16_t Lo, std::uint16_t Hi > struct mask_not_range : internal::range< internal::result_on_found::failure, internal::peek_mask_uint16_be< M >, Lo, Hi > {};
+      template< std::uint16_t M, std::uint16_t... Cs > struct mask_one : internal::one< internal::result_on_found::success, internal::peek_mask_uint16_be< M >, Cs... > {};
+      template< std::uint16_t M, std::uint16_t Lo, std::uint16_t Hi > struct mask_range : internal::range< internal::result_on_found::success, internal::peek_mask_uint16_be< M >, Lo, Hi > {};
+      template< std::uint16_t M, std::uint16_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint16_be< M >, Cs... > {};
+      template< std::uint16_t M, std::uint16_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_mask_uint16_be< M >, Cs >... > {};
+      // clang-format on
+
+   }  // namespace uint16_be
+
+   namespace uint16_le
+   {
+      // clang-format off
+      struct any : internal::any< internal::peek_uint16_le > {};
+
+      template< std::uint16_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_uint16_le, Cs... > {};
+      template< std::uint16_t Lo, std::uint16_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_uint16_le, Lo, Hi > {};
+      template< std::uint16_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_uint16_le, Cs... > {};
+      template< std::uint16_t Lo, std::uint16_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_uint16_le, Lo, Hi > {};
+      template< std::uint16_t... Cs > struct ranges : internal::ranges< internal::peek_uint16_le, Cs... > {};
+      template< std::uint16_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_uint16_le, Cs >... > {};
+
+      template< std::uint16_t M, std::uint16_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::failure, internal::peek_mask_uint16_le< M >, Cs... > {};
+      template< std::uint16_t M, std::uint16_t Lo, std::uint16_t Hi > struct mask_not_range : internal::range< internal::result_on_found::failure, internal::peek_mask_uint16_le< M >, Lo, Hi > {};
+      template< std::uint16_t M, std::uint16_t... Cs > struct mask_one : internal::one< internal::result_on_found::success, internal::peek_mask_uint16_le< M >, Cs... > {};
+      template< std::uint16_t M, std::uint16_t Lo, std::uint16_t Hi > struct mask_range : internal::range< internal::result_on_found::success, internal::peek_mask_uint16_le< M >, Lo, Hi > {};
+      template< std::uint16_t M, std::uint16_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint16_le< M >, Cs... > {};
+      template< std::uint16_t M, std::uint16_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_mask_uint16_le< M >, Cs >... > {};
+      // clang-format on
+
+   }  // namespace uint16_le
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/uint32.hpp b/packages/PEGTL/include/tao/pegtl/uint32.hpp
index 12f5617ceec963aa368a1448cf3c8962a3dd3b55..60d85cf9d0983e647d257292e110c073eadeff00 100644
--- a/packages/PEGTL/include/tao/pegtl/uint32.hpp
+++ b/packages/PEGTL/include/tao/pegtl/uint32.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_UINT32_HPP
@@ -11,56 +11,52 @@
 #include "internal/result_on_found.hpp"
 #include "internal/rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace uint32_be
    {
-      namespace uint32_be
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_uint32_be > {};
-
-         template< std::uint32_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_uint32_be, Cs... > {};
-         template< std::uint32_t Lo, std::uint32_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_uint32_be, Lo, Hi > {};
-         template< std::uint32_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_uint32_be, Cs... > {};
-         template< std::uint32_t Lo, std::uint32_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_uint32_be, Lo, Hi > {};
-         template< std::uint32_t... Cs > struct ranges : internal::ranges< internal::peek_uint32_be, Cs... > {};
-         template< std::uint32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_uint32_be, Cs >... > {};
-
-         template< std::uint32_t M, std::uint32_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_mask_uint32_be< M >, Cs... > {};
-         template< std::uint32_t M, std::uint32_t Lo, std::uint32_t Hi > struct mask_not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_mask_uint32_be< M >, Lo, Hi > {};
-         template< std::uint32_t M, std::uint32_t... Cs > struct mask_one : internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint32_be< M >, Cs... > {};
-         template< std::uint32_t M, std::uint32_t Lo, std::uint32_t Hi > struct mask_range : internal::range< internal::result_on_found::SUCCESS, internal::peek_mask_uint32_be< M >, Lo, Hi > {};
-         template< std::uint32_t M, std::uint32_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint32_be< M >, Cs... > {};
-         template< std::uint32_t M, std::uint32_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint32_be< M >, Cs >... > {};
-         // clang-format on
-
-      }  // namespace uint32_be
-
-      namespace uint32_le
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_uint32_le > {};
-
-         template< std::uint32_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_uint32_le, Cs... > {};
-         template< std::uint32_t Lo, std::uint32_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_uint32_le, Lo, Hi > {};
-         template< std::uint32_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_uint32_le, Cs... > {};
-         template< std::uint32_t Lo, std::uint32_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_uint32_le, Lo, Hi > {};
-         template< std::uint32_t... Cs > struct ranges : internal::ranges< internal::peek_uint32_le, Cs... > {};
-         template< std::uint32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_uint32_le, Cs >... > {};
-
-         template< std::uint32_t M, std::uint32_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_mask_uint32_le< M >, Cs... > {};
-         template< std::uint32_t M, std::uint32_t Lo, std::uint32_t Hi > struct mask_not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_mask_uint32_le< M >, Lo, Hi > {};
-         template< std::uint32_t M, std::uint32_t... Cs > struct mask_one : internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint32_le< M >, Cs... > {};
-         template< std::uint32_t M, std::uint32_t Lo, std::uint32_t Hi > struct mask_range : internal::range< internal::result_on_found::SUCCESS, internal::peek_mask_uint32_le< M >, Lo, Hi > {};
-         template< std::uint32_t M, std::uint32_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint32_le< M >, Cs... > {};
-         template< std::uint32_t M, std::uint32_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint32_le< M >, Cs >... > {};
-         // clang-format on
-
-      }  // namespace uint32_le
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      // clang-format off
+      struct any : internal::any< internal::peek_uint32_be > {};
+
+      template< std::uint32_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_uint32_be, Cs... > {};
+      template< std::uint32_t Lo, std::uint32_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_uint32_be, Lo, Hi > {};
+      template< std::uint32_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_uint32_be, Cs... > {};
+      template< std::uint32_t Lo, std::uint32_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_uint32_be, Lo, Hi > {};
+      template< std::uint32_t... Cs > struct ranges : internal::ranges< internal::peek_uint32_be, Cs... > {};
+      template< std::uint32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_uint32_be, Cs >... > {};
+
+      template< std::uint32_t M, std::uint32_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::failure, internal::peek_mask_uint32_be< M >, Cs... > {};
+      template< std::uint32_t M, std::uint32_t Lo, std::uint32_t Hi > struct mask_not_range : internal::range< internal::result_on_found::failure, internal::peek_mask_uint32_be< M >, Lo, Hi > {};
+      template< std::uint32_t M, std::uint32_t... Cs > struct mask_one : internal::one< internal::result_on_found::success, internal::peek_mask_uint32_be< M >, Cs... > {};
+      template< std::uint32_t M, std::uint32_t Lo, std::uint32_t Hi > struct mask_range : internal::range< internal::result_on_found::success, internal::peek_mask_uint32_be< M >, Lo, Hi > {};
+      template< std::uint32_t M, std::uint32_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint32_be< M >, Cs... > {};
+      template< std::uint32_t M, std::uint32_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_mask_uint32_be< M >, Cs >... > {};
+      // clang-format on
+
+   }  // namespace uint32_be
+
+   namespace uint32_le
+   {
+      // clang-format off
+      struct any : internal::any< internal::peek_uint32_le > {};
+
+      template< std::uint32_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_uint32_le, Cs... > {};
+      template< std::uint32_t Lo, std::uint32_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_uint32_le, Lo, Hi > {};
+      template< std::uint32_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_uint32_le, Cs... > {};
+      template< std::uint32_t Lo, std::uint32_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_uint32_le, Lo, Hi > {};
+      template< std::uint32_t... Cs > struct ranges : internal::ranges< internal::peek_uint32_le, Cs... > {};
+      template< std::uint32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_uint32_le, Cs >... > {};
+
+      template< std::uint32_t M, std::uint32_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::failure, internal::peek_mask_uint32_le< M >, Cs... > {};
+      template< std::uint32_t M, std::uint32_t Lo, std::uint32_t Hi > struct mask_not_range : internal::range< internal::result_on_found::failure, internal::peek_mask_uint32_le< M >, Lo, Hi > {};
+      template< std::uint32_t M, std::uint32_t... Cs > struct mask_one : internal::one< internal::result_on_found::success, internal::peek_mask_uint32_le< M >, Cs... > {};
+      template< std::uint32_t M, std::uint32_t Lo, std::uint32_t Hi > struct mask_range : internal::range< internal::result_on_found::success, internal::peek_mask_uint32_le< M >, Lo, Hi > {};
+      template< std::uint32_t M, std::uint32_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint32_le< M >, Cs... > {};
+      template< std::uint32_t M, std::uint32_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_mask_uint32_le< M >, Cs >... > {};
+      // clang-format on
+
+   }  // namespace uint32_le
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/uint64.hpp b/packages/PEGTL/include/tao/pegtl/uint64.hpp
index f6d2f7c49ba96b1f4134c1aad0b9bd6a3615e991..5507c5be7ed2af3a950016ac37e6a56b482f267b 100644
--- a/packages/PEGTL/include/tao/pegtl/uint64.hpp
+++ b/packages/PEGTL/include/tao/pegtl/uint64.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_UINT64_HPP
@@ -11,57 +11,53 @@
 #include "internal/result_on_found.hpp"
 #include "internal/rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace uint64_be
    {
-      namespace uint64_be
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_uint64_be > {};
+      // clang-format off
+      struct any : internal::any< internal::peek_uint64_be > {};
 
-         template< std::uint64_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_uint64_be, Cs... > {};
-         template< std::uint64_t Lo, std::uint64_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_uint64_be, Lo, Hi > {};
-         template< std::uint64_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_uint64_be, Cs... > {};
-         template< std::uint64_t Lo, std::uint64_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_uint64_be, Lo, Hi > {};
-         template< std::uint64_t... Cs > struct ranges : internal::ranges< internal::peek_uint64_be, Cs... > {};
-         template< std::uint64_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_uint64_be, Cs >... > {};
+      template< std::uint64_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_uint64_be, Cs... > {};
+      template< std::uint64_t Lo, std::uint64_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_uint64_be, Lo, Hi > {};
+      template< std::uint64_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_uint64_be, Cs... > {};
+      template< std::uint64_t Lo, std::uint64_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_uint64_be, Lo, Hi > {};
+      template< std::uint64_t... Cs > struct ranges : internal::ranges< internal::peek_uint64_be, Cs... > {};
+      template< std::uint64_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_uint64_be, Cs >... > {};
 
 
-         template< std::uint64_t M, std::uint64_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_mask_uint64_be< M >, Cs... > {};
-         template< std::uint64_t M, std::uint64_t Lo, std::uint64_t Hi > struct mask_not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_mask_uint64_be< M >, Lo, Hi > {};
-         template< std::uint64_t M, std::uint64_t... Cs > struct mask_one : internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint64_be< M >, Cs... > {};
-         template< std::uint64_t M, std::uint64_t Lo, std::uint64_t Hi > struct mask_range : internal::range< internal::result_on_found::SUCCESS, internal::peek_mask_uint64_be< M >, Lo, Hi > {};
-         template< std::uint64_t M, std::uint64_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint64_be< M >, Cs... > {};
-         template< std::uint64_t M, std::uint64_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint64_be< M >, Cs >... > {};
-         // clang-format on
+      template< std::uint64_t M, std::uint64_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::failure, internal::peek_mask_uint64_be< M >, Cs... > {};
+      template< std::uint64_t M, std::uint64_t Lo, std::uint64_t Hi > struct mask_not_range : internal::range< internal::result_on_found::failure, internal::peek_mask_uint64_be< M >, Lo, Hi > {};
+      template< std::uint64_t M, std::uint64_t... Cs > struct mask_one : internal::one< internal::result_on_found::success, internal::peek_mask_uint64_be< M >, Cs... > {};
+      template< std::uint64_t M, std::uint64_t Lo, std::uint64_t Hi > struct mask_range : internal::range< internal::result_on_found::success, internal::peek_mask_uint64_be< M >, Lo, Hi > {};
+      template< std::uint64_t M, std::uint64_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint64_be< M >, Cs... > {};
+      template< std::uint64_t M, std::uint64_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_mask_uint64_be< M >, Cs >... > {};
+      // clang-format on
 
-      }  // namespace uint64_be
+   }  // namespace uint64_be
 
-      namespace uint64_le
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_uint64_le > {};
-
-         template< std::uint64_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_uint64_le, Cs... > {};
-         template< std::uint64_t Lo, std::uint64_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_uint64_le, Lo, Hi > {};
-         template< std::uint64_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_uint64_le, Cs... > {};
-         template< std::uint64_t Lo, std::uint64_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_uint64_le, Lo, Hi > {};
-         template< std::uint64_t... Cs > struct ranges : internal::ranges< internal::peek_uint64_le, Cs... > {};
-         template< std::uint64_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_uint64_le, Cs >... > {};
-
-         template< std::uint64_t M, std::uint64_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_mask_uint64_le< M >, Cs... > {};
-         template< std::uint64_t M, std::uint64_t Lo, std::uint64_t Hi > struct mask_not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_mask_uint64_le< M >, Lo, Hi > {};
-         template< std::uint64_t M, std::uint64_t... Cs > struct mask_one : internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint64_le< M >, Cs... > {};
-         template< std::uint64_t M, std::uint64_t Lo, std::uint64_t Hi > struct mask_range : internal::range< internal::result_on_found::SUCCESS, internal::peek_mask_uint64_le< M >, Lo, Hi > {};
-         template< std::uint64_t M, std::uint64_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint64_le< M >, Cs... > {};
-         template< std::uint64_t M, std::uint64_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint64_le< M >, Cs >... > {};
-         // clang-format on
-
-      }  // namespace uint64_le
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+   namespace uint64_le
+   {
+      // clang-format off
+      struct any : internal::any< internal::peek_uint64_le > {};
+
+      template< std::uint64_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_uint64_le, Cs... > {};
+      template< std::uint64_t Lo, std::uint64_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_uint64_le, Lo, Hi > {};
+      template< std::uint64_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_uint64_le, Cs... > {};
+      template< std::uint64_t Lo, std::uint64_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_uint64_le, Lo, Hi > {};
+      template< std::uint64_t... Cs > struct ranges : internal::ranges< internal::peek_uint64_le, Cs... > {};
+      template< std::uint64_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_uint64_le, Cs >... > {};
+
+      template< std::uint64_t M, std::uint64_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::failure, internal::peek_mask_uint64_le< M >, Cs... > {};
+      template< std::uint64_t M, std::uint64_t Lo, std::uint64_t Hi > struct mask_not_range : internal::range< internal::result_on_found::failure, internal::peek_mask_uint64_le< M >, Lo, Hi > {};
+      template< std::uint64_t M, std::uint64_t... Cs > struct mask_one : internal::one< internal::result_on_found::success, internal::peek_mask_uint64_le< M >, Cs... > {};
+      template< std::uint64_t M, std::uint64_t Lo, std::uint64_t Hi > struct mask_range : internal::range< internal::result_on_found::success, internal::peek_mask_uint64_le< M >, Lo, Hi > {};
+      template< std::uint64_t M, std::uint64_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint64_le< M >, Cs... > {};
+      template< std::uint64_t M, std::uint64_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_mask_uint64_le< M >, Cs >... > {};
+      // clang-format on
+
+   }  // namespace uint64_le
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/uint8.hpp b/packages/PEGTL/include/tao/pegtl/uint8.hpp
index 694c40b309c131997803998ad3a91514756d9ff8..1225026568b539dae47cafde4187c6ae7164c8ab 100644
--- a/packages/PEGTL/include/tao/pegtl/uint8.hpp
+++ b/packages/PEGTL/include/tao/pegtl/uint8.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_UINT8_HPP
@@ -11,34 +11,26 @@
 #include "internal/result_on_found.hpp"
 #include "internal/rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::uint8
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace uint8
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_uint8 > {};
-
-         template< std::uint8_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_uint8, Cs... > {};
-         template< std::uint8_t Lo, std::uint8_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_uint8, Lo, Hi > {};
-         template< std::uint8_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_uint8, Cs... > {};
-         template< std::uint8_t Lo, std::uint8_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_uint8, Lo, Hi > {};
-         template< std::uint8_t... Cs > struct ranges : internal::ranges< internal::peek_uint8, Cs... > {};
-         template< std::uint8_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_uint8, Cs >... > {};
-
-         template< std::uint8_t M, std::uint8_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_mask_uint8< M >, Cs... > {};
-         template< std::uint8_t M, std::uint8_t Lo, std::uint8_t Hi > struct mask_not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_mask_uint8< M >, Lo, Hi > {};
-         template< std::uint8_t M, std::uint8_t... Cs > struct mask_one : internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint8< M >, Cs... > {};
-         template< std::uint8_t M, std::uint8_t Lo, std::uint8_t Hi > struct mask_range : internal::range< internal::result_on_found::SUCCESS, internal::peek_mask_uint8< M >, Lo, Hi > {};
-         template< std::uint8_t M, std::uint8_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint8< M >, Cs... > {};
-         template< std::uint8_t M, std::uint8_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_mask_uint8< M >, Cs >... > {};
-         // clang-format on
-
-      }  // namespace uint8
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+   // clang-format off
+   struct any : internal::any< internal::peek_uint8 > {};
+
+   template< std::uint8_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_uint8, Cs... > {};
+   template< std::uint8_t Lo, std::uint8_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_uint8, Lo, Hi > {};
+   template< std::uint8_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_uint8, Cs... > {};
+   template< std::uint8_t Lo, std::uint8_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_uint8, Lo, Hi > {};
+   template< std::uint8_t... Cs > struct ranges : internal::ranges< internal::peek_uint8, Cs... > {};
+   template< std::uint8_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_uint8, Cs >... > {};
+
+   template< std::uint8_t M, std::uint8_t... Cs > struct mask_not_one : internal::one< internal::result_on_found::failure, internal::peek_mask_uint8< M >, Cs... > {};
+   template< std::uint8_t M, std::uint8_t Lo, std::uint8_t Hi > struct mask_not_range : internal::range< internal::result_on_found::failure, internal::peek_mask_uint8< M >, Lo, Hi > {};
+   template< std::uint8_t M, std::uint8_t... Cs > struct mask_one : internal::one< internal::result_on_found::success, internal::peek_mask_uint8< M >, Cs... > {};
+   template< std::uint8_t M, std::uint8_t Lo, std::uint8_t Hi > struct mask_range : internal::range< internal::result_on_found::success, internal::peek_mask_uint8< M >, Lo, Hi > {};
+   template< std::uint8_t M, std::uint8_t... Cs > struct mask_ranges : internal::ranges< internal::peek_mask_uint8< M >, Cs... > {};
+   template< std::uint8_t M, std::uint8_t... Cs > struct mask_string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_mask_uint8< M >, Cs >... > {};
+   // clang-format on
+
+}  // namespace TAO_PEGTL_NAMESPACE::uint8
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/utf16.hpp b/packages/PEGTL/include/tao/pegtl/utf16.hpp
index cb475971fb6590429126bff7610c8838e67ebe0e..186d1e8e7c36a6259bc28a7d07d5c9265cbed90b 100644
--- a/packages/PEGTL/include/tao/pegtl/utf16.hpp
+++ b/packages/PEGTL/include/tao/pegtl/utf16.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_UTF16_HPP
@@ -10,44 +10,40 @@
 #include "internal/result_on_found.hpp"
 #include "internal/rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace utf16_be
    {
-      namespace utf16_be
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_utf16_be > {};
-         struct bom : internal::one< internal::result_on_found::SUCCESS, internal::peek_utf16_be, 0xfeff > {};
-         template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_utf16_be, Cs... > {};
-         template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_utf16_be, Lo, Hi > {};
-         template< char32_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_utf16_be, Cs... > {};
-         template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_utf16_be, Lo, Hi > {};
-         template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf16_be, Cs... > {};
-         template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_utf16_be, Cs >... > {};
-         // clang-format on
-
-      }  // namespace utf16_be
-
-      namespace utf16_le
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_utf16_le > {};
-         struct bom : internal::one< internal::result_on_found::SUCCESS, internal::peek_utf16_le, 0xfeff > {};
-         template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_utf16_le, Cs... > {};
-         template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_utf16_le, Lo, Hi > {};
-         template< char32_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_utf16_le, Cs... > {};
-         template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_utf16_le, Lo, Hi > {};
-         template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf16_le, Cs... > {};
-         template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_utf16_le, Cs >... > {};
-         // clang-format on
-
-      }  // namespace utf16_le
-
-      namespace utf16 = TAO_PEGTL_NATIVE_UTF16;  // NOLINT(misc-unused-alias-decls)
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      // clang-format off
+      struct any : internal::any< internal::peek_utf16_be > {};
+      struct bom : internal::one< internal::result_on_found::success, internal::peek_utf16_be, 0xfeff > {};
+      template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_utf16_be, Cs... > {};
+      template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_utf16_be, Lo, Hi > {};
+      template< char32_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_utf16_be, Cs... > {};
+      template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_utf16_be, Lo, Hi > {};
+      template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf16_be, Cs... > {};
+      template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_utf16_be, Cs >... > {};
+      // clang-format on
+
+   }  // namespace utf16_be
+
+   namespace utf16_le
+   {
+      // clang-format off
+      struct any : internal::any< internal::peek_utf16_le > {};
+      struct bom : internal::one< internal::result_on_found::success, internal::peek_utf16_le, 0xfeff > {};
+      template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_utf16_le, Cs... > {};
+      template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_utf16_le, Lo, Hi > {};
+      template< char32_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_utf16_le, Cs... > {};
+      template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_utf16_le, Lo, Hi > {};
+      template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf16_le, Cs... > {};
+      template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_utf16_le, Cs >... > {};
+      // clang-format on
+
+   }  // namespace utf16_le
+
+   namespace utf16 = TAO_PEGTL_NATIVE_UTF16;  // NOLINT(misc-unused-alias-decls)
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/utf32.hpp b/packages/PEGTL/include/tao/pegtl/utf32.hpp
index 34e102f74a35d0341c8610ce4040b9adf70186af..591a4cd20e4d8886259a61ca43027372613c591e 100644
--- a/packages/PEGTL/include/tao/pegtl/utf32.hpp
+++ b/packages/PEGTL/include/tao/pegtl/utf32.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_UTF32_HPP
@@ -10,44 +10,40 @@
 #include "internal/result_on_found.hpp"
 #include "internal/rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace utf32_be
    {
-      namespace utf32_be
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_utf32_be > {};
-         struct bom : internal::one< internal::result_on_found::SUCCESS, internal::peek_utf32_be, 0xfeff > {};
-         template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_utf32_be, Cs... > {};
-         template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_utf32_be, Lo, Hi > {};
-         template< char32_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_utf32_be, Cs... > {};
-         template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_utf32_be, Lo, Hi > {};
-         template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf32_be, Cs... > {};
-         template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_utf32_be, Cs >... > {};
-         // clang-format on
-
-      }  // namespace utf32_be
-
-      namespace utf32_le
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_utf32_le > {};
-         struct bom : internal::one< internal::result_on_found::SUCCESS, internal::peek_utf32_le, 0xfeff > {};
-         template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_utf32_le, Cs... > {};
-         template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_utf32_le, Lo, Hi > {};
-         template< char32_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_utf32_le, Cs... > {};
-         template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_utf32_le, Lo, Hi > {};
-         template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf32_le, Cs... > {};
-         template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_utf32_le, Cs >... > {};
-         // clang-format on
-
-      }  // namespace utf32_le
-
-      namespace utf32 = TAO_PEGTL_NATIVE_UTF32;  // NOLINT(misc-unused-alias-decls)
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      // clang-format off
+      struct any : internal::any< internal::peek_utf32_be > {};
+      struct bom : internal::one< internal::result_on_found::success, internal::peek_utf32_be, 0xfeff > {};
+      template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_utf32_be, Cs... > {};
+      template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_utf32_be, Lo, Hi > {};
+      template< char32_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_utf32_be, Cs... > {};
+      template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_utf32_be, Lo, Hi > {};
+      template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf32_be, Cs... > {};
+      template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_utf32_be, Cs >... > {};
+      // clang-format on
+
+   }  // namespace utf32_be
+
+   namespace utf32_le
+   {
+      // clang-format off
+      struct any : internal::any< internal::peek_utf32_le > {};
+      struct bom : internal::one< internal::result_on_found::success, internal::peek_utf32_le, 0xfeff > {};
+      template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_utf32_le, Cs... > {};
+      template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_utf32_le, Lo, Hi > {};
+      template< char32_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_utf32_le, Cs... > {};
+      template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_utf32_le, Lo, Hi > {};
+      template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf32_le, Cs... > {};
+      template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_utf32_le, Cs >... > {};
+      // clang-format on
+
+   }  // namespace utf32_le
+
+   namespace utf32 = TAO_PEGTL_NATIVE_UTF32;  // NOLINT(misc-unused-alias-decls)
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/utf8.hpp b/packages/PEGTL/include/tao/pegtl/utf8.hpp
index c76e83e3a45c647e299a134275835cccbfca4546..0f3cb4aea597752d57acc955c51d370ab53b88cc 100644
--- a/packages/PEGTL/include/tao/pegtl/utf8.hpp
+++ b/packages/PEGTL/include/tao/pegtl/utf8.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_UTF8_HPP
@@ -10,27 +10,19 @@
 #include "internal/result_on_found.hpp"
 #include "internal/rules.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::utf8
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace utf8
-      {
-         // clang-format off
-         struct any : internal::any< internal::peek_utf8 > {};
-         struct bom : internal::one< internal::result_on_found::SUCCESS, internal::peek_utf8, 0xfeff > {};
-         template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::FAILURE, internal::peek_utf8, Cs... > {};
-         template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::FAILURE, internal::peek_utf8, Lo, Hi > {};
-         template< char32_t... Cs > struct one : internal::one< internal::result_on_found::SUCCESS, internal::peek_utf8, Cs... > {};
-         template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::SUCCESS, internal::peek_utf8, Lo, Hi > {};
-         template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf8, Cs... > {};
-         template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::SUCCESS, internal::peek_utf8, Cs >... > {};
-         // clang-format on
-
-      }  // namespace utf8
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+   // clang-format off
+   struct any : internal::any< internal::peek_utf8 > {};
+   struct bom : internal::one< internal::result_on_found::success, internal::peek_utf8, 0xfeff > {};
+   template< char32_t... Cs > struct not_one : internal::one< internal::result_on_found::failure, internal::peek_utf8, Cs... > {};
+   template< char32_t Lo, char32_t Hi > struct not_range : internal::range< internal::result_on_found::failure, internal::peek_utf8, Lo, Hi > {};
+   template< char32_t... Cs > struct one : internal::one< internal::result_on_found::success, internal::peek_utf8, Cs... > {};
+   template< char32_t Lo, char32_t Hi > struct range : internal::range< internal::result_on_found::success, internal::peek_utf8, Lo, Hi > {};
+   template< char32_t... Cs > struct ranges : internal::ranges< internal::peek_utf8, Cs... > {};
+   template< char32_t... Cs > struct string : internal::seq< internal::one< internal::result_on_found::success, internal::peek_utf8, Cs >... > {};
+   // clang-format on
+
+}  // namespace TAO_PEGTL_NAMESPACE::utf8
 
 #endif
diff --git a/packages/PEGTL/include/tao/pegtl/version.hpp b/packages/PEGTL/include/tao/pegtl/version.hpp
index 491c38b7fe02fdda6256539aa295b36fac5d56c0..6a11e3e0e476fbaee31a0535e23dafc780677d0b 100644
--- a/packages/PEGTL/include/tao/pegtl/version.hpp
+++ b/packages/PEGTL/include/tao/pegtl/version.hpp
@@ -1,19 +1,13 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_VERSION_HPP
 #define TAO_PEGTL_VERSION_HPP
 
-#define TAO_PEGTL_VERSION "2.7.1"
+#define TAO_PEGTL_VERSION "3.0.0"
 
-#define TAO_PEGTL_VERSION_MAJOR 2
-#define TAO_PEGTL_VERSION_MINOR 7
-#define TAO_PEGTL_VERSION_PATCH 1
-
-// Compatibility, remove with 3.0
-#define TAOCPP_PEGTL_VERSION TAO_PEGTL_VERSION
-#define TAOCPP_PEGTL_VERSION_MAJOR TAO_PEGTL_VERSION_MAJOR
-#define TAOCPP_PEGTL_VERSION_MINOR TAO_PEGTL_VERSION_MINOR
-#define TAOCPP_PEGTL_VERSION_PATCH TAO_PEGTL_VERSION_PATCH
+#define TAO_PEGTL_VERSION_MAJOR 3
+#define TAO_PEGTL_VERSION_MINOR 0
+#define TAO_PEGTL_VERSION_PATCH 0
 
 #endif
diff --git a/packages/PEGTL/src/example/pegtl/CMakeLists.txt b/packages/PEGTL/src/example/pegtl/CMakeLists.txt
index c904012ef0698997d172e9b5093f3e8ddffb16ec..2fed9a883279bf46e9e6178ec8b5a1b5a24ba56a 100644
--- a/packages/PEGTL/src/example/pegtl/CMakeLists.txt
+++ b/packages/PEGTL/src/example/pegtl/CMakeLists.txt
@@ -1,6 +1,6 @@
-cmake_minimum_required (VERSION 3.3.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
 
-set (example_sources
+set(example_sources
   abnf2pegtl.cpp
   analyze.cpp
   calculator.cpp
@@ -10,13 +10,13 @@ set (example_sources
   dynamic_match.cpp
   hello_world.cpp
   indent_aware.cpp
-  json_build_one.cpp
-  json_build_two.cpp
+  json_build.cpp
   json_count.cpp
   json_parse.cpp
   lua53_parse.cpp
   modulus_match.cpp
   parse_tree.cpp
+  parse_tree_user_state.cpp
   proto3.cpp
   recover.cpp
   s_expression.cpp
@@ -27,34 +27,33 @@ set (example_sources
   uri_trace.cpp
 )
 
-# file (GLOB ...) is used to validate the above list of test_sources
-file (GLOB glob_example_sources RELATIVE ${CMAKE_CURRENT_LIST_DIR} *.cpp)
+# file(GLOB ...) is used to validate the above list of test_sources
+file(GLOB glob_example_sources RELATIVE ${CMAKE_CURRENT_LIST_DIR} *.cpp)
 
-foreach (examplesourcefile ${example_sources})
-  if (${examplesourcefile} IN_LIST glob_example_sources)
-    list (REMOVE_ITEM glob_example_sources ${examplesourcefile})
-  else ()
-    message (SEND_ERROR "File ${examplesourcefile} is missing from src/example/pegtl")
-  endif ()
+foreach(examplesourcefile ${example_sources})
+  if(${examplesourcefile} IN_LIST glob_example_sources)
+    list(REMOVE_ITEM glob_example_sources ${examplesourcefile})
+  else()
+    message(SEND_ERROR "File ${examplesourcefile} is missing from src/example/pegtl")
+  endif()
 
-  get_filename_component (exename ${examplesourcefile} NAME_WE)
-  set (exename "pegtl-example-${exename}")
-  add_executable (${exename} ${examplesourcefile})
-  target_link_libraries (${exename} PRIVATE taocpp::pegtl)
-  set_target_properties (${exename} PROPERTIES
-    CXX_STANDARD 11
+  get_filename_component(exename pegtl-example-${examplesourcefile} NAME_WE)
+  add_executable(${exename} ${examplesourcefile})
+  target_link_libraries(${exename} PRIVATE taocpp::pegtl)
+  set_target_properties(${exename} PROPERTIES
+    CXX_STANDARD 17
     CXX_STANDARD_REQUIRED ON
     CXX_EXTENSIONS OFF
   )
-  if (MSVC)
-    target_compile_options (${exename} PRIVATE /W4 /WX /utf-8)
-  else ()
-    target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror)
-  endif ()
-endforeach (examplesourcefile)
+  if(MSVC)
+    target_compile_options(${exename} PRIVATE /W4 /WX /utf-8)
+  else()
+    target_compile_options(${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror)
+  endif()
+endforeach(examplesourcefile)
 
-if (glob_example_sources)
-  foreach (ignored_source_file ${glob_example_sources})
-    message (SEND_ERROR "File ${ignored_source_file} in src/example/pegtl is ignored")
-  endforeach (ignored_source_file)
-endif ()
+if(glob_example_sources)
+  foreach(ignored_source_file ${glob_example_sources})
+    message(SEND_ERROR "File ${ignored_source_file} in src/example/pegtl is ignored")
+  endforeach(ignored_source_file)
+endif()
diff --git a/packages/PEGTL/src/example/pegtl/abnf2pegtl.cpp b/packages/PEGTL/src/example/pegtl/abnf2pegtl.cpp
index 6251172ae34664f15c327845e3d9b8dce655e187..4e019eccbe1112f79937d291a47627e76e97c585 100644
--- a/packages/PEGTL/src/example/pegtl/abnf2pegtl.cpp
+++ b/packages/PEGTL/src/example/pegtl/abnf2pegtl.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <algorithm>
@@ -28,672 +28,670 @@
 #include <tao/pegtl/contrib/abnf.hpp>
 #include <tao/pegtl/contrib/parse_tree.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::abnf
 {
-   namespace TAO_PEGTL_NAMESPACE
+   using node_ptr = std::unique_ptr< parse_tree::node >;
+
+   namespace
    {
-      namespace abnf
+      std::string prefix = "tao::pegtl::";  // NOLINT
+
+      std::set< std::string > keywords = {  // NOLINT
+         "alignas",
+         "alignof",
+         "and",
+         "and_eq",
+         "asm",
+         "auto",
+         "bitand",
+         "bitor",
+         "bool",
+         "break",
+         "case",
+         "catch",
+         "char",
+         "char16_t",
+         "char32_t",
+         "class",
+         "compl",
+         "const",
+         "constexpr",
+         "const_cast",
+         "continue",
+         "decltype",
+         "default",
+         "delete",
+         "do",
+         "double",
+         "dynamic_cast",
+         "else",
+         "enum",
+         "explicit",
+         "export",
+         "extern",
+         "false",
+         "float",
+         "for",
+         "friend",
+         "goto",
+         "if",
+         "inline",
+         "int",
+         "long",
+         "mutable",
+         "namespace",
+         "new",
+         "noexcept",
+         "not",
+         "not_eq",
+         "nullptr",
+         "operator",
+         "or",
+         "or_eq",
+         "private",
+         "protected",
+         "public",
+         "register",
+         "reinterpret_cast",
+         "return",
+         "short",
+         "signed",
+         "sizeof",
+         "static",
+         "static_assert",
+         "static_cast",
+         "struct",
+         "switch",
+         "template",
+         "this",
+         "thread_local",
+         "throw",
+         "true",
+         "try",
+         "typedef",
+         "typeid",
+         "typename",
+         "union",
+         "unsigned",
+         "using",
+         "virtual",
+         "void",
+         "volatile",
+         "wchar_t",
+         "while",
+         "xor",
+         "xor_eq"
+      };
+
+      using rules_t = std::vector< std::string >;
+      rules_t rules_defined;  // NOLINT
+      rules_t rules;          // NOLINT
+
+      // clang-format off
+      struct one_tag {};
+      struct string_tag {};
+      struct istring_tag {};
+      // clang-format on
+
+      rules_t::reverse_iterator find_rule( rules_t& r, const std::string& v, const rules_t::reverse_iterator& rbegin )
       {
-         using node_ptr = std::unique_ptr< parse_tree::node >;
+         return std::find_if( rbegin, r.rend(), [&]( const rules_t::value_type& p ) { return TAO_PEGTL_STRCASECMP( p.c_str(), v.c_str() ) == 0; } );
+      }
 
-         namespace
-         {
-            std::string prefix = "tao::pegtl::";  // NOLINT
-
-            std::set< std::string > keywords = {  // NOLINT
-               "alignas",
-               "alignof",
-               "and",
-               "and_eq",
-               "asm",
-               "auto",
-               "bitand",
-               "bitor",
-               "bool",
-               "break",
-               "case",
-               "catch",
-               "char",
-               "char16_t",
-               "char32_t",
-               "class",
-               "compl",
-               "const",
-               "constexpr",
-               "const_cast",
-               "continue",
-               "decltype",
-               "default",
-               "delete",
-               "do",
-               "double",
-               "dynamic_cast",
-               "else",
-               "enum",
-               "explicit",
-               "export",
-               "extern",
-               "false",
-               "float",
-               "for",
-               "friend",
-               "goto",
-               "if",
-               "inline",
-               "int",
-               "long",
-               "mutable",
-               "namespace",
-               "new",
-               "noexcept",
-               "not",
-               "not_eq",
-               "nullptr",
-               "operator",
-               "or",
-               "or_eq",
-               "private",
-               "protected",
-               "public",
-               "register",
-               "reinterpret_cast",
-               "return",
-               "short",
-               "signed",
-               "sizeof",
-               "static",
-               "static_assert",
-               "static_cast",
-               "struct",
-               "switch",
-               "template",
-               "this",
-               "thread_local",
-               "throw",
-               "true",
-               "try",
-               "typedef",
-               "typeid",
-               "typename",
-               "union",
-               "unsigned",
-               "using",
-               "virtual",
-               "void",
-               "volatile",
-               "wchar_t",
-               "while",
-               "xor",
-               "xor_eq"
-            };
-
-            using rules_t = std::vector< std::string >;
-            rules_t rules_defined;  // NOLINT
-            rules_t rules;          // NOLINT
-
-            // clang-format off
-            struct one_tag {};
-            struct string_tag {};
-            struct istring_tag {};
-            // clang-format on
-
-            rules_t::reverse_iterator find_rule( rules_t& r, const std::string& v, const rules_t::reverse_iterator& rbegin )
-            {
-               return std::find_if( rbegin, r.rend(), [&]( const rules_t::value_type& p ) { return TAO_PEGTL_STRCASECMP( p.c_str(), v.c_str() ) == 0; } );
-            }
+      rules_t::reverse_iterator find_rule( rules_t& r, const std::string& v )
+      {
+         return find_rule( r, v, r.rbegin() );
+      }
 
-            rules_t::reverse_iterator find_rule( rules_t& r, const std::string& v )
-            {
-               return find_rule( r, v, r.rbegin() );
-            }
+      bool append_char( std::string& s, const char c )
+      {
+         if( !s.empty() ) {
+            s += ", ";
+         }
+         s += '\'';
+         if( c == '\'' || c == '\\' ) {
+            s += '\\';
+         }
+         s += c;
+         s += '\'';
+         return std::isalpha( c ) != 0;
+      }
 
-            bool append_char( std::string& s, const char c )
-            {
-               if( !s.empty() ) {
-                  s += ", ";
-               }
-               s += '\'';
-               if( c == '\'' || c == '\\' ) {
-                  s += '\\';
-               }
-               s += c;
-               s += '\'';
-               return std::isalpha( c ) != 0;
-            }
+      std::string remove_leading_zeroes( const std::string& v )
+      {
+         const auto pos = v.find_first_not_of( '0' );
+         if( pos == std::string::npos ) {
+            return "";
+         }
+         return v.substr( pos );
+      }
 
-            std::string remove_leading_zeroes( const std::string& v )
-            {
-               const auto pos = v.find_first_not_of( '0' );
-               if( pos == std::string::npos ) {
-                  return "";
-               }
-               return v.substr( pos );
-            }
+      void shift( internal::iterator& it, int delta )
+      {
+         it.data += delta;
+         it.byte += delta;
+         it.byte_in_line += delta;
+      }
 
-            void shift( internal::iterator& it, int delta )
-            {
-               it.data += delta;
-               it.byte += delta;
-               it.byte_in_line += delta;
-            }
+   }  // namespace
 
-         }  // namespace
+   namespace grammar
+   {
+      // ABNF grammar according to RFC 5234, updated by RFC 7405, with
+      // the following differences:
+      //
+      // To form a C++ identifier from a rulename, all minuses are
+      // replaced with underscores.
+      //
+      // As C++ identifiers are case-sensitive, we remember the "correct"
+      // spelling from the first occurrence of a rulename, all other
+      // occurrences are automatically changed to that.
+      //
+      // Certain rulenames are reserved as their equivalent C++ identifier is
+      // reserved as a keyword, an alternative token, by the standard or
+      // for other, special reasons.
+      //
+      // When using numerical values (num-val, repeat), the values
+      // must be in the range of the corresponding C++ data type.
+      //
+      // Remember we are defining a PEG, not a CFG. Simply copying some
+      // ABNF from somewhere might lead to surprising results as the
+      // alternations are now sequential, using the sor<> rule.
+      //
+      // PEG also require two extensions: the and-predicate and the
+      // not-predicate. They are expressed by '&' and '!' respectively,
+      // being allowed (optionally, only one of them) before the
+      // repetition. You can use braces for more complex expressions.
+      //
+      // Finally, instead of the pre-defined CRLF sequence, we accept
+      // any type of line ending as a convenience extension:
+
+      // clang-format off
+      struct CRLF : sor< abnf::CRLF, CR, LF > {};
+
+      // The rest is according to the RFC(s):
+      struct comment_cont : until< CRLF, sor< WSP, VCHAR > > {};
+      struct comment : if_must< one< ';' >, comment_cont > {};
+      struct c_nl : sor< comment, CRLF > {};
+      struct c_wsp : sor< WSP, seq< c_nl, WSP > > {};
+
+      struct rulename : seq< ALPHA, star< ranges< 'a', 'z', 'A', 'Z', '0', '9', '-' > > > {};
+
+      struct quoted_string_cont : until< DQUOTE, print > {};
+      struct quoted_string : if_must< DQUOTE, quoted_string_cont > {};
+      struct case_insensitive_string : seq< opt< istring< '%', 'i' > >, quoted_string > {};
+      struct case_sensitive_string : seq< istring< '%', 's' >, quoted_string > {};
+      struct char_val : sor< case_insensitive_string, case_sensitive_string > {};
+
+      struct prose_val_cont : until< one< '>' >, print > {};
+      struct prose_val : if_must< one< '<' >, prose_val_cont > {};
+
+      template< char First, typename Digit >
+      struct gen_val
+      {
+         struct value : plus< Digit > {};
+         struct range : if_must< one< '-' >, value > {};
+         struct next_value : must< value > {};
+         struct type : seq< istring< First >, must< value >, sor< range, star< one< '.' >, next_value > > > {};
+      };
 
-         namespace grammar
-         {
-            // ABNF grammar according to RFC 5234, updated by RFC 7405, with
-            // the following differences:
-            //
-            // To form a C++ identifier from a rulename, all minuses are
-            // replaced with underscores.
-            //
-            // As C++ identifiers are case-sensitive, we remember the "correct"
-            // spelling from the first occurrence of a rulename, all other
-            // occurrences are automatically changed to that.
-            //
-            // Certain rulenames are reserved as their equivalent C++ identifier is
-            // reserved as a keyword, an alternative token, by the standard or
-            // for other, special reasons.
-            //
-            // When using numerical values (num-val, repeat), the values
-            // must be in the range of the corresponsing C++ data type.
-            //
-            // Remember we are defining a PEG, not a CFG. Simply copying some
-            // ABNF from somewhere might lead to surprising results as the
-            // alternations are now sequential, using the sor<> rule.
-            //
-            // PEG also require two extensions: the and-predicate and the
-            // not-predicate. They are expressed by '&' and '!' respectively,
-            // being allowed (optionally, only one of them) before the
-            // repetition. You can use braces for more complex expressions.
-            //
-            // Finally, instead of the pre-defined CRLF sequence, we accept
-            // any type of line ending as a convencience extension:
-
-            // clang-format off
-            struct CRLF : sor< abnf::CRLF, CR, LF > {};
-
-            // The rest is according to the RFC(s):
-            struct comment_cont : until< CRLF, sor< WSP, VCHAR > > {};
-            struct comment : if_must< one< ';' >, comment_cont > {};
-            struct c_nl : sor< comment, CRLF > {};
-            struct c_wsp : sor< WSP, seq< c_nl, WSP > > {};
-
-            struct rulename : seq< ALPHA, star< ranges< 'a', 'z', 'A', 'Z', '0', '9', '-' > > > {};
-
-            struct quoted_string_cont : until< DQUOTE, print > {};
-            struct quoted_string : if_must< DQUOTE, quoted_string_cont > {};
-            struct case_insensitive_string : seq< opt< istring< '%', 'i' > >, quoted_string > {};
-            struct case_sensitive_string : seq< istring< '%', 's' >, quoted_string > {};
-            struct char_val : sor< case_insensitive_string, case_sensitive_string > {};
-
-            struct prose_val_cont : until< one< '>' >, print > {};
-            struct prose_val : if_must< one< '<' >, prose_val_cont > {};
-
-            template< char First, typename Digit >
-            struct gen_val
-            {
-               struct value : plus< Digit > {};
-               struct range : if_must< one< '-' >, value > {};
-               struct next_value : must< value > {};
-               struct type : seq< istring< First >, must< value >, sor< range, star< one< '.' >, next_value > > > {};
-            };
-
-            using hex_val = gen_val< 'x', HEXDIG >;
-            using dec_val = gen_val< 'd', DIGIT >;
-            using bin_val = gen_val< 'b', BIT >;
-
-            struct num_val_choice : sor< bin_val::type, dec_val::type, hex_val::type > {};
-            struct num_val : if_must< one< '%' >, num_val_choice > {};
-
-            struct alternation;
-            struct option_close : one< ']' > {};
-            struct option : seq< one< '[' >, pad< must< alternation >, c_wsp >, must< option_close > > {};
-            struct group_close : one< ')' > {};
-            struct group : seq< one< '(' >, pad< must< alternation >, c_wsp >, must< group_close > > {};
-            struct element : sor< rulename, group, option, char_val, num_val, prose_val > {};
-
-            struct repeat : sor< seq< star< DIGIT >, one< '*' >, star< DIGIT > >, plus< DIGIT > > {};
-            struct repetition : seq< opt< repeat >, element > {};
-
-            struct and_predicate : if_must< one< '&' >, repetition > {};
-            struct not_predicate : if_must< one< '!' >, repetition > {};
-            struct predicate : sor< and_predicate, not_predicate, repetition > {};
-
-            struct concatenation : list< predicate, plus< c_wsp > > {};
-            struct alternation : list_must< concatenation, pad< one< '/' >, c_wsp > > {};
-
-            struct defined_as_op : sor< string< '=', '/' >, one< '=' > > {};
-            struct defined_as : pad< defined_as_op, c_wsp > {};
-            struct rule : seq< if_must< rulename, defined_as, alternation >, star< c_wsp >, must< c_nl > > {};
-            struct rulelist : until< eof, sor< seq< star< c_wsp >, c_nl >, must< rule > > > {};
-
-            // end of grammar
-
-            template< typename Rule >
-            struct error_control : normal< Rule >
-            {
-               static const std::string error_message;
-
-               template< typename Input, typename... States >
-               static void raise( const Input& in, States&&... /*unused*/ )
-               {
-                  throw parse_error( error_message, in );
-               }
-            };
-
-            template<> const std::string error_control< comment_cont >::error_message = "unterminated comment";  // NOLINT
-
-            template<> const std::string error_control< quoted_string_cont >::error_message = "unterminated string (missing '\"')";  // NOLINT
-            template<> const std::string error_control< prose_val_cont >::error_message = "unterminated prose description (missing '>')";  // NOLINT
-
-            template<> const std::string error_control< hex_val::value >::error_message = "expected hexadecimal value";  // NOLINT
-            template<> const std::string error_control< dec_val::value >::error_message = "expected decimal value";  // NOLINT
-            template<> const std::string error_control< bin_val::value >::error_message = "expected binary value";  // NOLINT
-            template<> const std::string error_control< num_val_choice >::error_message = "expected base specifier (one of 'bBdDxX')";  // NOLINT
-
-            template<> const std::string error_control< option_close >::error_message = "unterminated option (missing ']')";  // NOLINT
-            template<> const std::string error_control< group_close >::error_message = "unterminated group (missing ')')";  // NOLINT
-
-            template<> const std::string error_control< repetition >::error_message = "expected element";  // NOLINT
-            template<> const std::string error_control< concatenation >::error_message = "expected element";  // NOLINT
-            template<> const std::string error_control< alternation >::error_message = "expected element";  // NOLINT
-
-            template<> const std::string error_control< defined_as >::error_message = "expected '=' or '=/'";  // NOLINT
-            template<> const std::string error_control< c_nl >::error_message = "unterminated rule";  // NOLINT
-            template<> const std::string error_control< rule >::error_message = "expected rule";  // NOLINT
-            // clang-format on
-
-         }  // namespace grammar
-
-         template< typename Rule >
-         struct selector
-            : parse_tree::selector<
-                 Rule,
-                 parse_tree::apply_store_content::to<
-                    grammar::rulename,
-                    grammar::prose_val,
-                    grammar::hex_val::value,
-                    grammar::dec_val::value,
-                    grammar::bin_val::value,
-                    grammar::hex_val::range,
-                    grammar::dec_val::range,
-                    grammar::bin_val::range,
-                    grammar::hex_val::type,
-                    grammar::dec_val::type,
-                    grammar::bin_val::type,
-                    grammar::repeat,
-                    grammar::defined_as_op >,
-                 parse_tree::apply_remove_content::to<
-                    grammar::option,
-                    grammar::and_predicate,
-                    grammar::not_predicate,
-                    grammar::rule >,
-                 parse_tree::apply_fold_one::to<
-                    grammar::alternation,
-                    grammar::group,
-                    grammar::repetition,
-                    grammar::concatenation > >
-         {
-         };
+      using hex_val = gen_val< 'x', HEXDIG >;
+      using dec_val = gen_val< 'd', DIGIT >;
+      using bin_val = gen_val< 'b', BIT >;
 
-         template<>
-         struct selector< grammar::quoted_string > : std::true_type
-         {
-            static void transform( node_ptr& n )
-            {
-               shift( n->m_begin, 1 );
-               shift( n->m_end, -1 );
-
-               const std::string content = n->content();
-               for( const auto c : content ) {
-                  if( std::isalpha( c ) != 0 ) {
-                     n->id = &typeid( istring_tag );
-                     return;
-                  }
-               }
-               if( content.size() == 1 ) {
-                  n->id = &typeid( one_tag );
-               }
-               else {
-                  n->id = &typeid( string_tag );
-               }
-            }
-         };
+      struct num_val_choice : sor< bin_val::type, dec_val::type, hex_val::type > {};
+      struct num_val : if_must< one< '%' >, num_val_choice > {};
 
-         template<>
-         struct selector< grammar::case_sensitive_string > : std::true_type
-         {
-            static void transform( node_ptr& n )
-            {
-               n = std::move( n->children.back() );
-               if( n->content().size() == 1 ) {
-                  n->id = &typeid( one_tag );
-               }
-               else {
-                  n->id = &typeid( string_tag );
-               }
-            }
-         };
+      struct alternation;
+      struct option_close : one< ']' > {};
+      struct option : seq< one< '[' >, pad< must< alternation >, c_wsp >, must< option_close > > {};
+      struct group_close : one< ')' > {};
+      struct group : seq< one< '(' >, pad< must< alternation >, c_wsp >, must< group_close > > {};
+      struct element : sor< rulename, group, option, char_val, num_val, prose_val > {};
 
-         std::string to_string( const node_ptr& n );
-         std::string to_string( const std::vector< node_ptr >& v );
+      struct repeat : sor< seq< star< DIGIT >, one< '*' >, star< DIGIT > >, plus< DIGIT > > {};
+      struct repetition : seq< opt< repeat >, element > {};
 
-         std::string to_string_unwrap_seq( const node_ptr& n )
+      struct and_predicate : if_must< one< '&' >, repetition > {};
+      struct not_predicate : if_must< one< '!' >, repetition > {};
+      struct predicate : sor< and_predicate, not_predicate, repetition > {};
+
+      struct concatenation : list< predicate, plus< c_wsp > > {};
+      struct alternation : list_must< concatenation, pad< one< '/' >, c_wsp > > {};
+
+      struct defined_as_op : sor< string< '=', '/' >, one< '=' > > {};
+      struct defined_as : pad< defined_as_op, c_wsp > {};
+      struct rule : seq< if_must< rulename, defined_as, alternation >, star< c_wsp >, must< c_nl > > {};
+      struct rulelist : until< eof, sor< seq< star< c_wsp >, c_nl >, must< rule > > > {};
+
+      // end of grammar
+
+      template< typename Rule >
+      struct error_control : normal< Rule >
+      {
+         static const std::string error_message;
+
+         template< typename Input, typename... States >
+         static void raise( const Input& in, States&&... /*unused*/ )
          {
-            if( n->is< grammar::group >() || n->is< grammar::concatenation >() ) {
-               return to_string( n->children );
-            }
-            return to_string( n );
+            throw parse_error( error_message, in );
          }
+      };
+
+      template<> const std::string error_control< comment_cont >::error_message = "unterminated comment";  // NOLINT
+
+      template<> const std::string error_control< quoted_string_cont >::error_message = "unterminated string (missing '\"')";  // NOLINT
+      template<> const std::string error_control< prose_val_cont >::error_message = "unterminated prose description (missing '>')";  // NOLINT
+
+      template<> const std::string error_control< hex_val::value >::error_message = "expected hexadecimal value";  // NOLINT
+      template<> const std::string error_control< dec_val::value >::error_message = "expected decimal value";  // NOLINT
+      template<> const std::string error_control< bin_val::value >::error_message = "expected binary value";  // NOLINT
+      template<> const std::string error_control< num_val_choice >::error_message = "expected base specifier (one of 'bBdDxX')";  // NOLINT
+
+      template<> const std::string error_control< option_close >::error_message = "unterminated option (missing ']')";  // NOLINT
+      template<> const std::string error_control< group_close >::error_message = "unterminated group (missing ')')";  // NOLINT
+
+      template<> const std::string error_control< repetition >::error_message = "expected element";  // NOLINT
+      template<> const std::string error_control< concatenation >::error_message = "expected element";  // NOLINT
+      template<> const std::string error_control< alternation >::error_message = "expected element";  // NOLINT
+
+      template<> const std::string error_control< defined_as >::error_message = "expected '=' or '=/'";  // NOLINT
+      template<> const std::string error_control< c_nl >::error_message = "unterminated rule";  // NOLINT
+      template<> const std::string error_control< rule >::error_message = "expected rule";  // NOLINT
+      // clang-format on
+
+   }  // namespace grammar
+
+   template< typename Rule >
+   struct selector
+      : parse_tree::selector<
+           Rule,
+           parse_tree::store_content::on<
+              grammar::rulename,
+              grammar::prose_val,
+              grammar::hex_val::value,
+              grammar::dec_val::value,
+              grammar::bin_val::value,
+              grammar::hex_val::range,
+              grammar::dec_val::range,
+              grammar::bin_val::range,
+              grammar::hex_val::type,
+              grammar::dec_val::type,
+              grammar::bin_val::type,
+              grammar::repeat,
+              grammar::defined_as_op >,
+           parse_tree::remove_content::on<
+              grammar::option,
+              grammar::and_predicate,
+              grammar::not_predicate,
+              grammar::rule >,
+           parse_tree::fold_one::on<
+              grammar::alternation,
+              grammar::group,
+              grammar::repetition,
+              grammar::concatenation > >
+   {
+   };
 
-         namespace
-         {
-            std::string get_rulename( const node_ptr& n )
-            {
-               assert( n->is< grammar::rulename >() );
-               std::string v = n->content();
-               std::replace( v.begin(), v.end(), '-', '_' );
-               return v;
+   template<>
+   struct selector< grammar::quoted_string > : std::true_type
+   {
+      template< typename... States >
+      static void transform( node_ptr& n )
+      {
+         shift( n->m_begin, 1 );
+         shift( n->m_end, -1 );
+
+         const auto content = n->string_view();
+         for( const auto c : content ) {
+            if( std::isalpha( c ) != 0 ) {
+               n->id = typeid( istring_tag );
+               return;
             }
+         }
+         if( content.size() == 1 ) {
+            n->id = typeid( one_tag );
+         }
+         else {
+            n->id = typeid( string_tag );
+         }
+      }
+   };
 
-            std::string get_rulename( const node_ptr& n, const bool print_forward_declarations )
-            {
-               std::string v = get_rulename( n );
-               const auto it = find_rule( rules, v );
-               if( it != rules.rend() ) {
-                  return *it;
-               }
-               if( keywords.count( v ) != 0 || v.find( "__" ) != std::string::npos ) {
-                  throw parse_error( '\'' + n->content() + "' is a reserved rulename", n->begin() );  // NOLINT
-               }
-               if( print_forward_declarations && find_rule( rules_defined, v ) != rules_defined.rend() ) {
-                  std::cout << "struct " << v << ";\n";
-               }
-               rules.push_back( v );
-               return v;
-            }
+   template<>
+   struct selector< grammar::case_sensitive_string > : std::true_type
+   {
+      template< typename... States >
+      static void transform( node_ptr& n )
+      {
+         n = std::move( n->children.back() );
+         if( n->string_view().size() == 1 ) {
+            n->id = typeid( one_tag );
+         }
+         else {
+            n->id = typeid( string_tag );
+         }
+      }
+   };
 
-            template< typename T >
-            std::string gen_val( const node_ptr& n )
-            {
-               if( n->children.size() == 2 ) {
-                  if( n->children.back()->is< T >() ) {
-                     return prefix + "range< " + to_string( n->children.front() ) + ", " + to_string( n->children.back()->children.front() ) + " >";
-                  }
-               }
-               if( n->children.size() == 1 ) {
-                  return prefix + "one< " + to_string( n->children ) + " >";
-               }
-               return prefix + "string< " + to_string( n->children ) + " >";
-            }
+   std::string to_string( const node_ptr& n );
+   std::string to_string( const std::vector< node_ptr >& v );
 
-            struct ccmp
-            {
-               bool operator()( const std::string& lhs, const std::string& rhs ) const noexcept
-               {
-                  return TAO_PEGTL_STRCASECMP( lhs.c_str(), rhs.c_str() ) < 0;
-               }
-            };
+   std::string to_string_unwrap_seq( const node_ptr& n )
+   {
+      if( n->is< grammar::group >() || n->is< grammar::concatenation >() ) {
+         return to_string( n->children );
+      }
+      return to_string( n );
+   }
 
-            std::map< std::string, parse_tree::node*, ccmp > previous_rules;  // NOLINT
+   namespace
+   {
+      std::string get_rulename( const node_ptr& n )
+      {
+         assert( n->is< grammar::rulename >() );
+         std::string v = n->string();
+         std::replace( v.begin(), v.end(), '-', '_' );
+         return v;
+      }
 
-         }  // namespace
+      std::string get_rulename( const node_ptr& n, const bool print_forward_declarations )
+      {
+         std::string v = get_rulename( n );
+         const auto it = find_rule( rules, v );
+         if( it != rules.rend() ) {
+            return *it;
+         }
+         if( keywords.count( v ) != 0 || v.find( "__" ) != std::string::npos ) {
+            throw parse_error( '\'' + n->string() + "' is a reserved rulename", n->begin() );  // NOLINT
+         }
+         if( print_forward_declarations && find_rule( rules_defined, v ) != rules_defined.rend() ) {
+            std::cout << "struct " << v << ";\n";
+         }
+         rules.push_back( v );
+         return v;
+      }
 
-         template<>
-         struct selector< grammar::rule > : std::true_type
-         {
-            static void transform( node_ptr& n )
-            {
-               const auto rname = get_rulename( n->children.front() );
-               assert( n->children.at( 1 )->is< grammar::defined_as_op >() );
-               const auto op = n->children.at( 1 )->content();
-               // when we insert a normal rule, we need to check for duplicates
-               if( op == "=" ) {
-                  if( !previous_rules.insert( { rname, n.get() } ).second ) {
-                     throw parse_error( "rule '" + rname + "' is already defined", n->begin() );  // NOLINT
-                  }
-               }
-               // if it is an "incremental alternation", we need to consolidate the assigned alternations
-               else if( op == "=/" ) {
-                  const auto p = previous_rules.find( rname );
-                  if( p == previous_rules.end() ) {
-                     throw parse_error( "incremental alternation '" + rname + "' without previous rule definition", n->begin() );  // NOLINT
-                  }
-                  auto& previous = p->second->children.back();
-
-                  // if the previous rule does not assign an alternation, create an intermediate alternation and move its assignee into it.
-                  if( !previous->is< abnf::grammar::alternation >() ) {
-                     node_ptr s( new parse_tree::node );
-                     s->id = &typeid( abnf::grammar::alternation );
-                     s->source = previous->source;
-                     s->m_begin = previous->m_begin;
-                     s->m_end = previous->m_end;
-                     s->children.emplace_back( std::move( previous ) );
-                     previous = std::move( s );
-                  }
-
-                  // append all new options to the previous rule's assignee (which always is an alternation now)
-                  previous->m_end = n->children.back()->m_end;
-
-                  // if the new rule itself contains an alternation, append the individual entries...
-                  if( n->children.back()->is< abnf::grammar::alternation >() ) {
-                     for( auto& e : n->children.back()->children ) {
-                        previous->children.emplace_back( std::move( e ) );
-                     }
-                  }
-                  // ...otherwise add the node itself as another option.
-                  else {
-                     previous->children.emplace_back( std::move( n->children.back() ) );
-                  }
-                  n.reset();
-               }
-               else {
-                  throw parse_error( "invalid operator '" + op + "', this should not happen!", n->begin() );  // NOLINT
-               }
+      template< typename T >
+      std::string gen_val( const node_ptr& n )
+      {
+         if( n->children.size() == 2 ) {
+            if( n->children.back()->is< T >() ) {
+               return prefix + "range< " + to_string( n->children.front() ) + ", " + to_string( n->children.back()->children.front() ) + " >";
             }
-         };
+         }
+         if( n->children.size() == 1 ) {
+            return prefix + "one< " + to_string( n->children ) + " >";
+         }
+         return prefix + "string< " + to_string( n->children ) + " >";
+      }
 
-         struct stringifier
+      struct ccmp
+      {
+         bool operator()( const std::string& lhs, const std::string& rhs ) const noexcept
          {
-            using function_t = std::string ( * )( const node_ptr& n );
-            function_t default_ = nullptr;
+            return TAO_PEGTL_STRCASECMP( lhs.c_str(), rhs.c_str() ) < 0;
+         }
+      };
+
+      std::map< std::string, parse_tree::node*, ccmp > previous_rules;  // NOLINT
 
-            std::map< const std::type_info*, function_t > map_;
+   }  // namespace
 
-            template< typename T >
-            void add( const function_t& f )
-            {
-               map_.insert( { &typeid( T ), f } );
+   template<>
+   struct selector< grammar::rule > : std::true_type
+   {
+      template< typename... States >
+      static void transform( node_ptr& n )
+      {
+         const auto rname = get_rulename( n->children.front() );
+         assert( n->children.at( 1 )->is< grammar::defined_as_op >() );
+         const auto op = n->children.at( 1 )->string();
+         // when we insert a normal rule, we need to check for duplicates
+         if( op == "=" ) {
+            if( !previous_rules.insert( { rname, n.get() } ).second ) {
+               throw parse_error( "rule '" + rname + "' is already defined", n->begin() );  // NOLINT
+            }
+         }
+         // if it is an "incremental alternation", we need to consolidate the assigned alternations
+         else if( op == "=/" ) {
+            const auto p = previous_rules.find( rname );
+            if( p == previous_rules.end() ) {
+               throw parse_error( "incremental alternation '" + rname + "' without previous rule definition", n->begin() );  // NOLINT
             }
+            auto& previous = p->second->children.back();
+
+            // if the previous rule does not assign an alternation, create an intermediate alternation and move its assignee into it.
+            if( !previous->is< abnf::grammar::alternation >() ) {
+               auto s = std::make_unique< parse_tree::node >();
+               s->id = typeid( abnf::grammar::alternation );
+               s->source = previous->source;
+               s->m_begin = previous->m_begin;
+               s->m_end = previous->m_end;
+               s->children.emplace_back( std::move( previous ) );
+               previous = std::move( s );
+            }
+
+            // append all new options to the previous rule's assignee (which always is an alternation now)
+            previous->m_end = n->children.back()->m_end;
 
-            std::string operator()( const node_ptr& n ) const
-            {
-               const auto it = map_.find( n->id );
-               if( it != map_.end() ) {
-                  return it->second( n );
+            // if the new rule itself contains an alternation, append the individual entries...
+            if( n->children.back()->is< abnf::grammar::alternation >() ) {
+               for( auto& e : n->children.back()->children ) {
+                  previous->children.emplace_back( std::move( e ) );
                }
-               return default_( n );
             }
-         };
+            // ...otherwise add the node itself as another option.
+            else {
+               previous->children.emplace_back( std::move( n->children.back() ) );
+            }
+            n.reset();
+         }
+         else {
+            throw parse_error( "invalid operator '" + op + "', this should not happen!", n->begin() );  // NOLINT
+         }
+      }
+   };
 
-         stringifier make_stringifier()
-         {
-            stringifier nrv;
-            nrv.default_ = []( const node_ptr& n ) -> std::string {
-               throw parse_error( "missing to_string() for " + n->name(), n->begin() );  // NOLINT
-            };
-
-            nrv.add< grammar::rulename >( []( const node_ptr& n ) { return get_rulename( n, true ); } );
-
-            nrv.add< grammar::rule >( []( const node_ptr& n ) {
-               return "struct " + get_rulename( n->children.front(), false ) + " : " + to_string( n->children.back() ) + " {};";
-            } );
-
-            nrv.add< string_tag >( []( const node_ptr& n ) {
-               const std::string content = n->content();
-               std::string s;
-               for( const auto c : content ) {
-                  append_char( s, c );
-               }
-               return prefix + "string< " + s + " >";
-            } );
-
-            nrv.add< istring_tag >( []( const node_ptr& n ) {
-               const std::string content = n->content();
-               std::string s;
-               for( const auto c : content ) {
-                  append_char( s, c );
-               }
-               return prefix + "istring< " + s + " >";
-            } );
-
-            nrv.add< one_tag >( []( const node_ptr& n ) {
-               const std::string content = n->content();
-               std::string s;
-               for( const auto c : content ) {
-                  append_char( s, c );
-               }
-               return prefix + "one< " + s + " >";
-            } );
-
-            nrv.add< grammar::hex_val::value >( []( const node_ptr& n ) { return "0x" + n->content(); } );
-            nrv.add< grammar::dec_val::value >( []( const node_ptr& n ) { return n->content(); } );
-            nrv.add< grammar::bin_val::value >( []( const node_ptr& n ) {
-               unsigned long long v = 0;
-               const char* p = n->m_begin.data;
-               // TODO: Detect overflow
-               do {
-                  v <<= 1;
-                  v |= ( *p++ & 1 );
-               } while( p != n->m_end.data );
-               std::ostringstream o;
-               o << v;
-               return o.str();
-            } );
-
-            nrv.add< grammar::hex_val::type >( []( const node_ptr& n ) { return gen_val< grammar::hex_val::range >( n ); } );
-            nrv.add< grammar::dec_val::type >( []( const node_ptr& n ) { return gen_val< grammar::dec_val::range >( n ); } );
-            nrv.add< grammar::bin_val::type >( []( const node_ptr& n ) { return gen_val< grammar::bin_val::range >( n ); } );
-
-            nrv.add< grammar::alternation >( []( const node_ptr& n ) { return prefix + "sor< " + to_string( n->children ) + " >"; } );
-            nrv.add< grammar::option >( []( const node_ptr& n ) { return prefix + "opt< " + to_string( n->children ) + " >"; } );
-            nrv.add< grammar::group >( []( const node_ptr& n ) { return prefix + "seq< " + to_string( n->children ) + " >"; } );
-
-            nrv.add< grammar::prose_val >( []( const node_ptr& n ) { return "/* " + n->content() + " */"; } );
-
-            nrv.add< grammar::and_predicate >( []( const node_ptr& n ) {
-               assert( n->children.size() == 1 );
-               return prefix + "at< " + to_string_unwrap_seq( n->children.front() ) + " >";
-            } );
-
-            nrv.add< grammar::not_predicate >( []( const node_ptr& n ) {
-               assert( n->children.size() == 1 );
-               return prefix + "not_at< " + to_string_unwrap_seq( n->children.front() ) + " >";
-            } );
-
-            nrv.add< grammar::concatenation >( []( const node_ptr& n ) {
-               assert( !n->children.empty() );
-               return prefix + "seq< " + to_string( n->children ) + " >";
-            } );
-
-            nrv.add< grammar::repetition >( []( const node_ptr& n ) -> std::string {
-               assert( n->children.size() == 2 );
-               const auto content = to_string_unwrap_seq( n->children.back() );
-               const auto rep = n->children.front()->content();
-               const auto star = rep.find( '*' );
-               if( star == std::string::npos ) {
-                  const auto v = remove_leading_zeroes( rep );
-                  if( v.empty() ) {
-                     throw parse_error( "repetition of zero not allowed", n->begin() );  // NOLINT
-                  }
-                  return prefix + "rep< " + v + ", " + content + " >";
-               }
-               const auto min = remove_leading_zeroes( rep.substr( 0, star ) );
-               const auto max = remove_leading_zeroes( rep.substr( star + 1 ) );
-               if( ( star != rep.size() - 1 ) && max.empty() ) {
-                  throw parse_error( "repetition maximum of zero not allowed", n->begin() );  // NOLINT
-               }
-               if( min.empty() && max.empty() ) {
-                  return prefix + "star< " + content + " >";
-               }
-               if( !min.empty() && max.empty() ) {
-                  if( min == "1" ) {
-                     return prefix + "plus< " + content + " >";
-                  }
-                  return prefix + "rep_min< " + min + ", " + content + " >";
-               }
-               if( min.empty() && !max.empty() ) {
-                  if( max == "1" ) {
-                     return prefix + "opt< " + content + " >";
-                  }
-                  return prefix + "rep_max< " + max + ", " + content + " >";
-               }
-               unsigned long long min_val;
-               unsigned long long max_val;
-               {
-                  std::stringstream s;
-                  s.str( min );
-                  s >> min_val;
-                  s.clear();
-                  s.str( max );
-                  s >> max_val;
-               }
-               if( min_val > max_val ) {
-                  throw parse_error( "repetition minimum which is greater than the repetition maximum not allowed", n->begin() );  // NOLINT
-               }
-               if( ( min_val == 1 ) && ( max_val == 1 ) ) {
-                  // note: content can not be used here!
-                  return to_string( n->children.back() );
-               }
-               const auto min_element = ( min_val == 1 ) ? content : ( prefix + "rep< " + min + ", " + content + " >" );
-               if( min_val == max_val ) {
-                  return min_element;
-               }
-               std::ostringstream os;
-               os << ( max_val - min_val );
-               const auto max_element = prefix + ( ( max_val - min_val == 1 ) ? "opt< " : ( "rep_opt< " + os.str() + ", " ) ) + content + " >";
-               return prefix + "seq< " + min_element + ", " + max_element + " >";
-            } );
+   struct stringifier
+   {
+      using function_t = std::string ( * )( const node_ptr& n );
+      function_t default_ = nullptr;
 
-            return nrv;
-         }
+      std::map< std::type_index, function_t > map_;
 
-         std::string to_string( const node_ptr& n )
-         {
-            static stringifier s = make_stringifier();
-            return s( n );
+      template< typename T >
+      void add( const function_t& f )
+      {
+         map_.insert( { typeid( T ), f } );
+      }
+
+      std::string operator()( const node_ptr& n ) const
+      {
+         const auto it = map_.find( n->id );
+         if( it != map_.end() ) {
+            return it->second( n );
          }
+         return default_( n );
+      }
+   };
 
-         std::string to_string( const std::vector< node_ptr >& v )
-         {
-            std::string result;
-            for( const auto& c : v ) {
-               if( !result.empty() ) {
-                  result += ", ";
-               }
-               result += to_string( c );
+   stringifier make_stringifier()
+   {
+      stringifier nrv;
+      nrv.default_ = []( const node_ptr& n ) -> std::string {
+         throw parse_error( "missing to_string() for " + n->name(), n->begin() );  // NOLINT
+      };
+
+      nrv.add< grammar::rulename >( []( const node_ptr& n ) { return get_rulename( n, true ); } );
+
+      nrv.add< grammar::rule >( []( const node_ptr& n ) {
+         return "struct " + get_rulename( n->children.front(), false ) + " : " + to_string( n->children.back() ) + " {};";
+      } );
+
+      nrv.add< string_tag >( []( const node_ptr& n ) {
+         const auto content = n->string_view();
+         std::string s;
+         for( const auto c : content ) {
+            append_char( s, c );
+         }
+         return prefix + "string< " + s + " >";
+      } );
+
+      nrv.add< istring_tag >( []( const node_ptr& n ) {
+         const auto content = n->string_view();
+         std::string s;
+         for( const auto c : content ) {
+            append_char( s, c );
+         }
+         return prefix + "istring< " + s + " >";
+      } );
+
+      nrv.add< one_tag >( []( const node_ptr& n ) {
+         const auto content = n->string_view();
+         std::string s;
+         for( const auto c : content ) {
+            append_char( s, c );
+         }
+         return prefix + "one< " + s + " >";
+      } );
+
+      nrv.add< grammar::hex_val::value >( []( const node_ptr& n ) { return "0x" + n->string(); } );
+      nrv.add< grammar::dec_val::value >( []( const node_ptr& n ) { return n->string(); } );
+      nrv.add< grammar::bin_val::value >( []( const node_ptr& n ) {
+         unsigned long long v = 0;
+         const char* p = n->m_begin.data;
+         // TODO: Detect overflow
+         do {
+            v <<= 1;
+            v |= ( *p++ & 1 );
+         } while( p != n->m_end.data );
+         std::ostringstream o;
+         o << v;
+         return o.str();
+      } );
+
+      nrv.add< grammar::hex_val::type >( []( const node_ptr& n ) { return gen_val< grammar::hex_val::range >( n ); } );
+      nrv.add< grammar::dec_val::type >( []( const node_ptr& n ) { return gen_val< grammar::dec_val::range >( n ); } );
+      nrv.add< grammar::bin_val::type >( []( const node_ptr& n ) { return gen_val< grammar::bin_val::range >( n ); } );
+
+      nrv.add< grammar::alternation >( []( const node_ptr& n ) { return prefix + "sor< " + to_string( n->children ) + " >"; } );
+      nrv.add< grammar::option >( []( const node_ptr& n ) { return prefix + "opt< " + to_string( n->children ) + " >"; } );
+      nrv.add< grammar::group >( []( const node_ptr& n ) { return prefix + "seq< " + to_string( n->children ) + " >"; } );
+
+      nrv.add< grammar::prose_val >( []( const node_ptr& n ) { return "/* " + n->string() + " */"; } );
+
+      nrv.add< grammar::and_predicate >( []( const node_ptr& n ) {
+         assert( n->children.size() == 1 );
+         return prefix + "at< " + to_string_unwrap_seq( n->children.front() ) + " >";
+      } );
+
+      nrv.add< grammar::not_predicate >( []( const node_ptr& n ) {
+         assert( n->children.size() == 1 );
+         return prefix + "not_at< " + to_string_unwrap_seq( n->children.front() ) + " >";
+      } );
+
+      nrv.add< grammar::concatenation >( []( const node_ptr& n ) {
+         assert( !n->children.empty() );
+         return prefix + "seq< " + to_string( n->children ) + " >";
+      } );
+
+      nrv.add< grammar::repetition >( []( const node_ptr& n ) -> std::string {
+         assert( n->children.size() == 2 );
+         const auto content = to_string_unwrap_seq( n->children.back() );
+         const auto rep = n->children.front()->string();
+         const auto star = rep.find( '*' );
+         if( star == std::string::npos ) {
+            const auto v = remove_leading_zeroes( rep );
+            if( v.empty() ) {
+               throw parse_error( "repetition of zero not allowed", n->begin() );  // NOLINT
+            }
+            return prefix + "rep< " + v + ", " + content + " >";
+         }
+         const auto min = remove_leading_zeroes( rep.substr( 0, star ) );
+         const auto max = remove_leading_zeroes( rep.substr( star + 1 ) );
+         if( ( star != rep.size() - 1 ) && max.empty() ) {
+            throw parse_error( "repetition maximum of zero not allowed", n->begin() );  // NOLINT
+         }
+         if( min.empty() && max.empty() ) {
+            return prefix + "star< " + content + " >";
+         }
+         if( !min.empty() && max.empty() ) {
+            if( min == "1" ) {
+               return prefix + "plus< " + content + " >";
+            }
+            return prefix + "rep_min< " + min + ", " + content + " >";
+         }
+         if( min.empty() && !max.empty() ) {
+            if( max == "1" ) {
+               return prefix + "opt< " + content + " >";
             }
-            return result;
+            return prefix + "rep_max< " + max + ", " + content + " >";
+         }
+         unsigned long long min_val;
+         unsigned long long max_val;
+         {
+            std::stringstream s;
+            s.str( min );
+            s >> min_val;
+            s.clear();
+            s.str( max );
+            s >> max_val;
          }
+         if( min_val > max_val ) {
+            throw parse_error( "repetition minimum which is greater than the repetition maximum not allowed", n->begin() );  // NOLINT
+         }
+         if( ( min_val == 1 ) && ( max_val == 1 ) ) {
+            // note: content can not be used here!
+            return to_string( n->children.back() );
+         }
+         const auto min_element = ( min_val == 1 ) ? content : ( prefix + "rep< " + min + ", " + content + " >" );
+         if( min_val == max_val ) {
+            return min_element;
+         }
+         std::ostringstream os;
+         os << ( max_val - min_val );
+         const auto max_element = prefix + ( ( max_val - min_val == 1 ) ? "opt< " : ( "rep_opt< " + os.str() + ", " ) ) + content + " >";
+         return prefix + "seq< " + min_element + ", " + max_element + " >";
+      } );
+
+      return nrv;
+   }
 
-      }  // namespace abnf
+   std::string to_string( const node_ptr& n )
+   {
+      static stringifier s = make_stringifier();
+      return s( n );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   std::string to_string( const std::vector< node_ptr >& v )
+   {
+      std::string result;
+      for( const auto& c : v ) {
+         if( !result.empty() ) {
+            result += ", ";
+         }
+         result += to_string( c );
+      }
+      return result;
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::abnf
 
 int main( int argc, char** argv )
 {
-   using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+   using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 
    if( argc != 2 ) {
-      analyze< abnf::grammar::rulelist >();
       std::cerr << "Usage: " << argv[ 0 ] << " SOURCE" << std::endl;
       return 1;
    }
 
-   file_input<> in( argv[ 1 ] );
+   if( analyze< abnf::grammar::rulelist >() != 0 ) {
+      return 2;
+   }
+
+   file_input in( argv[ 1 ] );
    try {
       const auto root = parse_tree::parse< abnf::grammar::rulelist, abnf::selector, nothing, abnf::grammar::error_control >( in );
 
@@ -708,7 +706,7 @@ int main( int argc, char** argv )
    catch( const parse_error& e ) {
       const auto p = e.positions.front();
       std::cerr << e.what() << std::endl
-                << in.line_as_string( p ) << std::endl
+                << in.line_at( p ) << std::endl
                 << std::string( p.byte_in_line, ' ' ) << '^' << std::endl;
    }
 
diff --git a/packages/PEGTL/src/example/pegtl/analyze.cpp b/packages/PEGTL/src/example/pegtl/analyze.cpp
index 98ad12e7ac5ed1a72f35e401084121198c063290..ecccbef9bd33e1f06b70b0de0e8a5bd4930e921f 100644
--- a/packages/PEGTL/src/example/pegtl/analyze.cpp
+++ b/packages/PEGTL/src/example/pegtl/analyze.cpp
@@ -1,10 +1,10 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <tao/pegtl.hpp>
 #include <tao/pegtl/analyze.hpp>
 
-using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 
 struct bar;
 
diff --git a/packages/PEGTL/src/example/pegtl/calculator.cpp b/packages/PEGTL/src/example/pegtl/calculator.cpp
index 5404848ed21370871602f85175f08f4e91468fac..b841e327a3ee5b317f93e2611069588b6a6e337e 100644
--- a/packages/PEGTL/src/example/pegtl/calculator.cpp
+++ b/packages/PEGTL/src/example/pegtl/calculator.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <cassert>
@@ -15,7 +15,7 @@
 
 #include <tao/pegtl/analyze.hpp>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 namespace calculator
 {
@@ -168,10 +168,10 @@ namespace calculator
       void insert( const std::string& name, const order p, const std::function< long( long, long ) >& f )
       {
          assert( !name.empty() );
-         m_ops.insert( { name, { p, f } } );
+         m_ops.emplace( name, op{ p, f } );
       }
 
-      const std::map< std::string, op >& ops() const
+      [[nodiscard]] const std::map< std::string, op >& ops() const noexcept
       {
          return m_ops;
       }
@@ -188,8 +188,7 @@ namespace calculator
 
    struct comment
       : if_must< one< '#' >, until< eolf > >
-   {
-   };
+   {};
 
    // The calculator ignores all spaces and comments; space is a pegtl rule
    // that matches the usual ascii characters ' ', '\t', '\n' etc. In other
@@ -197,8 +196,7 @@ namespace calculator
 
    struct ignored
       : sor< space, comment >
-   {
-   };
+   {};
 
    // Since the binary operators are taken from a runtime data structure
    // (rather than hard-coding them into the grammar), we need a custom
@@ -207,14 +205,17 @@ namespace calculator
 
    struct infix
    {
-      using analyze_t = analysis::generic< analysis::rule_type::ANY >;
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
 
       template< apply_mode,
                 rewind_mode,
-                template< typename... > class Action,
-                template< typename... > class Control,
-                typename Input >
-      static bool match( Input& in, const operators& b, stacks& s )
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      static bool match( Input& in, const operators& b, stacks& s, States&&... /*unused*/ )
       {
          // Look for the longest match of the input against the operators in the operator map.
 
@@ -246,12 +247,11 @@ namespace calculator
       }
    };
 
-   // A number is a non-empty sequence of digits preceeded by an optional sign.
+   // A number is a non-empty sequence of digits preceded by an optional sign.
 
    struct number
       : seq< opt< one< '+', '-' > >, plus< digit > >
-   {
-   };
+   {};
 
    struct expression;
 
@@ -260,45 +260,37 @@ namespace calculator
 
    struct bracket
       : if_must< one< '(' >, expression, one< ')' > >
-   {
-   };
+   {};
 
    // An atomic expression, i.e. one without operators, is either a number or
    // a bracketed expression.
 
    struct atomic
       : sor< number, bracket >
-   {
-   };
+   {};
 
    // An expression is a non-empty list of atomic expressions where each pair
    // of atomic expressions is separated by an infix operator and we allow
-   // the rule ignored as padding (before and after every singlar expression).
+   // the rule ignored as padding (before and after every single expression).
 
    struct expression
       : list< atomic, infix, ignored >
-   {
-   };
+   {};
 
    // The top-level grammar allows one expression and then expects eof.
 
    struct grammar
       : must< expression, eof >
-   {
-   };
+   {};
 
    // After the grammar we proceed with the additional actions that are
    // required to let our calculator actually do something.
 
-   // The base-case of the class template for the actions must derive from
-   // pegtl::nothing (or, alternatively, define an action that does something
-   // sensible for all rules for which no specialisation exists).
+   // The base-case of the class template for the actions, does nothing.
 
    template< typename Rule >
    struct action
-      : pegtl::nothing< Rule >
-   {
-   };
+   {};
 
    // This action will be called when the number rule matches; it converts the
    // matched portion of the input to a long and pushes it onto the operand
@@ -310,8 +302,7 @@ namespace calculator
       template< typename Input >
       static void apply( const Input& in, const operators& /*unused*/, stacks& s )
       {
-         std::stringstream ss;
-         ss.str( in.string() );
+         std::stringstream ss( in.string() );
          long v;
          ss >> v;
          s.push( v );
@@ -345,7 +336,9 @@ int main( int argc, char** argv )
 {
    // Check the grammar for some possible issues.
 
-   pegtl::analyze< calculator::grammar >();
+   if( pegtl::analyze< calculator::grammar >() != 0 ) {
+      return 1;
+   }
 
    // The objects required as state by the actions.
 
@@ -355,7 +348,7 @@ int main( int argc, char** argv )
    for( int i = 1; i < argc; ++i ) {
       // Parse and process the command-line arguments as calculator expressions...
 
-      pegtl::argv_input<> in( argv, i );
+      pegtl::argv_input in( argv, i );
       pegtl::parse< calculator::grammar, calculator::action >( in, b, s );
 
       // ...and print the respective results to std::cout.
diff --git a/packages/PEGTL/src/example/pegtl/chomsky_hierarchy.cpp b/packages/PEGTL/src/example/pegtl/chomsky_hierarchy.cpp
index f60bb2c24e9bd14837a67401c104cde75576defb..cfda7474729ab13176b68bde15539919c9301d3b 100644
--- a/packages/PEGTL/src/example/pegtl/chomsky_hierarchy.cpp
+++ b/packages/PEGTL/src/example/pegtl/chomsky_hierarchy.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <cassert>
@@ -8,7 +8,7 @@
 
 #include <tao/pegtl.hpp>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 namespace example
 {
@@ -42,10 +42,13 @@ namespace example
    {
       template< pegtl::apply_mode,
                 pegtl::rewind_mode,
-                template< typename... > class Action,
-                template< typename... > class Control,
-                typename Input >
-      static bool match( Input& in, std::size_t& count )
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      static bool match( Input& in, std::size_t& count, States&&... /*unused*/ )
       {
          if( in.size( count ) >= count ) {
             for( std::size_t i = 0; i < count; ++i ) {
@@ -67,7 +70,6 @@ namespace example
 
    template< typename Rule >
    struct action_2_with_state
-      : pegtl::nothing< Rule >
    {
    };
 
@@ -112,7 +114,7 @@ namespace example
 int main( int argc, char** argv )
 {
    for( int i = 1; i < argc; ++i ) {
-      pegtl::argv_input<> in( argv, i );
+      pegtl::argv_input in( argv, i );
       const auto r3 = pegtl::parse< pegtl::seq< example::type_3, pegtl::eof > >( in );
       in.restart();
       const auto r2r = pegtl::parse< pegtl::seq< example::type_2_recursive, pegtl::eof > >( in );
diff --git a/packages/PEGTL/src/example/pegtl/csv1.cpp b/packages/PEGTL/src/example/pegtl/csv1.cpp
index 109203c1d7c653ab5f982def2afc6a9109c7009d..f17c73936b955a099fdf17eb11e4a80d0aefc66d 100644
--- a/packages/PEGTL/src/example/pegtl/csv1.cpp
+++ b/packages/PEGTL/src/example/pegtl/csv1.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <cassert>
@@ -10,7 +10,7 @@
 
 #include <tao/pegtl.hpp>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 namespace csv1
 {
@@ -45,9 +45,7 @@ namespace csv1
 
    template< typename Rule >
    struct action
-      : pegtl::nothing< Rule >
-   {
-   };
+   {};
 
    template<>
    struct action< value >
@@ -56,8 +54,7 @@ namespace csv1
       static void apply( const Input& in, result_data& data )
       {
          assert( !data.empty() );
-         std::stringstream ss;
-         ss << in.string();
+         std::stringstream ss( in.string() );
          unsigned long v;
          ss >> v;
          data.back().push_back( v );
@@ -93,7 +90,7 @@ namespace csv1
 int main( int argc, char** argv )
 {
    for( int i = 1; i < argc; ++i ) {
-      pegtl::file_input<> in( argv[ i ] );
+      pegtl::file_input in( argv[ i ] );
       csv1::result_data data;
       pegtl::parse< pegtl::must< csv1::file >, csv1::action, csv1::control >( in, data );
       for( const auto& line : data ) {
diff --git a/packages/PEGTL/src/example/pegtl/csv2.cpp b/packages/PEGTL/src/example/pegtl/csv2.cpp
index 4da6dd15fd9afa1ccf9cbd7141cc05b927e68430..dcc2a06a2f4e468b5c19f18acbff92c17300c3f8 100644
--- a/packages/PEGTL/src/example/pegtl/csv2.cpp
+++ b/packages/PEGTL/src/example/pegtl/csv2.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <iostream>
@@ -6,7 +6,7 @@
 
 #include <tao/pegtl.hpp>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 namespace csv2
 {
@@ -28,7 +28,7 @@ namespace csv2
    struct quoted_value : pegtl::if_must< pegtl::one< '"' >, string_without< '"' >, pegtl::one< '"' > > {};
    struct value : pegtl::sor< quoted_value, plain_value > {};
    template< unsigned N > struct line : pegtl::seq< value, pegtl::rep< N - 1, pegtl::one< ',' >, value >, pegtl::eol > {};
-   template< unsigned N > struct file : pegtl::until< pegtl::eof, line< N > > { static_assert( N, "N must be positive" ); };
+   template< unsigned N > struct file : pegtl::until< pegtl::eof, line< N > > { static_assert( N != 0 ); };
    // clang-format on
 
    // Meta-programming helper:
@@ -85,9 +85,8 @@ namespace csv2
    // Action class to fill in the above data structure:
 
    template< typename Rule >
-   struct action : pegtl::nothing< Rule >
-   {
-   };
+   struct action
+   {};
 
    template<>
    struct action< plain_value >
@@ -102,8 +101,7 @@ namespace csv2
    template<>
    struct action< string_without< '"' > >
       : action< plain_value >
-   {
-   };
+   {};
 
    template< unsigned N >
    struct action< line< N > >
@@ -173,7 +171,7 @@ namespace csv2
 int main( int argc, char** argv )
 {
    for( int i = 1; i < argc; ++i ) {
-      pegtl::file_input<> in( argv[ i ] );
+      pegtl::file_input in( argv[ i ] );
       constexpr unsigned number_of_columns = 3;
       csv2::result_data< number_of_columns > data;
       pegtl::parse< pegtl::must< csv2::file< number_of_columns > >, csv2::action >( in, data );
diff --git a/packages/PEGTL/src/example/pegtl/double.hpp b/packages/PEGTL/src/example/pegtl/double.hpp
index 336da79f33837b277837c1fb0f12dc51b6d1c452..02eb259440154077888dab1de60ed7bf5b6360b5 100644
--- a/packages/PEGTL/src/example/pegtl/double.hpp
+++ b/packages/PEGTL/src/example/pegtl/double.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_EXAMPLES_PEGTL_DOUBLE_HPP  // NOLINT
@@ -11,7 +11,7 @@ namespace double_
    // A grammar for doubles suitable for std::stod without locale support.
    // See also: http://en.cppreference.com/w/cpp/string/basic_string/stof
 
-   using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+   using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 
    // clang-format off
    struct plus_minus : opt< one< '+', '-' > > {};
diff --git a/packages/PEGTL/src/example/pegtl/dynamic_match.cpp b/packages/PEGTL/src/example/pegtl/dynamic_match.cpp
index 990f2d3244f289b37dcd55890f93dd2b96781a39..55495006bd4598093b4986b8d59f549fb43964d4 100644
--- a/packages/PEGTL/src/example/pegtl/dynamic_match.cpp
+++ b/packages/PEGTL/src/example/pegtl/dynamic_match.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <cstring>
@@ -8,28 +8,29 @@
 
 #include <tao/pegtl.hpp>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 namespace dynamic
 {
    struct long_literal_id
       : pegtl::plus< pegtl::not_one< '[' > >
-   {
-   };
+   {};
 
    struct long_literal_open
       : pegtl::seq< pegtl::one< '[' >, long_literal_id, pegtl::one< '[' > >
-   {
-   };
+   {};
 
    struct long_literal_mark
    {
       template< pegtl::apply_mode,
                 pegtl::rewind_mode,
-                template< typename... > class Action,
-                template< typename... > class Control,
-                typename Input >
-      static bool match( Input& in, const std::string& id, const std::string& /*unused*/ )
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      static bool match( Input& in, const std::string& id, const std::string& /*unused*/, States&&... /*unused*/ )
       {
          if( in.size( id.size() ) >= id.size() ) {
             if( std::memcmp( in.current(), id.data(), id.size() ) == 0 ) {
@@ -43,24 +44,19 @@ namespace dynamic
 
    struct long_literal_close
       : pegtl::seq< pegtl::one< ']' >, long_literal_mark, pegtl::one< ']' > >
-   {
-   };
+   {};
 
    struct long_literal_body
       : pegtl::any
-   {
-   };
+   {};
 
    struct grammar
       : pegtl::if_must< long_literal_open, pegtl::until< long_literal_close, long_literal_body >, pegtl::eof >
-   {
-   };
+   {};
 
    template< typename Rule >
    struct action
-      : pegtl::nothing< Rule >
-   {
-   };
+   {};
 
    template<>
    struct action< long_literal_id >
@@ -90,7 +86,7 @@ int main( int argc, char** argv )
       std::string id;
       std::string body;
 
-      pegtl::argv_input<> in( argv, 1 );
+      pegtl::argv_input in( argv, 1 );
       pegtl::parse< dynamic::grammar, dynamic::action >( in, id, body );
 
       std::cout << "long literal id was: " << id << std::endl;
diff --git a/packages/PEGTL/src/example/pegtl/hello_world.cpp b/packages/PEGTL/src/example/pegtl/hello_world.cpp
index 8a9aacb2f38f2601513a1cd8534ca8d09bbe338d..18a6ae2b3b6fb977cba8926e13d433e4e01c2d73 100644
--- a/packages/PEGTL/src/example/pegtl/hello_world.cpp
+++ b/packages/PEGTL/src/example/pegtl/hello_world.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <iostream>
@@ -6,7 +6,7 @@
 
 #include <tao/pegtl.hpp>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 namespace hello
 {
@@ -18,9 +18,7 @@ namespace hello
 
    template< typename Rule >
    struct action
-      : pegtl::nothing< Rule >
-   {
-   };
+   {};
 
    template<>
    struct action< name >
@@ -39,7 +37,7 @@ int main( int argc, char** argv )
    if( argc > 1 ) {
       std::string name;
 
-      pegtl::argv_input<> in( argv, 1 );
+      pegtl::argv_input in( argv, 1 );
       pegtl::parse< hello::grammar, hello::action >( in, name );
 
       std::cout << "Good bye, " << name << "!" << std::endl;
diff --git a/packages/PEGTL/src/example/pegtl/indent_aware.cpp b/packages/PEGTL/src/example/pegtl/indent_aware.cpp
index ef979d1b51fd633183589e1e09163e7c88ae1cb9..1d504a82a54333402746acf422dfd74ebb99b98e 100644
--- a/packages/PEGTL/src/example/pegtl/indent_aware.cpp
+++ b/packages/PEGTL/src/example/pegtl/indent_aware.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <cassert>
@@ -7,7 +7,7 @@
 
 #include <tao/pegtl.hpp>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 /*
 
@@ -73,10 +73,10 @@ namespace example
 
    enum class type
    {
-      DEF,
-      IF,
-      ELSE,
-      LET
+      def,
+      if_,
+      else_,
+      let
    };
 
    struct entry
@@ -84,8 +84,7 @@ namespace example
       entry( const std::size_t i, const example::type t )
          : indent( i ),
            type( t )
-      {
-      }
+      {}
 
       std::size_t indent;
       example::type type;
@@ -101,9 +100,7 @@ namespace example
 
    template< typename Rule >
    struct action
-      : pegtl::nothing< Rule >
-   {
-   };
+   {};
 
    template<>
    struct action< co >
@@ -119,7 +116,7 @@ namespace example
    {
       static void apply0( state& s )
       {
-         s.stack.emplace_back( s.current_indent, type::DEF );
+         s.stack.emplace_back( s.current_indent, type::def );
       }
    };
 
@@ -128,7 +125,7 @@ namespace example
    {
       static void apply0( state& s )
       {
-         s.stack.emplace_back( s.current_indent, type::IF );
+         s.stack.emplace_back( s.current_indent, type::if_ );
       }
    };
 
@@ -139,10 +136,10 @@ namespace example
       static void apply( const Input& in, state& s )
       {
          assert( !s.stack.empty() );
-         if( ( s.stack.back().type != type::IF ) || ( s.stack.back().indent != s.current_indent ) ) {
+         if( ( s.stack.back().type != type::if_ ) || ( s.stack.back().indent != s.current_indent ) ) {
             throw pegtl::parse_error( "expected previous 'if' on same indent as current 'else'", in );  // NOLINT
          }
-         s.stack.back().type = type::ELSE;
+         s.stack.back().type = type::else_;
       }
    };
 
@@ -151,7 +148,7 @@ namespace example
    {
       static void apply0( state& s )
       {
-         s.stack.emplace_back( s.current_indent, type::LET );
+         s.stack.emplace_back( s.current_indent, type::let );
       }
    };
 
@@ -209,7 +206,7 @@ namespace example
 int main( int argc, char** argv )
 {
    for( int i = 1; i < argc; ++i ) {
-      pegtl::file_input<> in( argv[ i ] );
+      pegtl::file_input in( argv[ i ] );
       example::state is;
       pegtl::parse< example::grammar, example::action >( in, is );
    }
diff --git a/packages/PEGTL/src/example/pegtl/json_build_two.cpp b/packages/PEGTL/src/example/pegtl/json_build.cpp
similarity index 59%
rename from packages/PEGTL/src/example/pegtl/json_build_two.cpp
rename to packages/PEGTL/src/example/pegtl/json_build.cpp
index 67de229cc605abb8d367122c1fa6ea58180fe6be..7d7b9dc7798250eaf168b21ddc7b3cfb09e21c6c 100644
--- a/packages/PEGTL/src/example/pegtl/json_build_two.cpp
+++ b/packages/PEGTL/src/example/pegtl/json_build.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <cassert>
@@ -6,18 +6,19 @@
 #include <vector>
 
 #include <tao/pegtl.hpp>
-#include <tao/pegtl/contrib/changes.hpp>
 #include <tao/pegtl/contrib/json.hpp>
 
 #include "json_classes.hpp"
 #include "json_errors.hpp"
 #include "json_unescape.hpp"
 
+namespace pegtl = TAO_PEGTL_NAMESPACE;
+
 namespace examples
 {
    // State class that stores the result of a JSON parsing run -- a single JSON object.
-   // The other members are used temporarily, at the end of a (successful) parsing run
-   // they are expected to be empty.
+   // The other members are used temporarily, at the end of a (successful) parsing run.
+   // They are expected to be empty.
 
    struct json_state
    {
@@ -27,20 +28,15 @@ namespace examples
       std::vector< std::shared_ptr< object_json > > objects;
    };
 
-   // Action and Control classes
-
-   template< typename Rule >
-   struct action : unescape_action< Rule >  // Inherit from json_unescape.hpp.
-   {
-   };
+   // Action class
 
    template< typename Rule >
-   struct control : errors< Rule >  // Inherit from json_errors.hpp.
+   struct action
    {
    };
 
    template<>
-   struct action< tao::TAO_PEGTL_NAMESPACE::json::null >
+   struct action< pegtl::json::null >
    {
       static void apply0( json_state& state )
       {
@@ -49,7 +45,7 @@ namespace examples
    };
 
    template<>
-   struct action< tao::TAO_PEGTL_NAMESPACE::json::true_ >
+   struct action< pegtl::json::true_ >
    {
       static void apply0( json_state& state )
       {
@@ -58,7 +54,7 @@ namespace examples
    };
 
    template<>
-   struct action< tao::TAO_PEGTL_NAMESPACE::json::false_ >
+   struct action< pegtl::json::false_ >
    {
       static void apply0( json_state& state )
       {
@@ -67,38 +63,31 @@ namespace examples
    };
 
    template<>
-   struct action< tao::TAO_PEGTL_NAMESPACE::json::number >
+   struct action< pegtl::json::number >
    {
       template< typename Input >
       static void apply( const Input& in, json_state& state )
       {
-         std::stringstream ss;
-         ss << in.string();
+         std::stringstream ss( in.string() );
          long double v;
          ss >> v;  // NOTE: not quite correct for JSON but we'll use it for this simple example.
          state.result = std::make_shared< number_json >( v );
       }
    };
 
-   // To parse a string, we change the state to decouple string parsing/unescaping
-
-   struct string_state
-      : public unescape_state_base
+   template<>
+   struct action< pegtl::json::string::content >
+      : json_unescape
    {
-      void success( json_state& state )
+      template< typename Input >
+      static void success( const Input& /*unused*/, std::string& s, json_state& state )
       {
-         state.result = std::make_shared< string_json >( unescaped );
+         state.result = std::make_shared< string_json >( std::move( s ) );
       }
    };
 
    template<>
-   struct control< tao::TAO_PEGTL_NAMESPACE::json::string::content >
-      : tao::TAO_PEGTL_NAMESPACE::change_state< tao::TAO_PEGTL_NAMESPACE::json::string::content, string_state, errors >
-   {
-   };
-
-   template<>
-   struct action< tao::TAO_PEGTL_NAMESPACE::json::array::begin >
+   struct action< pegtl::json::array::begin >
    {
       static void apply0( json_state& state )
       {
@@ -107,7 +96,7 @@ namespace examples
    };
 
    template<>
-   struct action< tao::TAO_PEGTL_NAMESPACE::json::array::element >
+   struct action< pegtl::json::array::element >
    {
       static void apply0( json_state& state )
       {
@@ -116,7 +105,7 @@ namespace examples
    };
 
    template<>
-   struct action< tao::TAO_PEGTL_NAMESPACE::json::array::end >
+   struct action< pegtl::json::array::end >
    {
       static void apply0( json_state& state )
       {
@@ -126,7 +115,7 @@ namespace examples
    };
 
    template<>
-   struct action< tao::TAO_PEGTL_NAMESPACE::json::object::begin >
+   struct action< pegtl::json::object::begin >
    {
       static void apply0( json_state& state )
       {
@@ -136,22 +125,19 @@ namespace examples
 
    // To parse a key, we change the state to decouple string parsing/unescaping
 
-   struct key_state : unescape_state_base
+   template<>
+   struct action< pegtl::json::key::content >
+      : json_unescape
    {
-      void success( json_state& state )
+      template< typename Input >
+      static void success( const Input& /*unused*/, std::string& s, json_state& state )
       {
-         state.keys.push_back( std::move( unescaped ) );
+         state.keys.push_back( std::move( s ) );
       }
    };
 
    template<>
-   struct control< tao::TAO_PEGTL_NAMESPACE::json::key::content >
-      : tao::TAO_PEGTL_NAMESPACE::change_state< tao::TAO_PEGTL_NAMESPACE::json::key::content, key_state, errors >
-   {
-   };
-
-   template<>
-   struct action< tao::TAO_PEGTL_NAMESPACE::json::object::element >
+   struct action< pegtl::json::object::element >
    {
       static void apply0( json_state& state )
       {
@@ -161,7 +147,7 @@ namespace examples
    };
 
    template<>
-   struct action< tao::TAO_PEGTL_NAMESPACE::json::object::end >
+   struct action< pegtl::json::object::end >
    {
       static void apply0( json_state& state )
       {
@@ -170,7 +156,7 @@ namespace examples
       }
    };
 
-   using grammar = tao::TAO_PEGTL_NAMESPACE::must< tao::TAO_PEGTL_NAMESPACE::json::text, tao::TAO_PEGTL_NAMESPACE::eof >;
+   using grammar = pegtl::must< pegtl::json::text, pegtl::eof >;
 
 }  // namespace examples
 
@@ -181,8 +167,8 @@ int main( int argc, char** argv )
    }
    else {
       examples::json_state state;
-      tao::TAO_PEGTL_NAMESPACE::file_input<> in( argv[ 1 ] );
-      tao::TAO_PEGTL_NAMESPACE::parse< examples::grammar, examples::action, examples::control >( in, state );
+      pegtl::file_input in( argv[ 1 ] );
+      pegtl::parse< examples::grammar, examples::action, examples::errors >( in, state );
       assert( state.keys.empty() );
       assert( state.arrays.empty() );
       assert( state.objects.empty() );
diff --git a/packages/PEGTL/src/example/pegtl/json_build_one.cpp b/packages/PEGTL/src/example/pegtl/json_build_one.cpp
deleted file mode 100644
index 17db35a74891b52760957f344fe226e20e7c90e8..0000000000000000000000000000000000000000
--- a/packages/PEGTL/src/example/pegtl/json_build_one.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
-// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
-
-#include <cassert>
-#include <sstream>
-
-#include <tao/pegtl.hpp>
-#include <tao/pegtl/contrib/changes.hpp>
-#include <tao/pegtl/contrib/json.hpp>
-
-#include "json_classes.hpp"
-#include "json_errors.hpp"
-#include "json_unescape.hpp"
-
-namespace examples
-{
-   // Basic state class that stores the result of a JSON parsing run -- a single JSON object.
-
-   struct result_state
-   {
-      result_state() = default;
-      result_state( const result_state& ) = delete;
-      result_state( result_state&& ) = delete;
-
-      ~result_state() = default;
-
-      void operator=( const result_state& ) = delete;
-      void operator=( result_state&& ) = delete;
-
-      std::shared_ptr< json_base > result;
-   };
-
-   // Action class for the simple cases...
-
-   template< typename Rule >
-   struct value_action
-      : unescape_action< Rule >
-   {
-   };
-
-   struct string_state
-      : public unescape_state_base
-   {
-      void success( result_state& result )
-      {
-         result.result = std::make_shared< string_json >( std::move( unescaped ) );
-      }
-   };
-
-   template<>
-   struct value_action< tao::TAO_PEGTL_NAMESPACE::json::null >
-   {
-      static void apply0( result_state& result )
-      {
-         result.result = std::make_shared< null_json >();
-      }
-   };
-
-   template<>
-   struct value_action< tao::TAO_PEGTL_NAMESPACE::json::true_ >
-   {
-      static void apply0( result_state& result )
-      {
-         result.result = std::make_shared< boolean_json >( true );
-      }
-   };
-
-   template<>
-   struct value_action< tao::TAO_PEGTL_NAMESPACE::json::false_ >
-   {
-      static void apply0( result_state& result )
-      {
-         result.result = std::make_shared< boolean_json >( false );
-      }
-   };
-
-   template<>
-   struct value_action< tao::TAO_PEGTL_NAMESPACE::json::number >
-   {
-      template< typename Input >
-      static void apply( const Input& in, result_state& result )
-      {
-         std::stringstream ss;
-         ss << in.string();
-         long double v;
-         ss >> v;  // NOTE: not quite correct for JSON but we'll use it for this simple example.
-         result.result = std::make_shared< number_json >( v );
-      }
-   };
-
-   // State and action classes to accumulate the data for a JSON array.
-
-   struct array_state
-      : public result_state
-   {
-      std::shared_ptr< array_json > array = std::make_shared< array_json >();
-
-      void push_back()
-      {
-         array->data.push_back( std::move( result ) );
-         result.reset();
-      }
-
-      void success( result_state& in_result )
-      {
-         if( this->result ) {
-            push_back();
-         }
-         in_result.result = array;
-      }
-   };
-
-   template< typename Rule >
-   struct array_action
-      : tao::TAO_PEGTL_NAMESPACE::nothing< Rule >
-   {
-   };
-
-   template<>
-   struct array_action< tao::TAO_PEGTL_NAMESPACE::json::value_separator >
-   {
-      static void apply0( array_state& result )
-      {
-         result.push_back();
-      }
-   };
-
-   // State and action classes to accumulate the data for a JSON object.
-
-   struct object_state
-      : public result_state
-   {
-      std::string unescaped;
-      std::shared_ptr< object_json > object = std::make_shared< object_json >();
-
-      void insert()
-      {
-         object->data.insert( std::make_pair( std::move( unescaped ), std::move( result ) ) );
-         unescaped.clear();
-         result.reset();
-      }
-
-      void success( result_state& in_result )
-      {
-         if( this->result ) {
-            insert();
-         }
-         in_result.result = object;
-      }
-   };
-
-   template< typename Rule >
-   struct object_action
-      : unescape_action< Rule >
-   {
-   };
-
-   template<>
-   struct object_action< tao::TAO_PEGTL_NAMESPACE::json::value_separator >
-   {
-      static void apply0( object_state& result )
-      {
-         result.insert();
-      }
-   };
-
-   // Put together a control class that changes the actions and states as required.
-
-   // clang-format off
-   template< typename Rule > struct control : errors< Rule > {};  // Inherit from json_errors.hpp.
-
-   template<> struct control< tao::TAO_PEGTL_NAMESPACE::json::value > : tao::TAO_PEGTL_NAMESPACE::change_action< tao::TAO_PEGTL_NAMESPACE::json::value, value_action, errors > {};
-   template<> struct control< tao::TAO_PEGTL_NAMESPACE::json::string::content > : tao::TAO_PEGTL_NAMESPACE::change_state< tao::TAO_PEGTL_NAMESPACE::json::string::content, string_state, errors > {};
-   template<> struct control< tao::TAO_PEGTL_NAMESPACE::json::array::content > : tao::TAO_PEGTL_NAMESPACE::change_state_and_action< tao::TAO_PEGTL_NAMESPACE::json::array::content, array_state, array_action, errors > {};
-   template<> struct control< tao::TAO_PEGTL_NAMESPACE::json::object::content > : tao::TAO_PEGTL_NAMESPACE::change_state_and_action< tao::TAO_PEGTL_NAMESPACE::json::object::content, object_state, object_action, errors > {};
-
-   struct grammar : tao::TAO_PEGTL_NAMESPACE::must< tao::TAO_PEGTL_NAMESPACE::json::text, tao::TAO_PEGTL_NAMESPACE::eof > {};
-   // clang-format on
-
-}  // namespace examples
-
-int main( int argc, char** argv )
-{
-   for( int i = 1; i < argc; ++i ) {
-      examples::result_state result;
-      tao::TAO_PEGTL_NAMESPACE::file_input<> in( argv[ i ] );
-      tao::TAO_PEGTL_NAMESPACE::parse< examples::grammar, tao::TAO_PEGTL_NAMESPACE::nothing, examples::control >( in, result );
-      assert( result.result );
-      std::cout << result.result << std::endl;
-   }
-   return 0;
-}
diff --git a/packages/PEGTL/src/example/pegtl/json_classes.hpp b/packages/PEGTL/src/example/pegtl/json_classes.hpp
index 1d09e1fb760ce3a44f8081eac85d2ae6d0497e3f..0e5567e95911cb3e2fe19268762048f30a79c1db 100644
--- a/packages/PEGTL/src/example/pegtl/json_classes.hpp
+++ b/packages/PEGTL/src/example/pegtl/json_classes.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_EXAMPLES_PEGTL_JSON_CLASSES_HPP  // NOLINT
@@ -14,12 +14,12 @@ namespace examples
 {
    enum class json_type
    {
-      ARRAY,
-      BOOLEAN,
-      NULL_,
-      NUMBER,
-      OBJECT,
-      STRING
+      array,
+      boolean,
+      null,
+      number,
+      object,
+      string
    };
 
    class json_base
@@ -59,7 +59,7 @@ namespace examples
       : public json_base
    {
       array_json()
-         : json_base( json_type::ARRAY )
+         : json_base( json_type::array )
       {
       }
 
@@ -83,7 +83,7 @@ namespace examples
       : public json_base
    {
       explicit boolean_json( const bool in_data )
-         : json_base( json_type::BOOLEAN ),
+         : json_base( json_type::boolean ),
            data( in_data )
       {
       }
@@ -100,7 +100,7 @@ namespace examples
       : public json_base
    {
       null_json()
-         : json_base( json_type::NULL_ )
+         : json_base( json_type::null )
       {
       }
 
@@ -114,7 +114,7 @@ namespace examples
       : public json_base
    {
       explicit number_json( const long double in_data )
-         : json_base( json_type::NUMBER ),
+         : json_base( json_type::number ),
            data( in_data )
       {
       }
@@ -179,7 +179,7 @@ namespace examples
       : public json_base
    {
       explicit string_json( const std::string& in_data )  // NOLINT
-         : json_base( json_type::STRING ),
+         : json_base( json_type::string ),
            data( in_data )
       {
       }
@@ -196,7 +196,7 @@ namespace examples
       : public json_base
    {
       object_json()
-         : json_base( json_type::OBJECT )
+         : json_base( json_type::object )
       {
       }
 
diff --git a/packages/PEGTL/src/example/pegtl/json_count.cpp b/packages/PEGTL/src/example/pegtl/json_count.cpp
index ce8f26a6c27e03700a3d2b95eb7d8a4f56489931..7b6cd295bab057ff7a770cbbc2bbaed1f5f83548 100644
--- a/packages/PEGTL/src/example/pegtl/json_count.cpp
+++ b/packages/PEGTL/src/example/pegtl/json_count.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <iomanip>
@@ -11,7 +11,7 @@
 #include <tao/pegtl/contrib/json.hpp>
 #include <tao/pegtl/file_input.hpp>
 
-using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 using grammar = must< json::text, eof >;
 
 int main( int argc, char** argv )
@@ -19,10 +19,10 @@ int main( int argc, char** argv )
    counter_state cs;
 
    for( int i = 1; i < argc; ++i ) {
-      file_input<> in( argv[ i ] );
+      file_input in( argv[ i ] );
       parse< grammar, nothing, counter >( in, cs );
    }
-   std::cout << std::right << std::setw( 72 ) << "RULE NAME" << std::left << "      START  SUCCESS  FAILURE" << std::endl;
+   std::cout << std::right << std::setw( 72 ) << "RULE NAME" << std::left << "      START  success  FAILURE" << std::endl;
    for( const auto& j : cs.counts ) {
       std::cout << std::right << std::setw( 72 ) << j.first << "   " << std::setw( 8 ) << j.second.start << " " << std::setw( 8 ) << j.second.success << " " << std::setw( 8 ) << j.second.failure << std::endl;
    }
diff --git a/packages/PEGTL/src/example/pegtl/json_errors.hpp b/packages/PEGTL/src/example/pegtl/json_errors.hpp
index 77668ea0a4131c97c528cb219d5cecd8af5e2892..07067cf3e829cf09c95f20317a26b9f60239606a 100644
--- a/packages/PEGTL/src/example/pegtl/json_errors.hpp
+++ b/packages/PEGTL/src/example/pegtl/json_errors.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_EXAMPLES_PEGTL_JSON_ERRORS_HPP  // NOLINT
@@ -7,24 +7,26 @@
 #include <tao/pegtl.hpp>
 #include <tao/pegtl/contrib/json.hpp>
 
+namespace pegtl = TAO_PEGTL_NAMESPACE;
+
 namespace examples
 {
    // This file shows how to throw exceptions with
    // custom error messages for parse errors. A custom
    // control class is created that delegates everything
-   // to the PEGTL default control class tao::TAO_PEGTL_NAMESPACE::normal<>
+   // to the PEGTL default control class TAO_PEGTL_NAMESPACE::normal<>
    // except for the throwing of exceptions:
 
    template< typename Rule >
    struct errors
-      : public tao::TAO_PEGTL_NAMESPACE::normal< Rule >
+      : public pegtl::normal< Rule >
    {
       static const std::string error_message;
 
       template< typename Input, typename... States >
       static void raise( const Input& in, States&&... /*unused*/ )
       {
-         throw tao::TAO_PEGTL_NAMESPACE::parse_error( error_message, in );
+         throw pegtl::parse_error( error_message, in );
       }
    };
 
@@ -32,23 +34,23 @@ namespace examples
    // member are then used in the exception messages:
 
    // clang-format off
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::text >::error_message = "no valid JSON";  // NOLINT
-
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::end_array >::error_message = "incomplete array, expected ']'";  // NOLINT
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::end_object >::error_message = "incomplete object, expected '}'";  // NOLINT
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::member >::error_message = "expected member";  // NOLINT
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::name_separator >::error_message = "expected ':'";  // NOLINT
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::array_element >::error_message = "expected value";  // NOLINT
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::value >::error_message = "expected value";  // NOLINT
-
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::digits >::error_message = "expected at least one digit";  // NOLINT
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::xdigit >::error_message = "incomplete universal character name";  // NOLINT
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::escaped >::error_message = "unknown escape sequence";  // NOLINT
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::char_ >::error_message = "invalid character in string";  // NOLINT
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::string::content >::error_message = "unterminated string";  // NOLINT
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::json::key::content >::error_message = "unterminated key";  // NOLINT
-
-   template<> const std::string errors< tao::TAO_PEGTL_NAMESPACE::eof >::error_message = "unexpected character after JSON value";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::text >::error_message = "no valid JSON";  // NOLINT
+
+   template<> inline const std::string errors< pegtl::json::end_array >::error_message = "incomplete array, expected ']'";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::end_object >::error_message = "incomplete object, expected '}'";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::member >::error_message = "expected member";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::name_separator >::error_message = "expected ':'";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::array_element >::error_message = "expected value";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::value >::error_message = "expected value";  // NOLINT
+
+   template<> inline const std::string errors< pegtl::json::digits >::error_message = "expected at least one digit";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::xdigit >::error_message = "incomplete universal character name";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::escaped >::error_message = "unknown escape sequence";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::char_ >::error_message = "invalid character in string";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::string::content >::error_message = "unterminated string";  // NOLINT
+   template<> inline const std::string errors< pegtl::json::key::content >::error_message = "unterminated key";  // NOLINT
+
+   template<> inline const std::string errors< pegtl::eof >::error_message = "unexpected character after JSON value";  // NOLINT
    // clang-format on
 
    // The raise()-function-template is instantiated exactly
diff --git a/packages/PEGTL/src/example/pegtl/json_parse.cpp b/packages/PEGTL/src/example/pegtl/json_parse.cpp
index 7b41924d7cb3695000d810ee3ab5f6725b40d329..65f62b21a70766fab1369a56dc21119fe912877e 100644
--- a/packages/PEGTL/src/example/pegtl/json_parse.cpp
+++ b/packages/PEGTL/src/example/pegtl/json_parse.cpp
@@ -1,17 +1,17 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <tao/pegtl.hpp>
 
 #include "json_errors.hpp"
 
-using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 using grammar = must< json::text, eof >;
 
 int main( int argc, char** argv )
 {
    for( int i = 1; i < argc; ++i ) {
-      argv_input<> in( argv, i );
+      argv_input in( argv, i );
       parse< grammar, nothing, examples::errors >( in );
    }
    return 0;
diff --git a/packages/PEGTL/src/example/pegtl/json_unescape.hpp b/packages/PEGTL/src/example/pegtl/json_unescape.hpp
index 2f067b6cd1e581334c85c59f4eae95f80a78cd69..09be84f2cd6cb1eaccc07b21c23c28c081b341d1 100644
--- a/packages/PEGTL/src/example/pegtl/json_unescape.hpp
+++ b/packages/PEGTL/src/example/pegtl/json_unescape.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_EXAMPLES_PEGTL_JSON_UNESCAPE_HPP  // NOLINT
@@ -6,42 +6,24 @@
 
 #include <string>
 
-#include <tao/pegtl.hpp>
+#include <tao/pegtl/change_action_and_states.hpp>
 #include <tao/pegtl/contrib/json.hpp>
 #include <tao/pegtl/contrib/unescape.hpp>
 
 namespace examples
 {
-   // State base class to store an unescaped string
-
-   struct unescape_state_base
-   {
-      unescape_state_base() = default;
-
-      unescape_state_base( const unescape_state_base& ) = delete;
-      unescape_state_base( unescape_state_base&& ) = delete;
-
-      ~unescape_state_base() = default;
-
-      void operator=( const unescape_state_base& ) = delete;
-      void operator=( unescape_state_base&& ) = delete;
-
-      std::string unescaped;
-   };
-
    // Action class for parsing literal strings, uses the PEGTL unescape utilities, cf. unescape.cpp.
 
-   template< typename Rule, template< typename... > class Base = tao::TAO_PEGTL_NAMESPACE::nothing >
-   struct unescape_action : Base< Rule >
-   {
-   };
-
    // clang-format off
-   template<> struct unescape_action< tao::TAO_PEGTL_NAMESPACE::json::unicode > : tao::TAO_PEGTL_NAMESPACE::unescape::unescape_j {};
-   template<> struct unescape_action< tao::TAO_PEGTL_NAMESPACE::json::escaped_char > : tao::TAO_PEGTL_NAMESPACE::unescape::unescape_c< tao::TAO_PEGTL_NAMESPACE::json::escaped_char, '"', '\\', '/', '\b', '\f', '\n', '\r', '\t' > {};
-   template<> struct unescape_action< tao::TAO_PEGTL_NAMESPACE::json::unescaped > : tao::TAO_PEGTL_NAMESPACE::unescape::append_all {};
+   template< typename Rule > struct json_unescape_action {};
+
+   template<> struct json_unescape_action< TAO_PEGTL_NAMESPACE::json::unicode > : TAO_PEGTL_NAMESPACE::unescape::unescape_j {};
+   template<> struct json_unescape_action< TAO_PEGTL_NAMESPACE::json::escaped_char > : TAO_PEGTL_NAMESPACE::unescape::unescape_c< TAO_PEGTL_NAMESPACE::json::escaped_char, '"', '\\', '/', '\b', '\f', '\n', '\r', '\t' > {};
+   template<> struct json_unescape_action< TAO_PEGTL_NAMESPACE::json::unescaped > : TAO_PEGTL_NAMESPACE::unescape::append_all {};
    // clang-format on
 
+   using json_unescape = tao::pegtl::change_action_and_states< json_unescape_action, std::string >;
+
 }  // namespace examples
 
 #endif
diff --git a/packages/PEGTL/src/example/pegtl/lua53_parse.cpp b/packages/PEGTL/src/example/pegtl/lua53_parse.cpp
index dcb48f37833d148480bf42ae07b8036102573a16..70449f4fef49993aa7f631a3a274530e5f311368 100644
--- a/packages/PEGTL/src/example/pegtl/lua53_parse.cpp
+++ b/packages/PEGTL/src/example/pegtl/lua53_parse.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <tao/pegtl.hpp>
@@ -89,7 +89,7 @@ namespace lua53
    // comments). In some places, where it is more efficient,
    // right padding is used.
 
-   namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+   namespace pegtl = TAO_PEGTL_NAMESPACE;
 
    // clang-format off
    struct short_comment : pegtl::until< pegtl::eolf > {};
@@ -159,8 +159,6 @@ namespace lua53
    template< typename R >
    struct pad : pegtl::pad< R, sep > {};
 
-   struct three_dots : pegtl::three< '.' > {};
-
    struct name : pegtl::seq< pegtl::not_at< keyword >, pegtl::identifier > {};
 
    struct single : pegtl::one< 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '"', '\'', '0', '\n' > {};
@@ -216,8 +214,8 @@ namespace lua53
    struct table_field_list : pegtl::list_tail< table_field, pegtl::one< ',', ';' >, sep > {};
    struct table_constructor : pegtl::if_must< pegtl::one< '{' >, pegtl::pad_opt< table_field_list, sep >, pegtl::one< '}' > > {};
 
-   struct parameter_list_one : pegtl::seq< name_list, pegtl::opt_must< pad< pegtl::one< ',' > >, three_dots > > {};
-   struct parameter_list : pegtl::sor< three_dots, parameter_list_one > {};
+   struct parameter_list_one : pegtl::seq< name_list, pegtl::opt_must< pad< pegtl::one< ',' > >, pegtl::ellipsis > > {};
+   struct parameter_list : pegtl::sor< pegtl::ellipsis, parameter_list_one > {};
 
    struct function_body : pegtl::seq< pegtl::one< '(' >, pegtl::pad_opt< parameter_list, sep >, pegtl::one< ')' >, seps, statement_list< key_end > > {};
    struct function_literal : pegtl::if_must< key_function, seps, function_body > {};
@@ -257,7 +255,7 @@ namespace lua53
    struct expr_twelve : pegtl::sor< key_nil,
                                     key_true,
                                     key_false,
-                                    three_dots,
+                                    pegtl::ellipsis,
                                     numeral,
                                     literal_string,
                                     function_literal,
@@ -337,11 +335,13 @@ namespace lua53
 
 int main( int argc, char** argv )
 {
-   tao::TAO_PEGTL_NAMESPACE::analyze< lua53::grammar >();
+   if( TAO_PEGTL_NAMESPACE::analyze< lua53::grammar >() != 0 ) {
+      return 1;
+   }
 
    for( int i = 1; i < argc; ++i ) {
-      tao::TAO_PEGTL_NAMESPACE::file_input<> in( argv[ i ] );
-      tao::TAO_PEGTL_NAMESPACE::parse< lua53::grammar >( in );
+      TAO_PEGTL_NAMESPACE::file_input in( argv[ i ] );
+      TAO_PEGTL_NAMESPACE::parse< lua53::grammar >( in );
    }
    return 0;
 }
diff --git a/packages/PEGTL/src/example/pegtl/modulus_match.cpp b/packages/PEGTL/src/example/pegtl/modulus_match.cpp
index 6d7e4e9721a7f36e17169236027e5a19014a30d2..76c8394d7b38b4fbe86975c7b7bfa2e0546df8b9 100644
--- a/packages/PEGTL/src/example/pegtl/modulus_match.cpp
+++ b/packages/PEGTL/src/example/pegtl/modulus_match.cpp
@@ -1,16 +1,16 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <tao/pegtl.hpp>
 
-using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 
 namespace modulus
 {
    template< unsigned M, unsigned R = 0 >
    struct my_rule
    {
-      using analyze_t = analysis::generic< analysis::rule_type::ANY >;
+      using analyze_t = analysis::generic< analysis::rule_type::any >;
 
       static_assert( M > 1, "Modulus must be greater than 1" );
       static_assert( R < M, "Remainder must be less than modulus" );
@@ -38,7 +38,7 @@ namespace modulus
 int main( int argc, char** argv )
 {
    if( argc > 1 ) {
-      argv_input<> in( argv, 1 );
+      argv_input in( argv, 1 );
       parse< modulus::grammar >( in );
    }
    return 0;
diff --git a/packages/PEGTL/src/example/pegtl/parse_tree.cpp b/packages/PEGTL/src/example/pegtl/parse_tree.cpp
index 424a3b40e860077ac0ffd81842800b290be8191d..3e5f6ee741458d07681cb3e3cefd5094c86ec67f 100644
--- a/packages/PEGTL/src/example/pegtl/parse_tree.cpp
+++ b/packages/PEGTL/src/example/pegtl/parse_tree.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <iostream>
@@ -7,8 +7,9 @@
 
 #include <tao/pegtl.hpp>
 #include <tao/pegtl/contrib/parse_tree.hpp>
+#include <tao/pegtl/contrib/parse_tree_to_dot.hpp>
 
-using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 
 namespace example
 {
@@ -32,10 +33,12 @@ namespace example
    struct product : list_must< value, sor< multiply, divide > > {};
    struct expression : list_must< product, sor< plus, minus > > {};
 
-   struct grammar : seq< expression, eof > {};
+   struct grammar : must< expression, eof > {};
+   // clang-format on
 
    // after a node is stored successfully, you can add an optional transformer like this:
-   struct rearrange : std::true_type
+   struct rearrange
+      : parse_tree::apply< rearrange >  // allows bulk selection, see selector<...>
    {
       // recursively rearrange nodes. the basic principle is:
       //
@@ -52,7 +55,8 @@ namespace example
       // if only one child is left for LHS..., replace the PROD/EXPR with the child directly.
       // otherwise, perform the above transformation, then apply it recursively until LHS...
       // becomes a single child, which then replaces the parent node and the recursion ends.
-      static void transform( std::unique_ptr< parse_tree::node >& n )
+      template< typename... States >
+      static void transform( std::unique_ptr< parse_tree::node >& n, States&&... st )
       {
          if( n->children.size() == 1 ) {
             n = std::move( n->children.back() );
@@ -67,7 +71,7 @@ namespace example
             o->children.emplace_back( std::move( n ) );
             o->children.emplace_back( std::move( r ) );
             n = std::move( o );
-            transform( n->children.front() );
+            transform( n->children.front(), st... );
          }
       }
    };
@@ -77,60 +81,42 @@ namespace example
    template< typename Rule >
    using selector = parse_tree::selector<
       Rule,
-      parse_tree::apply_store_content::to<
+      parse_tree::store_content::on<
          integer,
          variable >,
-      parse_tree::apply_remove_content::to<
+      parse_tree::remove_content::on<
          plus,
          minus,
          multiply,
          divide >,
-      parse_tree::apply< rearrange >::to<
+      rearrange::on<
          product,
          expression > >;
 
-   // debugging/show result:
-
-   void print_node( const parse_tree::node& n, const std::string& s = "" )
-   {
-      // detect the root node:
-      if( n.is_root() ) {
-         std::cout << "ROOT" << std::endl;
-      }
-      else {
-         if( n.has_content() ) {
-            std::cout << s << n.name() << " \"" << n.content() << "\" at " << n.begin() << " to " << n.end() << std::endl;
-         }
-         else {
-            std::cout << s << n.name() << " at " << n.begin() << std::endl;
-         }
-      }
-      // print all child nodes
-      if( !n.children.empty() ) {
-         const auto s2 = s + "  ";
-         for( auto& up : n.children ) {
-            print_node( *up, s2 );
-         }
-      }
-   }
-
 }  // namespace example
 
 int main( int argc, char** argv )
 {
-   for( int i = 1; i < argc; ++i ) {
-      try {
-         argv_input<> in( argv, i );
-         if( const auto root = parse_tree::parse< example::grammar, example::selector >( in ) ) {
-            example::print_node( *root );
-         }
-         else {
-            std::cout << "PARSE FAILED" << std::endl;
-         }
-      }
-      catch( const std::exception& e ) {
-         std::cout << "PARSE FAILED WITH EXCEPTION: " << e.what() << std::endl;
-      }
+   if( argc != 2 ) {
+      std::cerr << "Usage: " << argv[ 0 ] << " EXPR\n"
+                << "Generate a 'dot' file from expression.\n\n"
+                << "Example: " << argv[ 0 ] << " \"(2*a + 3*b) / (4*n)\" | dot -Tpng -o parse_tree.png\n";
+      return 1;
+   }
+   argv_input in( argv, 1 );
+   try {
+      const auto root = parse_tree::parse< example::grammar, example::selector >( in );
+      parse_tree::print_dot( std::cout, *root );
+      return 0;
+   }
+   catch( const parse_error& e ) {
+      const auto p = e.positions.front();
+      std::cerr << e.what() << std::endl
+                << in.line_at( p ) << std::endl
+                << std::string( p.byte_in_line, ' ' ) << '^' << std::endl;
+   }
+   catch( const std::exception& e ) {
+      std::cerr << e.what() << std::endl;
    }
-   return 0;
+   return 1;
 }
diff --git a/packages/PEGTL/src/example/pegtl/parse_tree_user_state.cpp b/packages/PEGTL/src/example/pegtl/parse_tree_user_state.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6b207c062bda56e21e1519ed356af95c15e60967
--- /dev/null
+++ b/packages/PEGTL/src/example/pegtl/parse_tree_user_state.cpp
@@ -0,0 +1,37 @@
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include <type_traits>
+
+#include <tao/pegtl.hpp>
+#include <tao/pegtl/contrib/parse_tree.hpp>
+
+using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
+
+template< typename >
+using selector = std::true_type;
+
+struct user_state
+{};
+
+template< typename Rule >
+struct work
+{};
+
+template<>
+struct work< success >
+{
+   template< typename Input >
+   static void apply( const Input& /*unused*/, user_state& /*unused*/ )
+   {}
+};
+
+int main()
+{
+   memory_input input( "", "dummy" );
+
+   user_state state;
+   auto root = parse_tree::parse< success, selector, work >( input, state );
+
+   return 0;
+}
diff --git a/packages/PEGTL/src/example/pegtl/proto3.cpp b/packages/PEGTL/src/example/pegtl/proto3.cpp
index b871ef4800b73e137286f24bca1beea2133b0e14..a1b6f281b68b7c9ad5b17160f86ddc544fc58d23 100644
--- a/packages/PEGTL/src/example/pegtl/proto3.cpp
+++ b/packages/PEGTL/src/example/pegtl/proto3.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #define TAO_PEGTL_PRETTY_DEMANGLE 1
@@ -6,140 +6,134 @@
 #include <tao/pegtl.hpp>
 #include <tao/pegtl/analyze.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE::proto3
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      namespace proto3
-      {
-         // clang-format off
-
-         struct comment : seq< two< '/' >, until< eolf > > {};
-         struct sp : sor< space, comment > {};
-         struct sps : star< sp > {};
-
-         struct comma : one< ',' > {};
-         struct dot : one< '.' > {};
-         struct equ : one< '=' > {};
-         struct semi : one< ';' > {};
-
-         struct option;
-         struct message;
-
-         struct odigit : range< '0', '7' > {};
-
-         struct ident_first : ranges< 'a', 'z', 'A', 'Z' > {};  // NOTE: Yes, no '_'.
-         struct ident_other : ranges< 'a', 'z', 'A', 'Z', '0', '9', '_' > {};
-         struct ident : seq< ident_first, star< ident_other > > {};
-         struct full_ident : list_must< ident, dot > {};
+   // clang-format off
+
+   struct comment : seq< two< '/' >, until< eolf > > {};
+   struct sp : sor< space, comment > {};
+   struct sps : star< sp > {};
+
+   struct comma : one< ',' > {};
+   struct dot : one< '.' > {};
+   struct equ : one< '=' > {};
+   struct semi : one< ';' > {};
+
+   struct option;
+   struct message;
 
-         struct oct_lit : seq< one< '0' >, star< odigit > > {};
-         struct hex_lit : seq< one< '0' >, one< 'x', 'X' >, plus< xdigit > > {};
-         struct dec_lit : seq< range< '1', '9' >, star< digit > > {};
-         struct int_lit : sor< dec_lit, hex_lit, oct_lit > {};
+   struct odigit : range< '0', '7' > {};
 
-         struct hex_escape : if_must< one< 'x', 'X' >, xdigit, xdigit > {};
-         struct oct_escape : if_must< odigit, odigit, odigit > {};
-         struct char_escape : one< 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '\'', '"' > {};
-         struct escape : if_must< one< '\\' >, hex_escape, oct_escape, char_escape > {};
-         struct char_value : sor< escape, not_one< '\n', '\0' > > {};  // NOTE: No need to exclude '\' from not_one<>, see escape rule.
-         template< char Q >
-         struct str_impl : if_must< one< Q >, until< one< Q >, char_value > > {};
-         struct str_lit : sor< str_impl< '\'' >, str_impl< '"' > > {};
+   struct ident_first : ranges< 'a', 'z', 'A', 'Z' > {};  // NOTE: Yes, no '_'.
+   struct ident_other : ranges< 'a', 'z', 'A', 'Z', '0', '9', '_' > {};
+   struct ident : seq< ident_first, star< ident_other > > {};
+   struct full_ident : list_must< ident, dot > {};
 
-         struct bool_lit : seq< sor< string< 't', 'r', 'u', 'e' >, string< 'f', 'a', 'l', 's', 'e' > >, not_at< ident_other > > {};
+   struct oct_lit : seq< one< '0' >, star< odigit > > {};
+   struct hex_lit : seq< one< '0' >, one< 'x', 'X' >, plus< xdigit > > {};
+   struct dec_lit : seq< range< '1', '9' >, star< digit > > {};
+   struct int_lit : sor< dec_lit, hex_lit, oct_lit > {};
 
-         struct sign : one< '+', '-' > {};
-         struct constant : sor< bool_lit, full_ident, seq< opt< sign >, int_lit >, str_lit > {};  // TODO: Needs sps after sign?
+   struct hex_escape : if_must< one< 'x', 'X' >, xdigit, xdigit > {};
+   struct oct_escape : if_must< odigit, odigit, odigit > {};
+   struct char_escape : one< 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '\'', '"' > {};
+   struct escape : if_must< one< '\\' >, hex_escape, oct_escape, char_escape > {};
+   struct char_value : sor< escape, not_one< '\n', '\0' > > {};  // NOTE: No need to exclude '\' from not_one<>, see escape rule.
+   template< char Q >
+   struct str_impl : if_must< one< Q >, until< one< Q >, char_value > > {};
+   struct str_lit : sor< str_impl< '\'' >, str_impl< '"' > > {};
 
-         struct option_name : seq< sor< ident, if_must< one< '(' >, full_ident, one< ')' > > >, star_must< dot, ident > > {};
-         struct option : if_must< string< 'o', 'p', 't', 'i', 'o', 'n' >, sps, option_name, sps, equ, sps, constant, sps, semi, sps > {};
+   struct bool_lit : seq< sor< string< 't', 'r', 'u', 'e' >, string< 'f', 'a', 'l', 's', 'e' > >, not_at< ident_other > > {};
 
-         struct bool_type : string< 'b', 'o', 'o', 'l' > {};
-         struct bytes_type : string< 'b', 'y', 't', 'e', 's' > {};
-         struct double_type : string< 'd', 'o', 'u', 'b', 'l', 'e' > {};
-         struct float_type : string< 'f', 'l', 'o', 'a', 't' > {};
-         struct string_type : string< 's', 't', 'r', 'i', 'n', 'g' > {};
+   struct sign : one< '+', '-' > {};
+   struct constant : sor< bool_lit, full_ident, seq< opt< sign >, int_lit >, str_lit > {};  // TODO: Needs sps after sign?
 
-         struct int32_type : string< 'i', 'n', 't', '3', '2' > {};
-         struct int64_type : string< 'i', 'n', 't', '6', '4' > {};
-         struct sint32_type : string< 's', 'i', 'n', 't', '3', '2' > {};
-         struct sint64_type : string< 's', 'i', 'n', 't', '6', '4' > {};
-         struct uint32_type : string< 'u', 'i', 'n', 't', '3', '2' > {};
-         struct uint64_type : string< 'u', 'i', 'n', 't', '6', '4' > {};
-         struct fixed32_type : string< 'f', 'i', 'x', 'e', 'd', '3', '2' > {};
-         struct fixed64_type : string< 'f', 'i', 'x', 'e', 'd', '6', '4' > {};
-         struct sfixed32_type : string< 's', 'f', 'i', 'x', 'e', 'd', '3', '2' > {};
-         struct sfixed64_type : string< 's', 'f', 'i', 'x', 'e', 'd', '6', '4' > {};
+   struct option_name : seq< sor< ident, if_must< one< '(' >, full_ident, one< ')' > > >, star_must< dot, ident > > {};
+   struct option : if_must< string< 'o', 'p', 't', 'i', 'o', 'n' >, sps, option_name, sps, equ, sps, constant, sps, semi, sps > {};
 
-         struct builtin_type : seq< sor< bool_type, bytes_type, double_type, float_type, string_type, int32_type, int64_type, sint32_type, sint64_type, uint32_type, uint64_type, fixed32_type, fixed64_type, sfixed32_type, sfixed64_type >, not_at< ident_other > > {};
+   struct bool_type : string< 'b', 'o', 'o', 'l' > {};
+   struct bytes_type : string< 'b', 'y', 't', 'e', 's' > {};
+   struct double_type : string< 'd', 'o', 'u', 'b', 'l', 'e' > {};
+   struct float_type : string< 'f', 'l', 'o', 'a', 't' > {};
+   struct string_type : string< 's', 't', 'r', 'i', 'n', 'g' > {};
 
-         struct defined_type : seq< opt< dot >, full_ident > {};  // NOTE: This replaces both message_type and enum_type -- they have the same syntax.
+   struct int32_type : string< 'i', 'n', 't', '3', '2' > {};
+   struct int64_type : string< 'i', 'n', 't', '6', '4' > {};
+   struct sint32_type : string< 's', 'i', 'n', 't', '3', '2' > {};
+   struct sint64_type : string< 's', 'i', 'n', 't', '6', '4' > {};
+   struct uint32_type : string< 'u', 'i', 'n', 't', '3', '2' > {};
+   struct uint64_type : string< 'u', 'i', 'n', 't', '6', '4' > {};
+   struct fixed32_type : string< 'f', 'i', 'x', 'e', 'd', '3', '2' > {};
+   struct fixed64_type : string< 'f', 'i', 'x', 'e', 'd', '6', '4' > {};
+   struct sfixed32_type : string< 's', 'f', 'i', 'x', 'e', 'd', '3', '2' > {};
+   struct sfixed64_type : string< 's', 'f', 'i', 'x', 'e', 'd', '6', '4' > {};
 
-         struct type : sor< builtin_type, defined_type > {};
+   struct builtin_type : seq< sor< bool_type, bytes_type, double_type, float_type, string_type, int32_type, int64_type, sint32_type, sint64_type, uint32_type, uint64_type, fixed32_type, fixed64_type, sfixed32_type, sfixed64_type >, not_at< ident_other > > {};
 
-         struct field_option : if_must< option_name, sps, equ, sps, constant > {};
-         struct field_options : if_must< one< '[' >, sps, list< field_option, comma, sp >, sps, one< ']' > > {};
-         struct field_name : ident {};
-         struct field_number : int_lit {};
-         struct field : seq< opt< string< 'r', 'e', 'p', 'e', 'a', 't', 'e', 'd' >, sps >, type, sps, field_name, sps, equ, sps, field_number, sps, opt< field_options, sps >, semi > {};
+   struct defined_type : seq< opt< dot >, full_ident > {};  // NOTE: This replaces both message_type and enum_type -- they have the same syntax.
 
-         struct oneof_name : ident {};
-         struct oneof_field : if_must< type, sps, field_name, sps, equ, sps, field_number, sps, opt< field_options, sps >, semi > {};
-         struct oneof_body : sor< oneof_field, semi > {};
-         struct oneof : if_must< string< 'o', 'n', 'e', 'o', 'f' >, sps, oneof_name, sps, one< '{' >, sps, until< one< '}' >, oneof_body, sps >, sps > {};
+   struct type : sor< builtin_type, defined_type > {};
 
-         struct key_type : seq< sor< bool_type, string_type, int32_type, int64_type, sint32_type, sint64_type, uint32_type, uint64_type, fixed32_type, fixed64_type, sfixed32_type, sfixed64_type >, not_at< ident_other > > {};
-         struct map_name : ident {};
-         struct map_field : if_must< string< 'm', 'a', 'p' >, sps, one< '<' >, sps, key_type, sps, comma, sps, type, sps, one< '>' >, sps, map_name, sps, equ, sps, field_number, sps, opt< field_options, sps >, semi > {};
+   struct field_option : if_must< option_name, sps, equ, sps, constant > {};
+   struct field_options : if_must< one< '[' >, sps, list< field_option, comma, sp >, sps, one< ']' > > {};
+   struct field_name : ident {};
+   struct field_number : int_lit {};
+   struct field : seq< opt< string< 'r', 'e', 'p', 'e', 'a', 't', 'e', 'd' >, sps >, type, sps, field_name, sps, equ, sps, field_number, sps, opt< field_options, sps >, semi > {};
 
-         struct range : if_must< int_lit, sps, string< 't', 'o' >, sps, sor< int_lit, string< 'm', 'a', 'x' > > > {};
-         struct ranges : list_must< range, comma, sp > {};
-         struct field_names : list_must< field_name, comma, sp > {};
-         struct reserved : if_must< string< 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd' >, sps, sor< ranges, field_names >, sps, semi > {};
+   struct oneof_name : ident {};
+   struct oneof_field : if_must< type, sps, field_name, sps, equ, sps, field_number, sps, opt< field_options, sps >, semi > {};
+   struct oneof_body : sor< oneof_field, semi > {};
+   struct oneof : if_must< string< 'o', 'n', 'e', 'o', 'f' >, sps, oneof_name, sps, one< '{' >, sps, until< one< '}' >, oneof_body, sps >, sps > {};
 
-         struct enum_name : ident {};
-         struct enum_value_option : seq< option_name, sps, equ, sps, constant > {};
-         struct enum_field : seq< ident, sps, equ, sps, int_lit, sps, opt_must< one< '[' >, sps, list_must< enum_value_option, comma, sp >, sps, one< ']' >, sps >, semi > {};
-         struct enum_body : if_must< one< '{' >, sps, star< sor< option, enum_field, semi >, sps >, one< '}' > > {};
-         struct enum_ : if_must< string< 'e', 'n', 'u', 'm' >, sps, enum_name, sps, enum_body > {};
+   struct key_type : seq< sor< bool_type, string_type, int32_type, int64_type, sint32_type, sint64_type, uint32_type, uint64_type, fixed32_type, fixed64_type, sfixed32_type, sfixed64_type >, not_at< ident_other > > {};
+   struct map_name : ident {};
+   struct map_field : if_must< string< 'm', 'a', 'p' >, sps, one< '<' >, sps, key_type, sps, comma, sps, type, sps, one< '>' >, sps, map_name, sps, equ, sps, field_number, sps, opt< field_options, sps >, semi > {};
 
-         struct message_thing : sor< field, enum_, message, option, oneof, map_field, reserved, semi > {};
-         struct message : if_must< string< 'm', 'e', 's', 's', 'a', 'g', 'e' >, sps, ident, sps, one< '{' >, sps, star< message_thing, sps >, one< '}' >, sps > {};
+   struct range : if_must< int_lit, sps, string< 't', 'o' >, sps, sor< int_lit, string< 'm', 'a', 'x' > > > {};
+   struct ranges : list_must< range, comma, sp > {};
+   struct field_names : list_must< field_name, comma, sp > {};
+   struct reserved : if_must< string< 'r', 'e', 's', 'e', 'r', 'v', 'e', 'd' >, sps, sor< ranges, field_names >, sps, semi > {};
 
-         struct package : if_must< string< 'p', 'a', 'c', 'k', 'a', 'g', 'e' >, sps, full_ident, sps, semi, sps > {};
+   struct enum_name : ident {};
+   struct enum_value_option : seq< option_name, sps, equ, sps, constant > {};
+   struct enum_field : seq< ident, sps, equ, sps, int_lit, sps, opt_must< one< '[' >, sps, list_must< enum_value_option, comma, sp >, sps, one< ']' >, sps >, semi > {};
+   struct enum_body : if_must< one< '{' >, sps, star< sor< option, enum_field, semi >, sps >, one< '}' > > {};
+   struct enum_ : if_must< string< 'e', 'n', 'u', 'm' >, sps, enum_name, sps, enum_body > {};
 
-         struct import_option : opt< sor< string< 'w', 'e', 'a', 'k' >, string< 'p', 'u', 'b', 'l', 'i', 'c' > > > {};
-         struct import : if_must< string< 'i', 'm', 'p', 'o', 'r', 't' >, sps, import_option, sps, str_lit, sps, semi, sps > {};
+   struct message_thing : sor< field, enum_, message, option, oneof, map_field, reserved, semi > {};
+   struct message : if_must< string< 'm', 'e', 's', 's', 'a', 'g', 'e' >, sps, ident, sps, one< '{' >, sps, star< message_thing, sps >, one< '}' >, sps > {};
 
-         struct rpc_name : ident {};
-         struct rpc_type : if_must< one< '(' >, sps, opt< string< 's', 't', 'r', 'e', 'a', 'm' >, sps >, defined_type, sps, one< ')' > > {};
-         struct rpc_options : if_must< one< '{' >, sps, star< sor< option, semi >, sps >, one< '}' > > {};
-         struct rpc : if_must< string< 'r', 'p', 'c' >, sps, rpc_name, sps, rpc_type, sps, string< 'r', 'e', 't', 'u', 'r', 'n', 's' >, sps, rpc_type, sor< semi, rpc_options > > {};
-         struct service_name : ident {};
-         struct service : if_must< string< 's', 'e', 'r', 'v', 'i', 'c', 'e' >, sps, service_name, sps, one< '{' >, sps, list_must< sor< option, rpc, semi >, comma, sp >, sps, one< '}' > > {};
+   struct package : if_must< string< 'p', 'a', 'c', 'k', 'a', 'g', 'e' >, sps, full_ident, sps, semi, sps > {};
 
-         struct body : sor< import, package, option, message, enum_, service, semi > {};
+   struct import_option : opt< sor< string< 'w', 'e', 'a', 'k' >, string< 'p', 'u', 'b', 'l', 'i', 'c' > > > {};
+   struct import : if_must< string< 'i', 'm', 'p', 'o', 'r', 't' >, sps, import_option, sps, str_lit, sps, semi, sps > {};
 
-         struct head : if_must< string< 's', 'y', 'n', 't', 'a', 'x' >, sps, equ, sps, string< '"', 'p', 'r', 'o', 't', 'o', '3', '"' >, sps, semi > {};
-         struct proto : must< sps, head, sps, star< body, sps >, eof > {};
+   struct rpc_name : ident {};
+   struct rpc_type : if_must< one< '(' >, sps, opt< string< 's', 't', 'r', 'e', 'a', 'm' >, sps >, defined_type, sps, one< ')' > > {};
+   struct rpc_options : if_must< one< '{' >, sps, star< sor< option, semi >, sps >, one< '}' > > {};
+   struct rpc : if_must< string< 'r', 'p', 'c' >, sps, rpc_name, sps, rpc_type, sps, string< 'r', 'e', 't', 'u', 'r', 'n', 's' >, sps, rpc_type, sor< semi, rpc_options > > {};
+   struct service_name : ident {};
+   struct service : if_must< string< 's', 'e', 'r', 'v', 'i', 'c', 'e' >, sps, service_name, sps, one< '{' >, sps, list_must< sor< option, rpc, semi >, comma, sp >, sps, one< '}' > > {};
 
-         // clang-format on
+   struct body : sor< import, package, option, message, enum_, service, semi > {};
 
-      }  // namespace proto3
+   struct head : if_must< string< 's', 'y', 'n', 't', 'a', 'x' >, sps, equ, sps, string< '"', 'p', 'r', 'o', 't', 'o', '3', '"' >, sps, semi > {};
+   struct proto : must< sps, head, sps, star< body, sps >, eof > {};
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   // clang-format on
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE::proto3
 
 int main( int argc, char** argv )
 {
-   using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+   using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 
-   analyze< proto3::proto >();
+   if( analyze< proto3::proto >() != 0 ) {
+      return 1;
+   }
 
    for( int i = 1; i < argc; ++i ) {
-      file_input<> in( argv[ i ] );
+      file_input in( argv[ i ] );
       parse< proto3::proto >( in );
    }
    return 0;
diff --git a/packages/PEGTL/src/example/pegtl/recover.cpp b/packages/PEGTL/src/example/pegtl/recover.cpp
index bb1a56cf526a52629b938ad840f7ca7a30307479..c39dcc1179281c3a3049a4e2d25ed3271c61f3d4 100644
--- a/packages/PEGTL/src/example/pegtl/recover.cpp
+++ b/packages/PEGTL/src/example/pegtl/recover.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 // This is a small experiment with a grammar that can recover from errors.
@@ -16,7 +16,7 @@
 
 #include <tao/pegtl.hpp>
 
-using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 
 // clang-format off
 
@@ -47,9 +47,7 @@ struct my_grammar : star< not_at< eof >, recoverable_expr > {};
 
 template< typename Rule >
 struct my_action
-   : nothing< Rule >
-{
-};
+{};
 
 template< typename T >
 struct my_action< skipping< T > >
@@ -113,7 +111,7 @@ struct my_control
 int main( int argc, char** argv )
 {
    for( int i = 1; i < argc; ++i ) {
-      argv_input<> in( argv, i );
+      argv_input in( argv, i );
       bool error = false;
       parse< my_grammar, my_action, my_control >( in, error );
    }
diff --git a/packages/PEGTL/src/example/pegtl/s_expression.cpp b/packages/PEGTL/src/example/pegtl/s_expression.cpp
index e47b76528e95a632c3dfb468148663b1e7094efb..c99311f8d89722ad14a3435ba7947e761a692fac 100644
--- a/packages/PEGTL/src/example/pegtl/s_expression.cpp
+++ b/packages/PEGTL/src/example/pegtl/s_expression.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <iostream>
@@ -6,79 +6,40 @@
 #include <tao/pegtl.hpp>
 #include <tao/pegtl/analyze.hpp>
 
-using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 
 namespace sexpr
 {
-   struct hash_comment
-      : until< eolf >
-   {
-   };
+   // clang-format off
+   struct hash_comment : until< eolf > {};
 
    struct list;
+   struct list_comment : if_must< at< one< '(' > >, disable< list > > {};
 
-   struct list_comment
-      : if_must< at< one< '(' > >, disable< list > >
-   {
-   };
-
-   struct read_include
-      : seq< one< ' ' >, one< '"' >, plus< not_one< '"' > >, one< '"' > >
-   {
-   };
+   struct read_include : seq< one< ' ' >, one< '"' >, plus< not_one< '"' > >, one< '"' > > {};
+   struct hash_include : if_must< string< 'i', 'n', 'c', 'l', 'u', 'd', 'e' >, read_include > {};
 
-   struct hash_include
-      : if_must< string< 'i', 'n', 'c', 'l', 'u', 'd', 'e' >, read_include >
-   {
-   };
-
-   struct hashed
-      : if_must< one< '#' >, sor< hash_include, list_comment, hash_comment > >
-   {
-   };
-
-   struct number
-      : plus< digit >
-   {
-   };
+   struct hashed : if_must< one< '#' >, sor< hash_include, list_comment, hash_comment > > {};
 
-   struct symbol
-      : identifier
-   {
-   };
+   struct number : plus< digit > {};
+   struct symbol : identifier {};
 
-   struct atom
-      : sor< number, symbol >
-   {
-   };
+   struct atom : sor< number, symbol > {};
 
    struct anything;
 
-   struct list
-      : if_must< one< '(' >, until< one< ')' >, anything > >
-   {
-   };
+   struct list : if_must< one< '(' >, until< one< ')' >, anything > > {};
 
-   struct normal
-      : sor< atom, list >
-   {
-   };
+   struct normal : sor< atom, list > {};
 
-   struct anything
-      : sor< space, hashed, normal >
-   {
-   };
+   struct anything : sor< space, hashed, normal > {};
 
-   struct main
-      : until< eof, must< anything > >
-   {
-   };
+   struct main : until< eof, must< anything > > {};
+   // clang-format on
 
    template< typename Rule >
    struct action
-      : nothing< Rule >
-   {
-   };
+   {};
 
    template<>
    struct action< plus< not_one< '"' > > >
@@ -103,7 +64,7 @@ namespace sexpr
          // last string literal that we use as filename here, and
          // the input is passed on for chained error messages (as
          // in "error in line x file foo included from file bar...)
-         file_input<> i2( fn );
+         file_input i2( fn );
          parse_nested< main, sexpr::action >( in, i2, f2 );
       }
    };
@@ -112,11 +73,13 @@ namespace sexpr
 
 int main( int argc, char** argv )
 {
-   analyze< sexpr::main >();
+   if( analyze< sexpr::main >() != 0 ) {
+      return 1;
+   }
 
    for( int i = 1; i < argc; ++i ) {
       std::string fn;
-      argv_input<> in( argv, i );
+      argv_input in( argv, i );
       parse< sexpr::main, sexpr::action >( in, fn );
    }
    return 0;
diff --git a/packages/PEGTL/src/example/pegtl/sum.cpp b/packages/PEGTL/src/example/pegtl/sum.cpp
index ef3440db4b4adb4cecc49b4ccfc347ba9cccca4a..25b2484f50bac80a5171fa3f5a9c309dcc5c4007 100644
--- a/packages/PEGTL/src/example/pegtl/sum.cpp
+++ b/packages/PEGTL/src/example/pegtl/sum.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <cstdlib>
@@ -8,7 +8,7 @@
 
 #include <tao/pegtl.hpp>
 
-using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 
 #include "double.hpp"
 
@@ -16,24 +16,19 @@ namespace sum
 {
    struct padded_double
       : pad< double_::grammar, space >
-   {
-   };
+   {};
 
    struct double_list
       : list< padded_double, one< ',' > >
-   {
-   };
+   {};
 
    struct grammar
       : seq< double_list, eof >
-   {
-   };
+   {};
 
    template< typename Rule >
    struct action
-      : nothing< Rule >
-   {
-   };
+   {};
 
    template<>
    struct action< double_::grammar >
@@ -42,8 +37,7 @@ namespace sum
       static void apply( const Input& in, double& sum )
       {
          // assume all values will fit into a C++ double
-         std::stringstream ss;
-         ss << in.string();
+         std::stringstream ss( in.string() );
          double v;
          ss >> v;
          sum += v;
@@ -65,7 +59,7 @@ int main()
          break;
       }
       double d = 0.0;
-      memory_input<> in( str, "std::cin" );
+      memory_input in( str, "std::cin" );
       if( parse< sum::grammar, sum::action >( in, d ) ) {
          std::cout << "parsing OK; sum = " << d << std::endl;
       }
diff --git a/packages/PEGTL/src/example/pegtl/symbol_table.cpp b/packages/PEGTL/src/example/pegtl/symbol_table.cpp
index 4f51b16889106d34f1e88d317cb4a08106576cc2..fce5d6e1a364d2efdca25c54f68fe8790ed4ff9b 100644
--- a/packages/PEGTL/src/example/pegtl/symbol_table.cpp
+++ b/packages/PEGTL/src/example/pegtl/symbol_table.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <cstring>
@@ -10,7 +10,7 @@
 
 #include <tao/pegtl/contrib/integer.hpp>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 namespace example
 {
@@ -43,9 +43,7 @@ namespace example
 
    template< typename Rule >
    struct action
-      : pegtl::nothing< Rule >
-   {
-   };
+   {};
 
    template<>
    struct action< value >
@@ -70,7 +68,7 @@ namespace example
       template< typename Input >
       static void apply( const Input& in, state& st )
       {
-         if( !st.symbol_table.insert( { st.temporary, 0 } ).second ) {
+         if( !st.symbol_table.emplace( st.temporary, 0 ).second ) {
             throw pegtl::parse_error( "duplicate symbol " + st.temporary, in );  // NOLINT
          }
       }
@@ -95,7 +93,7 @@ namespace example
 int main( int argc, char** argv )
 {
    for( int i = 1; i < argc; ++i ) {
-      pegtl::file_input<> in( argv[ i ] );
+      pegtl::file_input in( argv[ i ] );
       example::state st;
       pegtl::parse< example::grammar, example::action >( in, st );
       for( const auto& j : st.symbol_table ) {
diff --git a/packages/PEGTL/src/example/pegtl/unescape.cpp b/packages/PEGTL/src/example/pegtl/unescape.cpp
index fca7a66c2d690d71f37f3cba9c37fc25fadf161f..69705ca340ab21c329886285339c98193a0bbec7 100644
--- a/packages/PEGTL/src/example/pegtl/unescape.cpp
+++ b/packages/PEGTL/src/example/pegtl/unescape.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <iostream>
@@ -7,14 +7,14 @@
 
 #include <tao/pegtl/contrib/unescape.hpp>
 
-using namespace tao::TAO_PEGTL_NAMESPACE;  // NOLINT
+using namespace TAO_PEGTL_NAMESPACE;  // NOLINT
 
 namespace example
 {
    // Grammar for string literals with some escape sequences from the C language:
    // - \x followed by two hex-digits to insert any byte value.
    // - \u followed by four hex-digits to insert a Unicode code point.
-   // - \U followed by eight hex-digits to insert any Unicdoe code points.
+   // - \U followed by eight hex-digits to insert any Unicode code points.
    // - A backslash followed by one of the characters listed in the grammar below.
 
    // clang-format off
@@ -37,7 +37,7 @@ namespace example
    // produce a UTF-8 encoded result string where all escape sequences are
    // replaced with their intended meaning.
 
-   template< typename Rule > struct action : nothing< Rule > {};
+   template< typename Rule > struct action {};
 
    template<> struct action< utf8::range< 0x20, 0x10FFFF > > : unescape::append_all {};
    template<> struct action< escaped_x > : unescape::unescape_x {};
@@ -51,10 +51,10 @@ namespace example
 int main( int argc, char** argv )
 {
    for( int i = 1; i < argc; ++i ) {
-      unescape::state s;
-      argv_input<> in( argv, i );
+      std::string s;
+      argv_input in( argv, i );
       parse< example::padded, example::action >( in, s );
-      std::cout << "argv[ " << i << " ] = " << s.unescaped << std::endl;
+      std::cout << "argv[ " << i << " ] = " << s << std::endl;
    }
    return 0;
 }
diff --git a/packages/PEGTL/src/example/pegtl/uri.cpp b/packages/PEGTL/src/example/pegtl/uri.cpp
index 21f51b78b0721083bb719b20644e92509e8e05b3..f504b68cf177e69b43dd50eb222b369d7bd70074 100644
--- a/packages/PEGTL/src/example/pegtl/uri.cpp
+++ b/packages/PEGTL/src/example/pegtl/uri.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <tao/pegtl.hpp>
@@ -6,7 +6,7 @@
 
 #include <iostream>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 struct URI
 {
@@ -35,7 +35,7 @@ namespace uri
    };
 
    // clang-format off
-   template< typename Rule > struct action : tao::pegtl::nothing< Rule > {};
+   template< typename Rule > struct action {};
 
    template<> struct action< pegtl::uri::scheme > : bind< &URI::scheme > {};
    template<> struct action< pegtl::uri::authority > : bind< &URI::authority > {};
@@ -67,7 +67,7 @@ namespace uri
 URI::URI( const std::string& uri )
 {
    using grammar = pegtl::must< pegtl::uri::URI >;
-   pegtl::memory_input<> input( uri, "uri" );
+   pegtl::memory_input input( uri, "uri" );
    pegtl::parse< grammar, uri::action >( input, *this );
 }
 
diff --git a/packages/PEGTL/src/example/pegtl/uri_trace.cpp b/packages/PEGTL/src/example/pegtl/uri_trace.cpp
index b1c43e3d9883d100c2ce5be5caa5b332e682ba74..1d09e9fa5ef9a899575df80bd38e1033122b6c77 100644
--- a/packages/PEGTL/src/example/pegtl/uri_trace.cpp
+++ b/packages/PEGTL/src/example/pegtl/uri_trace.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <iostream>
@@ -7,7 +7,7 @@
 #include <tao/pegtl/contrib/tracer.hpp>
 #include <tao/pegtl/contrib/uri.hpp>
 
-namespace pegtl = tao::TAO_PEGTL_NAMESPACE;
+namespace pegtl = TAO_PEGTL_NAMESPACE;
 
 using grammar = pegtl::must< pegtl::uri::URI >;
 
@@ -15,7 +15,7 @@ int main( int argc, char** argv )
 {
    for( int i = 1; i < argc; ++i ) {
       std::cout << "Parsing " << argv[ i ] << std::endl;
-      pegtl::argv_input<> in( argv, i );
+      pegtl::argv_input in( argv, i );
       pegtl::parse< grammar, pegtl::nothing, pegtl::tracer >( in );
    }
    return 0;
diff --git a/packages/PEGTL/src/test/pegtl/CMakeLists.txt b/packages/PEGTL/src/test/pegtl/CMakeLists.txt
index f2c45acd050c4ba8f04b0a232d18e14a86a38cbf..fda805afb0fa5ed505485d9d3ac397fefeb264cb 100644
--- a/packages/PEGTL/src/test/pegtl/CMakeLists.txt
+++ b/packages/PEGTL/src/test/pegtl/CMakeLists.txt
@@ -1,6 +1,8 @@
-cmake_minimum_required (VERSION 3.3.0 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
 
-set (test_sources
+set(test_sources
+  action_enable.cpp
+  action_match.cpp
   actions_one.cpp
   actions_three.cpp
   actions_two.cpp
@@ -17,11 +19,17 @@ set (test_sources
   ascii_string.cpp
   ascii_three.cpp
   ascii_two.cpp
+  buffer_input.cpp
+  change_action_and_state.cpp
+  change_action_and_states.cpp
+  change_state.cpp
+  change_states.cpp
   contrib_alphabet.cpp
   contrib_integer.cpp
   contrib_if_then.cpp
   contrib_json.cpp
   contrib_parse_tree.cpp
+  contrib_partial_trace.cpp
   contrib_raw_string.cpp
   contrib_rep_one_min_max.cpp
   contrib_to_string.cpp
@@ -30,6 +38,7 @@ set (test_sources
   contrib_uri.cpp
   data_cstring.cpp
   demangle.cpp
+  discard_input.cpp
   file_cstream.cpp
   file_file.cpp
   file_istream.cpp
@@ -67,6 +76,7 @@ set (test_sources
   rule_pad.cpp
   rule_pad_opt.cpp
   rule_plus.cpp
+  rule_rematch.cpp
   rule_rep.cpp
   rule_rep_max.cpp
   rule_rep_min.cpp
@@ -91,39 +101,38 @@ set (test_sources
   utf8_general.cpp
 )
 
-# file (GLOB ...) is used to validate the above list of test_sources
-file (GLOB glob_test_sources RELATIVE ${CMAKE_CURRENT_LIST_DIR} *.cpp)
+# file(GLOB ...) is used to validate the above list of test_sources
+file(GLOB glob_test_sources RELATIVE ${CMAKE_CURRENT_LIST_DIR} *.cpp)
 
-foreach (testsourcefile ${test_sources})
-  if (${testsourcefile} IN_LIST glob_test_sources)
-    list (REMOVE_ITEM glob_test_sources ${testsourcefile})
-  else ()
-    message (SEND_ERROR "File ${testsourcefile} is missing from src/test/pegtl")
-  endif ()
+foreach(testsourcefile ${test_sources})
+  if(${testsourcefile} IN_LIST glob_test_sources)
+    list(REMOVE_ITEM glob_test_sources ${testsourcefile})
+  else()
+    message(SEND_ERROR "File ${testsourcefile} is missing from src/test/pegtl")
+  endif()
 
-  get_filename_component (exename ${testsourcefile} NAME_WE)
-  set (exename "pegtl-test-${exename}")
-  add_executable (${exename} ${testsourcefile})
-  target_link_libraries (${exename} PRIVATE taocpp::pegtl)
-  set_target_properties (${exename} PROPERTIES
-    CXX_STANDARD 11
+  get_filename_component(exename pegtl-test-${testsourcefile} NAME_WE)
+  add_executable(${exename} ${testsourcefile})
+  target_link_libraries(${exename} PRIVATE taocpp::pegtl)
+  set_target_properties(${exename} PROPERTIES
+    CXX_STANDARD 17
     CXX_STANDARD_REQUIRED ON
     CXX_EXTENSIONS OFF
   )
-  if (MSVC)
-    target_compile_options (${exename} PRIVATE /W4 /WX /utf-8)
-  else ()
-    target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror)
-  endif ()
-  if (ANDROID)
-    add_test (NAME ${exename} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../.. COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_RESOURCES=src/test/pegtl/data;src/test/pegtl/file_data.txt;Makefile" -DTEST_RESOURCES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../../.. -DUNITTEST=${CMAKE_CURRENT_BINARY_DIR}/${exename} -DTEST_PARAMETER=-all -P ${CMAKE_CURRENT_SOURCE_DIR}/ExecuteOnAndroid.cmake)
-  else ()
-    add_test (NAME ${exename} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../.. COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${exename})
-  endif ()
-endforeach (testsourcefile)
+  if(MSVC)
+    target_compile_options(${exename} PRIVATE /W4 /WX /utf-8)
+  else()
+    target_compile_options(${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror)
+  endif()
+  if(ANDROID)
+    add_test(NAME ${exename} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../.. COMMAND ${CMAKE_COMMAND} -DANDROID_NDK=${ANDROID_NDK} "-DTEST_RESOURCES=src/test/pegtl/data;src/test/pegtl/file_data.txt;Makefile" -DTEST_RESOURCES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/../../.. -DUNITTEST=${CMAKE_CURRENT_BINARY_DIR}/${exename} -DTEST_PARAMETER=-all -P ${CMAKE_CURRENT_SOURCE_DIR}/ExecuteOnAndroid.cmake)
+  else()
+    add_test(NAME ${exename} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../.. COMMAND ${exename})
+  endif()
+endforeach(testsourcefile)
 
-if (glob_test_sources)
-  foreach (ignored_source_file ${glob_test_sources})
-    message (SEND_ERROR "File ${ignored_source_file} in src/test/pegtl is ignored")
-  endforeach (ignored_source_file)
-endif ()
+if(glob_test_sources)
+  foreach(ignored_source_file ${glob_test_sources})
+    message(SEND_ERROR "File ${ignored_source_file} in src/test/pegtl is ignored")
+  endforeach(ignored_source_file)
+endif()
diff --git a/packages/PEGTL/src/test/pegtl/action_enable.cpp b/packages/PEGTL/src/test/pegtl/action_enable.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..89890bac351b1828c7f0764ab1e80a1301fc7614
--- /dev/null
+++ b/packages/PEGTL/src/test/pegtl/action_enable.cpp
@@ -0,0 +1,64 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include "test.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   // clang-format off
+   struct A : one< 'a' > {};
+   struct B : one< 'b' > {};
+   struct C : one< 'c' > {};
+   struct BCB : seq< B, C, B > {};
+   struct ABCBA : seq< A, BCB, A > {};
+   // clang-format on
+
+   template< typename >
+   struct my_action
+   {};
+
+   template<>
+   struct my_action< A >
+   {
+      static void apply0( int& a, int& /*b*/, int& /*c*/ )
+      {
+         ++a;
+      }
+   };
+
+   template<>
+   struct my_action< B >
+      : disable_action
+   {
+      static void apply0( int& /*a*/, int& b, int& /*c*/ )
+      {
+         ++b;
+      }
+   };
+
+   template<>
+   struct my_action< C >
+      : enable_action
+   {
+      static void apply0( int& /*a*/, int& /*b*/, int& c )
+      {
+         ++c;
+      }
+   };
+
+   void unit_test()
+   {
+      memory_input<> in( "abcba", "" );
+      int a = 0;
+      int b = 0;
+      int c = 0;
+      const auto result = parse< ABCBA, my_action >( in, a, b, c );
+      TAO_PEGTL_TEST_ASSERT( result );
+      TAO_PEGTL_TEST_ASSERT( a == 2 );
+      TAO_PEGTL_TEST_ASSERT( b == 0 );
+      TAO_PEGTL_TEST_ASSERT( c == 1 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/action_match.cpp b/packages/PEGTL/src/test/pegtl/action_match.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..dfb60c6f4254b8f54e1fead5cacf26c8ac643fd3
--- /dev/null
+++ b/packages/PEGTL/src/test/pegtl/action_match.cpp
@@ -0,0 +1,116 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include "test.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   struct remove_state
+   {
+      template< typename Rule,
+                apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      [[nodiscard]] static bool match( Input& in, States&&... /*unused*/ )
+      {
+         return TAO_PEGTL_NAMESPACE::match< Rule, A, M, Action, Control >( in );
+      }
+   };
+
+   // further generic helpers could be build, e.g.
+   //
+   // - change_control
+   // - remove prefix/suffix from input (e.g. remove surrounding quotes)
+   // - replace the input completely?
+   // - append states
+   // - prepend states
+   // - ...
+
+   std::size_t global_state = 0;
+
+   struct state_one
+   {
+      std::size_t byte_in_line_a;
+      std::size_t byte_in_line_b;
+   };
+
+   // clang-format off
+   struct grammar_inner : one< 'a' > {};
+   struct grammar_one_c : seq< grammar_inner > {};
+   struct grammar_one_b : seq< grammar_inner, grammar_one_c > {};
+   struct grammar_one_a : seq< grammar_inner, grammar_one_b, eof > {};
+   // clang-format on
+
+   template< typename Rule >
+   struct action_one_b
+   {};
+
+   template< typename Rule >
+   struct action_one_t
+   {};
+
+   template< typename Rule >
+   struct action_one_a
+   {};
+
+   template<>
+   struct action_one_b< grammar_one_c >
+      : remove_state
+   {};
+
+   template<>
+   struct action_one_b< grammar_inner >
+   {
+      // used inside of remove_state
+      template< typename Input >
+      static void apply( const Input& /*unused*/ )
+      {
+         ++global_state;
+      }
+
+      // used outside of remove_state
+      template< typename Input >
+      static void apply( const Input& in, state_one& state )
+      {
+         state.byte_in_line_b += in.input().byte();
+      }
+   };
+
+   template<>
+   struct action_one_t< grammar_one_b >
+      : change_action< action_one_b >
+   {};
+
+   template<>
+   struct action_one_a< grammar_one_b >
+      : change_action< action_one_t >
+   {};
+
+   template<>
+   struct action_one_a< grammar_inner >
+   {
+      template< typename Input >
+      static void apply( const Input& in, state_one& state )
+      {
+         state.byte_in_line_a += in.input().byte();
+      }
+   };
+
+   void unit_test()
+   {
+      state_one state{ 0, 0 };
+      bool parse_result = parse< grammar_one_a, action_one_a >( memory_input( "aaa", __FUNCTION__ ), state );
+      TAO_PEGTL_TEST_ASSERT( parse_result );
+      TAO_PEGTL_TEST_ASSERT( state.byte_in_line_a == 1 );
+      TAO_PEGTL_TEST_ASSERT( state.byte_in_line_b == 2 );
+      TAO_PEGTL_TEST_ASSERT( global_state == 1 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/actions_one.cpp b/packages/PEGTL/src/test/pegtl/actions_one.cpp
index eb964a00823c65b66a658b6887bbcd0ab26b2235..9577fae8ac6b2377c4b68680d074d05b81e6476e 100644
--- a/packages/PEGTL/src/test/pegtl/actions_one.cpp
+++ b/packages/PEGTL/src/test/pegtl/actions_one.cpp
@@ -1,90 +1,102 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 
-namespace tao
+#include <string>
+#include <utility>
+#include <vector>
+
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   std::vector< std::pair< std::string, std::string > > applied;  // NOLINT
+
+   namespace test1
    {
-      namespace test1
+      struct fiz : if_must< at< one< 'a' > >, two< 'a' > >
       {
-         struct fiz : if_must< at< one< 'a' > >, two< 'a' > >
-         {
-         };
-
-         struct foo : sor< fiz, one< 'b' > >
-         {
-         };
-
-         struct bar : until< eof, foo >
-         {
-         };
-
-         void test_result()
-         {
-            TAO_PEGTL_TEST_ASSERT( applied.size() == 10 );
-
-            TAO_PEGTL_TEST_ASSERT( applied[ 0 ].first == internal::demangle< one< 'b' > >() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 1 ].first == internal::demangle< foo >() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 2 ].first == internal::demangle< at< one< 'a' > > >() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 3 ].first == internal::demangle< two< 'a' > >() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 4 ].first == internal::demangle< fiz >() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 5 ].first == internal::demangle< foo >() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 6 ].first == internal::demangle< one< 'b' > >() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 7 ].first == internal::demangle< foo >() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 8 ].first == internal::demangle< eof >() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 9 ].first == internal::demangle< bar >() );
-
-            TAO_PEGTL_TEST_ASSERT( applied[ 0 ].second == "b" );
-            TAO_PEGTL_TEST_ASSERT( applied[ 1 ].second == "b" );
-            TAO_PEGTL_TEST_ASSERT( applied[ 2 ].second.empty() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 3 ].second == "aa" );
-            TAO_PEGTL_TEST_ASSERT( applied[ 4 ].second == "aa" );
-            TAO_PEGTL_TEST_ASSERT( applied[ 5 ].second == "aa" );
-            TAO_PEGTL_TEST_ASSERT( applied[ 6 ].second == "b" );
-            TAO_PEGTL_TEST_ASSERT( applied[ 7 ].second == "b" );
-            TAO_PEGTL_TEST_ASSERT( applied[ 8 ].second.empty() );
-            TAO_PEGTL_TEST_ASSERT( applied[ 9 ].second == "baab" );
-         }
-
-      }  // namespace test1
-
-      void unit_test()
+      };
+
+      struct foo : sor< fiz, one< 'b' > >
       {
-         parse< disable< test1::bar >, test_action >( memory_input<>( "baab", __FUNCTION__ ) );
-         TAO_PEGTL_TEST_ASSERT( applied.size() == 1 );
+      };
 
-         TAO_PEGTL_TEST_ASSERT( applied[ 0 ].first == internal::demangle< disable< test1::bar > >() );
-         TAO_PEGTL_TEST_ASSERT( applied[ 0 ].second == "baab" );
+      struct bar : until< eof, foo >
+      {
+      };
 
-         applied.clear();
+      void test_result()
+      {
+         TAO_PEGTL_TEST_ASSERT( applied.size() == 10 );
+
+         TAO_PEGTL_TEST_ASSERT( applied[ 0 ].first == internal::demangle< one< 'b' > >() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 1 ].first == internal::demangle< foo >() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 2 ].first == internal::demangle< at< one< 'a' > > >() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 3 ].first == internal::demangle< two< 'a' > >() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 4 ].first == internal::demangle< fiz >() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 5 ].first == internal::demangle< foo >() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 6 ].first == internal::demangle< one< 'b' > >() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 7 ].first == internal::demangle< foo >() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 8 ].first == internal::demangle< eof >() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 9 ].first == internal::demangle< bar >() );
+
+         TAO_PEGTL_TEST_ASSERT( applied[ 0 ].second == "b" );
+         TAO_PEGTL_TEST_ASSERT( applied[ 1 ].second == "b" );
+         TAO_PEGTL_TEST_ASSERT( applied[ 2 ].second.empty() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 3 ].second == "aa" );
+         TAO_PEGTL_TEST_ASSERT( applied[ 4 ].second == "aa" );
+         TAO_PEGTL_TEST_ASSERT( applied[ 5 ].second == "aa" );
+         TAO_PEGTL_TEST_ASSERT( applied[ 6 ].second == "b" );
+         TAO_PEGTL_TEST_ASSERT( applied[ 7 ].second == "b" );
+         TAO_PEGTL_TEST_ASSERT( applied[ 8 ].second.empty() );
+         TAO_PEGTL_TEST_ASSERT( applied[ 9 ].second == "baab" );
+      }
 
-         parse< at< action< test_action, test1::bar > > >( memory_input<>( "baab", __FUNCTION__ ) );
+   }  // namespace test1
 
-         TAO_PEGTL_TEST_ASSERT( applied.empty() );
+   template< typename Rule >
+   struct test_action
+   {
+      template< typename Input >
+      static void apply( const Input& in )
+      {
+         applied.emplace_back( internal::demangle< Rule >(), in.string() );
+      }
+   };
+
+   void unit_test()
+   {
+      parse< disable< test1::bar >, test_action >( memory_input( "baab", __FUNCTION__ ) );
+      TAO_PEGTL_TEST_ASSERT( applied.size() == 1 );
 
-         applied.clear();
+      TAO_PEGTL_TEST_ASSERT( applied[ 0 ].first == internal::demangle< disable< test1::bar > >() );
+      TAO_PEGTL_TEST_ASSERT( applied[ 0 ].second == "baab" );
 
-         parse< test1::bar, test_action >( memory_input<>( "baab", __FUNCTION__ ) );
+      applied.clear();
 
-         test1::test_result();
+      parse< at< action< test_action, test1::bar > > >( memory_input( "baab", __FUNCTION__ ) );
 
-         applied.clear();
+      TAO_PEGTL_TEST_ASSERT( applied.empty() );
 
-         parse< action< test_action, test1::bar > >( memory_input<>( "baab", __FUNCTION__ ) );
+      applied.clear();
 
-         test1::test_result();
+      parse< test1::bar, test_action >( memory_input( "baab", __FUNCTION__ ) );
 
-         applied.clear();
+      test1::test_result();
 
-         parse< disable< enable< action< test_action, test1::bar > > > >( memory_input<>( "baab", __FUNCTION__ ) );
+      applied.clear();
 
-         test1::test_result();
-      }
+      parse< action< test_action, test1::bar > >( memory_input( "baab", __FUNCTION__ ) );
+
+      test1::test_result();
+
+      applied.clear();
+
+      parse< disable< enable< action< test_action, test1::bar > > > >( memory_input( "baab", __FUNCTION__ ) );
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      test1::test_result();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/actions_three.cpp b/packages/PEGTL/src/test/pegtl/actions_three.cpp
index 378025cc73c13355255a3f1559d4a716dbfdde47..be49391fef1ecd1bb176c32be47f312ee0e184ce 100644
--- a/packages/PEGTL/src/test/pegtl/actions_three.cpp
+++ b/packages/PEGTL/src/test/pegtl/actions_three.cpp
@@ -1,102 +1,95 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace test1
    {
-      namespace test1
-      {
-         bool apply_result;
-
-         struct grammar
-            : test_rule< 2, apply_mode::ACTION, rewind_mode::ACTIVE, any >
-         {
-         };
+      bool apply_result;
 
-         template< typename Rule >
-         struct apply_bool_action : nothing< Rule >
-         {
-         };
+      struct grammar
+         : test_rule< 2, apply_mode::action, rewind_mode::active, any >
+      {};
 
-         template<>
-         struct apply_bool_action< grammar >
-         {
-            template< typename Input >
-            static bool apply( const Input& /*unused*/ )
-            {
-               return apply_result;
-            }
-         };
+      template< typename Rule >
+      struct apply_bool_action
+      {};
 
-         void apply_bool_true()
-         {
-            apply_result = true;
-            memory_input<> in( "ab", __FUNCTION__ );
-            const auto result = parse< grammar, apply_bool_action >( in );
-            TAO_PEGTL_TEST_ASSERT( result );
-            TAO_PEGTL_TEST_ASSERT( in.size() == 1 );
-            TAO_PEGTL_TEST_ASSERT( in.peek_char() == 'b' );
-         }
-
-         void apply_bool_false()
+      template<>
+      struct apply_bool_action< grammar >
+      {
+         template< typename Input >
+         static bool apply( const Input& /*unused*/ )
          {
-            apply_result = false;
-            memory_input<> in( "ab", __FUNCTION__ );
-            const auto result = parse< grammar, apply_bool_action >( in );
-            TAO_PEGTL_TEST_ASSERT( !result );
-            TAO_PEGTL_TEST_ASSERT( in.size() == 2 );
-            TAO_PEGTL_TEST_ASSERT( in.peek_char() == 'a' );
+            return apply_result;
          }
+      };
 
-         template< typename Rule >
-         struct apply0_bool_action : nothing< Rule >
-         {
-         };
+      void apply_bool_true()
+      {
+         apply_result = true;
+         memory_input in( "ab", __FUNCTION__ );
+         const auto result = parse< grammar, apply_bool_action >( in );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( in.size() == 1 );
+         TAO_PEGTL_TEST_ASSERT( in.peek_char() == 'b' );
+      }
 
-         template<>
-         struct apply0_bool_action< grammar >
-         {
-            static bool apply0()
-            {
-               return apply_result;
-            }
-         };
+      void apply_bool_false()
+      {
+         apply_result = false;
+         memory_input in( "ab", __FUNCTION__ );
+         const auto result = parse< grammar, apply_bool_action >( in );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( in.size() == 2 );
+         TAO_PEGTL_TEST_ASSERT( in.peek_char() == 'a' );
+      }
 
-         void apply0_bool_true()
-         {
-            apply_result = true;
-            memory_input<> in( "ab", __FUNCTION__ );
-            const auto result = parse< grammar, apply0_bool_action >( in );
-            TAO_PEGTL_TEST_ASSERT( result );
-            TAO_PEGTL_TEST_ASSERT( in.size() == 1 );
-            TAO_PEGTL_TEST_ASSERT( in.peek_char() == 'b' );
-         }
+      template< typename Rule >
+      struct apply0_bool_action
+      {};
 
-         void apply0_bool_false()
+      template<>
+      struct apply0_bool_action< grammar >
+      {
+         static bool apply0()
          {
-            apply_result = false;
-            memory_input<> in( "ab", __FUNCTION__ );
-            const auto result = parse< grammar, apply0_bool_action >( in );
-            TAO_PEGTL_TEST_ASSERT( !result );
-            TAO_PEGTL_TEST_ASSERT( in.size() == 2 );
-            TAO_PEGTL_TEST_ASSERT( in.peek_char() == 'a' );
+            return apply_result;
          }
+      };
 
-      }  // namespace test1
+      void apply0_bool_true()
+      {
+         apply_result = true;
+         memory_input in( "ab", __FUNCTION__ );
+         const auto result = parse< grammar, apply0_bool_action >( in );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( in.size() == 1 );
+         TAO_PEGTL_TEST_ASSERT( in.peek_char() == 'b' );
+      }
 
-      void unit_test()
+      void apply0_bool_false()
       {
-         test1::apply_bool_true();
-         test1::apply_bool_false();
-         test1::apply0_bool_true();
-         test1::apply0_bool_false();
+         apply_result = false;
+         memory_input in( "ab", __FUNCTION__ );
+         const auto result = parse< grammar, apply0_bool_action >( in );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( in.size() == 2 );
+         TAO_PEGTL_TEST_ASSERT( in.peek_char() == 'a' );
       }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   }  // namespace test1
+
+   void unit_test()
+   {
+      test1::apply_bool_true();
+      test1::apply_bool_false();
+      test1::apply0_bool_true();
+      test1::apply0_bool_false();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/actions_two.cpp b/packages/PEGTL/src/test/pegtl/actions_two.cpp
index d5d5b6be23422fc1804e82481a196e58dd0344fb..0d4475a41a904a0934b379abf66ea075b676cdd8 100644
--- a/packages/PEGTL/src/test/pegtl/actions_two.cpp
+++ b/packages/PEGTL/src/test/pegtl/actions_two.cpp
@@ -1,141 +1,133 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace test1
    {
-      namespace test1
+      struct state1
       {
-         struct state1
-         {
-            char c;
-
-            template< typename Input >
-            state1( const Input& /*unused*/, std::string& /*unused*/ )
-               : c()
-            {
-            }
-
-            template< typename Input >
-            void success( const Input& /*unused*/, std::string& s ) const
-            {
-               s += c;
-            }
-         };
-
-         struct fobble : sor< state< state1, alpha >, digit >
-         {
-         };
+         char c;
 
-         struct fibble : until< eof, fobble >
+         template< typename Input >
+         state1( const Input& /*unused*/, std::string& /*unused*/ )
+            : c()
          {
-         };
+         }
 
-         template< typename Rule >
-         struct action1 : nothing< Rule >
+         template< typename Input >
+         void success( const Input& /*unused*/, std::string& s ) const
          {
-         };
+            s += c;
+         }
+      };
 
-         template<>
-         struct action1< alpha >
-         {
-            template< typename Input >
-            static void apply( const Input& in, state1& s )
-            {
-               assert( in.size() == 1 );
-               s.c = in.begin()[ 0 ];
-            }
-         };
-
-         void state_test()
+      struct fobble : sor< state< state1, alpha >, digit >
+      {};
+
+      struct fibble : until< eof, fobble >
+      {};
+
+      template< typename Rule >
+      struct action1
+      {};
+
+      template<>
+      struct action1< alpha >
+      {
+         template< typename Input >
+         static void apply( const Input& in, state1& s )
          {
-            std::string result;
-            memory_input<> in( "dk41sk41xk3", __FUNCTION__ );
-            parse< fibble, action1 >( in, result );
-            TAO_PEGTL_TEST_ASSERT( result == "dkskxk" );
+            assert( in.size() == 1 );
+            s.c = in.begin()[ 0 ];
          }
+      };
 
-         template< typename Rule >
-         struct action0 : nothing< Rule >
-         {
-         };
+      void state_test()
+      {
+         std::string result;
+         memory_input in( "dk41sk41xk3", __FUNCTION__ );
+         parse< fibble, action1 >( in, result );
+         TAO_PEGTL_TEST_ASSERT( result == "dkskxk" );
+      }
 
-         static int i0 = 0;
+      template< typename Rule >
+      struct action0
+      {};
 
-         template<>
-         struct action0< alpha >
-         {
-            static void apply0()
-            {
-               ++i0;
-            }
-         };
-
-         template<>
-         struct action0< digit >
+      static int i0 = 0;
+
+      template<>
+      struct action0< alpha >
+      {
+         static void apply0()
          {
-            static void apply0( std::string& s )
-            {
-               s += '0';
-            }
-         };
+            ++i0;
+         }
+      };
 
-         void apply0_test()
+      template<>
+      struct action0< digit >
+      {
+         static void apply0( std::string& s )
          {
-            memory_input<> ina( "abcdefgh", __FUNCTION__ );
-            parse< star< alpha >, action0 >( ina );
-            TAO_PEGTL_TEST_ASSERT( i0 == 8 );
-            std::string s0;
-            memory_input<> ind( "12345678", __FUNCTION__ );
-            parse< star< digit >, action0 >( ind, s0 );
-            TAO_PEGTL_TEST_ASSERT( s0 == "00000000" );
+            s += '0';
          }
+      };
+
+      void apply0_test()
+      {
+         memory_input ina( "abcdefgh", __FUNCTION__ );
+         parse< star< alpha >, action0 >( ina );
+         TAO_PEGTL_TEST_ASSERT( i0 == 8 );
+         std::string s0;
+         memory_input ind( "12345678", __FUNCTION__ );
+         parse< star< digit >, action0 >( ind, s0 );
+         TAO_PEGTL_TEST_ASSERT( s0 == "00000000" );
+      }
 
-         const std::size_t count_byte = 12345;
-         const std::size_t count_line = 42;
-         const std::size_t count_byte_in_line = 12;
+      const std::size_t count_byte = 12345;
+      const std::size_t count_line = 42;
+      const std::size_t count_byte_in_line = 12;
 
-         const char* count_source = "count_source";
+      const char* count_source = "count_source";
 
-         template< typename Rule >
-         struct count_action
-         {
-            template< typename Input >
-            static void apply( const Input& in )
-            {
-               TAO_PEGTL_TEST_ASSERT( in.iterator().byte == count_byte );
-               TAO_PEGTL_TEST_ASSERT( in.iterator().line == count_line );
-               TAO_PEGTL_TEST_ASSERT( in.iterator().byte_in_line == count_byte_in_line );
-               TAO_PEGTL_TEST_ASSERT( in.input().source() == count_source );
-               TAO_PEGTL_TEST_ASSERT( in.size() == 1 );
-               TAO_PEGTL_TEST_ASSERT( in.begin() + 1 == in.end() );
-               TAO_PEGTL_TEST_ASSERT( in.peek_char() == 'f' );
-               TAO_PEGTL_TEST_ASSERT( in.peek_byte() == static_cast< unsigned char >( 'f' ) );
-            }
-         };
-
-         void count_test()
+      template< typename Rule >
+      struct count_action
+      {
+         template< typename Input >
+         static void apply( const Input& in )
          {
-            const char* foo = "f";
-            memory_input<> in( foo, foo + 1, count_source, count_byte, count_line, count_byte_in_line );
-            const auto result = parse< must< alpha >, count_action >( in );
-            TAO_PEGTL_TEST_ASSERT( result );
+            TAO_PEGTL_TEST_ASSERT( in.iterator().byte == count_byte );
+            TAO_PEGTL_TEST_ASSERT( in.iterator().line == count_line );
+            TAO_PEGTL_TEST_ASSERT( in.iterator().byte_in_line == count_byte_in_line );
+            TAO_PEGTL_TEST_ASSERT( in.input().source() == count_source );
+            TAO_PEGTL_TEST_ASSERT( in.size() == 1 );
+            TAO_PEGTL_TEST_ASSERT( in.begin() + 1 == in.end() );
+            TAO_PEGTL_TEST_ASSERT( in.peek_char() == 'f' );
+            TAO_PEGTL_TEST_ASSERT( in.peek_uint8() == static_cast< unsigned char >( 'f' ) );
          }
+      };
 
-      }  // namespace test1
-
-      void unit_test()
+      void count_test()
       {
-         test1::state_test();
-         test1::apply0_test();
-         test1::count_test();
+         const char* foo = "f";
+         memory_input in( foo, foo + 1, count_source, count_byte, count_line, count_byte_in_line );
+         const auto result = parse< must< alpha >, count_action >( in );
+         TAO_PEGTL_TEST_ASSERT( result );
       }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   }  // namespace test1
+
+   void unit_test()
+   {
+      test1::state_test();
+      test1::apply0_test();
+      test1::count_test();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/analyze_cycles.cpp b/packages/PEGTL/src/test/pegtl/analyze_cycles.cpp
index 1625b3e82522ca16e8edaf3c08a68e7ea714766a..099fcc4c6dee28a5cb1e5fb89848ebb123af3325 100644
--- a/packages/PEGTL/src/test/pegtl/analyze_cycles.cpp
+++ b/packages/PEGTL/src/test/pegtl/analyze_cycles.cpp
@@ -1,311 +1,307 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   struct any_seq
+      : public seq< Rules... >
    {
-      template< typename... Rules >
-      struct any_seq
-         : public seq< Rules... >
-      {
-         using analyze_t = analysis::generic< analysis::rule_type::ANY, Rules... >;
-      };
+      using analyze_t = analysis::generic< analysis::rule_type::any, Rules... >;
+   };
 
-      void unit_test()
-      {
-         verify_analyze< eof >( __LINE__, __FILE__, false, false );
-         verify_analyze< eolf >( __LINE__, __FILE__, false, false );
-         verify_analyze< success >( __LINE__, __FILE__, false, false );
-         verify_analyze< failure >( __LINE__, __FILE__, true, false );
-         {
-            struct tst : star< tst >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : plus< tst >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : seq< eof, at< digit >, tst >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );  // This is a false positive.
-         }
-         {
-            struct tst : sor< digit, seq< at< digit >, tst > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );  // This is a false positive.
-         }
-         {
-            struct tst : sor< digit, seq< opt< digit >, tst > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : sor< digit, tst >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : at< any >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, false );
-         }
-         {
-            struct tst : at< tst >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : at< any, tst >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, false );
-         }
-         {
-            struct tst : not_at< any >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, false );
-         }
-         {
-            struct tst : opt< tst >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : opt< any, tst >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, false );
-         }
-         {
-            struct rec : sor< seq< rec, alpha >, alpha >
-            {
-            };
-            verify_analyze< rec >( __LINE__, __FILE__, true, true );
-         }
-         {
-            struct bar;
-            struct foo : seq< digit, bar >
-            {
-            };
-            struct bar : plus< foo >
-            {
-            };
-            verify_analyze< seq< any, bar > >( __LINE__, __FILE__, true, false );
-         }
-         {
-            struct bar;
-            struct foo : seq< bar, digit >
-            {
-            };
-            struct bar : plus< foo >
-            {
-            };
-            verify_analyze< seq< bar, any > >( __LINE__, __FILE__, true, true );
-         }
-         {
-            struct bar;
-            struct foo : sor< digit, bar >
-            {
-            };
-            struct bar : plus< foo >
-            {
-            };
-            verify_analyze< bar >( __LINE__, __FILE__, false, true );
-            verify_analyze< foo >( __LINE__, __FILE__, false, true );
-            verify_analyze< sor< any, bar > >( __LINE__, __FILE__, false, true );
-         }
-         {
-            // Excerpt from the Lua 5.3 grammar:
-            //  prefixexp ::= var | functioncall | ‘(’ exp ‘)’
-            //  functioncall ::=  prefixexp args | prefixexp ‘:’ Name args
-            //  var ::=  Name | prefixexp ‘[’ exp ‘]’ | prefixexp ‘.’ Name
-            // Simplified version, equivalent regarding consumption of input:
-            struct var;
-            struct fun;
-            struct exp : sor< var, fun, seq< any, exp, any > >
-            {
-            };
-            struct fun : seq< exp, any >
-            {
-            };
-            struct var : sor< any, seq< exp, any, exp >, seq< exp, any > >
-            {
-            };
-            verify_analyze< exp >( __LINE__, __FILE__, true, true );
-            verify_analyze< fun >( __LINE__, __FILE__, true, true );
-            verify_analyze< var >( __LINE__, __FILE__, true, true );
-         }
-         {
-            struct exp : sor< exp, seq< any, exp > >
-            {
-            };
-            verify_analyze< exp >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : until< any >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, true, false );
-         }
-         {
-            struct tst : until< star< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, false );
-         }
-         {
-            struct tst : until< any, star< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, true, true );
-         }
-         {
-            struct tst : until< star< any >, star< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : until< star< any >, star< any > >
-            {
-            };
-            verify_analyze< any_seq< tst > >( __LINE__, __FILE__, true, true );
-         }
-         {
-            struct tst : until< any, any >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, true, false );
-         }
-         {
-            struct tst : until< star< any >, any >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, false );
-         }
-         {
-            struct tst : plus< plus< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, true, false );
-         }
-         {
-            struct tst : star< star< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : plus< star< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : plus< opt< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : star< opt< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : star< plus< opt< any > > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : list< any, any >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, true, false );
-         }
-         {
-            struct tst : list< star< any >, any >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, false );
-         }
-         {
-            struct tst : list< any, opt< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, true, false );
-         }
-         {
-            struct tst : list< star< any >, opt< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : list_must< any, any >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, true, false );
-         }
-         {
-            struct tst : list_must< star< any >, any >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, false );
-         }
-         {
-            struct tst : list_must< any, opt< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, true, false );
-         }
-         {
-            struct tst : list_must< star< any >, opt< any > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : plus< pad_opt< alpha, digit > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
-         {
-            struct tst : rep< 42, opt< alpha > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, false );
-         }
-         {
-            struct tst : rep_min< 42, opt< alpha > >
-            {
-            };
-            verify_analyze< tst >( __LINE__, __FILE__, false, true );
-         }
+   void unit_test()
+   {
+      verify_analyze< eof >( __LINE__, __FILE__, false, false );
+      verify_analyze< eolf >( __LINE__, __FILE__, false, false );
+      verify_analyze< success >( __LINE__, __FILE__, false, false );
+      verify_analyze< failure >( __LINE__, __FILE__, true, false );
+      {
+         struct tst : star< tst >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
       }
+      {
+         struct tst : plus< tst >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : seq< eof, at< digit >, tst >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );  // This is a false positive.
+      }
+      {
+         struct tst : sor< digit, seq< at< digit >, tst > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );  // This is a false positive.
+      }
+      {
+         struct tst : sor< digit, seq< opt< digit >, tst > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : sor< digit, tst >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : at< any >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, false );
+      }
+      {
+         struct tst : at< tst >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : at< any, tst >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, false );
+      }
+      {
+         struct tst : not_at< any >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, false );
+      }
+      {
+         struct tst : opt< tst >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : opt< any, tst >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, false );
+      }
+      {
+         struct rec : sor< seq< rec, alpha >, alpha >
+         {
+         };
+         verify_analyze< rec >( __LINE__, __FILE__, true, true );
+      }
+      {
+         struct bar;
+         struct foo : seq< digit, bar >
+         {
+         };
+         struct bar : plus< foo >
+         {
+         };
+         verify_analyze< seq< any, bar > >( __LINE__, __FILE__, true, false );
+      }
+      {
+         struct bar;
+         struct foo : seq< bar, digit >
+         {
+         };
+         struct bar : plus< foo >
+         {
+         };
+         verify_analyze< seq< bar, any > >( __LINE__, __FILE__, true, true );
+      }
+      {
+         struct bar;
+         struct foo : sor< digit, bar >
+         {
+         };
+         struct bar : plus< foo >
+         {
+         };
+         verify_analyze< bar >( __LINE__, __FILE__, false, true );
+         verify_analyze< foo >( __LINE__, __FILE__, false, true );
+         verify_analyze< sor< any, bar > >( __LINE__, __FILE__, false, true );
+      }
+      {
+         // Excerpt from the Lua 5.3 grammar:
+         //  prefixexp ::= var | functioncall | ‘(’ exp ‘)’
+         //  functioncall ::=  prefixexp args | prefixexp ‘:’ Name args
+         //  var ::=  Name | prefixexp ‘[’ exp ‘]’ | prefixexp ‘.’ Name
+         // Simplified version, equivalent regarding consumption of input:
+         struct var;
+         struct fun;
+         struct exp : sor< var, fun, seq< any, exp, any > >
+         {
+         };
+         struct fun : seq< exp, any >
+         {
+         };
+         struct var : sor< any, seq< exp, any, exp >, seq< exp, any > >
+         {
+         };
+         verify_analyze< exp >( __LINE__, __FILE__, true, true );
+         verify_analyze< fun >( __LINE__, __FILE__, true, true );
+         verify_analyze< var >( __LINE__, __FILE__, true, true );
+      }
+      {
+         struct exp : sor< exp, seq< any, exp > >
+         {
+         };
+         verify_analyze< exp >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : until< any >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, true, false );
+      }
+      {
+         struct tst : until< star< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, false );
+      }
+      {
+         struct tst : until< any, star< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, true, true );
+      }
+      {
+         struct tst : until< star< any >, star< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : until< star< any >, star< any > >
+         {
+         };
+         verify_analyze< any_seq< tst > >( __LINE__, __FILE__, true, true );
+      }
+      {
+         struct tst : until< any, any >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, true, false );
+      }
+      {
+         struct tst : until< star< any >, any >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, false );
+      }
+      {
+         struct tst : plus< plus< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, true, false );
+      }
+      {
+         struct tst : star< star< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : plus< star< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : plus< opt< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : star< opt< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : star< plus< opt< any > > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : list< any, any >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, true, false );
+      }
+      {
+         struct tst : list< star< any >, any >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, false );
+      }
+      {
+         struct tst : list< any, opt< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, true, false );
+      }
+      {
+         struct tst : list< star< any >, opt< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : list_must< any, any >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, true, false );
+      }
+      {
+         struct tst : list_must< star< any >, any >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, false );
+      }
+      {
+         struct tst : list_must< any, opt< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, true, false );
+      }
+      {
+         struct tst : list_must< star< any >, opt< any > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : plus< pad_opt< alpha, digit > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+      {
+         struct tst : rep< 42, opt< alpha > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, false );
+      }
+      {
+         struct tst : rep_min< 42, opt< alpha > >
+         {
+         };
+         verify_analyze< tst >( __LINE__, __FILE__, false, true );
+      }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/argv_input.cpp b/packages/PEGTL/src/test/pegtl/argv_input.cpp
index 0755211af5e418c33241f17990982ef9d86ad1a4..da27be5deae571eec8db4cdd6b7c445f3f9cf884 100644
--- a/packages/PEGTL/src/test/pegtl/argv_input.cpp
+++ b/packages/PEGTL/src/test/pegtl/argv_input.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <cstring>
@@ -7,23 +7,19 @@
 
 #include <tao/pegtl.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         char data[ 12 ];
-         std::memcpy( data, "foo\0bar\0baz", 12 );
-         char* argv[] = { data, data + 4, data + 8 };
-         argv_input<> in( argv, 1 );
-         TAO_PEGTL_TEST_ASSERT( in.source() == "argv[1]" );
-         const auto result = parse< string< 'b', 'a', 'r' > >( in );
-         TAO_PEGTL_TEST_ASSERT( result );
-      }
+      char data[ 12 ];  // NOLINT
+      std::memcpy( data, "foo\0bar\0baz", 12 );
+      char* argv[] = { data, data + 4, data + 8 };  // NOLINT
+      argv_input in( argv, 1 );
+      TAO_PEGTL_TEST_ASSERT( in.source() == "argv[1]" );
+      const auto result = parse< string< 'b', 'a', 'r' > >( in );
+      TAO_PEGTL_TEST_ASSERT( result );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_classes.cpp b/packages/PEGTL/src/test/pegtl/ascii_classes.cpp
index 406b567356813f8408513157eefca173ca148f28..a16a70d0bb6ed7ef24afdfc59d3b3bdd79f02512 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_classes.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_classes.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -6,114 +6,110 @@
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< alnum >( __LINE__, __FILE__, true, false );
-         verify_analyze< alpha >( __LINE__, __FILE__, true, false );
-         verify_analyze< any >( __LINE__, __FILE__, true, false );
-         verify_analyze< blank >( __LINE__, __FILE__, true, false );
-         verify_analyze< digit >( __LINE__, __FILE__, true, false );
-         verify_analyze< eol >( __LINE__, __FILE__, true, false );
-         verify_analyze< identifier_first >( __LINE__, __FILE__, true, false );
-         verify_analyze< identifier_other >( __LINE__, __FILE__, true, false );
-         verify_analyze< lower >( __LINE__, __FILE__, true, false );
-         verify_analyze< nul >( __LINE__, __FILE__, true, false );
-         verify_analyze< print >( __LINE__, __FILE__, true, false );
-         verify_analyze< seven >( __LINE__, __FILE__, true, false );
-         verify_analyze< space >( __LINE__, __FILE__, true, false );
-         verify_analyze< upper >( __LINE__, __FILE__, true, false );
-         verify_analyze< xdigit >( __LINE__, __FILE__, true, false );
-
-         verify_analyze< not_one< 'a' > >( __LINE__, __FILE__, true, false );
-         verify_analyze< not_one< 'a', 'z' > >( __LINE__, __FILE__, true, false );
-         verify_analyze< not_range< 'a', 'z' > >( __LINE__, __FILE__, true, false );
-         verify_analyze< one< 'a' > >( __LINE__, __FILE__, true, false );
-         verify_analyze< one< 'a', 'z' > >( __LINE__, __FILE__, true, false );
-         verify_analyze< range< 'a', 'z' > >( __LINE__, __FILE__, true, false );
-         verify_analyze< ranges< 'a', 'z' > >( __LINE__, __FILE__, true, false );
-         verify_analyze< ranges< 'a', 'z', '4' > >( __LINE__, __FILE__, true, false );
-
-         verify_rule< alnum >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< alpha >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< blank >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< digit >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< eol >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< identifier_first >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< identifier_other >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< lower >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< nul >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< print >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< seven >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< space >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< upper >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< xdigit >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-
-         verify_rule< not_one< 'a' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< not_one< 'a', 'z' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< not_range< 'a', 'z' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< one< 'a' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< one< 'a', 'z' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< range< 'a', 'z' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< ranges< 'a', 'z' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< ranges< 'a', 'z', '4' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-
-         for( int i = -100; i < 200; ++i ) {
-            const auto c = char( i );
-
-            const bool is_blank = ( c == ' ' ) || ( c == '\t' );
-            const bool is_digit = ( '0' <= c ) && ( c <= '9' );
-            const bool is_lower = ( 'a' <= c ) && ( c <= 'z' );
-            const bool is_print = ( ( ' ' <= c ) && ( c <= 126 ) );
-            const bool is_seven = ( ( i >= 0 ) && ( i <= 127 ) );
-            const bool is_space = ( c == '\n' ) || ( c == '\r' ) || ( c == '\v' ) || ( c == '\f' );
-            const bool is_upper = ( 'A' <= c ) && ( c <= 'Z' );
-            const bool is_xalpha = ( ( 'a' <= c ) && ( c <= 'f' ) ) || ( ( 'A' <= c ) && ( c <= 'F' ) );
-
-            const bool is_newline = ( c == '\n' );
-
-            const bool is_ident_first = ( c == '_' ) || is_lower || is_upper;
-            const bool is_ident_other = is_ident_first || is_digit;
-
-            verify_char< alnum >( __LINE__, __FILE__, c, is_lower || is_upper || is_digit );
-            verify_char< alpha >( __LINE__, __FILE__, c, is_lower || is_upper );
-            verify_char< any >( __LINE__, __FILE__, c, true );
-            verify_char< blank >( __LINE__, __FILE__, c, is_blank );
-            verify_char< digit >( __LINE__, __FILE__, c, is_digit );
-            verify_char< eol >( __LINE__, __FILE__, c, is_newline );
-            verify_char< identifier_first >( __LINE__, __FILE__, c, is_ident_first );
-            verify_char< identifier_other >( __LINE__, __FILE__, c, is_ident_other );
-            verify_char< lower >( __LINE__, __FILE__, c, is_lower );
-            verify_char< nul >( __LINE__, __FILE__, c, c == 0 );
-            verify_char< print >( __LINE__, __FILE__, c, is_print );
-            verify_char< seven >( __LINE__, __FILE__, c, is_seven );
-            verify_char< space >( __LINE__, __FILE__, c, is_blank || is_space );
-            verify_char< upper >( __LINE__, __FILE__, c, is_upper );
-            verify_char< xdigit >( __LINE__, __FILE__, c, is_digit || is_xalpha );
-
-            const bool is_one = ( c == '#' ) || ( c == 'a' ) || ( c == ' ' );
-            const bool is_range = ( 20 <= c ) && ( c <= 120 );
-            const bool is_ranges = is_range || ( c == 3 );
-
-            verify_char< not_one< 'P' > >( __LINE__, __FILE__, c, c != 'P' );
-            verify_char< not_one< 'a', '#', ' ' > >( __LINE__, __FILE__, c, !is_one );
-            verify_char< not_range< 20, 120 > >( __LINE__, __FILE__, c, !is_range );
-            verify_char< one< 'T' > >( __LINE__, __FILE__, c, c == 'T' );
-            verify_char< one< 'a', '#', ' ' > >( __LINE__, __FILE__, c, is_one );
-            verify_char< range< 20, 120 > >( __LINE__, __FILE__, c, is_range );
-            verify_char< ranges< 20, 120 > >( __LINE__, __FILE__, c, is_range );
-            verify_char< ranges< 20, 120, 3 > >( __LINE__, __FILE__, c, is_ranges );
-
-            verify_char< eolf >( __LINE__, __FILE__, c, is_newline );
-         }
+      verify_analyze< alnum >( __LINE__, __FILE__, true, false );
+      verify_analyze< alpha >( __LINE__, __FILE__, true, false );
+      verify_analyze< any >( __LINE__, __FILE__, true, false );
+      verify_analyze< blank >( __LINE__, __FILE__, true, false );
+      verify_analyze< digit >( __LINE__, __FILE__, true, false );
+      verify_analyze< eol >( __LINE__, __FILE__, true, false );
+      verify_analyze< identifier_first >( __LINE__, __FILE__, true, false );
+      verify_analyze< identifier_other >( __LINE__, __FILE__, true, false );
+      verify_analyze< lower >( __LINE__, __FILE__, true, false );
+      verify_analyze< nul >( __LINE__, __FILE__, true, false );
+      verify_analyze< print >( __LINE__, __FILE__, true, false );
+      verify_analyze< seven >( __LINE__, __FILE__, true, false );
+      verify_analyze< space >( __LINE__, __FILE__, true, false );
+      verify_analyze< upper >( __LINE__, __FILE__, true, false );
+      verify_analyze< xdigit >( __LINE__, __FILE__, true, false );
+
+      verify_analyze< not_one< 'a' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< not_one< 'a', 'z' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< not_range< 'a', 'z' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< one< 'a' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< one< 'a', 'z' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< range< 'a', 'z' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< ranges< 'a', 'z' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< ranges< 'a', 'z', '4' > >( __LINE__, __FILE__, true, false );
+
+      verify_rule< alnum >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< alpha >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< any >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< blank >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< digit >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< eol >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< identifier_first >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< identifier_other >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< lower >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< nul >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< print >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< seven >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< space >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< upper >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< xdigit >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+
+      verify_rule< not_one< 'a' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< not_one< 'a', 'z' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< not_range< 'a', 'z' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< one< 'a' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< one< 'a', 'z' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< range< 'a', 'z' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< ranges< 'a', 'z' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< ranges< 'a', 'z', '4' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+
+      for( int i = -100; i < 200; ++i ) {
+         const auto c = char( i );
+
+         const bool is_blank = ( c == ' ' ) || ( c == '\t' );
+         const bool is_digit = ( '0' <= c ) && ( c <= '9' );
+         const bool is_lower = ( 'a' <= c ) && ( c <= 'z' );
+         const bool is_print = ( ( ' ' <= c ) && ( c <= 126 ) );
+         const bool is_seven = ( ( i >= 0 ) && ( i <= 127 ) );
+         const bool is_space = ( c == '\n' ) || ( c == '\r' ) || ( c == '\v' ) || ( c == '\f' );
+         const bool is_upper = ( 'A' <= c ) && ( c <= 'Z' );
+         const bool is_xalpha = ( ( 'a' <= c ) && ( c <= 'f' ) ) || ( ( 'A' <= c ) && ( c <= 'F' ) );
+
+         const bool is_newline = ( c == '\n' );
+
+         const bool is_ident_first = ( c == '_' ) || is_lower || is_upper;
+         const bool is_ident_other = is_ident_first || is_digit;
+
+         verify_char< alnum >( __LINE__, __FILE__, c, is_lower || is_upper || is_digit );
+         verify_char< alpha >( __LINE__, __FILE__, c, is_lower || is_upper );
+         verify_char< any >( __LINE__, __FILE__, c, true );
+         verify_char< blank >( __LINE__, __FILE__, c, is_blank );
+         verify_char< digit >( __LINE__, __FILE__, c, is_digit );
+         verify_char< eol >( __LINE__, __FILE__, c, is_newline );
+         verify_char< identifier_first >( __LINE__, __FILE__, c, is_ident_first );
+         verify_char< identifier_other >( __LINE__, __FILE__, c, is_ident_other );
+         verify_char< lower >( __LINE__, __FILE__, c, is_lower );
+         verify_char< nul >( __LINE__, __FILE__, c, c == 0 );
+         verify_char< print >( __LINE__, __FILE__, c, is_print );
+         verify_char< seven >( __LINE__, __FILE__, c, is_seven );
+         verify_char< space >( __LINE__, __FILE__, c, is_blank || is_space );
+         verify_char< upper >( __LINE__, __FILE__, c, is_upper );
+         verify_char< xdigit >( __LINE__, __FILE__, c, is_digit || is_xalpha );
+
+         const bool is_one = ( c == '#' ) || ( c == 'a' ) || ( c == ' ' );
+         const bool is_range = ( 20 <= c ) && ( c <= 120 );
+         const bool is_ranges = is_range || ( c == 3 );
+
+         verify_char< not_one< 'P' > >( __LINE__, __FILE__, c, c != 'P' );
+         verify_char< not_one< 'a', '#', ' ' > >( __LINE__, __FILE__, c, !is_one );
+         verify_char< not_range< 20, 120 > >( __LINE__, __FILE__, c, !is_range );
+         verify_char< one< 'T' > >( __LINE__, __FILE__, c, c == 'T' );
+         verify_char< one< 'a', '#', ' ' > >( __LINE__, __FILE__, c, is_one );
+         verify_char< range< 20, 120 > >( __LINE__, __FILE__, c, is_range );
+         verify_char< ranges< 20, 120 > >( __LINE__, __FILE__, c, is_range );
+         verify_char< ranges< 20, 120, 3 > >( __LINE__, __FILE__, c, is_ranges );
+
+         verify_char< eolf >( __LINE__, __FILE__, c, is_newline );
       }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_eol.cpp b/packages/PEGTL/src/test/pegtl/ascii_eol.cpp
index b5808c4cd3e90d1748c270b36cafbb60d2b707bb..d84eef09d521b79ea55bd2438ead57c04a6cc21e 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_eol.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_eol.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -6,87 +6,83 @@
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< eol >( __LINE__, __FILE__, true, false );
+      verify_analyze< eol >( __LINE__, __FILE__, true, false );
 
-         verify_rule< eol >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
+      verify_rule< eol >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
 
-         for( char i = 1; i < 127; ++i ) {
-            verify_char< eol >( __LINE__, __FILE__, i, ( i == '\n' ) ? result_type::SUCCESS : result_type::LOCAL_FAILURE );
-         }
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\r", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\n", result_type::SUCCESS, 0 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\r\n", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\n\r", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\n\r\n", result_type::SUCCESS, 2 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\n\r\r", result_type::SUCCESS, 2 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\na", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\ra", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\r\na", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\r\n\r", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\r\n\n", result_type::LOCAL_FAILURE, 3 );
-
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\r", result_type::SUCCESS, 0 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\n", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\r\n", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\n\r", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\n\r\n", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\n\r\r", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\na", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\ra", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\r\na", result_type::SUCCESS, 2 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\r\n\r", result_type::SUCCESS, 2 );
-         verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\r\n\n", result_type::SUCCESS, 2 );
+      for( char i = 1; i < 127; ++i ) {
+         verify_char< eol >( __LINE__, __FILE__, i, ( i == '\n' ) ? result_type::success : result_type::local_failure );
+      }
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\r", result_type::local_failure, 1 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\n", result_type::success, 0 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\r\n", result_type::local_failure, 2 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\n\r", result_type::success, 1 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\n\r\n", result_type::success, 2 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\n\r\r", result_type::success, 2 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\na", result_type::success, 1 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\ra", result_type::local_failure, 2 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\r\na", result_type::local_failure, 3 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\r\n\r", result_type::local_failure, 3 );
+      verify_rule< eol, eol::lf >( __LINE__, __FILE__, "\r\n\n", result_type::local_failure, 3 );
 
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\r", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\n", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\r\n", result_type::SUCCESS, 0 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\n\r", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\n\r\n", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\n\r\r", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\na", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\ra", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\r\na", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\r\n\r", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\r\n\n", result_type::SUCCESS, 1 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\r", result_type::success, 0 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\n", result_type::local_failure, 1 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\r\n", result_type::success, 1 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\n\r", result_type::local_failure, 2 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\n\r\n", result_type::local_failure, 3 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\n\r\r", result_type::local_failure, 3 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\na", result_type::local_failure, 2 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\ra", result_type::success, 1 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\r\na", result_type::success, 2 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\r\n\r", result_type::success, 2 );
+      verify_rule< eol, eol::cr >( __LINE__, __FILE__, "\r\n\n", result_type::success, 2 );
 
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\r", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\n", result_type::SUCCESS, 0 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\r\n", result_type::SUCCESS, 0 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\n\r", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\n\r\n", result_type::SUCCESS, 2 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\n\r\r", result_type::SUCCESS, 2 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\na", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\ra", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\r\na", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\r\n\r", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\r\n\n", result_type::SUCCESS, 1 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\r", result_type::local_failure, 1 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\n", result_type::local_failure, 1 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\r\n", result_type::success, 0 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\n\r", result_type::local_failure, 2 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\n\r\n", result_type::local_failure, 3 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\n\r\r", result_type::local_failure, 3 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\na", result_type::local_failure, 2 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\ra", result_type::local_failure, 2 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\r\na", result_type::success, 1 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\r\n\r", result_type::success, 1 );
+      verify_rule< eol, eol::crlf >( __LINE__, __FILE__, "\r\n\n", result_type::success, 1 );
 
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\r", result_type::SUCCESS, 0 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\n", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\r\n", result_type::SUCCESS, 0 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\n\r", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\n\r\n", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\n\r\r", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\na", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\ra", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\r\na", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\r\n\r", result_type::SUCCESS, 1 );
-         verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\r\n\n", result_type::SUCCESS, 1 );
-      }
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\r", result_type::local_failure, 1 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\n", result_type::success, 0 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\r\n", result_type::success, 0 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\n\r", result_type::success, 1 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\n\r\n", result_type::success, 2 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\n\r\r", result_type::success, 2 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\na", result_type::success, 1 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\ra", result_type::local_failure, 2 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\r\na", result_type::success, 1 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\r\n\r", result_type::success, 1 );
+      verify_rule< eol, eol::lf_crlf >( __LINE__, __FILE__, "\r\n\n", result_type::success, 1 );
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\r", result_type::success, 0 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\n", result_type::local_failure, 1 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\r\n", result_type::success, 0 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\n\r", result_type::local_failure, 2 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\n\r\n", result_type::local_failure, 3 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\n\r\r", result_type::local_failure, 3 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\na", result_type::local_failure, 2 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\ra", result_type::success, 1 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\r\na", result_type::success, 1 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\r\n\r", result_type::success, 1 );
+      verify_rule< eol, eol::cr_crlf >( __LINE__, __FILE__, "\r\n\n", result_type::success, 1 );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_eolf.cpp b/packages/PEGTL/src/test/pegtl/ascii_eolf.cpp
index 53baa0d86371d905a3c212750860d585bc2b0a79..7b94b247503f2868052953e1eb84c7790e297b92 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_eolf.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_eolf.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -6,87 +6,83 @@
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< eolf >( __LINE__, __FILE__, false, false );
+      verify_analyze< eolf >( __LINE__, __FILE__, false, false );
 
-         verify_rule< eolf >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
+      verify_rule< eolf >( __LINE__, __FILE__, "", result_type::success, 0 );
 
-         for( char i = 1; i < 127; ++i ) {
-            verify_char< eolf >( __LINE__, __FILE__, i, ( i == '\n' ) ? result_type::SUCCESS : result_type::LOCAL_FAILURE );
-         }
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\r", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\n", result_type::SUCCESS, 0 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\r\n", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\n\r", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\n\r\n", result_type::SUCCESS, 2 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\n\r\r", result_type::SUCCESS, 2 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\na", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\ra", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\r\na", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\r\n\r", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\r\n\n", result_type::LOCAL_FAILURE, 3 );
-
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\r", result_type::SUCCESS, 0 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\n", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\r\n", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\n\r", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\n\r\n", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\n\r\r", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\na", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\ra", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\r\na", result_type::SUCCESS, 2 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\r\n\r", result_type::SUCCESS, 2 );
-         verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\r\n\n", result_type::SUCCESS, 2 );
+      for( char i = 1; i < 127; ++i ) {
+         verify_char< eolf >( __LINE__, __FILE__, i, ( i == '\n' ) ? result_type::success : result_type::local_failure );
+      }
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\r", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\n", result_type::success, 0 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\r\n", result_type::local_failure, 2 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\n\r", result_type::success, 1 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\n\r\n", result_type::success, 2 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\n\r\r", result_type::success, 2 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\na", result_type::success, 1 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\ra", result_type::local_failure, 2 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\r\na", result_type::local_failure, 3 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\r\n\r", result_type::local_failure, 3 );
+      verify_rule< eolf, eol::lf >( __LINE__, __FILE__, "\r\n\n", result_type::local_failure, 3 );
 
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\r", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\n", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\r\n", result_type::SUCCESS, 0 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\n\r", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\n\r\n", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\n\r\r", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\na", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\ra", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\r\na", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\r\n\r", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\r\n\n", result_type::SUCCESS, 1 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\r", result_type::success, 0 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\n", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\r\n", result_type::success, 1 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\n\r", result_type::local_failure, 2 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\n\r\n", result_type::local_failure, 3 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\n\r\r", result_type::local_failure, 3 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\na", result_type::local_failure, 2 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\ra", result_type::success, 1 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\r\na", result_type::success, 2 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\r\n\r", result_type::success, 2 );
+      verify_rule< eolf, eol::cr >( __LINE__, __FILE__, "\r\n\n", result_type::success, 2 );
 
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\r", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\n", result_type::SUCCESS, 0 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\r\n", result_type::SUCCESS, 0 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\n\r", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\n\r\n", result_type::SUCCESS, 2 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\n\r\r", result_type::SUCCESS, 2 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\na", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\ra", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\r\na", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\r\n\r", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\r\n\n", result_type::SUCCESS, 1 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\r", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\n", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\r\n", result_type::success, 0 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\n\r", result_type::local_failure, 2 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\n\r\n", result_type::local_failure, 3 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\n\r\r", result_type::local_failure, 3 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\na", result_type::local_failure, 2 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\ra", result_type::local_failure, 2 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\r\na", result_type::success, 1 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\r\n\r", result_type::success, 1 );
+      verify_rule< eolf, eol::crlf >( __LINE__, __FILE__, "\r\n\n", result_type::success, 1 );
 
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\r", result_type::SUCCESS, 0 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\n", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\r\n", result_type::SUCCESS, 0 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\n\r", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\n\r\n", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\n\r\r", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\na", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\ra", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\r\na", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\r\n\r", result_type::SUCCESS, 1 );
-         verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\r\n\n", result_type::SUCCESS, 1 );
-      }
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\r", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\n", result_type::success, 0 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\r\n", result_type::success, 0 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\n\r", result_type::success, 1 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\n\r\n", result_type::success, 2 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\n\r\r", result_type::success, 2 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\na", result_type::success, 1 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\ra", result_type::local_failure, 2 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\r\na", result_type::success, 1 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\r\n\r", result_type::success, 1 );
+      verify_rule< eolf, eol::lf_crlf >( __LINE__, __FILE__, "\r\n\n", result_type::success, 1 );
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\r", result_type::success, 0 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\n", result_type::local_failure, 1 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\r\n", result_type::success, 0 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\n\r", result_type::local_failure, 2 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\n\r\n", result_type::local_failure, 3 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\n\r\r", result_type::local_failure, 3 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\na", result_type::local_failure, 2 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\ra", result_type::success, 1 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\r\na", result_type::success, 1 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\r\n\r", result_type::success, 1 );
+      verify_rule< eolf, eol::cr_crlf >( __LINE__, __FILE__, "\r\n\n", result_type::success, 1 );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_forty_two.cpp b/packages/PEGTL/src/test/pegtl/ascii_forty_two.cpp
index 258feea7bf9f86516045dde18f929d4e873220ac..4e79fdd9df37413eda5c18e0b3e004bb8dbb7341 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_forty_two.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_forty_two.cpp
@@ -1,42 +1,38 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< forty_two< 'a' > >( __LINE__, __FILE__, true, false );
-         verify_analyze< forty_two< 'a', 'z' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< forty_two< 'a' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< forty_two< 'a', 'z' > >( __LINE__, __FILE__, true, false );
 
-         for( std::size_t i = 0; i < 42; ++i ) {
-            verify_rule< forty_two< 'a' > >( __LINE__, __FILE__, std::string( i, 'a' ), result_type::LOCAL_FAILURE );
-         }
-         for( std::size_t i = 42; i < 100; ++i ) {
-            verify_rule< forty_two< 'a' > >( __LINE__, __FILE__, std::string( i, 'a' ), result_type::SUCCESS, i - 42 );
-         }
-         for( std::size_t i = 0; i < 42; ++i ) {
-            verify_rule< forty_two< 'a', 'z' > >( __LINE__, __FILE__, std::string( i, 'a' ), result_type::LOCAL_FAILURE );
-         }
-         for( std::size_t i = 42; i < 100; ++i ) {
-            verify_rule< forty_two< 'a', 'z' > >( __LINE__, __FILE__, std::string( i, 'a' ), result_type::SUCCESS, i - 42 );
-         }
-         for( std::size_t i = 0; i < 42; ++i ) {
-            verify_rule< forty_two< 'a', 'z' > >( __LINE__, __FILE__, std::string( i, 'z' ), result_type::LOCAL_FAILURE );
-         }
-         for( std::size_t i = 42; i < 100; ++i ) {
-            verify_rule< forty_two< 'a', 'z' > >( __LINE__, __FILE__, std::string( i, 'z' ), result_type::SUCCESS, i - 42 );
-         }
-         verify_rule< forty_two< 'a', 'z' > >( __LINE__, __FILE__, "azzaazaazaaazzzaaaazzaaazzaazazzzaazzazaza", result_type::SUCCESS );
+      for( std::size_t i = 0; i < 42; ++i ) {
+         verify_rule< forty_two< 'a' > >( __LINE__, __FILE__, std::string( i, 'a' ), result_type::local_failure );
       }
+      for( std::size_t i = 42; i < 100; ++i ) {
+         verify_rule< forty_two< 'a' > >( __LINE__, __FILE__, std::string( i, 'a' ), result_type::success, i - 42 );
+      }
+      for( std::size_t i = 0; i < 42; ++i ) {
+         verify_rule< forty_two< 'a', 'z' > >( __LINE__, __FILE__, std::string( i, 'a' ), result_type::local_failure );
+      }
+      for( std::size_t i = 42; i < 100; ++i ) {
+         verify_rule< forty_two< 'a', 'z' > >( __LINE__, __FILE__, std::string( i, 'a' ), result_type::success, i - 42 );
+      }
+      for( std::size_t i = 0; i < 42; ++i ) {
+         verify_rule< forty_two< 'a', 'z' > >( __LINE__, __FILE__, std::string( i, 'z' ), result_type::local_failure );
+      }
+      for( std::size_t i = 42; i < 100; ++i ) {
+         verify_rule< forty_two< 'a', 'z' > >( __LINE__, __FILE__, std::string( i, 'z' ), result_type::success, i - 42 );
+      }
+      verify_rule< forty_two< 'a', 'z' > >( __LINE__, __FILE__, "azzaazaazaaazzzaaaazzaaazzaazazzzaazzazaza", result_type::success );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_identifier.cpp b/packages/PEGTL/src/test/pegtl/ascii_identifier.cpp
index d384fde2d49f8949f4073eb8516dde910b121e0e..059b98bc48701c89e665c8b6cff19e1a5abb078d 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_identifier.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_identifier.cpp
@@ -1,35 +1,31 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< identifier >( __LINE__, __FILE__, true, false );
+      verify_analyze< identifier >( __LINE__, __FILE__, true, false );
 
-         verify_rule< identifier >( __LINE__, __FILE__, "_", result_type::SUCCESS, 0 );
-         verify_rule< identifier >( __LINE__, __FILE__, "_a", result_type::SUCCESS, 0 );
-         verify_rule< identifier >( __LINE__, __FILE__, "_1", result_type::SUCCESS, 0 );
-         verify_rule< identifier >( __LINE__, __FILE__, "_123", result_type::SUCCESS, 0 );
-         verify_rule< identifier >( __LINE__, __FILE__, "_1a", result_type::SUCCESS, 0 );
-         verify_rule< identifier >( __LINE__, __FILE__, "_a1", result_type::SUCCESS, 0 );
-         verify_rule< identifier >( __LINE__, __FILE__, "_fro_bble", result_type::SUCCESS, 0 );
-         verify_rule< identifier >( __LINE__, __FILE__, "f_o_o42", result_type::SUCCESS, 0 );
-         verify_rule< identifier >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< identifier >( __LINE__, __FILE__, "1", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< identifier >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< identifier >( __LINE__, __FILE__, " _", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< identifier >( __LINE__, __FILE__, " a", result_type::LOCAL_FAILURE, 2 );
-      }
+      verify_rule< identifier >( __LINE__, __FILE__, "_", result_type::success, 0 );
+      verify_rule< identifier >( __LINE__, __FILE__, "_a", result_type::success, 0 );
+      verify_rule< identifier >( __LINE__, __FILE__, "_1", result_type::success, 0 );
+      verify_rule< identifier >( __LINE__, __FILE__, "_123", result_type::success, 0 );
+      verify_rule< identifier >( __LINE__, __FILE__, "_1a", result_type::success, 0 );
+      verify_rule< identifier >( __LINE__, __FILE__, "_a1", result_type::success, 0 );
+      verify_rule< identifier >( __LINE__, __FILE__, "_fro_bble", result_type::success, 0 );
+      verify_rule< identifier >( __LINE__, __FILE__, "f_o_o42", result_type::success, 0 );
+      verify_rule< identifier >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< identifier >( __LINE__, __FILE__, "1", result_type::local_failure, 1 );
+      verify_rule< identifier >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< identifier >( __LINE__, __FILE__, " _", result_type::local_failure, 2 );
+      verify_rule< identifier >( __LINE__, __FILE__, " a", result_type::local_failure, 2 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_istring.cpp b/packages/PEGTL/src/test/pegtl/ascii_istring.cpp
index 054c1aa3f3d79e446b866a11ecf9f04313bf7ecd..06816ae859b9c4f4ba494756a8846f84537988e8 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_istring.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_istring.cpp
@@ -1,46 +1,42 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< istring<> >( __LINE__, __FILE__, false, false );
-         verify_analyze< istring< 1 > >( __LINE__, __FILE__, true, false );
-         verify_analyze< istring< 1, 2 > >( __LINE__, __FILE__, true, false );
-         verify_analyze< istring< 1, 2, 3, 4 > >( __LINE__, __FILE__, true, false );
-         verify_analyze< istring< 1, 2, 3, 4, 5, 6, 7 > >( __LINE__, __FILE__, true, false );
+      verify_analyze< istring<> >( __LINE__, __FILE__, false, false );
+      verify_analyze< istring< 1 > >( __LINE__, __FILE__, true, false );
+      verify_analyze< istring< 1, 2 > >( __LINE__, __FILE__, true, false );
+      verify_analyze< istring< 1, 2, 3, 4 > >( __LINE__, __FILE__, true, false );
+      verify_analyze< istring< 1, 2, 3, 4, 5, 6, 7 > >( __LINE__, __FILE__, true, false );
 
-         verify_rule< istring<> >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "c", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aa", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aB", result_type::SUCCESS, 0 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "AB", result_type::SUCCESS, 0 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "Ab", result_type::SUCCESS, 0 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "ac", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "ba", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "bb", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aab", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aab", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "Abb", result_type::SUCCESS, 1 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "abc", result_type::SUCCESS, 1 );
-         verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aBab", result_type::SUCCESS, 2 );
-         verify_rule< istring< 'a', '0' > >( __LINE__, __FILE__, "a0A0", result_type::SUCCESS, 2 );
-      }
+      verify_rule< istring<> >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "c", result_type::local_failure, 1 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aB", result_type::success, 0 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "AB", result_type::success, 0 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "Ab", result_type::success, 0 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "ac", result_type::local_failure, 2 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "ba", result_type::local_failure, 2 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "bb", result_type::local_failure, 2 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aab", result_type::local_failure, 3 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aab", result_type::local_failure, 3 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "Abb", result_type::success, 1 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "abc", result_type::success, 1 );
+      verify_rule< istring< 'a', 'b' > >( __LINE__, __FILE__, "aBab", result_type::success, 2 );
+      verify_rule< istring< 'a', '0' > >( __LINE__, __FILE__, "a0A0", result_type::success, 2 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_keyword.cpp b/packages/PEGTL/src/test/pegtl/ascii_keyword.cpp
index 55f17b61b5500dfa8817c809f97a8ba52e239aa4..023e3e16d739534be56b2255f094d1e44ac563f9 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_keyword.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_keyword.cpp
@@ -1,33 +1,29 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, true, false );
 
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "foo", result_type::SUCCESS, 0 );
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "foo ", result_type::SUCCESS, 1 );
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "foo foo", result_type::SUCCESS, 4 );
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "FOO", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "f", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "fo", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, " foo", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "foo_", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "foo1", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "fooa", result_type::LOCAL_FAILURE, 4 );
-      }
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "foo", result_type::success, 0 );
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "foo ", result_type::success, 1 );
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "foo foo", result_type::success, 4 );
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "FOO", result_type::local_failure, 3 );
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "f", result_type::local_failure, 1 );
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "fo", result_type::local_failure, 2 );
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, " foo", result_type::local_failure, 4 );
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "foo_", result_type::local_failure, 4 );
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "foo1", result_type::local_failure, 4 );
+      verify_rule< keyword< 'f', 'o', 'o' > >( __LINE__, __FILE__, "fooa", result_type::local_failure, 4 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_shebang.cpp b/packages/PEGTL/src/test/pegtl/ascii_shebang.cpp
index e03e9b8e3c9e910567a78778a63a135d0848d5b2..004852cf77b63b4da70ee2ab76e4baf48fa7f96f 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_shebang.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_shebang.cpp
@@ -1,37 +1,33 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< shebang >( __LINE__, __FILE__, true, false );
+      verify_analyze< shebang >( __LINE__, __FILE__, true, false );
 
-         verify_rule< shebang >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< shebang >( __LINE__, __FILE__, "#", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< shebang >( __LINE__, __FILE__, "!", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< shebang >( __LINE__, __FILE__, "!#", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< shebang >( __LINE__, __FILE__, "#  ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< shebang >( __LINE__, __FILE__, "!  ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< shebang >( __LINE__, __FILE__, "## ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< shebang >( __LINE__, __FILE__, "!! ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< shebang >( __LINE__, __FILE__, "#!", result_type::SUCCESS, 0 );
-         verify_rule< shebang >( __LINE__, __FILE__, "#! ", result_type::SUCCESS, 0 );
-         verify_rule< shebang >( __LINE__, __FILE__, "#!/bin/bash", result_type::SUCCESS, 0 );
-         verify_rule< shebang >( __LINE__, __FILE__, "#!/bin/bash\n", result_type::SUCCESS, 0 );
-         verify_rule< shebang >( __LINE__, __FILE__, "#!/bin/bash\n#!/b", result_type::SUCCESS, 4 );
-         verify_rule< shebang >( __LINE__, __FILE__, "#!\n", result_type::SUCCESS, 0 );
-         verify_rule< shebang >( __LINE__, __FILE__, "#!\n ", result_type::SUCCESS, 1 );
-      }
+      verify_rule< shebang >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< shebang >( __LINE__, __FILE__, "#", result_type::local_failure, 1 );
+      verify_rule< shebang >( __LINE__, __FILE__, "!", result_type::local_failure, 1 );
+      verify_rule< shebang >( __LINE__, __FILE__, "!#", result_type::local_failure, 2 );
+      verify_rule< shebang >( __LINE__, __FILE__, "#  ", result_type::local_failure, 3 );
+      verify_rule< shebang >( __LINE__, __FILE__, "!  ", result_type::local_failure, 3 );
+      verify_rule< shebang >( __LINE__, __FILE__, "## ", result_type::local_failure, 3 );
+      verify_rule< shebang >( __LINE__, __FILE__, "!! ", result_type::local_failure, 3 );
+      verify_rule< shebang >( __LINE__, __FILE__, "#!", result_type::success, 0 );
+      verify_rule< shebang >( __LINE__, __FILE__, "#! ", result_type::success, 0 );
+      verify_rule< shebang >( __LINE__, __FILE__, "#!/bin/bash", result_type::success, 0 );
+      verify_rule< shebang >( __LINE__, __FILE__, "#!/bin/bash\n", result_type::success, 0 );
+      verify_rule< shebang >( __LINE__, __FILE__, "#!/bin/bash\n#!/b", result_type::success, 4 );
+      verify_rule< shebang >( __LINE__, __FILE__, "#!\n", result_type::success, 0 );
+      verify_rule< shebang >( __LINE__, __FILE__, "#!\n ", result_type::success, 1 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_string.cpp b/packages/PEGTL/src/test/pegtl/ascii_string.cpp
index 89796aaab95214d5d90eddd9da8b4c73b757b62b..a35950391b53dd03a56c5d9f152374d49b997f89 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_string.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_string.cpp
@@ -1,45 +1,41 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< string<> >( __LINE__, __FILE__, false, false );
-         verify_analyze< string< 1 > >( __LINE__, __FILE__, true, false );
-         verify_analyze< string< 1, 2 > >( __LINE__, __FILE__, true, false );
-         verify_analyze< string< 1, 2, 3, 4 > >( __LINE__, __FILE__, true, false );
-         verify_analyze< string< 1, 2, 3, 4, 5, 6, 7 > >( __LINE__, __FILE__, true, false );
+      verify_analyze< string<> >( __LINE__, __FILE__, false, false );
+      verify_analyze< string< 1 > >( __LINE__, __FILE__, true, false );
+      verify_analyze< string< 1, 2 > >( __LINE__, __FILE__, true, false );
+      verify_analyze< string< 1, 2, 3, 4 > >( __LINE__, __FILE__, true, false );
+      verify_analyze< string< 1, 2, 3, 4, 5, 6, 7 > >( __LINE__, __FILE__, true, false );
 
-         verify_rule< string<> >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "c", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "aa", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "aB", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "AB", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "Ab", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "ac", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "ba", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "bb", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "aab", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "aab", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "abb", result_type::SUCCESS, 1 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "abc", result_type::SUCCESS, 1 );
-         verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 2 );
-      }
+      verify_rule< string<> >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "c", result_type::local_failure, 1 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "aB", result_type::local_failure, 2 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "AB", result_type::local_failure, 2 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "Ab", result_type::local_failure, 2 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "ac", result_type::local_failure, 2 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "ba", result_type::local_failure, 2 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "bb", result_type::local_failure, 2 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "aab", result_type::local_failure, 3 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "aab", result_type::local_failure, 3 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "abb", result_type::success, 1 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "abc", result_type::success, 1 );
+      verify_rule< string< 'a', 'b' > >( __LINE__, __FILE__, "abab", result_type::success, 2 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_three.cpp b/packages/PEGTL/src/test/pegtl/ascii_three.cpp
index a71d3598b883d4c3a7375f2956da2aa2de4abe19..7ee53f663fc573a81ddad01ea6fe997919d4db45 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_three.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_three.cpp
@@ -1,31 +1,27 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< three< 'a' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< three< 'a' > >( __LINE__, __FILE__, true, false );
 
-         verify_rule< three< 'a' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< three< 'a' > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE );
-         verify_rule< three< 'a' > >( __LINE__, __FILE__, "aa", result_type::LOCAL_FAILURE );
-         verify_rule< three< 'a' > >( __LINE__, __FILE__, "ab", result_type::LOCAL_FAILURE );
-         verify_rule< three< 'a' > >( __LINE__, __FILE__, "aab", result_type::LOCAL_FAILURE );
-         verify_rule< three< 'a' > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS );
-         verify_rule< three< 'a' > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 1 );
-         verify_rule< three< 'a' > >( __LINE__, __FILE__, "aaaaa", result_type::SUCCESS, 2 );
-         verify_rule< three< 'a' > >( __LINE__, __FILE__, "aaaaaa", result_type::SUCCESS, 3 );
-      }
+      verify_rule< three< 'a' > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< three< 'a' > >( __LINE__, __FILE__, "a", result_type::local_failure );
+      verify_rule< three< 'a' > >( __LINE__, __FILE__, "aa", result_type::local_failure );
+      verify_rule< three< 'a' > >( __LINE__, __FILE__, "ab", result_type::local_failure );
+      verify_rule< three< 'a' > >( __LINE__, __FILE__, "aab", result_type::local_failure );
+      verify_rule< three< 'a' > >( __LINE__, __FILE__, "aaa", result_type::success );
+      verify_rule< three< 'a' > >( __LINE__, __FILE__, "aaaa", result_type::success, 1 );
+      verify_rule< three< 'a' > >( __LINE__, __FILE__, "aaaaa", result_type::success, 2 );
+      verify_rule< three< 'a' > >( __LINE__, __FILE__, "aaaaaa", result_type::success, 3 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/ascii_two.cpp b/packages/PEGTL/src/test/pegtl/ascii_two.cpp
index f547ca044690620612f26f186e6dc41e360826a4..5bd48d65018608ce00539a9160557927a992b436 100644
--- a/packages/PEGTL/src/test/pegtl/ascii_two.cpp
+++ b/packages/PEGTL/src/test/pegtl/ascii_two.cpp
@@ -1,28 +1,24 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< two< 'a' > >( __LINE__, __FILE__, true, false );
+      verify_analyze< two< 'a' > >( __LINE__, __FILE__, true, false );
 
-         verify_rule< two< 'a' > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< two< 'a' > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE );
-         verify_rule< two< 'a' > >( __LINE__, __FILE__, "ab", result_type::LOCAL_FAILURE );
-         verify_rule< two< 'a' > >( __LINE__, __FILE__, "aa", result_type::SUCCESS );
-         verify_rule< two< 'a' > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 1 );
-         verify_rule< two< 'a' > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 2 );
-      }
+      verify_rule< two< 'a' > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< two< 'a' > >( __LINE__, __FILE__, "a", result_type::local_failure );
+      verify_rule< two< 'a' > >( __LINE__, __FILE__, "ab", result_type::local_failure );
+      verify_rule< two< 'a' > >( __LINE__, __FILE__, "aa", result_type::success );
+      verify_rule< two< 'a' > >( __LINE__, __FILE__, "aaa", result_type::success, 1 );
+      verify_rule< two< 'a' > >( __LINE__, __FILE__, "aaaa", result_type::success, 2 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/buffer_input.cpp b/packages/PEGTL/src/test/pegtl/buffer_input.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..752aa7251a97a6e680a8ad71d7b6e44643f20b5d
--- /dev/null
+++ b/packages/PEGTL/src/test/pegtl/buffer_input.cpp
@@ -0,0 +1,41 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include <string>
+
+#include "test.hpp"
+
+#include <tao/pegtl/internal/cstring_reader.hpp>
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   template< typename Rule, template< typename... > class Action = nothing >
+   bool parse_cstring( const char* string, const char* source, const std::size_t maximum )
+   {
+      buffer_input< internal::cstring_reader > in( source, maximum, string );
+      return parse< Rule, Action >( in );
+   }
+
+   void unit_test()
+   {
+      static constexpr std::size_t chunk_size = buffer_input< internal::cstring_reader >::chunk_size;
+
+      static_assert( chunk_size >= 2 );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< seq< string< 'a', 'b', 'c' >, eof > >( "abc", TAO_TEST_LINE, 1 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< seq< string< 'a', 'b', 'c' >, eof > >( "abc", TAO_TEST_LINE, 128 ) );
+
+      // We need one extra byte in the buffer so that eof calling in.empty() calling in.require( 1 ) does not throw a "require beyond end of buffer" exception.
+      TAO_PEGTL_TEST_THROWS( parse_cstring< seq< rep< chunk_size + 2, one< 'a' > >, eof > >( std::string( std::size_t( chunk_size + 2 ), 'a' ).c_str(), TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< seq< rep< chunk_size + 2, one< 'a' > >, eof > >( std::string( std::size_t( chunk_size + 2 ), 'a' ).c_str(), TAO_TEST_LINE, 3 ) );
+
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< chunk_size + 9, one< 'a' > > >( std::string( std::size_t( chunk_size + 9 ), 'a' ).c_str(), TAO_TEST_LINE, 9 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< chunk_size + 9, one< 'a' > > >( std::string( std::size_t( chunk_size + 10 ), 'a' ).c_str(), TAO_TEST_LINE, 9 ) );
+      TAO_PEGTL_TEST_THROWS( parse_cstring< rep< chunk_size + 10, one< 'a' > > >( std::string( std::size_t( chunk_size + 10 ), 'a' ).c_str(), TAO_TEST_LINE, 9 ) );
+      TAO_PEGTL_TEST_THROWS( parse_cstring< rep< chunk_size + 10, one< 'a' > > >( std::string( std::size_t( chunk_size + 11 ), 'a' ).c_str(), TAO_TEST_LINE, 9 ) );
+      TAO_PEGTL_TEST_THROWS( parse_cstring< seq< rep< chunk_size + 10, one< 'a' > >, eof > >( std::string( std::size_t( chunk_size + 10 ), 'a' ).c_str(), TAO_TEST_LINE, 9 ) );
+      TAO_PEGTL_TEST_THROWS( parse_cstring< seq< rep< chunk_size + 10, one< 'a' > >, eof > >( std::string( std::size_t( chunk_size + 10 ), 'a' ).c_str(), TAO_TEST_LINE, 10 ) );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/change_action_and_state.cpp b/packages/PEGTL/src/test/pegtl/change_action_and_state.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..52cbaf735de3ff7c41531d54945d3a275c19b022
--- /dev/null
+++ b/packages/PEGTL/src/test/pegtl/change_action_and_state.cpp
@@ -0,0 +1,122 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include "test.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   // clang-format off
+   struct A : one< 'a' > {};
+   struct B : one< 'b' > {};
+   struct AB : seq< A, B > {};
+   // clang-format on
+
+   template< typename >
+   struct my_action_1
+   {};
+
+   template< typename >
+   struct my_action_2
+   {};
+
+   template<>
+   struct my_action_1< A >
+   {
+      static void apply0( int& c )
+      {
+         if( c != 0 ) {
+            throw std::runtime_error( "fail1" );
+         }
+         c = 1;
+      }
+   };
+
+   struct S
+   {
+      int v = 0;
+
+      template< typename Input >
+      explicit S( const Input& /*unused*/, int& c )
+      {
+         if( c == 5 ) {
+            v = 6;
+         }
+         else {
+            if( c != 1 ) {
+               throw std::runtime_error( "fail2" );
+            }
+            v = 2;
+         }
+      }
+
+      template< typename Input >
+      void success( const Input& /*unused*/, int& c )
+      {
+         if( v != 3 ) {
+            throw std::runtime_error( "fail3" );
+         }
+         c = 4;
+      }
+   };
+
+   template<>
+   struct my_action_1< B >
+      : change_action_and_state< my_action_2, S >
+   {};
+
+   template<>
+   struct my_action_2< A >
+   {
+      static void apply0( S& /*s*/ )
+      {
+         throw std::runtime_error( "fail4" );
+      }
+   };
+
+   template<>
+   struct my_action_2< B >
+   {
+      static void apply0( S& s )
+      {
+         if( s.v != 2 ) {
+            throw std::runtime_error( "fail5" );
+         }
+         s.v = 3;
+      }
+   };
+
+   void unit_test()
+   {
+      {
+         memory_input in( "ab", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action_1 >( in, c );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( c == 4 );
+      }
+      {
+         memory_input in( "a", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action_1 >( in, c );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( c == 1 );
+      }
+      {
+         memory_input in( "b", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action_1 >( in, c );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( c == 0 );
+      }
+      {
+         memory_input in( "ab", "" );
+         int c = 5;
+         const auto result = parse< disable< AB >, my_action_1 >( in, c );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( c == 5 );
+      }
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/change_action_and_states.cpp b/packages/PEGTL/src/test/pegtl/change_action_and_states.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..38b889f2cfe56507f9f49aaaa22fe7b3d09665b6
--- /dev/null
+++ b/packages/PEGTL/src/test/pegtl/change_action_and_states.cpp
@@ -0,0 +1,112 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include "test.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   // clang-format off
+   struct A : one< 'a' > {};
+   struct B : one< 'b' > {};
+   struct AB : seq< A, B > {};
+   // clang-format on
+
+   template< typename >
+   struct my_action_1
+   {};
+
+   template< typename >
+   struct my_action_2
+   {};
+
+   template<>
+   struct my_action_1< A >
+   {
+      static void apply0( int& c )
+      {
+         if( c != 0 ) {
+            throw std::runtime_error( "fail1" );
+         }
+         c = 1;
+      }
+   };
+
+   template<>
+   struct my_action_1< B >
+      : change_action_and_states< my_action_2, int >
+   {
+      // not called because my_action_2 is active
+      static void apply0( int& /*v*/ )
+      {
+         throw std::runtime_error( "fail2" );
+      }
+
+      template< typename Input >
+      static void success( const Input& /*unused*/, int& v, int& c )
+      {
+         if( v != 2 ) {
+            throw std::runtime_error( "fail3" );
+         }
+         if( c != 1 ) {
+            throw std::runtime_error( "fail4" );
+         }
+         c = 3;
+      }
+   };
+
+   template<>
+   struct my_action_2< A >
+   {
+      static void apply0( int& /*c*/ )
+      {
+         throw std::runtime_error( "fail5" );
+      }
+   };
+
+   template<>
+   struct my_action_2< B >
+   {
+      static void apply0( int& v )
+      {
+         if( v != 0 ) {
+            throw std::runtime_error( "fail6" );
+         }
+         v = 2;
+      }
+   };
+
+   void unit_test()
+   {
+      {
+         memory_input in( "ab", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action_1 >( in, c );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( c == 3 );
+      }
+      {
+         memory_input in( "a", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action_1 >( in, c );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( c == 1 );
+      }
+      {
+         memory_input in( "b", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action_1 >( in, c );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( c == 0 );
+      }
+      {
+         memory_input in( "ab", "" );
+         int c = 5;
+         const auto result = parse< disable< AB >, my_action_1 >( in, c );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( c == 5 );
+      }
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/change_state.cpp b/packages/PEGTL/src/test/pegtl/change_state.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..32e3da708d2704f66b98081f79ae50d4788a6031
--- /dev/null
+++ b/packages/PEGTL/src/test/pegtl/change_state.cpp
@@ -0,0 +1,105 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include "test.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   // clang-format off
+   struct A : one< 'a' > {};
+   struct B : one< 'b' > {};
+   struct AB : seq< A, B > {};
+   // clang-format on
+
+   template< typename >
+   struct my_action
+   {};
+
+   template<>
+   struct my_action< A >
+   {
+      static void apply0( int& c )
+      {
+         if( c != 0 ) {
+            throw std::runtime_error( "fail1" );
+         }
+         c = 1;
+      }
+   };
+
+   struct S
+   {
+      int v = 0;
+
+      template< typename Input >
+      explicit S( const Input& /*unused*/, int& c )
+      {
+         if( c == 5 ) {
+            v = 6;
+         }
+         else {
+            if( c != 1 ) {
+               throw std::runtime_error( "fail2" );
+            }
+            v = 2;
+         }
+      }
+
+      template< typename Input >
+      void success( const Input& /*unused*/, int& c )
+      {
+         if( v != 3 ) {
+            throw std::runtime_error( "fail3" );
+         }
+         c = 4;
+      }
+   };
+
+   template<>
+   struct my_action< B >
+      : change_state< S >
+   {
+      static void apply0( S& s )
+      {
+         if( s.v != 2 ) {
+            throw std::runtime_error( "fail4" );
+         }
+         s.v = 3;
+      }
+   };
+
+   void unit_test()
+   {
+      {
+         memory_input in( "ab", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action >( in, c );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( c == 4 );
+      }
+      {
+         memory_input in( "a", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action >( in, c );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( c == 1 );
+      }
+      {
+         memory_input in( "b", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action >( in, c );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( c == 0 );
+      }
+      {
+         memory_input in( "ab", "" );
+         int c = 5;
+         const auto result = parse< disable< AB >, my_action >( in, c );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( c == 5 );
+      }
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/change_states.cpp b/packages/PEGTL/src/test/pegtl/change_states.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0cdeb2d9af712d572fc6836f4700eddb480ef0b5
--- /dev/null
+++ b/packages/PEGTL/src/test/pegtl/change_states.cpp
@@ -0,0 +1,89 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include "test.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   // clang-format off
+   struct A : one< 'a' > {};
+   struct B : one< 'b' > {};
+   struct AB : seq< A, B > {};
+   // clang-format on
+
+   template< typename >
+   struct my_action
+   {};
+
+   template<>
+   struct my_action< A >
+   {
+      static void apply0( int& c )
+      {
+         if( c != 0 ) {
+            throw std::runtime_error( "fail1" );
+         }
+         c = 1;
+      }
+   };
+
+   template<>
+   struct my_action< B >
+      : change_states< int >
+   {
+      static void apply0( int& v )
+      {
+         if( v != 0 ) {
+            throw std::runtime_error( "fail2" );
+         }
+         v = 2;
+      }
+
+      template< typename Input >
+      static void success( const Input& /*unused*/, int& v, int& c )
+      {
+         if( v != 2 ) {
+            throw std::runtime_error( "fail3" );
+         }
+         if( c != 1 ) {
+            throw std::runtime_error( "fail4" );
+         }
+         c = 3;
+      }
+   };
+
+   void unit_test()
+   {
+      {
+         memory_input in( "ab", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action >( in, c );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( c == 3 );
+      }
+      {
+         memory_input in( "a", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action >( in, c );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( c == 1 );
+      }
+      {
+         memory_input in( "b", "" );
+         int c = 0;
+         const auto result = parse< AB, my_action >( in, c );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( c == 0 );
+      }
+      {
+         memory_input in( "ab", "" );
+         int c = 5;
+         const auto result = parse< disable< AB >, my_action >( in, c );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( c == 5 );
+      }
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_alphabet.cpp b/packages/PEGTL/src/test/pegtl/contrib_alphabet.cpp
index 1d12656af7b8b3dc77664f13cfd6ac8970553431..4d0e8c35a4418b014ff6a6a6823f17dd84777c1e 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_alphabet.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_alphabet.cpp
@@ -1,73 +1,69 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 
 #include <tao/pegtl/contrib/alphabet.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         static_assert( alphabet::a == 'a', "a" );
-         static_assert( alphabet::b == 'b', "b" );
-         static_assert( alphabet::c == 'c', "c" );
-         static_assert( alphabet::d == 'd', "d" );
-         static_assert( alphabet::e == 'e', "e" );
-         static_assert( alphabet::f == 'f', "f" );
-         static_assert( alphabet::g == 'g', "g" );
-         static_assert( alphabet::h == 'h', "h" );
-         static_assert( alphabet::i == 'i', "i" );
-         static_assert( alphabet::j == 'j', "j" );
-         static_assert( alphabet::k == 'k', "k" );
-         static_assert( alphabet::l == 'l', "l" );
-         static_assert( alphabet::m == 'm', "m" );
-         static_assert( alphabet::n == 'n', "n" );
-         static_assert( alphabet::o == 'o', "o" );
-         static_assert( alphabet::p == 'p', "p" );
-         static_assert( alphabet::q == 'q', "q" );
-         static_assert( alphabet::r == 'r', "r" );
-         static_assert( alphabet::s == 's', "s" );
-         static_assert( alphabet::t == 't', "t" );
-         static_assert( alphabet::u == 'u', "u" );
-         static_assert( alphabet::v == 'v', "v" );
-         static_assert( alphabet::w == 'w', "w" );
-         static_assert( alphabet::x == 'x', "x" );
-         static_assert( alphabet::y == 'y', "y" );
-         static_assert( alphabet::z == 'z', "z" );
+      static_assert( alphabet::a == 'a' );
+      static_assert( alphabet::b == 'b' );
+      static_assert( alphabet::c == 'c' );
+      static_assert( alphabet::d == 'd' );
+      static_assert( alphabet::e == 'e' );
+      static_assert( alphabet::f == 'f' );
+      static_assert( alphabet::g == 'g' );
+      static_assert( alphabet::h == 'h' );
+      static_assert( alphabet::i == 'i' );
+      static_assert( alphabet::j == 'j' );
+      static_assert( alphabet::k == 'k' );
+      static_assert( alphabet::l == 'l' );
+      static_assert( alphabet::m == 'm' );
+      static_assert( alphabet::n == 'n' );
+      static_assert( alphabet::o == 'o' );
+      static_assert( alphabet::p == 'p' );
+      static_assert( alphabet::q == 'q' );
+      static_assert( alphabet::r == 'r' );
+      static_assert( alphabet::s == 's' );
+      static_assert( alphabet::t == 't' );
+      static_assert( alphabet::u == 'u' );
+      static_assert( alphabet::v == 'v' );
+      static_assert( alphabet::w == 'w' );
+      static_assert( alphabet::x == 'x' );
+      static_assert( alphabet::y == 'y' );
+      static_assert( alphabet::z == 'z' );
 
-         static_assert( alphabet::A == 'A', "A" );
-         static_assert( alphabet::B == 'B', "B" );
-         static_assert( alphabet::C == 'C', "C" );
-         static_assert( alphabet::D == 'D', "D" );
-         static_assert( alphabet::E == 'E', "E" );
-         static_assert( alphabet::F == 'F', "F" );
-         static_assert( alphabet::G == 'G', "G" );
-         static_assert( alphabet::H == 'H', "H" );
-         static_assert( alphabet::I == 'I', "I" );
-         static_assert( alphabet::J == 'J', "J" );
-         static_assert( alphabet::K == 'K', "K" );
-         static_assert( alphabet::L == 'L', "L" );
-         static_assert( alphabet::M == 'M', "M" );
-         static_assert( alphabet::N == 'N', "N" );
-         static_assert( alphabet::O == 'O', "O" );
-         static_assert( alphabet::P == 'P', "P" );
-         static_assert( alphabet::Q == 'Q', "Q" );
-         static_assert( alphabet::R == 'R', "R" );
-         static_assert( alphabet::S == 'S', "S" );
-         static_assert( alphabet::T == 'T', "T" );
-         static_assert( alphabet::U == 'U', "U" );
-         static_assert( alphabet::V == 'V', "V" );
-         static_assert( alphabet::W == 'W', "W" );
-         static_assert( alphabet::X == 'X', "X" );
-         static_assert( alphabet::Y == 'Y', "Y" );
-         static_assert( alphabet::Z == 'Z', "Z" );
-      }
+      static_assert( alphabet::A == 'A' );
+      static_assert( alphabet::B == 'B' );
+      static_assert( alphabet::C == 'C' );
+      static_assert( alphabet::D == 'D' );
+      static_assert( alphabet::E == 'E' );
+      static_assert( alphabet::F == 'F' );
+      static_assert( alphabet::G == 'G' );
+      static_assert( alphabet::H == 'H' );
+      static_assert( alphabet::I == 'I' );
+      static_assert( alphabet::J == 'J' );
+      static_assert( alphabet::K == 'K' );
+      static_assert( alphabet::L == 'L' );
+      static_assert( alphabet::M == 'M' );
+      static_assert( alphabet::N == 'N' );
+      static_assert( alphabet::O == 'O' );
+      static_assert( alphabet::P == 'P' );
+      static_assert( alphabet::Q == 'Q' );
+      static_assert( alphabet::R == 'R' );
+      static_assert( alphabet::S == 'S' );
+      static_assert( alphabet::T == 'T' );
+      static_assert( alphabet::U == 'U' );
+      static_assert( alphabet::V == 'V' );
+      static_assert( alphabet::W == 'W' );
+      static_assert( alphabet::X == 'X' );
+      static_assert( alphabet::Y == 'Y' );
+      static_assert( alphabet::Z == 'Z' );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_if_then.cpp b/packages/PEGTL/src/test/pegtl/contrib_if_then.cpp
index 8af618797c59c938b7b79fdeb40bffaa4aa5aa98..36199ecf45a2cff08c024803c42c81d0b3989076 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_if_then.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_if_then.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -6,26 +6,23 @@
 
 #include <tao/pegtl/contrib/if_then.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         // clang-format off
-         using grammar =
-            if_then< one< 'a' >, one< 'b' >, one< 'c' > >::
-            else_if_then< one< 'a' >, one< 'b' > >::
-            else_then< one< 'c' > >;
+      // clang-format off
+      using grammar =
+         if_then< one< 'a' >, one< 'b' >, one< 'c' > >::
+         else_if_then< one< 'a' >, one< 'b' > >::
+         else_then< one< 'c' > >;
 
-         verify_rule< grammar >( __LINE__, __FILE__, "abc", result_type::SUCCESS, 0 );
-         verify_rule< grammar >( __LINE__, __FILE__, "abcd", result_type::SUCCESS, 1 );
-         verify_rule< grammar >( __LINE__, __FILE__, "ab", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< grammar >( __LINE__, __FILE__, "c", result_type::SUCCESS, 0 );
-      }
+      verify_rule< grammar >( __LINE__, __FILE__, "abc", result_type::success, 0 );
+      verify_rule< grammar >( __LINE__, __FILE__, "abcd", result_type::success, 1 );
+      verify_rule< grammar >( __LINE__, __FILE__, "ab", result_type::local_failure, 2 );
+      verify_rule< grammar >( __LINE__, __FILE__, "c", result_type::success, 0 );
+      // clang-format on
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_integer.cpp b/packages/PEGTL/src/test/pegtl/contrib_integer.cpp
index ba5104f592bd04db384ba2a5cd5e263654c40831..a6f3d9a52e698dc1a6002a5da1e02e000a48fc81 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_integer.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_integer.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <limits>
@@ -8,143 +8,135 @@
 
 #include <tao/pegtl/contrib/integer.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename I >
+   struct int_state
    {
-      template< typename I >
-      struct int_state
-      {
-         I converted = 55;
-      };
-
-      template< typename Rule >
-      struct int_action
-         : nothing< Rule >
-      {
-      };
-
-      template<>
-      struct int_action< integer::signed_rule >
-         : integer::signed_action
-      {
-      };
-
-      template<>
-      struct int_action< integer::unsigned_rule >
-         : integer::unsigned_action
-      {
-      };
-
-      template< typename S >
-      void test_signed( const std::string& i, const S s )
-      {
-         int_state< S > st;
-         memory_input<> in( i, __FUNCTION__ );
-         parse< must< integer::signed_rule, eof >, int_action >( in, st );
-         TAO_PEGTL_TEST_ASSERT( st.converted == s );
-      }
-
-      template< typename S >
-      void test_signed( const std::string& i )
-      {
-         int_state< S > st;
-         memory_input<> in( i, __FUNCTION__ );
-         TAO_PEGTL_TEST_THROWS( parse< must< integer::signed_rule, eof >, int_action >( in, st ) );
-      }
-
-      template< typename S >
-      std::string lexical_cast( const S s )
-      {
-         std::ostringstream o;
-         o << s;
-         return o.str();
-      }
-
-      template< typename S >
-      void test_signed( const S s )
-      {
-         int_state< S > st;
-         const auto i = lexical_cast( s );
-         memory_input<> in( i, __FUNCTION__ );
-         parse< must< integer::signed_rule, eof >, int_action >( in, st );
-         TAO_PEGTL_TEST_ASSERT( st.converted == s );
-      }
-
-      template< typename S >
-      void test_unsigned( const std::string& i, const S s )
-      {
-         int_state< S > st;
-         memory_input<> in( i, __FUNCTION__ );
-         parse< must< integer::unsigned_rule, eof >, int_action >( in, st );
-         TAO_PEGTL_TEST_ASSERT( st.converted == s );
-      }
-
-      template< typename S >
-      void test_unsigned( const std::string& i )
-      {
-         int_state< S > st;
-         memory_input<> in( i, __FUNCTION__ );
-         TAO_PEGTL_TEST_THROWS( parse< must< integer::unsigned_rule, eof >, int_action >( in, st ) );
-      }
-
-      template< typename S >
-      void test_unsigned( const S s )
-      {
-         int_state< S > st;
-         const auto i = lexical_cast( s );
-         memory_input<> in( i, __FUNCTION__ );
-         parse< must< integer::unsigned_rule, eof >, int_action >( in, st );
-         TAO_PEGTL_TEST_ASSERT( st.converted == s );
-      }
-
-      void unit_test()
-      {
-         test_signed< signed char >( "--0" );
-         test_signed< signed char >( "++0" );
-         test_signed< signed char >( "-+0" );
-
-         test_signed< signed char >( "0", 0 );
-         test_signed< signed char >( "+0", 0 );
-         test_signed< signed char >( "-0", 0 );
-         test_signed< signed char >( "000", 0 );
-         test_signed< signed char >( "+000", 0 );
-         test_signed< signed char >( "-000", 0 );
-
-         test_signed< signed char >( "127", 127 );
-
-         test_signed< signed char >( "-1", -1 );
-         test_signed< signed char >( "-001", -1 );
-
-         test_signed< signed char >( "-127", -127 );
-         test_signed< signed char >( "-128", -128 );
-
-         test_signed< signed char >( "128" );
-         test_signed< signed char >( "-129" );
-         test_signed< signed char >( "00128" );
-         test_signed< signed char >( "-00129" );
-
-         test_unsigned< unsigned char >( "-0" );
-         test_unsigned< unsigned char >( "+1" );
-
-         test_unsigned< unsigned char >( "0", 0 );
-         test_unsigned< unsigned char >( "000", 0 );
-         test_unsigned< unsigned char >( "0", 0 );
-         test_unsigned< unsigned char >( "255", 255 );
-         test_unsigned< unsigned char >( "000255", 255 );
-         test_unsigned< unsigned char >( "256" );
-         test_unsigned< unsigned char >( "000256" );
-
-         test_signed< signed long long >( "0", 0 );
-         test_signed< signed long long >( std::numeric_limits< signed long long >::max() );
-         test_signed< signed long long >( std::numeric_limits< signed long long >::min() );
-
-         test_unsigned< unsigned long long >( "0", 0 );
-         test_unsigned< unsigned long long >( std::numeric_limits< unsigned long long >::max() );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      I converted = 55;
+   };
+
+   template< typename Rule >
+   struct int_action
+   {};
+
+   template<>
+   struct int_action< integer::signed_rule >
+      : integer::signed_action
+   {};
+
+   template<>
+   struct int_action< integer::unsigned_rule >
+      : integer::unsigned_action
+   {};
+
+   template< typename S >
+   void test_signed( const std::string& i, const S s )
+   {
+      int_state< S > st;
+      memory_input in( i, __FUNCTION__ );
+      parse< must< integer::signed_rule, eof >, int_action >( in, st );
+      TAO_PEGTL_TEST_ASSERT( st.converted == s );
+   }
+
+   template< typename S >
+   void test_signed( const std::string& i )
+   {
+      int_state< S > st;
+      memory_input in( i, __FUNCTION__ );
+      TAO_PEGTL_TEST_THROWS( parse< must< integer::signed_rule, eof >, int_action >( in, st ) );
+   }
+
+   template< typename S >
+   std::string lexical_cast( const S s )
+   {
+      std::ostringstream o;
+      o << s;
+      return o.str();
+   }
+
+   template< typename S >
+   void test_signed( const S s )
+   {
+      int_state< S > st;
+      const auto i = lexical_cast( s );
+      memory_input in( i, __FUNCTION__ );
+      parse< must< integer::signed_rule, eof >, int_action >( in, st );
+      TAO_PEGTL_TEST_ASSERT( st.converted == s );
+   }
+
+   template< typename S >
+   void test_unsigned( const std::string& i, const S s )
+   {
+      int_state< S > st;
+      memory_input in( i, __FUNCTION__ );
+      parse< must< integer::unsigned_rule, eof >, int_action >( in, st );
+      TAO_PEGTL_TEST_ASSERT( st.converted == s );
+   }
+
+   template< typename S >
+   void test_unsigned( const std::string& i )
+   {
+      int_state< S > st;
+      memory_input in( i, __FUNCTION__ );
+      TAO_PEGTL_TEST_THROWS( parse< must< integer::unsigned_rule, eof >, int_action >( in, st ) );
+   }
+
+   template< typename S >
+   void test_unsigned( const S s )
+   {
+      int_state< S > st;
+      const auto i = lexical_cast( s );
+      memory_input in( i, __FUNCTION__ );
+      parse< must< integer::unsigned_rule, eof >, int_action >( in, st );
+      TAO_PEGTL_TEST_ASSERT( st.converted == s );
+   }
+
+   void unit_test()
+   {
+      test_signed< signed char >( "--0" );
+      test_signed< signed char >( "++0" );
+      test_signed< signed char >( "-+0" );
+
+      test_signed< signed char >( "0", 0 );
+      test_signed< signed char >( "+0", 0 );
+      test_signed< signed char >( "-0", 0 );
+      test_signed< signed char >( "000", 0 );
+      test_signed< signed char >( "+000", 0 );
+      test_signed< signed char >( "-000", 0 );
+
+      test_signed< signed char >( "127", 127 );
+
+      test_signed< signed char >( "-1", -1 );
+      test_signed< signed char >( "-001", -1 );
+
+      test_signed< signed char >( "-127", -127 );
+      test_signed< signed char >( "-128", -128 );
+
+      test_signed< signed char >( "128" );
+      test_signed< signed char >( "-129" );
+      test_signed< signed char >( "00128" );
+      test_signed< signed char >( "-00129" );
+
+      test_unsigned< unsigned char >( "-0" );
+      test_unsigned< unsigned char >( "+1" );
+
+      test_unsigned< unsigned char >( "0", 0 );
+      test_unsigned< unsigned char >( "000", 0 );
+      test_unsigned< unsigned char >( "0", 0 );
+      test_unsigned< unsigned char >( "255", 255 );
+      test_unsigned< unsigned char >( "000255", 255 );
+      test_unsigned< unsigned char >( "256" );
+      test_unsigned< unsigned char >( "000256" );
+
+      test_signed< signed long long >( "0", 0 );
+      test_signed< signed long long >( ( std::numeric_limits< signed long long >::max )() );
+      test_signed< signed long long >( ( std::numeric_limits< signed long long >::min )() );
+
+      test_unsigned< unsigned long long >( "0", 0 );
+      test_unsigned< unsigned long long >( ( std::numeric_limits< unsigned long long >::max )() );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_json.cpp b/packages/PEGTL/src/test/pegtl/contrib_json.cpp
index 5688748f45019b1441c4797f8b69cb5785f4c676..d438385aea924cf4a8f3e8b1cb17d079d44aaa6b 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_json.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_json.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -9,133 +9,129 @@
 #include <tao/pegtl/analyze.hpp>
 #include <tao/pegtl/contrib/json.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule >
+   void verify_file_fail( const std::size_t line, const char* file, const std::string& s )
    {
-      template< typename Rule >
-      void verify_file_fail( const std::size_t line, const char* file, const std::string& s )
-      {
-         file_input<> in( s );
-         try {
-            parse< Rule >( in );
-            TAO_PEGTL_TEST_FAILED( "expected exception" );
-         }
-         catch( ... ) {
-         }
+      file_input in( s );
+      try {
+         parse< Rule >( in );
+         TAO_PEGTL_TEST_FAILED( "expected exception" );
       }
+      catch( ... ) {
+      }
+   }
 
-      using GRAMMAR = must< json::text, eof >;
-
-      void unit_test()
-      {
-         verify_analyze< GRAMMAR >( __LINE__, __FILE__, true, false );
+   using GRAMMAR = must< json::text, eof >;
 
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "{}", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, " [ ] ", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, " { } ", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "   [   ]   ", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "   {   }   ", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[[{}],[],{}]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[ null, true, false, 0, 1, 2, 123, 1.23, 0.12, -1, -0, -1.23, \"\", \"abc\" ]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\b\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\f\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\n\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\r\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\t\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\/\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\\\\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\\"\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\u002C\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\u002c\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"ab\\u002Ccd\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"ab\\u002ccd\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\uD834\\uDD1E\"]", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\uD834\"]", result_type::SUCCESS, 0 );           // unfortunately, this is valid for the grammar...
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\uDD1E\"]", result_type::SUCCESS, 0 );           // ...although both inputs are invalid in unicode.
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\xC3\x84\"]", result_type::SUCCESS, 0 );          // German a-umlaut
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\xF4\x8F\xBF\xBF\"]", result_type::SUCCESS, 0 );  // largest allowed codepoint U+10FFFF
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\U0010FFFF\"]", result_type::SUCCESS, 0 );        // largest allowed codepoint U+10FFFF
+   void unit_test()
+   {
+      verify_analyze< GRAMMAR >( __LINE__, __FILE__, true, false );
 
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, " " );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "   " );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, " [" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, " ]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[ " );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "] " );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, " [ " );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, " ] " );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\a\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\c\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\d\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\e\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\v\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\'\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\b\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\f\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\n\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\r\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\t\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\\\\\\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\u12\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\xFF\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\xF4\x90\x80\x80\"]" );
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\xF7\xBF\xBF\xBF\"]" );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "{}", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, " [ ] ", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, " { } ", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "   [   ]   ", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "   {   }   ", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[[{}],[],{}]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[ null, true, false, 0, 1, 2, 123, 1.23, 0.12, -1, -0, -1.23, \"\", \"abc\" ]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\b\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\f\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\n\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\r\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\t\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\/\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\\\\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\\"\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\u002C\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\u002c\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"ab\\u002Ccd\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"ab\\u002ccd\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\uD834\\uDD1E\"]", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\uD834\"]", result_type::success, 0 );           // unfortunately, this is valid for the grammar...
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\\uDD1E\"]", result_type::success, 0 );           // ...although both inputs are invalid in unicode.
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\xC3\x84\"]", result_type::success, 0 );          // German a-umlaut
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\xF4\x8F\xBF\xBF\"]", result_type::success, 0 );  // largest allowed codepoint U+10FFFF
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "[\"\U0010FFFF\"]", result_type::success, 0 );        // largest allowed codepoint U+10FFFF
 
-         TAO_PEGTL_TEST_ASSERT( parse< GRAMMAR >( file_input<>( "src/test/pegtl/data/pass1.json" ) ) );
-         TAO_PEGTL_TEST_ASSERT( parse< GRAMMAR >( file_input<>( "src/test/pegtl/data/pass2.json" ) ) );
-         TAO_PEGTL_TEST_ASSERT( parse< GRAMMAR >( file_input<>( "src/test/pegtl/data/pass3.json" ) ) );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, " " );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "   " );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, " [" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, " ]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[ " );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "] " );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, " [ " );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, " ] " );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\a\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\c\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\d\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\e\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\v\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\'\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\b\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\f\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\n\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\r\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\t\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\\\\\\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\\u12\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\xFF\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\xF4\x90\x80\x80\"]" );
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "[\"\xF7\xBF\xBF\xBF\"]" );
 
-         TAO_PEGTL_TEST_ASSERT( parse< GRAMMAR >( file_input<>( "src/test/pegtl/data/blns.json" ) ) );
+      TAO_PEGTL_TEST_ASSERT( parse< GRAMMAR >( file_input( "src/test/pegtl/data/pass1.json" ) ) );
+      TAO_PEGTL_TEST_ASSERT( parse< GRAMMAR >( file_input( "src/test/pegtl/data/pass2.json" ) ) );
+      TAO_PEGTL_TEST_ASSERT( parse< GRAMMAR >( file_input( "src/test/pegtl/data/pass3.json" ) ) );
 
-         // verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail1.json" ); // disabled as it is valid now
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail2.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail3.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail4.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail5.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail6.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail7.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail8.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail9.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail10.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail11.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail12.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail13.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail14.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail15.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail16.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail17.json" );
-         // verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail18.json" ); // disabled as deep nesting is allowed
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail19.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail20.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail21.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail22.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail23.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail24.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail25.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail26.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail27.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail28.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail29.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail30.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail31.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail32.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail33.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail34.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail35.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail36.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail37.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail38.json" );
-         verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail39.json" );
-      }
+      TAO_PEGTL_TEST_ASSERT( parse< GRAMMAR >( file_input( "src/test/pegtl/data/blns.json" ) ) );
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      // verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail1.json" ); // disabled as it is valid now
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail2.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail3.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail4.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail5.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail6.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail7.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail8.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail9.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail10.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail11.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail12.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail13.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail14.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail15.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail16.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail17.json" );
+      // verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail18.json" ); // disabled as deep nesting is allowed
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail19.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail20.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail21.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail22.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail23.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail24.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail25.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail26.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail27.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail28.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail29.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail30.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail31.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail32.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail33.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail34.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail35.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail36.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail37.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail38.json" );
+      verify_file_fail< GRAMMAR >( __LINE__, __FILE__, "src/test/pegtl/data/fail39.json" );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_parse_tree.cpp b/packages/PEGTL/src/test/pegtl/contrib_parse_tree.cpp
index 984f4506cb9f00edc219a28a67a384a211dcc112..2df7a9b301a0abdfa303480549819b6d0b805c9c 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_parse_tree.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_parse_tree.cpp
@@ -1,60 +1,56 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 
 #include <tao/pegtl/contrib/parse_tree.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   // clang-format off
+   struct A : one< 'a' > {};
+   struct B : one< 'b' > {};
+   struct C : one< 'c' > {};
+
+   struct D : sor< seq< A, B >, seq< A, C > > {};
+   // clang-format on
+
+   template< typename Rule >
+   struct selector
+      : parse_tree::selector< Rule, parse_tree::store_content::on< A, B, C, D > >
    {
-      // clang-format off
-      struct A : one< 'a' > {};
-      struct B : one< 'b' > {};
-      struct C : one< 'c' > {};
-
-      struct D : sor< seq< A, B >, seq< A, C > > {};
-      // clang-format on
-
-      template< typename Rule >
-      struct selector
-         : parse_tree::selector< Rule, parse_tree::apply_store_content::to< A, B, C, D > >
-      {
-      };
-
-      void unit_test()
-      {
-         memory_input<> in( "ac", "input" );
-         const auto r = parse_tree::parse< D, selector >( in );
-         TAO_PEGTL_TEST_ASSERT( r->is_root() );
-         TAO_PEGTL_TEST_ASSERT( !r->has_content() );
-         TAO_PEGTL_TEST_ASSERT( r->children.size() == 1 );
-
-         const auto& d = r->children.front();
-         TAO_PEGTL_TEST_ASSERT( !d->is_root() );
-         TAO_PEGTL_TEST_ASSERT( d->id == &typeid( D ) );
-         TAO_PEGTL_TEST_ASSERT( d->is< D >() );
+   };
+
+   void unit_test()
+   {
+      memory_input in( "ac", "input" );
+      const auto r = parse_tree::parse< D, selector >( in );
+      TAO_PEGTL_TEST_ASSERT( r->is_root() );
+      TAO_PEGTL_TEST_ASSERT( !r->has_content() );
+      TAO_PEGTL_TEST_ASSERT( r->children.size() == 1 );
+
+      const auto& d = r->children.front();
+      TAO_PEGTL_TEST_ASSERT( !d->is_root() );
+      TAO_PEGTL_TEST_ASSERT( d->id == typeid( D ) );
+      TAO_PEGTL_TEST_ASSERT( d->is< D >() );
 #if !defined( _MSC_VER )
-         TAO_PEGTL_TEST_ASSERT( d->name() == "tao::pegtl::D" );
+      TAO_PEGTL_TEST_ASSERT( d->name() == "tao::pegtl::D" );
 #endif
 
-         TAO_PEGTL_TEST_ASSERT( d->has_content() );
-         TAO_PEGTL_TEST_ASSERT( d->begin().byte == 0 );
-         TAO_PEGTL_TEST_ASSERT( d->end().byte == 2 );
-         TAO_PEGTL_TEST_ASSERT( d->content() == "ac" );
-
-         TAO_PEGTL_TEST_ASSERT( d->children.size() == 2 );
-         TAO_PEGTL_TEST_ASSERT( d->children.front()->is< A >() );
-         TAO_PEGTL_TEST_ASSERT( d->children.back()->is< C >() );
+      TAO_PEGTL_TEST_ASSERT( d->has_content() );
+      TAO_PEGTL_TEST_ASSERT( d->begin().byte == 0 );
+      TAO_PEGTL_TEST_ASSERT( d->end().byte == 2 );
+      TAO_PEGTL_TEST_ASSERT( d->string_view() == "ac" );
 
-         memory_input<> in2( "x", "input" );
-         const auto r2 = parse_tree::parse< D, selector >( in2 );
-         TAO_PEGTL_TEST_ASSERT( !r2 );
-      }
+      TAO_PEGTL_TEST_ASSERT( d->children.size() == 2 );
+      TAO_PEGTL_TEST_ASSERT( d->children.front()->is< A >() );
+      TAO_PEGTL_TEST_ASSERT( d->children.back()->is< C >() );
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      memory_input in2( "x", "input" );
+      const auto r2 = parse_tree::parse< D, selector >( in2 );
+      TAO_PEGTL_TEST_ASSERT( !r2 );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_partial_trace.cpp b/packages/PEGTL/src/test/pegtl/contrib_partial_trace.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f4d82a1d747880960cc27e3c640e4e592401ea45
--- /dev/null
+++ b/packages/PEGTL/src/test/pegtl/contrib_partial_trace.cpp
@@ -0,0 +1,28 @@
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include "test.hpp"
+
+#include <tao/pegtl/contrib/tracer.hpp>
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   // clang-format off
+   struct inner : seq< one< 'a' >, sor< one< 'b' >, one< 'c' > > > {};
+   struct outer : seq< one< 'x' >, inner, one< 'y' > > {};
+
+   // how to run a tracer on a *part* of the grammar:
+   template< typename > struct partial_action {};
+   template<> struct partial_action< inner > : change_control< tracer > {};
+   // clang-format on
+
+   void unit_test()
+   {
+      memory_input in( "xacy", "trace test please ignore" );
+      const auto result = parse< outer, partial_action >( in );
+      TAO_PEGTL_TEST_ASSERT( result );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_raw_string.cpp b/packages/PEGTL/src/test/pegtl/contrib_raw_string.cpp
index fd17847ced04b0259f478448206e3e60c226a53e..6c41cfca344c520caad90720f106b4e35d1fe9e7 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_raw_string.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_raw_string.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -6,132 +6,124 @@
 
 #include <tao/pegtl/contrib/raw_string.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      std::string content;  // NOLINT
-
-      using rstring = raw_string< '[', '=', ']' >;
-      using qstring = raw_string< '[', '=', ']', alpha, digit >;
+   std::string content;  // NOLINT
 
-      template< typename Rule >
-      struct raction
-         : nothing< Rule >
-      {
-      };
+   using rstring = raw_string< '[', '=', ']' >;
+   using qstring = raw_string< '[', '=', ']', alpha, digit >;
 
-      template<>
-      struct raction< rstring::content >
-      {
-         template< typename Input, typename... States >
-         static void apply( const Input& in, const States&... /*unused*/ )
-         {
-            content.assign( in.begin(), in.end() );
-         }
-      };
-
-      template< typename Rule >
-      struct qaction
-         : nothing< Rule >
-      {
-      };
+   template< typename Rule >
+   struct raction
+   {};
 
-      template<>
-      struct qaction< qstring::content >
-      {
-         template< typename Input, typename... States >
-         static void apply( const Input& in, const States&... /*unused*/ )
-         {
-            content.assign( in.begin(), in.end() );
-         }
-      };
-
-      struct rgrammar
-         : must< rstring, eof >
+   template<>
+   struct raction< rstring::content >
+   {
+      template< typename Input, typename... States >
+      static void apply( const Input& in, const States&... /*unused*/ )
       {
-      };
+         content.assign( in.begin(), in.end() );
+      }
+   };
 
-      struct qgrammar
-         : must< qstring, eof >
-      {
-      };
+   template< typename Rule >
+   struct qaction
+   {};
 
-      template< typename Rule, template< typename > class Action, unsigned M, unsigned N >
-      void verify_data( const std::size_t line, const char* file, const char ( &m )[ M ], const char ( &n )[ N ] )
+   template<>
+   struct qaction< qstring::content >
+   {
+      template< typename Input, typename... States >
+      static void apply( const Input& in, const States&... /*unused*/ )
       {
-         content.clear();
-         memory_input<> in( m, m + M - 1, file, 0, line, 0 );
-         const auto r = parse< Rule, Action >( in );
-         if( ( !r ) || ( content != std::string( n, N - 1 ) ) ) {
-            TAO_PEGTL_TEST_FAILED( "input data [ '" << m << "' ] expected success with [ '" << n << "' ] but got [ '" << content << "' ] result [ " << r << " ]" );
-         }
-         content.clear();
-         memory_input< tracking_mode::LAZY > in2( m, m + M - 1, file, 0, line, 0 );
-         const auto r2 = parse< Rule, Action >( in2 );
-         if( ( !r2 ) || ( content != std::string( n, N - 1 ) ) ) {
-            TAO_PEGTL_TEST_FAILED( "input data [ '" << m << "' ] with tracking_mode::LAZY expected success with [ '" << n << "' ] but got [ '" << content << "' ] result [ " << r2 << " ]" );
-         }
+         content.assign( in.begin(), in.end() );
       }
+   };
 
-      void unit_test()
-      {
-         verify_data< rgrammar, raction >( __LINE__, __FILE__, "[[]]", "" );
-         verify_data< rgrammar, raction >( __LINE__, __FILE__, "[[foo]]", "foo" );
-         verify_data< rgrammar, raction >( __LINE__, __FILE__, "[===[foo]===]", "foo" );
-         verify_data< rgrammar, raction >( __LINE__, __FILE__, "[===[\nfoo]===]", "foo" );
-         verify_data< rgrammar, raction >( __LINE__, __FILE__, "[===[\r\nfoo]===]", "foo" );
-         verify_data< rgrammar, raction >( __LINE__, __FILE__, "[===[\0\0\0]===]", "\0\0\0" );
-
-         verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[[]]", "" );
-         verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[[a1]]", "a1" );
-         verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[===[a1]===]", "a1" );
-         verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[===[\na1]===]", "a1" );
-         verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[===[\r\na1]===]", "a1" );
-         verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[===[a0a1a2a3]===]", "a0a1a2a3" );
-
-         verify_fail< rgrammar >( __LINE__, __FILE__, "" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[=" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[=[" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[=[]=" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[=[]]" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[]" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[[]] " );
-         verify_fail< rgrammar >( __LINE__, __FILE__, " [[]]" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[=[]-]" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[-[]=]" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[-[]-]" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[===[]====]" );
-         verify_fail< rgrammar >( __LINE__, __FILE__, "[====[]===]" );
-
-         verify_fail< qgrammar >( __LINE__, __FILE__, "" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[]=" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[]]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[[]] " );
-         verify_fail< qgrammar >( __LINE__, __FILE__, " [[]]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[]-]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[-[]=]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[-[]-]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[===[]====]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[====[]===]" );
-
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[-]=]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[1]=]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[a]=]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[a+]=]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[aa]=]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[11]=]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[a1a]=]" );
-         verify_fail< qgrammar >( __LINE__, __FILE__, "[=[a1aa]=]" );
-      }
+   struct rgrammar
+      : must< rstring, eof >
+   {
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   struct qgrammar
+      : must< qstring, eof >
+   {
+   };
 
-}  // namespace tao
+   template< typename Rule, template< typename > class Action, unsigned M, unsigned N >
+   void verify_data( const std::size_t line, const char* file, const char ( &m )[ M ], const char ( &n )[ N ] )  // NOLINT
+   {
+      content.clear();
+      memory_input in( m, m + M - 1, file, 0, line, 0 );
+      const auto r = parse< Rule, Action >( in );
+      if( ( !r ) || ( content != std::string_view( n, N - 1 ) ) ) {
+         TAO_PEGTL_TEST_FAILED( "input data [ '" << m << "' ] expected success with [ '" << n << "' ] but got [ '" << content << "' ] result [ " << r << " ]" );
+      }
+      content.clear();
+      memory_input< tracking_mode::lazy > in2( m, m + M - 1, file, 0, line, 0 );
+      const auto r2 = parse< Rule, Action >( in2 );
+      if( ( !r2 ) || ( content != std::string_view( n, N - 1 ) ) ) {
+         TAO_PEGTL_TEST_FAILED( "input data [ '" << m << "' ] with tracking_mode::lazy expected success with [ '" << n << "' ] but got [ '" << content << "' ] result [ " << r2 << " ]" );
+      }
+   }
+
+   void unit_test()
+   {
+      verify_data< rgrammar, raction >( __LINE__, __FILE__, "[[]]", "" );
+      verify_data< rgrammar, raction >( __LINE__, __FILE__, "[[foo]]", "foo" );
+      verify_data< rgrammar, raction >( __LINE__, __FILE__, "[===[foo]===]", "foo" );
+      verify_data< rgrammar, raction >( __LINE__, __FILE__, "[===[\nfoo]===]", "foo" );
+      verify_data< rgrammar, raction >( __LINE__, __FILE__, "[===[\r\nfoo]===]", "foo" );
+      verify_data< rgrammar, raction >( __LINE__, __FILE__, "[===[\0\0\0]===]", "\0\0\0" );
+
+      verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[[]]", "" );
+      verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[[a1]]", "a1" );
+      verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[===[a1]===]", "a1" );
+      verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[===[\na1]===]", "a1" );
+      verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[===[\r\na1]===]", "a1" );
+      verify_data< qgrammar, qaction >( __LINE__, __FILE__, "[===[a0a1a2a3]===]", "a0a1a2a3" );
+
+      verify_fail< rgrammar >( __LINE__, __FILE__, "" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[=" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[=[" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[=[]=" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[=[]]" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[]" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[[]] " );
+      verify_fail< rgrammar >( __LINE__, __FILE__, " [[]]" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[=[]-]" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[-[]=]" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[-[]-]" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[===[]====]" );
+      verify_fail< rgrammar >( __LINE__, __FILE__, "[====[]===]" );
+
+      verify_fail< qgrammar >( __LINE__, __FILE__, "" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[]=" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[]]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[[]] " );
+      verify_fail< qgrammar >( __LINE__, __FILE__, " [[]]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[]-]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[-[]=]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[-[]-]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[===[]====]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[====[]===]" );
+
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[-]=]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[1]=]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[a]=]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[a+]=]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[aa]=]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[11]=]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[a1a]=]" );
+      verify_fail< qgrammar >( __LINE__, __FILE__, "[=[a1aa]=]" );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_rep_one_min_max.cpp b/packages/PEGTL/src/test/pegtl/contrib_rep_one_min_max.cpp
index 2243f9d4841b1d6d4762ba9b7b0ef992cd00b629..ebfb08680611f4a86eec2685329d0abe48db7251 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_rep_one_min_max.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_rep_one_min_max.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -7,35 +7,31 @@
 
 #include <tao/pegtl/contrib/rep_one_min_max.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< ellipsis >( __LINE__, __FILE__, true, false );
-
-         verify_analyze< rep_one_min_max< 0, 1, '+' > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_one_min_max< 1, 1, '+' > >( __LINE__, __FILE__, true, false );
-
-         verify_rule< ellipsis >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< ellipsis >( __LINE__, __FILE__, ".", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< ellipsis >( __LINE__, __FILE__, "..", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< ellipsis >( __LINE__, __FILE__, "....", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< ellipsis >( __LINE__, __FILE__, "...", result_type::SUCCESS, 0 );
-         verify_rule< ellipsis >( __LINE__, __FILE__, "... ", result_type::SUCCESS, 1 );
-         verify_rule< ellipsis >( __LINE__, __FILE__, "...+", result_type::SUCCESS, 1 );
-         verify_rule< ellipsis >( __LINE__, __FILE__, "...a", result_type::SUCCESS, 1 );
-
-         verify_rule< rep_one_min_max< 0, 2, '+' > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< rep_one_min_max< 0, 2, '+' > >( __LINE__, __FILE__, "-", result_type::SUCCESS, 1 );
-         verify_rule< rep_one_min_max< 0, 2, '+' > >( __LINE__, __FILE__, "+-", result_type::SUCCESS, 1 );
-         verify_rule< rep_one_min_max< 0, 2, '+' > >( __LINE__, __FILE__, "++-", result_type::SUCCESS, 1 );
-         verify_rule< rep_one_min_max< 0, 2, '+' > >( __LINE__, __FILE__, "+++", result_type::LOCAL_FAILURE, 3 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< rep_one_min_max< 3, 3, '.' > >( __LINE__, __FILE__, true, false );
+
+      verify_analyze< rep_one_min_max< 0, 1, '+' > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_one_min_max< 1, 1, '+' > >( __LINE__, __FILE__, true, false );
+
+      verify_rule< rep_one_min_max< 3, 3, '.' > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< rep_one_min_max< 3, 3, '.' > >( __LINE__, __FILE__, ".", result_type::local_failure, 1 );
+      verify_rule< rep_one_min_max< 3, 3, '.' > >( __LINE__, __FILE__, "..", result_type::local_failure, 2 );
+      verify_rule< rep_one_min_max< 3, 3, '.' > >( __LINE__, __FILE__, "....", result_type::local_failure, 4 );
+      verify_rule< rep_one_min_max< 3, 3, '.' > >( __LINE__, __FILE__, "...", result_type::success, 0 );
+      verify_rule< rep_one_min_max< 3, 3, '.' > >( __LINE__, __FILE__, "... ", result_type::success, 1 );
+      verify_rule< rep_one_min_max< 3, 3, '.' > >( __LINE__, __FILE__, "...+", result_type::success, 1 );
+      verify_rule< rep_one_min_max< 3, 3, '.' > >( __LINE__, __FILE__, "...a", result_type::success, 1 );
+
+      verify_rule< rep_one_min_max< 0, 2, '+' > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< rep_one_min_max< 0, 2, '+' > >( __LINE__, __FILE__, "-", result_type::success, 1 );
+      verify_rule< rep_one_min_max< 0, 2, '+' > >( __LINE__, __FILE__, "+-", result_type::success, 1 );
+      verify_rule< rep_one_min_max< 0, 2, '+' > >( __LINE__, __FILE__, "++-", result_type::success, 1 );
+      verify_rule< rep_one_min_max< 0, 2, '+' > >( __LINE__, __FILE__, "+++", result_type::local_failure, 3 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_to_string.cpp b/packages/PEGTL/src/test/pegtl/contrib_to_string.cpp
index 2c92b96598465683187d6872e8ee62478e71b870..55f9d2749d28bcd704b20459e38c8d4dcaf1c2e2 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_to_string.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_to_string.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -6,32 +6,28 @@
 #include <tao/pegtl.hpp>
 #include <tao/pegtl/contrib/to_string.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         TAO_PEGTL_TEST_ASSERT( to_string< string<> >().empty() );
-         TAO_PEGTL_TEST_ASSERT( ( to_string< string< 'a', 'b', 'c' > >() == "abc" ) );
+      TAO_PEGTL_TEST_ASSERT( to_string< string<> >().empty() );
+      TAO_PEGTL_TEST_ASSERT( ( to_string< string< 'a', 'b', 'c' > >() == "abc" ) );
 
-         TAO_PEGTL_TEST_ASSERT( to_string< istring<> >().empty() );
-         TAO_PEGTL_TEST_ASSERT( ( to_string< istring< 'a', 'b', 'c' > >() == "abc" ) );
+      TAO_PEGTL_TEST_ASSERT( to_string< istring<> >().empty() );
+      TAO_PEGTL_TEST_ASSERT( ( to_string< istring< 'a', 'b', 'c' > >() == "abc" ) );
 
-         TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_STRING( "" ) >().empty() );
-         TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_STRING( "abc" ) >() == "abc" );
-         TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_STRING( "AbC" ) >() == "AbC" );
-         TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_STRING( "abc" ) >() != "AbC" );
-         TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_ISTRING( "abc" ) >() == "abc" );
-         TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_ISTRING( "AbC" ) >() == "AbC" );
-         TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_ISTRING( "abc" ) >() != "AbC" );
+      TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_STRING( "" ) >().empty() );
+      TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_STRING( "abc" ) >() == "abc" );
+      TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_STRING( "AbC" ) >() == "AbC" );
+      TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_STRING( "abc" ) >() != "AbC" );
+      TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_ISTRING( "abc" ) >() == "abc" );
+      TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_ISTRING( "AbC" ) >() == "AbC" );
+      TAO_PEGTL_TEST_ASSERT( to_string< TAO_PEGTL_ISTRING( "abc" ) >() != "AbC" );
 
-         // to_string does *not* care about the outer class template
-         TAO_PEGTL_TEST_ASSERT( ( to_string< one< 'a', 'b', 'c' > >() == "abc" ) );
-      }
+      // to_string does *not* care about the outer class template
+      TAO_PEGTL_TEST_ASSERT( ( to_string< one< 'a', 'b', 'c' > >() == "abc" ) );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_tracer.cpp b/packages/PEGTL/src/test/pegtl/contrib_tracer.cpp
index 429631650f86ce48cbc97a93b3aaa50606702a6c..1d8ac50107ee9ba3736ea4f80e96ed7fd6274dc7 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_tracer.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_tracer.cpp
@@ -1,81 +1,90 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 
 #include <tao/pegtl/contrib/tracer.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      using GRAMMAR = sor< failure, one< 'a' > >;
+   using GRAMMAR = sor< failure, one< 'a' > >;
+   using GRAMMAR2 = seq< one< 'a' >, any, any, any, any, one< 'b' >, eof >;
 
-      template< typename Rule >
-      struct tracer_action
-         : nothing< Rule >
-      {
-      };
+   template< typename Rule >
+   struct tracer_action
+   {};
 
-      unsigned a0 = 0;
-      unsigned a = 0;
+   unsigned a0 = 0;
+   unsigned a = 0;
 
-      template<>
-      struct tracer_action< one< 'a' > >
+   template<>
+   struct tracer_action< one< 'a' > >
+   {
+      template< typename... Ts >
+      static void apply0( Ts&&... /*unused*/ )
       {
-         template< typename... Ts >
-         static void apply0( Ts&&... /*unused*/ )
-         {
-            ++a0;
-         }
-      };
+         ++a0;
+      }
+   };
 
-      template<>
-      struct tracer_action< GRAMMAR >
+   template<>
+   struct tracer_action< GRAMMAR >
+   {
+      template< typename... Ts >
+      static void apply( Ts&&... /*unused*/ )
       {
-         template< typename... Ts >
-         static void apply( Ts&&... /*unused*/ )
-         {
-            ++a;
-         }
-      };
+         ++a;
+      }
+   };
 
-      void unit_test()
+   void unit_test()
+   {
       {
-         {
-            memory_input<> in( "ab", "trace test please ignore" );
-            const auto result = parse< GRAMMAR, nothing, tracer >( in );
-            TAO_PEGTL_TEST_ASSERT( result );
-            TAO_PEGTL_TEST_ASSERT( a0 == 0 );
-            TAO_PEGTL_TEST_ASSERT( a == 0 );
-         }
-         {
-            memory_input<> in( "ab", "trace test please ignore" );
-            const auto result = parse< GRAMMAR, tracer_action, tracer >( in );
-            TAO_PEGTL_TEST_ASSERT( result );
-            TAO_PEGTL_TEST_ASSERT( a0 == 1 );
-            TAO_PEGTL_TEST_ASSERT( a == 1 );
-         }
-         {
-            trace_state ts;
-            memory_input<> in( "ab", "trace test please ignore" );
-            const auto result = parse< GRAMMAR, nothing, tracer >( in, ts );
-            TAO_PEGTL_TEST_ASSERT( result );
-            TAO_PEGTL_TEST_ASSERT( a0 == 1 );
-            TAO_PEGTL_TEST_ASSERT( a == 1 );
-         }
-         {
-            trace_state ts;
-            memory_input<> in( "ab", "trace test please ignore" );
-            const auto result = parse< GRAMMAR, tracer_action, tracer >( in, ts );
-            TAO_PEGTL_TEST_ASSERT( result );
-            TAO_PEGTL_TEST_ASSERT( a0 == 2 );
-            TAO_PEGTL_TEST_ASSERT( a == 2 );
-         }
+         memory_input in( "ab", "trace test please ignore" );
+         const auto result = parse< GRAMMAR, nothing, tracer >( in );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( a0 == 0 );
+         TAO_PEGTL_TEST_ASSERT( a == 0 );
       }
+      {
+         memory_input in( "ab", "trace test please ignore" );
+         const auto result = parse< GRAMMAR, tracer_action, tracer >( in );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( a0 == 1 );
+         TAO_PEGTL_TEST_ASSERT( a == 1 );
+      }
+      {
+         trace_state ts;
+         memory_input in( "ab", "trace test please ignore" );
+         const auto result = parse< GRAMMAR, nothing, tracer >( in, ts );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( a0 == 1 );
+         TAO_PEGTL_TEST_ASSERT( a == 1 );
+      }
+      {
+         trace_state ts;
+         memory_input in( "ab", "trace test please ignore" );
+         const auto result = parse< GRAMMAR, tracer_action, tracer >( in, ts );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( a0 == 2 );
+         TAO_PEGTL_TEST_ASSERT( a == 2 );
+      }
+      {
+         trace_state ts;
+         memory_input in( "a\r\n\t\0b", 6, "trace test please ignore" );
+         const auto result = parse< GRAMMAR2, nothing, tracer >( in, ts );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( a0 == 2 );
+         TAO_PEGTL_TEST_ASSERT( a == 2 );
+      }
+      {
+         trace_state ts;
+         memory_input in( "a\r\n\t\0b", 6, "trace test please ignore" );
+         const auto result = parse< GRAMMAR2, tracer_action, tracer >( in, ts );
+         TAO_PEGTL_TEST_ASSERT( result );
+      }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_unescape.cpp b/packages/PEGTL/src/test/pegtl/contrib_unescape.cpp
index 254afe5238e0d37518a43e36e4672e3a9a9c51b0..f31754192121d152193cc0e69f24b2f79c062059 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_unescape.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_unescape.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -6,116 +6,112 @@
 
 #include <tao/pegtl/contrib/unescape.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   // clang-format off
+   struct escaped_c : one< '"', '\\', 't' > {};
+   struct escaped_u : seq< one< 'u' >, rep< 4, must< xdigit > > > {};
+   struct escaped_U : seq< one< 'U' >, rep< 8, must< xdigit > > > {};
+   struct escaped_j : list< seq< one< 'j' >, rep< 4, must< xdigit > > >, one< '\\' > > {};
+   struct escaped_x : seq< one< 'x' >, rep< 2, must< xdigit > > > {};
+   struct escaped : sor< escaped_c, escaped_u, escaped_U, escaped_j, escaped_x > {};
+   struct character : if_then_else< one< '\\' >, must< escaped >, utf8::any > {};
+   struct unstring : until< eof, character > {};
+
+   template< typename Rule > struct unaction {};
+
+   template<> struct unaction< escaped_c > : unescape::unescape_c< escaped_c, '"', '\\', '\t' > {};
+   template<> struct unaction< escaped_u > : unescape::unescape_u {};
+   template<> struct unaction< escaped_U > : unescape::unescape_u {};
+   template<> struct unaction< escaped_j > : unescape::unescape_j {};
+   template<> struct unaction< escaped_x > : unescape::unescape_x {};
+   template<> struct unaction< utf8::any > : unescape::append_all {};
+   // clang-format on
+
+   template< unsigned M, unsigned N >
+   void verify_data( const char ( &m )[ M ], const char ( &n )[ N ] )  // NOLINT
    {
-      // clang-format off
-      struct escaped_c : one< '"', '\\', 't' > {};
-      struct escaped_u : seq< one< 'u' >, rep< 4, must< xdigit > > > {};
-      struct escaped_U : seq< one< 'U' >, rep< 8, must< xdigit > > > {};
-      struct escaped_j : list< seq< one< 'j' >, rep< 4, must< xdigit > > >, one< '\\' > > {};
-      struct escaped_x : seq< one< 'x' >, rep< 2, must< xdigit > > > {};
-      struct escaped : sor< escaped_c, escaped_u, escaped_U, escaped_j, escaped_x > {};
-      struct character : if_then_else< one< '\\' >, must< escaped >, utf8::any > {};
-      struct unstring : until< eof, character > {};
-
-      template< typename Rule > struct unaction : nothing< Rule > {};
-
-      template<> struct unaction< escaped_c > : unescape::unescape_c< escaped_c, '"', '\\', '\t' > {};
-      template<> struct unaction< escaped_u > : unescape::unescape_u {};
-      template<> struct unaction< escaped_U > : unescape::unescape_u {};
-      template<> struct unaction< escaped_j > : unescape::unescape_j {};
-      template<> struct unaction< escaped_x > : unescape::unescape_x {};
-      template<> struct unaction< utf8::any > : unescape::append_all {};
-      // clang-format on
-
-      template< unsigned M, unsigned N >
-      void verify_data( const char ( &m )[ M ], const char ( &n )[ N ] )
-      {
-         unescape::state st;
-         memory_input<> in( m, M - 1, __FUNCTION__ );
-         parse< unstring, unaction >( in, st );
-         if( st.unescaped != std::string( n, N - 1 ) ) {
-            throw std::runtime_error( "test failed!" );  // NOLINT
-         }
+      std::string s;
+      memory_input in( m, M - 1, __FUNCTION__ );
+      parse< unstring, unaction >( in, s );
+      if( s != std::string( n, N - 1 ) ) {
+         throw std::runtime_error( "test failed!" );  // NOLINT
       }
+   }
 
-      void unit_test()
-      {
-         verify_data( "\\t", "\t" );
-         verify_data( "\\\\", "\\" );
-         verify_data( "abc", "abc" );
-         verify_data( "\\\"foo\\\"", "\"foo\"" );
-         verify_data( "\\x20", " " );
-         verify_data( "\\x30", "0" );
-         verify_data( "\\x2000", " 00" );
-         verify_data( "\\u0020", " " );
-         verify_data( "\\u0020\\u0020", "  " );
-         verify_data( "\\u00e4", "\xc3\xa4" );
-         verify_data( "\\u00E4", "\xC3\xA4" );
-         verify_data( "\\u20ac", "\xe2\x82\xac" );
-
-         TAO_PEGTL_TEST_THROWS( verify_data( "\\ud800", "" ) );
-         TAO_PEGTL_TEST_THROWS( verify_data( "\\ud800X", "" ) );
-         TAO_PEGTL_TEST_THROWS( verify_data( "\\ud800\\u0020", "" ) );
-         TAO_PEGTL_TEST_THROWS( verify_data( "\\ud800\\udc00", "" ) );  // unescape_u does not support surrogate pairs.
-         TAO_PEGTL_TEST_THROWS( verify_data( "\\udc00\\ud800", "" ) );
-
-         verify_data( "\\j0020", " " );
-         verify_data( "\\j0020\\j0020", "  " );
-         verify_data( "\\j20ac", "\xe2\x82\xac" );
-
-         verify_data( "\\jd800\\jdc00", "\xf0\x90\x80\x80" );  // unescape_j does support proper surrogate pairs.
-
-         TAO_PEGTL_TEST_THROWS( verify_data( "\\jd800", "" ) );
-         TAO_PEGTL_TEST_THROWS( verify_data( "\\jd800X", "" ) );
-         TAO_PEGTL_TEST_THROWS( verify_data( "\\jd800\\j0020", "" ) );
-         TAO_PEGTL_TEST_THROWS( verify_data( "\\jdc00\\jd800", "" ) );
-
-         verify_data( "\\j0000\\u0000\x00", "\x00\x00\x00" );
-
-         unescape::state st;
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\\\\\", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\x", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\xx", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\xa", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\x1", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\x1h", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\x", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\xx", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\xa", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\x1", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\x1h", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\a", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\_", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\z", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\1", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\a00", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\_1111", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\z22222222", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\13333333333333333", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\u", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\uu", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\uuuu", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\u123", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\u999", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\u444h", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\j", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\ju", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\juuu", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\j123", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\j999", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\j444h", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\U00110000", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\U80000000", st );
-         verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\Uffffffff", st );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+   void unit_test()
+   {
+      verify_data( "\\t", "\t" );
+      verify_data( "\\\\", "\\" );
+      verify_data( "abc", "abc" );
+      verify_data( "\\\"foo\\\"", "\"foo\"" );
+      verify_data( "\\x20", " " );
+      verify_data( "\\x30", "0" );
+      verify_data( "\\x2000", " 00" );
+      verify_data( "\\u0020", " " );
+      verify_data( "\\u0020\\u0020", "  " );
+      verify_data( "\\u00e4", "\xc3\xa4" );
+      verify_data( "\\u00E4", "\xC3\xA4" );
+      verify_data( "\\u20ac", "\xe2\x82\xac" );
+
+      TAO_PEGTL_TEST_THROWS( verify_data( "\\ud800", "" ) );
+      TAO_PEGTL_TEST_THROWS( verify_data( "\\ud800X", "" ) );
+      TAO_PEGTL_TEST_THROWS( verify_data( "\\ud800\\u0020", "" ) );
+      TAO_PEGTL_TEST_THROWS( verify_data( "\\ud800\\udc00", "" ) );  // unescape_u does not support surrogate pairs.
+      TAO_PEGTL_TEST_THROWS( verify_data( "\\udc00\\ud800", "" ) );
+
+      verify_data( "\\j0020", " " );
+      verify_data( "\\j0020\\j0020", "  " );
+      verify_data( "\\j20ac", "\xe2\x82\xac" );
+
+      verify_data( "\\jd800\\jdc00", "\xf0\x90\x80\x80" );  // unescape_j does support proper surrogate pairs.
+
+      TAO_PEGTL_TEST_THROWS( verify_data( "\\jd800", "" ) );
+      TAO_PEGTL_TEST_THROWS( verify_data( "\\jd800X", "" ) );
+      TAO_PEGTL_TEST_THROWS( verify_data( "\\jd800\\j0020", "" ) );
+      TAO_PEGTL_TEST_THROWS( verify_data( "\\jdc00\\jd800", "" ) );
+
+      verify_data( "\\j0000\\u0000\x00", "\x00\x00\x00" );
+
+      std::string s;
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\\\\\", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\x", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\xx", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\xa", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\x1", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\x1h", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\x", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\xx", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\xa", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\x1", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "a\\x1h", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\a", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\_", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\z", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\1", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\a00", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\_1111", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\z22222222", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\13333333333333333", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\u", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\uu", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\uuuu", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\u123", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\u999", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\u444h", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\j", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\ju", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\juuu", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\j123", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\j999", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\j444h", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\U00110000", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\U80000000", s );
+      verify_fail< unstring, unaction >( __LINE__, __FILE__, "\\Uffffffff", s );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/contrib_uri.cpp b/packages/PEGTL/src/test/pegtl/contrib_uri.cpp
index 7d502a843e5c5afaabb2fa459abbb586e4cc9d46..e9317f8cef5b3f2b0a6e3984aa2f745601d49fbb 100644
--- a/packages/PEGTL/src/test/pegtl/contrib_uri.cpp
+++ b/packages/PEGTL/src/test/pegtl/contrib_uri.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -8,39 +8,35 @@
 
 #include <tao/pegtl/contrib/uri.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   using GRAMMAR = must< uri::URI, eof >;
+
+   void unit_test()
    {
-      using GRAMMAR = must< uri::URI, eof >;
-
-      void unit_test()
-      {
-         verify_analyze< GRAMMAR >( __LINE__, __FILE__, true, false );
-
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "http://de.wikipedia.org/wiki/Uniform_Resource_Identifier", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "ftp://ftp.is.co.za/rfc/rfc1808.txt", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "file:///C:/Users/Benutzer/Desktop/Uniform%20Resource%20Identifier.html", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "file:///etc/fstab", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "geo:48.33,14.122;u=22.5", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "ldap://[2001:db8::7]/c=GB?objectClass?one", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "gopher://gopher.floodgap.com", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "mailto:John.Doe@example.com", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "sip:911@pbx.mycompany.com", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "news:comp.infosystems.www.servers.unix", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "data:text/plain;charset=iso-8859-7,%be%fa%be", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "tel:+1-816-555-1212", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "telnet://192.0.2.16:80/", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "urn:oasis:names:specification:docbook:dtd:xml:4.1.2", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "git://github.com/rails/rails.git", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "crid://broadcaster.com/movies/BestActionMovieEver", result_type::SUCCESS, 0 );
-         verify_rule< GRAMMAR >( __LINE__, __FILE__, "http://nobody:password@example.org:8080/cgi-bin/script.php?action=submit&pageid=86392001#section_2", result_type::SUCCESS, 0 );
-
-         verify_fail< GRAMMAR >( __LINE__, __FILE__, "" );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< GRAMMAR >( __LINE__, __FILE__, true, false );
+
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "http://de.wikipedia.org/wiki/Uniform_Resource_Identifier", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "ftp://ftp.is.co.za/rfc/rfc1808.txt", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "file:///C:/Users/Benutzer/Desktop/Uniform%20Resource%20Identifier.html", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "file:///etc/fstab", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "geo:48.33,14.122;u=22.5", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "ldap://[2001:db8::7]/c=GB?objectClass?one", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "gopher://gopher.floodgap.com", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "mailto:John.Doe@example.com", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "sip:911@pbx.mycompany.com", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "news:comp.infosystems.www.servers.unix", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "data:text/plain;charset=iso-8859-7,%be%fa%be", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "tel:+1-816-555-1212", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "telnet://192.0.2.16:80/", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "urn:oasis:names:specification:docbook:dtd:xml:4.1.2", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "git://github.com/rails/rails.git", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "crid://broadcaster.com/movies/BestActionMovieEver", result_type::success, 0 );
+      verify_rule< GRAMMAR >( __LINE__, __FILE__, "http://nobody:password@example.org:8080/cgi-bin/script.php?action=submit&pageid=86392001#section_2", result_type::success, 0 );
+
+      verify_fail< GRAMMAR >( __LINE__, __FILE__, "" );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/data/blns.json b/packages/PEGTL/src/test/pegtl/data/blns.json
old mode 100755
new mode 100644
diff --git a/packages/PEGTL/src/test/pegtl/data_cstring.cpp b/packages/PEGTL/src/test/pegtl/data_cstring.cpp
index 978a1af36f21dc6ee550d1dd0675a3d1248e36a2..9828c35f5c16b74da882b5416f2fa4682c04c729 100644
--- a/packages/PEGTL/src/test/pegtl/data_cstring.cpp
+++ b/packages/PEGTL/src/test/pegtl/data_cstring.cpp
@@ -1,37 +1,31 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 
 #include <tao/pegtl/internal/cstring_reader.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule,
+             template< typename... > class Action = nothing,
+             template< typename... > class Control = normal >
+   bool parse_cstring( const char* string, const char* source, const std::size_t maximum )
    {
-      template< typename Rule,
-                template< typename... > class Action = nothing,
-                template< typename... > class Control = normal,
-                typename... States >
-      bool parse_cstring( const char* string, const char* source, const std::size_t maximum, States&&... st )
-      {
-         buffer_input< internal::cstring_reader > in( source, maximum, string );
-         return parse< Rule, Action, Control >( in, st... );
-      }
+      buffer_input< internal::cstring_reader > in( source, maximum, string );
+      return parse< Rule, Action, Control >( in );
+   }
 
-      struct test_grammar : seq< string< 'a', 'b' >, discard, string< 'c', 'd' >, discard, any, any, discard, eof >
-      {
-      };
-
-      void unit_test()
-      {
-         const char* test_data = "abcdef";
-         TAO_PEGTL_TEST_ASSERT( parse_cstring< test_grammar >( test_data, "test data", 2 ) );
-         TAO_PEGTL_TEST_ASSERT( !parse_cstring< test_grammar >( test_data, "test data", 1 ) );
-      }
+   struct test_grammar : seq< string< 'a', 'b', 'c', 'd', 'e', 'f' >, not_at< any >, eof >
+   {
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
+   {
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< test_grammar >( "abcdef", "test data", 10 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< test_grammar >( "abcdef\0g", "test data", 10 ) );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/demangle.cpp b/packages/PEGTL/src/test/pegtl/demangle.cpp
index 526724dc8cf4dd1b8bba4cdfa92ddd02cf61054e..a83296d59454670e22df0fc4665a238134e7972f 100644
--- a/packages/PEGTL/src/test/pegtl/demangle.cpp
+++ b/packages/PEGTL/src/test/pegtl/demangle.cpp
@@ -1,39 +1,35 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 
 #include <tao/pegtl/internal/demangle_sanitise.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void test_chars( std::string a, const std::string& b )
    {
-      void test_chars( std::string a, const std::string& b )
-      {
-         internal::demangle_sanitise_chars( a );
-         TAO_PEGTL_TEST_ASSERT( a == b );
-      }
+      internal::demangle_sanitise_chars( a );
+      TAO_PEGTL_TEST_ASSERT( a == b );
+   }
 
-      void unit_test()
-      {
-         const std::string s = "something that can't be demangled";
-         const std::string a = internal::demangle( s.c_str() );
-         TAO_PEGTL_TEST_ASSERT( a == s );
-         const std::string b = internal::demangle< std::string >();
-         (void)b;  // Not standardised.
-
-         test_chars( "zzz(char)1xxx", "zzz1xxx" );
-         test_chars( "zzz(char)32xxx", "zzz' 'xxx" );
-         test_chars( "zzz(char)48xxx", "zzz'0'xxx" );
-         test_chars( "zzz(char)39xxx", "zzz'\\''xxx" );
-         test_chars( "zzz(char)92xxx", "zzz'\\\\'xxx" );
-         test_chars( "frobnicate<> (char)1 (char)32 (char)48 ***", "frobnicate<> 1 ' ' '0' ***" );
-         test_chars( "tao::pegtl::internal::until<tao::pegtl::at<tao::pegtl::ascii::one<(char)34> >", "tao::pegtl::internal::until<tao::pegtl::at<tao::pegtl::ascii::one<'\"'> >" );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+   void unit_test()
+   {
+      const std::string s = "something that can't be demangled";
+      const std::string a = internal::demangle( s.c_str() );
+      TAO_PEGTL_TEST_ASSERT( a == s );
+      const std::string b = internal::demangle< std::string >();
+      (void)b;  // Not standardised.
+
+      test_chars( "zzz(char)1xxx", "zzz1xxx" );
+      test_chars( "zzz(char)32xxx", "zzz' 'xxx" );
+      test_chars( "zzz(char)48xxx", "zzz'0'xxx" );
+      test_chars( "zzz(char)39xxx", "zzz'\\''xxx" );
+      test_chars( "zzz(char)92xxx", "zzz'\\\\'xxx" );
+      test_chars( "frobnicate<> (char)1 (char)32 (char)48 ***", "frobnicate<> 1 ' ' '0' ***" );
+      test_chars( "tao::pegtl::internal::until<tao::pegtl::at<tao::pegtl::ascii::one<(char)34> >", "tao::pegtl::internal::until<tao::pegtl::at<tao::pegtl::ascii::one<'\"'> >" );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/discard_input.cpp b/packages/PEGTL/src/test/pegtl/discard_input.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b693db5064b94d92c7d8148672387e6db5d34f8e
--- /dev/null
+++ b/packages/PEGTL/src/test/pegtl/discard_input.cpp
@@ -0,0 +1,56 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include <string>
+
+#include "test.hpp"
+
+#include <tao/pegtl/internal/cstring_reader.hpp>
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   template< typename Rule, template< typename... > class Action >
+   bool parse_cstring( const char* string, const char* source, const std::size_t maximum )
+   {
+      buffer_input< internal::cstring_reader, eol::lf_crlf, const char*, 1 > in( source, maximum, string );
+      return parse< Rule, Action >( in );
+   }
+
+   // clang-format off
+   struct n : one< 'n' > {};
+   struct a : one< 'a' > {};
+   struct f : one< 'f' > {};
+   struct s : one< 's' > {};
+
+   template< typename Rule > struct my_action {};
+   template<> struct my_action< a > : discard_input {};
+   template<> struct my_action< f > : discard_input_on_failure {};
+   template<> struct my_action< s > : discard_input_on_success {};
+   // clang-format on
+
+   void unit_test()
+   {
+      TAO_PEGTL_TEST_THROWS( parse_cstring< rep< 4, sor< n, n > >, my_action >( "nnnn", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< a, n > >, my_action >( "nnnn", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< f, n > >, my_action >( "nnnn", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_THROWS( parse_cstring< rep< 4, sor< s, n > >, my_action >( "nnnn", TAO_TEST_LINE, 2 ) );
+
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< n, a > >, my_action >( "aaaa", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< a, a > >, my_action >( "aaaa", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< f, a > >, my_action >( "aaaa", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< s, a > >, my_action >( "aaaa", TAO_TEST_LINE, 2 ) );
+
+      TAO_PEGTL_TEST_THROWS( parse_cstring< rep< 4, sor< n, f > >, my_action >( "ffff", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< a, f > >, my_action >( "ffff", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_THROWS( parse_cstring< rep< 4, sor< f, f > >, my_action >( "ffff", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_THROWS( parse_cstring< rep< 4, sor< s, f > >, my_action >( "ffff", TAO_TEST_LINE, 2 ) );
+
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< n, s > >, my_action >( "ssss", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< a, s > >, my_action >( "ssss", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< f, s > >, my_action >( "ssss", TAO_TEST_LINE, 2 ) );
+      TAO_PEGTL_TEST_ASSERT( parse_cstring< rep< 4, sor< s, s > >, my_action >( "ssss", TAO_TEST_LINE, 2 ) );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/file_cstream.cpp b/packages/PEGTL/src/test/pegtl/file_cstream.cpp
index e06b6e2d2316236ff79eb171e7077b7a1b1b6550..0560a33e9a8b3ad7b4de3dc13f2f970e38dd53a2 100644
--- a/packages/PEGTL/src/test/pegtl/file_cstream.cpp
+++ b/packages/PEGTL/src/test/pegtl/file_cstream.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <clocale>
@@ -6,34 +6,30 @@
 
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct file_content : seq< TAO_PEGTL_STRING( "dummy content" ), eol, discard >
    {
-      struct file_content : seq< TAO_PEGTL_STRING( "dummy content" ), eol, discard >
-      {
-      };
+   };
 
-      struct file_grammar : seq< rep_min_max< 11, 11, file_content >, eof >
-      {
-      };
+   struct file_grammar : seq< rep_min_max< 11, 11, file_content >, eof >
+   {
+   };
 
-      void unit_test()
-      {
-         const char* const filename = "src/test/pegtl/file_data.txt";
+   void unit_test()
+   {
+      const char* const filename = "src/test/pegtl/file_data.txt";
 #if defined( _MSC_VER )
-         std::FILE* stream;
-         ::fopen_s( &stream, filename, "rb" );  // NOLINT
+      std::FILE* stream;
+      ::fopen_s( &stream, filename, "rb" );  // NOLINT
 #else
-         std::FILE* stream = std::fopen( filename, "rb" );  // NOLINT
+      std::FILE* stream = std::fopen( filename, "rb" );  // NOLINT
 #endif
-         TAO_PEGTL_TEST_ASSERT( stream != nullptr );
-         TAO_PEGTL_TEST_ASSERT( parse< file_grammar >( cstream_input<>( stream, 16, filename ) ) );
-         std::fclose( stream );  // NOLINT(cppcoreguidelines-owning-memory)
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+      TAO_PEGTL_TEST_ASSERT( stream != nullptr );
+      TAO_PEGTL_TEST_ASSERT( parse< file_grammar >( cstream_input( stream, 16, filename ) ) );
+      std::fclose( stream );  // NOLINT(cppcoreguidelines-owning-memory)
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/file_file.cpp b/packages/PEGTL/src/test/pegtl/file_file.cpp
index 73af0546e67a1d72ee75e6ef9292a6ab945721fc..4e7da95350819f0509945d740430d6c178a695e6 100644
--- a/packages/PEGTL/src/test/pegtl/file_file.cpp
+++ b/packages/PEGTL/src/test/pegtl/file_file.cpp
@@ -1,20 +1,16 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_file.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_file< file_input<> >();
-      }
+      verify_file< file_input<> >();
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/file_istream.cpp b/packages/PEGTL/src/test/pegtl/file_istream.cpp
index b1938e439deff5d2fb6e1ac13e7bb038aa599a48..b4862f25f62c85ed6aa2f3d30fd8705dab172c1e 100644
--- a/packages/PEGTL/src/test/pegtl/file_istream.cpp
+++ b/packages/PEGTL/src/test/pegtl/file_istream.cpp
@@ -1,40 +1,41 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
+#include <cerrno>
 #include <fstream>
 
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct file_content : seq< TAO_PEGTL_STRING( "dummy content" ), eol, discard >
    {
-      struct file_content : seq< TAO_PEGTL_STRING( "dummy content" ), eol, discard >
-      {
-      };
+   };
 
-      struct file_grammar : seq< rep_min_max< 11, 11, file_content >, eof >
-      {
-      };
+   struct file_grammar : seq< rep_min_max< 11, 11, file_content >, eof >
+   {
+   };
 
-      void unit_test()
+   void unit_test()
+   {
       {
+         const char* filename = "src/test/pegtl/no_such_file.txt";
          try {
-            const char* filename = "src/test/pegtl/no_such_file.txt";
             std::ifstream stream( filename );
-            parse< file_grammar >( istream_input<>( stream, 16, filename ) );
+            parse< file_grammar >( istream_input( stream, 16, filename ) );
             TAO_PEGTL_TEST_ASSERT( false );
          }
-         catch( const input_error& e ) {
-            TAO_PEGTL_TEST_ASSERT( std::string( e.what() ).find( "error in istream.read()" ) != std::string::npos );
+         catch( const std::system_error& e ) {
+            TAO_PEGTL_TEST_ASSERT( e.code().category() == std::system_category() );
+            TAO_PEGTL_TEST_ASSERT( e.code().value() == ENOENT );
          }
-         const char* filename = "src/test/pegtl/file_data.txt";
-         std::ifstream stream( filename );
-         TAO_PEGTL_TEST_ASSERT( parse< file_grammar >( istream_input<>( stream, 16, filename ) ) );
       }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      const char* filename = "src/test/pegtl/file_data.txt";
+      std::ifstream stream( filename );
+      TAO_PEGTL_TEST_ASSERT( parse< file_grammar >( istream_input( stream, 16, filename ) ) );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/file_mmap.cpp b/packages/PEGTL/src/test/pegtl/file_mmap.cpp
index 4320bb0056cc42b2f912444cd4ac2603d026bb70..c7297c1874444613468d075cb646ca34f644cc84 100644
--- a/packages/PEGTL/src/test/pegtl/file_mmap.cpp
+++ b/packages/PEGTL/src/test/pegtl/file_mmap.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 // this include gives us _POSIX_MAPPED_FILES to test and mmap_input<> if it is set
@@ -9,18 +9,14 @@
 #include "test.hpp"
 #include "verify_file.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_file< mmap_input<> >();
-      }
+      verify_file< mmap_input<> >();
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
 
diff --git a/packages/PEGTL/src/test/pegtl/file_read.cpp b/packages/PEGTL/src/test/pegtl/file_read.cpp
index 2178cacbc1329ecbe4eb0249bcce2b39a377dc63..85bd80d53a805cdee10ccff553f2293334b653c4 100644
--- a/packages/PEGTL/src/test/pegtl/file_read.cpp
+++ b/packages/PEGTL/src/test/pegtl/file_read.cpp
@@ -1,36 +1,32 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_file.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< tracking_mode P = tracking_mode::eager, typename Eol = eol::lf_crlf >
+   struct open_input
+      : public read_input< P, Eol >
    {
-      template< tracking_mode P = tracking_mode::IMMEDIATE, typename Eol = eol::lf_crlf >
-      struct open_input
-         : public read_input< P, Eol >
+      explicit open_input( const char* in_filename )
+         : read_input< P, Eol >( internal::file_open( in_filename ), in_filename )
       {
-         explicit open_input( const char* in_filename )
-            : read_input< P, Eol >( internal::file_open( in_filename ), in_filename )
-         {
-         }
-
-         explicit open_input( const std::string& in_filename )
-            : open_input( in_filename.c_str() )
-         {
-         }
-      };
+      }
 
-      void unit_test()
+      explicit open_input( const std::string& in_filename )
+         : open_input( in_filename.c_str() )
       {
-         verify_file< read_input<> >();
-         verify_file< open_input<> >();
       }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
+   {
+      verify_file< read_input<> >();
+      verify_file< open_input<> >();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/internal_endian.cpp b/packages/PEGTL/src/test/pegtl/internal_endian.cpp
index 1b0629421b359198daa120451f723013dbef4d10..0dcfa983fc90cf5708c087cfc80963e0419fefbf 100644
--- a/packages/PEGTL/src/test/pegtl/internal_endian.cpp
+++ b/packages/PEGTL/src/test/pegtl/internal_endian.cpp
@@ -1,86 +1,82 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <tao/pegtl/internal/endian.hpp>
 
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int8_t( 0x7a ) ) == std::int8_t( 0x7a ) );
-         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint8_t( 0x7a ) ) == std::uint8_t( 0x7a ) );
-         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int8_t( 0x7a ) ) == std::int8_t( 0x7a ) );
-         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint8_t( 0x7a ) ) == std::uint8_t( 0x7a ) );
-         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int8_t( 0x7a ) ) == std::int8_t( 0x7a ) );
-         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint8_t( 0x7a ) ) == std::uint8_t( 0x7a ) );
-         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int8_t( 0x7a ) ) == std::int8_t( 0x7a ) );
-         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint8_t( 0x7a ) ) == std::uint8_t( 0x7a ) );
+      TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int8_t( 0x7a ) ) == std::int8_t( 0x7a ) );
+      TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint8_t( 0x7a ) ) == std::uint8_t( 0x7a ) );
+      TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int8_t( 0x7a ) ) == std::int8_t( 0x7a ) );
+      TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint8_t( 0x7a ) ) == std::uint8_t( 0x7a ) );
+      TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int8_t( 0x7a ) ) == std::int8_t( 0x7a ) );
+      TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint8_t( 0x7a ) ) == std::uint8_t( 0x7a ) );
+      TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int8_t( 0x7a ) ) == std::int8_t( 0x7a ) );
+      TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint8_t( 0x7a ) ) == std::uint8_t( 0x7a ) );
 
-         const std::uint16_t a = 1;
-         if( *static_cast< const std::uint8_t* >( static_cast< const void* >( &a ) ) != 1 ) {
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x7a39 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x7a39 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x7a39 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x7a39 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x397a ) );
+      const std::uint16_t a = 1;
+      if( *static_cast< const std::uint8_t* >( static_cast< const void* >( &a ) ) != 1 ) {
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x7a39 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x7a39 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x7a39 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x7a39 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x397a ) );
 
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x7a391f2b ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x7a391f2b ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x2b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x2b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x7a391f2b ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x7a391f2b ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x2b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x2b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x7a391f2b ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x7a391f2b ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x2b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x2b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x7a391f2b ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x7a391f2b ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x2b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x2b1f397a ) );
 
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x7a391f2b33445567 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x7a391f2b33445567 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x675544332b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x675544332b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x7a391f2b33445567 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x7a391f2b33445567 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x675544332b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x675544332b1f397a ) );
-         }
-         else {
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x7a39 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x7a39 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x7a39 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x7a39 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x7a391f2b33445567 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x7a391f2b33445567 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x675544332b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x675544332b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x7a391f2b33445567 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x7a391f2b33445567 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x675544332b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x675544332b1f397a ) );
+      }
+      else {
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x7a39 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x7a39 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x7a39 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x7a39 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int16_t( 0x7a39 ) ) == std::int16_t( 0x397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint16_t( 0x7a39 ) ) == std::uint16_t( 0x397a ) );
 
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x7a391f2b ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x7a391f2b ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x2b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x2b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x7a391f2b ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x7a391f2b ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x2b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x2b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x7a391f2b ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x7a391f2b ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x2b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x2b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x7a391f2b ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x7a391f2b ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int32_t( 0x7a391f2b ) ) == std::int32_t( 0x2b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint32_t( 0x7a391f2b ) ) == std::uint32_t( 0x2b1f397a ) );
 
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x7a391f2b33445567 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x7a391f2b33445567 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x675544332b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x675544332b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x7a391f2b33445567 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x7a391f2b33445567 ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x675544332b1f397a ) );
-            TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x675544332b1f397a ) );
-         }
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x7a391f2b33445567 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_le( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x7a391f2b33445567 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x675544332b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::h_to_be( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x675544332b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x7a391f2b33445567 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::le_to_h( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x7a391f2b33445567 ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::int64_t( 0x7a391f2b33445567 ) ) == std::int64_t( 0x675544332b1f397a ) );
+         TAO_PEGTL_TEST_ASSERT( internal::be_to_h( std::uint64_t( 0x7a391f2b33445567 ) ) == std::uint64_t( 0x675544332b1f397a ) );
       }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/internal_file_mapper.cpp b/packages/PEGTL/src/test/pegtl/internal_file_mapper.cpp
index 5e6eb95c0f0d29d4c61f4996656b67c04fca0c53..be408e037a3fb16f1656e7d1a2829aa05560015d 100644
--- a/packages/PEGTL/src/test/pegtl/internal_file_mapper.cpp
+++ b/packages/PEGTL/src/test/pegtl/internal_file_mapper.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <tao/pegtl/file_input.hpp>
@@ -7,28 +7,24 @@
 
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         try {
-            internal::file_mapper dummy( "include" );
-            std::cerr << "pegtl: unit test failed for [ internal::file_mapper ]" << std::endl;
-            ++failed;
-         }
-         catch( const input_error& ) {
-         }
-         catch( ... ) {
-            std::cerr << "pegtl: unit test failed for [ internal::file_mapper ] with unexpected exception" << std::endl;
-            ++failed;
-         }
+      try {
+         internal::file_mapper dummy( "include" );
+         std::cerr << "pegtl: unit test failed for [ internal::file_mapper ]" << std::endl;
+         ++failed;
       }
+      catch( const std::system_error& e ) {
+      }
+      catch( ... ) {
+         std::cerr << "pegtl: unit test failed for [ internal::file_mapper ] with unexpected exception" << std::endl;
+         ++failed;
+      }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
 
diff --git a/packages/PEGTL/src/test/pegtl/internal_file_opener.cpp b/packages/PEGTL/src/test/pegtl/internal_file_opener.cpp
index a0641b8a52bd1492efbcb6a14ea3ce978e1e0fdb..aa1134b5afe2bcc96f8ae7e4ce4ff5c794aa27c2 100644
--- a/packages/PEGTL/src/test/pegtl/internal_file_opener.cpp
+++ b/packages/PEGTL/src/test/pegtl/internal_file_opener.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <tao/pegtl/file_input.hpp>
@@ -7,26 +7,23 @@
 
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         const internal::file_opener fo( "Makefile" );
-         ::close( fo.m_fd );  // Provoke exception, nobody would normally do this.
-         try {
-            fo.size();
-            std::cerr << "pegtl: unit test failed for [ internal::file_opener ] " << std::endl;
-            ++failed;
-         }
-         catch( const std::exception& ) {
-         }
-      }
+      const internal::file_opener fo( "Makefile" );
+      ::close( fo.m_fd );  // Provoke exception, nobody would normally do this.
+      try {
+         (void)fo.size();  // expected to throw
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+         std::cerr << "pegtl: unit test failed for [ internal::file_opener ] " << std::endl;
+         ++failed;
+      }
+      catch( const std::exception& ) {
+      }
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
 
diff --git a/packages/PEGTL/src/test/pegtl/main.hpp b/packages/PEGTL/src/test/pegtl/main.hpp
index 92a79e4fc76994b127715dc8bb446e285d278e4a..c72e13b031452322b40b9e0080ff7cc515aefda8 100644
--- a/packages/PEGTL/src/test/pegtl/main.hpp
+++ b/packages/PEGTL/src/test/pegtl/main.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_MAIN_HPP  // NOLINT
@@ -9,12 +9,12 @@
 
 int main( int /*unused*/, char** argv )
 {
-   tao::TAO_PEGTL_NAMESPACE::unit_test();
+   TAO_PEGTL_NAMESPACE::unit_test();
 
-   if( tao::TAO_PEGTL_NAMESPACE::failed != 0 ) {
-      std::cerr << "pegtl: unit test " << argv[ 0 ] << " failed " << tao::TAO_PEGTL_NAMESPACE::failed << std::endl;
+   if( TAO_PEGTL_NAMESPACE::failed != 0 ) {
+      std::cerr << "pegtl: unit test " << argv[ 0 ] << " failed " << TAO_PEGTL_NAMESPACE::failed << std::endl;
    }
-   return ( tao::TAO_PEGTL_NAMESPACE::failed == 0 ) ? EXIT_SUCCESS : EXIT_FAILURE;
+   return ( TAO_PEGTL_NAMESPACE::failed == 0 ) ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 
 #endif
diff --git a/packages/PEGTL/src/test/pegtl/pegtl_string_t.cpp b/packages/PEGTL/src/test/pegtl/pegtl_string_t.cpp
index f8bde77e2a57b1103d41c8c0f6d22c31ae94b251..0a7c584397bc0429b59633cc8ea9108ca38d2452 100644
--- a/packages/PEGTL/src/test/pegtl/pegtl_string_t.cpp
+++ b/packages/PEGTL/src/test/pegtl/pegtl_string_t.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <type_traits>
@@ -14,26 +14,25 @@ namespace test
    {
    };
 
-   struct foobar : tao::TAO_PEGTL_NAMESPACE::sor< TAO_PEGTL_STRING( "foo" ), TAO_PEGTL_STRING( "bar" ) >
+   struct foobar : TAO_PEGTL_NAMESPACE::sor< TAO_PEGTL_STRING( "foo" ), TAO_PEGTL_STRING( "bar" ) >
    {
    };
 
-   static_assert( std::is_same< TAO_PEGTL_STRING( "Hello" ), tao::TAO_PEGTL_NAMESPACE::string< 'H', 'e', 'l', 'l', 'o' > >::value, "TAO_PEGTL_STRING broken" );
-   static_assert( !std::is_same< TAO_PEGTL_ISTRING( "Hello" ), tao::TAO_PEGTL_NAMESPACE::string< 'H', 'e', 'l', 'l', 'o' > >::value, "TAO_PEGTL_ISTRING broken" );
-   static_assert( std::is_same< TAO_PEGTL_ISTRING( "Hello" ), tao::TAO_PEGTL_NAMESPACE::istring< 'H', 'e', 'l', 'l', 'o' > >::value, "TAO_PEGTL_ISTRING broken" );
+   static_assert( std::is_same_v< TAO_PEGTL_STRING( "Hello" ), TAO_PEGTL_NAMESPACE::string< 'H', 'e', 'l', 'l', 'o' > > );
+   static_assert( !std::is_same_v< TAO_PEGTL_ISTRING( "Hello" ), TAO_PEGTL_NAMESPACE::string< 'H', 'e', 'l', 'l', 'o' > > );
+   static_assert( std::is_same_v< TAO_PEGTL_ISTRING( "Hello" ), TAO_PEGTL_NAMESPACE::istring< 'H', 'e', 'l', 'l', 'o' > > );
 
-   static_assert( std::is_same< TAO_PEGTL_KEYWORD( "private" ), tao::TAO_PEGTL_NAMESPACE::keyword< 'p', 'r', 'i', 'v', 'a', 't', 'e' > >::value, "TAO_PEGTL_KEYWORD broken" );
+   static_assert( std::is_same_v< TAO_PEGTL_KEYWORD( "private" ), TAO_PEGTL_NAMESPACE::keyword< 'p', 'r', 'i', 'v', 'a', 't', 'e' > > );
 
    // Strings may even contain embedded nulls
 
-   static_assert( std::is_same< TAO_PEGTL_STRING( "Hello, w\0rld!" ), tao::TAO_PEGTL_NAMESPACE::string< 'H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 0, 'r', 'l', 'd', '!' > >::value, "TAO_PEGTL_STRING broken" );
+   static_assert( std::is_same_v< TAO_PEGTL_STRING( "Hello, w\0rld!" ), TAO_PEGTL_NAMESPACE::string< 'H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 0, 'r', 'l', 'd', '!' > > );
 
    // The strings currently have a maximum length of 512 characters.
 
-   using namespace tao::TAO_PEGTL_NAMESPACE::alphabet;  // NOLINT
-   static_assert( std::is_same< TAO_PEGTL_STRING( "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" ),
-                                tao::TAO_PEGTL_NAMESPACE::string< a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z > >::value,
-                  "TAO_PEGTL_STRING broken" );
+   using namespace TAO_PEGTL_NAMESPACE::alphabet;  // NOLINT
+   static_assert( std::is_same_v< TAO_PEGTL_STRING( "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" ),
+                                  TAO_PEGTL_NAMESPACE::string< a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z > > );
 
 }  // namespace test
 
diff --git a/packages/PEGTL/src/test/pegtl/position.cpp b/packages/PEGTL/src/test/pegtl/position.cpp
index 2aa309c325cbfb93ff03cf3b4faf03f37809b9e9..1ea3ed24051583d5c99d1b8c18935ac7c7cc588a 100644
--- a/packages/PEGTL/src/test/pegtl/position.cpp
+++ b/packages/PEGTL/src/test/pegtl/position.cpp
@@ -1,182 +1,174 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 
 #include <tao/pegtl/internal/cstring_reader.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct buffer_input_t
+      : buffer_input< internal::cstring_reader >
    {
-      struct buffer_input_t
-         : buffer_input< internal::cstring_reader >
+      buffer_input_t( const std::string& in_string, const std::string& in_source )
+         : buffer_input< internal::cstring_reader >( in_source, 42, in_string.c_str() )
       {
-         buffer_input_t( const std::string& in_string, const std::string& in_source )
-            : buffer_input< internal::cstring_reader >( in_source, 42, in_string.c_str() )
-         {
-         }
-      };
-
-      template< typename Rule, typename Input = memory_input<> >
-      void test_matches_lf()
-      {
-         static const std::string s1 = "\n";
+      }
+   };
 
-         Input i1( s1, __FUNCTION__ );
+   template< typename Rule, typename Input = memory_input<> >
+   void test_matches_lf()
+   {
+      static const std::string s1 = "\n";
 
-         TAO_PEGTL_TEST_ASSERT( parse< Rule >( i1 ) );
-         TAO_PEGTL_TEST_ASSERT( i1.line() == 2 );
-         TAO_PEGTL_TEST_ASSERT( i1.byte_in_line() == 0 );
-      }
+      Input i1( s1, __FUNCTION__ );
 
-      template< typename Rule, typename Input = memory_input<> >
-      void test_matches_other( const std::string& s2 )
-      {
-         TAO_PEGTL_TEST_ASSERT( s2.size() == 1 );
+      TAO_PEGTL_TEST_ASSERT( parse< Rule >( i1 ) );
+      TAO_PEGTL_TEST_ASSERT( i1.line() == 2 );
+      TAO_PEGTL_TEST_ASSERT( i1.byte_in_line() == 0 );
+   }
 
-         Input i2( s2, __FUNCTION__ );
+   template< typename Rule, typename Input = memory_input<> >
+   void test_matches_other( const std::string& s2 )
+   {
+      TAO_PEGTL_TEST_ASSERT( s2.size() == 1 );
 
-         TAO_PEGTL_TEST_ASSERT( parse< Rule >( i2 ) );
-         TAO_PEGTL_TEST_ASSERT( i2.line() == 1 );
-         TAO_PEGTL_TEST_ASSERT( i2.byte_in_line() == 1 );
-      }
+      Input i2( s2, __FUNCTION__ );
 
-      template< typename Rule, typename Input = memory_input<> >
-      void test_mismatch( const std::string& s3 )
-      {
-         TAO_PEGTL_TEST_ASSERT( s3.size() == 1 );
+      TAO_PEGTL_TEST_ASSERT( parse< Rule >( i2 ) );
+      TAO_PEGTL_TEST_ASSERT( i2.line() == 1 );
+      TAO_PEGTL_TEST_ASSERT( i2.byte_in_line() == 1 );
+   }
 
-         Input i3( s3, __FUNCTION__ );
+   template< typename Rule, typename Input = memory_input<> >
+   void test_mismatch( const std::string& s3 )
+   {
+      TAO_PEGTL_TEST_ASSERT( s3.size() == 1 );
 
-         TAO_PEGTL_TEST_ASSERT( !parse< Rule >( i3 ) );
-         TAO_PEGTL_TEST_ASSERT( i3.line() == 1 );
-         TAO_PEGTL_TEST_ASSERT( i3.byte_in_line() == 0 );
-      }
+      Input i3( s3, __FUNCTION__ );
 
-      struct outer_grammar
-         : must< two< 'a' >, two< 'b' >, two< 'c' >, eof >
-      {
-      };
+      TAO_PEGTL_TEST_ASSERT( !parse< Rule >( i3 ) );
+      TAO_PEGTL_TEST_ASSERT( i3.line() == 1 );
+      TAO_PEGTL_TEST_ASSERT( i3.byte_in_line() == 0 );
+   }
 
-      struct inner_grammar
-         : must< one< 'd' >, two< 'e' >, eof >
-      {
-      };
+   struct outer_grammar
+      : must< two< 'a' >, two< 'b' >, two< 'c' >, eof >
+   {};
 
-      template< typename Rule >
-      struct outer_action
-         : nothing< Rule >
-      {
-      };
+   struct inner_grammar
+      : must< one< 'd' >, two< 'e' >, eof >
+   {};
 
-      template<>
-      struct outer_action< two< 'b' > >
-      {
-         template< typename Input >
-         static void apply( const Input& oi )
-         {
-            const auto p = oi.position();
-            TAO_PEGTL_TEST_ASSERT( p.source == "outer" );
-            TAO_PEGTL_TEST_ASSERT( p.byte == 2 );
-            TAO_PEGTL_TEST_ASSERT( p.line == 1 );
-            TAO_PEGTL_TEST_ASSERT( p.byte_in_line == 2 );
-            memory_input<> in( "dFF", "inner" );
-            parse_nested< inner_grammar >( oi, in );
-         }
-      };
-
-      template< typename Input = memory_input<> >
-      void test_nested()
-      {
-         try {
-            memory_input<> oi( "aabbcc", "outer" );
-            parse< outer_grammar, outer_action >( oi );
-         }
-         catch( const parse_error& e ) {
-            TAO_PEGTL_TEST_ASSERT( e.positions.size() == 2 );
-            TAO_PEGTL_TEST_ASSERT( e.positions[ 0 ].source == "inner" );
-            TAO_PEGTL_TEST_ASSERT( e.positions[ 0 ].byte == 1 );
-            TAO_PEGTL_TEST_ASSERT( e.positions[ 0 ].line == 1 );
-            TAO_PEGTL_TEST_ASSERT( e.positions[ 0 ].byte_in_line == 1 );
-            TAO_PEGTL_TEST_ASSERT( e.positions[ 1 ].source == "outer" );
-            TAO_PEGTL_TEST_ASSERT( e.positions[ 1 ].byte == 2 );
-            TAO_PEGTL_TEST_ASSERT( e.positions[ 1 ].line == 1 );
-            TAO_PEGTL_TEST_ASSERT( e.positions[ 1 ].byte_in_line == 2 );
-         }
-      }
+   template< typename Rule >
+   struct outer_action
+   {};
 
-      void unit_test()
+   template<>
+   struct outer_action< two< 'b' > >
+   {
+      template< typename Input >
+      static void apply( const Input& oi )
       {
-         test_matches_lf< any >();
-         test_matches_lf< any, buffer_input_t >();
-         test_matches_other< any >( " " );
-         test_matches_other< any, buffer_input_t >( " " );
-
-         test_matches_lf< one< '\n' > >();
-         test_matches_lf< one< '\n' >, buffer_input_t >();
-         test_mismatch< one< '\n' > >( " " );
-         test_mismatch< one< '\n' >, buffer_input_t >( " " );
-
-         test_matches_lf< one< ' ', '\n' > >();
-         test_matches_lf< one< ' ', '\n' >, buffer_input_t >();
-         test_matches_other< one< ' ', '\n' > >( " " );
-         test_matches_other< one< ' ', '\n' >, buffer_input_t >( " " );
-
-         test_matches_lf< one< ' ', '\n', 'b' > >();
-         test_matches_lf< one< ' ', '\n', 'b' >, buffer_input_t >();
-         test_matches_other< one< ' ', '\n', 'b' > >( " " );
-         test_matches_other< one< ' ', '\n', 'b' >, buffer_input_t >( " " );
-
-         test_matches_lf< string< '\n' > >();
-         test_matches_lf< string< '\n' >, buffer_input_t >();
-         test_mismatch< string< '\n' > >( " " );
-         test_mismatch< string< '\n' >, buffer_input_t >( " " );
-
-         test_matches_other< string< ' ' > >( " " );
-         test_matches_other< string< ' ' >, buffer_input_t >( " " );
-         test_mismatch< string< ' ' > >( "\n" );
-         test_mismatch< string< ' ' >, buffer_input_t >( "\n" );
-
-         test_matches_lf< range< 8, 33 > >();
-         test_matches_lf< range< 8, 33 >, buffer_input_t >();
-         test_matches_other< range< 8, 33 > >( " " );
-         test_matches_other< range< 8, 33 >, buffer_input_t >( " " );
-
-         test_mismatch< range< 11, 30 > >( "\n" );
-         test_mismatch< range< 11, 30 >, buffer_input_t >( "\n" );
-         test_mismatch< range< 11, 30 > >( " " );
-         test_mismatch< range< 11, 30 >, buffer_input_t >( " " );
-
-         test_matches_lf< not_range< 20, 30 > >();
-         test_matches_lf< not_range< 20, 30 >, buffer_input_t >();
-         test_matches_other< not_range< 20, 30 > >( " " );
-         test_matches_other< not_range< 20, 30 >, buffer_input_t >( " " );
-
-         test_mismatch< not_range< 5, 35 > >( "\n" );
-         test_mismatch< not_range< 5, 35 >, buffer_input_t >( "\n" );
-         test_mismatch< not_range< 5, 35 > >( " " );
-         test_mismatch< not_range< 5, 35 >, buffer_input_t >( " " );
-
-         test_matches_lf< ranges< 'a', 'z', 8, 33, 'A', 'Z' > >();
-         test_matches_lf< ranges< 'a', 'z', 8, 33, 'A', 'Z' >, buffer_input_t >();
-         test_matches_other< ranges< 'a', 'z', 8, 33, 'A', 'Z' > >( "N" );
-         test_mismatch< ranges< 'a', 'z', 8, 33, 'A', 'Z' > >( "9" );
-         test_mismatch< ranges< 'a', 'z', 8, 33, 'A', 'Z' >, buffer_input_t >( "9" );
-
-         test_matches_lf< ranges< 'a', 'z', 'A', 'Z', '\n' > >();
-         test_matches_lf< ranges< 'a', 'z', 'A', 'Z', '\n' >, buffer_input_t >();
-         test_matches_other< ranges< 'a', 'z', 'A', 'Z', '\n' > >( "P" );
-         test_matches_other< ranges< 'a', 'z', 'A', 'Z', '\n' >, buffer_input_t >( "P" );
-         test_mismatch< ranges< 'a', 'z', 'A', 'Z', '\n' > >( "8" );
-         test_mismatch< ranges< 'a', 'z', 'A', 'Z', '\n' >, buffer_input_t >( "8" );
-
-         test_nested<>();
-         test_nested< buffer_input_t >();
+         const auto p = oi.position();
+         TAO_PEGTL_TEST_ASSERT( p.source == "outer" );
+         TAO_PEGTL_TEST_ASSERT( p.byte == 2 );
+         TAO_PEGTL_TEST_ASSERT( p.line == 1 );
+         TAO_PEGTL_TEST_ASSERT( p.byte_in_line == 2 );
+         memory_input in( "dFF", "inner" );
+         parse_nested< inner_grammar >( oi, in );
       }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename Input = memory_input<> >
+   void test_nested()
+   {
+      try {
+         memory_input oi( "aabbcc", "outer" );
+         parse< outer_grammar, outer_action >( oi );
+      }
+      catch( const parse_error& e ) {
+         TAO_PEGTL_TEST_ASSERT( e.positions.size() == 2 );
+         TAO_PEGTL_TEST_ASSERT( e.positions[ 0 ].source == "inner" );
+         TAO_PEGTL_TEST_ASSERT( e.positions[ 0 ].byte == 1 );
+         TAO_PEGTL_TEST_ASSERT( e.positions[ 0 ].line == 1 );
+         TAO_PEGTL_TEST_ASSERT( e.positions[ 0 ].byte_in_line == 1 );
+         TAO_PEGTL_TEST_ASSERT( e.positions[ 1 ].source == "outer" );
+         TAO_PEGTL_TEST_ASSERT( e.positions[ 1 ].byte == 2 );
+         TAO_PEGTL_TEST_ASSERT( e.positions[ 1 ].line == 1 );
+         TAO_PEGTL_TEST_ASSERT( e.positions[ 1 ].byte_in_line == 2 );
+      }
+   }
 
-}  // namespace tao
+   void unit_test()
+   {
+      test_matches_lf< any >();
+      test_matches_lf< any, buffer_input_t >();
+      test_matches_other< any >( " " );
+      test_matches_other< any, buffer_input_t >( " " );
+
+      test_matches_lf< one< '\n' > >();
+      test_matches_lf< one< '\n' >, buffer_input_t >();
+      test_mismatch< one< '\n' > >( " " );
+      test_mismatch< one< '\n' >, buffer_input_t >( " " );
+
+      test_matches_lf< one< ' ', '\n' > >();
+      test_matches_lf< one< ' ', '\n' >, buffer_input_t >();
+      test_matches_other< one< ' ', '\n' > >( " " );
+      test_matches_other< one< ' ', '\n' >, buffer_input_t >( " " );
+
+      test_matches_lf< one< ' ', '\n', 'b' > >();
+      test_matches_lf< one< ' ', '\n', 'b' >, buffer_input_t >();
+      test_matches_other< one< ' ', '\n', 'b' > >( " " );
+      test_matches_other< one< ' ', '\n', 'b' >, buffer_input_t >( " " );
+
+      test_matches_lf< string< '\n' > >();
+      test_matches_lf< string< '\n' >, buffer_input_t >();
+      test_mismatch< string< '\n' > >( " " );
+      test_mismatch< string< '\n' >, buffer_input_t >( " " );
+
+      test_matches_other< string< ' ' > >( " " );
+      test_matches_other< string< ' ' >, buffer_input_t >( " " );
+      test_mismatch< string< ' ' > >( "\n" );
+      test_mismatch< string< ' ' >, buffer_input_t >( "\n" );
+
+      test_matches_lf< range< 8, 33 > >();
+      test_matches_lf< range< 8, 33 >, buffer_input_t >();
+      test_matches_other< range< 8, 33 > >( " " );
+      test_matches_other< range< 8, 33 >, buffer_input_t >( " " );
+
+      test_mismatch< range< 11, 30 > >( "\n" );
+      test_mismatch< range< 11, 30 >, buffer_input_t >( "\n" );
+      test_mismatch< range< 11, 30 > >( " " );
+      test_mismatch< range< 11, 30 >, buffer_input_t >( " " );
+
+      test_matches_lf< not_range< 20, 30 > >();
+      test_matches_lf< not_range< 20, 30 >, buffer_input_t >();
+      test_matches_other< not_range< 20, 30 > >( " " );
+      test_matches_other< not_range< 20, 30 >, buffer_input_t >( " " );
+
+      test_mismatch< not_range< 5, 35 > >( "\n" );
+      test_mismatch< not_range< 5, 35 >, buffer_input_t >( "\n" );
+      test_mismatch< not_range< 5, 35 > >( " " );
+      test_mismatch< not_range< 5, 35 >, buffer_input_t >( " " );
+
+      test_matches_lf< ranges< 'a', 'z', 8, 33, 'A', 'Z' > >();
+      test_matches_lf< ranges< 'a', 'z', 8, 33, 'A', 'Z' >, buffer_input_t >();
+      test_matches_other< ranges< 'a', 'z', 8, 33, 'A', 'Z' > >( "N" );
+      test_mismatch< ranges< 'a', 'z', 8, 33, 'A', 'Z' > >( "9" );
+      test_mismatch< ranges< 'a', 'z', 8, 33, 'A', 'Z' >, buffer_input_t >( "9" );
+
+      test_matches_lf< ranges< 'a', 'z', 'A', 'Z', '\n' > >();
+      test_matches_lf< ranges< 'a', 'z', 'A', 'Z', '\n' >, buffer_input_t >();
+      test_matches_other< ranges< 'a', 'z', 'A', 'Z', '\n' > >( "P" );
+      test_matches_other< ranges< 'a', 'z', 'A', 'Z', '\n' >, buffer_input_t >( "P" );
+      test_mismatch< ranges< 'a', 'z', 'A', 'Z', '\n' > >( "8" );
+      test_mismatch< ranges< 'a', 'z', 'A', 'Z', '\n' >, buffer_input_t >( "8" );
+
+      test_nested<>();
+      test_nested< buffer_input_t >();
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/result_type.hpp b/packages/PEGTL/src/test/pegtl/result_type.hpp
index 80473913458bba60925adbab2309af8bb03771a2..1d5c89c4cbce107a7fc9fcffcd2f03801c7fbf40 100644
--- a/packages/PEGTL/src/test/pegtl/result_type.hpp
+++ b/packages/PEGTL/src/test/pegtl/result_type.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_RESULT_TYPE_HPP  // NOLINT
@@ -8,32 +8,28 @@
 
 #include <tao/pegtl/config.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   enum class result_type
    {
-      enum class result_type
-      {
-         SUCCESS = 1,
-         LOCAL_FAILURE = 0,
-         GLOBAL_FAILURE = -1
-      };
+      success = 1,
+      local_failure = 0,
+      global_failure = -1
+   };
 
-      inline std::ostream& operator<<( std::ostream& o, const result_type t )
-      {
-         switch( t ) {
-            case result_type::SUCCESS:
-               return o << "success";
-            case result_type::LOCAL_FAILURE:
-               return o << "local failure";
-            case result_type::GLOBAL_FAILURE:
-               return o << "global failure";
-         }
-         return o << int( t );
+   inline std::ostream& operator<<( std::ostream& o, const result_type t )
+   {
+      switch( t ) {
+         case result_type::success:
+            return o << "success";
+         case result_type::local_failure:
+            return o << "local failure";
+         case result_type::global_failure:
+            return o << "global failure";
       }
+      return o << int( t );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/src/test/pegtl/rule_action.cpp b/packages/PEGTL/src/test/pegtl/rule_action.cpp
index 9c4dce78c2a79d3185fe6b9bbd231b7b2720d5ee..c7429f89164e51e096df78a9ac5ae4889d17c05d 100644
--- a/packages/PEGTL/src/test/pegtl/rule_action.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_action.cpp
@@ -1,23 +1,19 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_seqs.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      template< typename... Rules >
-      using test_action_rule = action< nothing, Rules... >;
-
-      void unit_test()
-      {
-         verify_seqs< test_action_rule >();
-      }
+   template< typename... Rules >
+   using test_action_rule = action< nothing, Rules... >;
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
+   {
+      verify_seqs< test_action_rule >();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_apply.cpp b/packages/PEGTL/src/test/pegtl/rule_apply.cpp
index 4dab0a779b418d7c79b7fb1444140f6c0528e778..4f64066e6b903558b2462d51867d5367623be058 100644
--- a/packages/PEGTL/src/test/pegtl/rule_apply.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_apply.cpp
@@ -1,98 +1,94 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace test1
    {
-      namespace test1
+      struct action_a
       {
-         struct action_a
+         template< typename Input >
+         static void apply( const Input& /*unused*/, int& r, int& s )
          {
-            template< typename Input >
-            static void apply( const Input& /*unused*/, int& r, int& s )
-            {
-               TAO_PEGTL_TEST_ASSERT( !r );
-               TAO_PEGTL_TEST_ASSERT( !s );
-               r += 1;
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( !r );
+            TAO_PEGTL_TEST_ASSERT( !s );
+            r += 1;
+         }
+      };
 
-         struct action_b
+      struct action_b
+      {
+         template< typename Input >
+         static bool apply( const Input& /*unused*/, int& r, int& s )
          {
-            template< typename Input >
-            static bool apply( const Input& /*unused*/, int& r, int& s )
-            {
-               TAO_PEGTL_TEST_ASSERT( !s );
-               TAO_PEGTL_TEST_ASSERT( r == 1 );
-               s += 2;
-               return true;
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( !s );
+            TAO_PEGTL_TEST_ASSERT( r == 1 );
+            s += 2;
+            return true;
+         }
+      };
 
-         struct action2_a
+      struct action2_a
+      {
+         template< typename Input >
+         static void apply( const Input& /*unused*/, bool& state_b )
          {
-            template< typename Input >
-            static void apply( const Input& /*unused*/, bool& state_b )
-            {
-               TAO_PEGTL_TEST_ASSERT( !state_b );
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( !state_b );
+         }
+      };
 
-         struct action2_b
+      struct action2_b
+      {
+         template< typename Input >
+         static bool apply( const Input& /*unused*/, bool& state_b )
          {
-            template< typename Input >
-            static bool apply( const Input& /*unused*/, bool& state_b )
-            {
-               TAO_PEGTL_TEST_ASSERT( !state_b );
-               state_b = true;
-               return false;
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( !state_b );
+            state_b = true;
+            return false;
+         }
+      };
 
-         struct action2_c
+      struct action2_c
+      {
+         template< typename Input >
+         static void apply( const Input& /*unused*/, bool& /*unused*/ )
          {
-            template< typename Input >
-            static void apply( const Input& /*unused*/, bool& /*unused*/ )
-            {
-               TAO_PEGTL_TEST_ASSERT( false );
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( false );
+         }
+      };
 
-      }  // namespace test1
+   }  // namespace test1
 
-      void unit_test()
-      {
-         int state_r = 0;
-         int state_s = 0;
-         parse< must< apply< test1::action_a, test1::action_b > > >( memory_input<>( "", __FUNCTION__ ), state_r, state_s );
-         TAO_PEGTL_TEST_ASSERT( state_r == 1 );
-         TAO_PEGTL_TEST_ASSERT( state_s == 2 );
-         parse< must< disable< apply< test1::action_a, test1::action_b > > > >( memory_input<>( "", __FUNCTION__ ), state_r, state_s );
-         TAO_PEGTL_TEST_ASSERT( state_r == 1 );
-         TAO_PEGTL_TEST_ASSERT( state_s == 2 );
+   void unit_test()
+   {
+      int state_r = 0;
+      int state_s = 0;
+      parse< must< apply< test1::action_a, test1::action_b > > >( memory_input( "", __FUNCTION__ ), state_r, state_s );
+      TAO_PEGTL_TEST_ASSERT( state_r == 1 );
+      TAO_PEGTL_TEST_ASSERT( state_s == 2 );
+      parse< must< disable< apply< test1::action_a, test1::action_b > > > >( memory_input( "", __FUNCTION__ ), state_r, state_s );
+      TAO_PEGTL_TEST_ASSERT( state_r == 1 );
+      TAO_PEGTL_TEST_ASSERT( state_s == 2 );
 
-         bool state_b = false;
-         const bool result = parse< apply< test1::action2_a, test1::action2_b, test1::action2_c > >( memory_input<>( "", __FUNCTION__ ), state_b );
-         TAO_PEGTL_TEST_ASSERT( !result );
-         TAO_PEGTL_TEST_ASSERT( state_b );
+      bool state_b = false;
+      const bool result = parse< apply< test1::action2_a, test1::action2_b, test1::action2_c > >( memory_input( "", __FUNCTION__ ), state_b );
+      TAO_PEGTL_TEST_ASSERT( !result );
+      TAO_PEGTL_TEST_ASSERT( state_b );
 
-         verify_analyze< apply<> >( __LINE__, __FILE__, false, false );
+      verify_analyze< apply<> >( __LINE__, __FILE__, false, false );
 
-         verify_rule< apply<> >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
+      verify_rule< apply<> >( __LINE__, __FILE__, "", result_type::success, 0 );
 
-         for( char i = 1; i < 127; ++i ) {
-            char t[] = { i, 0 };
-            verify_rule< apply<> >( __LINE__, __FILE__, std::string( t ), result_type::SUCCESS, 1 );
-         }
+      for( char i = 1; i < 127; ++i ) {
+         char t[] = { i, 0 };  // NOLINT
+         verify_rule< apply<> >( __LINE__, __FILE__, std::string( t ), result_type::success, 1 );
       }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_apply0.cpp b/packages/PEGTL/src/test/pegtl/rule_apply0.cpp
index 83dc519cefe9bb491a4c1d6d370a187bebecbd65..e3b27ee2f70d5a44512b26213c317eeaced3e403 100644
--- a/packages/PEGTL/src/test/pegtl/rule_apply0.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_apply0.cpp
@@ -1,93 +1,89 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace test1
    {
-      namespace test1
+      struct action_a
       {
-         struct action_a
+         static void apply0( int& r, int& s )
          {
-            static void apply0( int& r, int& s )
-            {
-               TAO_PEGTL_TEST_ASSERT( !r );
-               TAO_PEGTL_TEST_ASSERT( !s );
-               r += 1;
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( !r );
+            TAO_PEGTL_TEST_ASSERT( !s );
+            r += 1;
+         }
+      };
 
-         struct action_b
+      struct action_b
+      {
+         static bool apply0( int& r, int& s )
          {
-            static bool apply0( int& r, int& s )
-            {
-               TAO_PEGTL_TEST_ASSERT( !s );
-               TAO_PEGTL_TEST_ASSERT( r == 1 );
-               s += 2;
-               return true;
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( !s );
+            TAO_PEGTL_TEST_ASSERT( r == 1 );
+            s += 2;
+            return true;
+         }
+      };
 
-         struct action2_a
+      struct action2_a
+      {
+         static void apply0( bool& state_b )
          {
-            static void apply0( bool& state_b )
-            {
-               TAO_PEGTL_TEST_ASSERT( !state_b );
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( !state_b );
+         }
+      };
 
-         struct action2_b
+      struct action2_b
+      {
+         static bool apply0( bool& state_b )
          {
-            static bool apply0( bool& state_b )
-            {
-               TAO_PEGTL_TEST_ASSERT( !state_b );
-               state_b = true;
-               return false;
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( !state_b );
+            state_b = true;
+            return false;
+         }
+      };
 
-         struct action2_c
+      struct action2_c
+      {
+         static void apply0( bool& /*unused*/ )
          {
-            static void apply0( bool& /*unused*/ )
-            {
-               TAO_PEGTL_TEST_ASSERT( false );
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( false );
+         }
+      };
 
-      }  // namespace test1
+   }  // namespace test1
 
-      void unit_test()
-      {
-         int state_r = 0;
-         int state_s = 0;
-         parse< must< apply0< test1::action_a, test1::action_b > > >( memory_input<>( "", __FUNCTION__ ), state_r, state_s );
-         TAO_PEGTL_TEST_ASSERT( state_r == 1 );
-         TAO_PEGTL_TEST_ASSERT( state_s == 2 );
-         parse< must< disable< apply< test1::action_a, test1::action_b > > > >( memory_input<>( "", __FUNCTION__ ), state_r, state_s );
-         TAO_PEGTL_TEST_ASSERT( state_r == 1 );
-         TAO_PEGTL_TEST_ASSERT( state_s == 2 );
+   void unit_test()
+   {
+      int state_r = 0;
+      int state_s = 0;
+      parse< must< apply0< test1::action_a, test1::action_b > > >( memory_input( "", __FUNCTION__ ), state_r, state_s );
+      TAO_PEGTL_TEST_ASSERT( state_r == 1 );
+      TAO_PEGTL_TEST_ASSERT( state_s == 2 );
+      parse< must< disable< apply< test1::action_a, test1::action_b > > > >( memory_input( "", __FUNCTION__ ), state_r, state_s );
+      TAO_PEGTL_TEST_ASSERT( state_r == 1 );
+      TAO_PEGTL_TEST_ASSERT( state_s == 2 );
 
-         bool state_b = false;
-         const bool result = parse< apply0< test1::action2_a, test1::action2_b, test1::action2_c > >( memory_input<>( "", __FUNCTION__ ), state_b );
-         TAO_PEGTL_TEST_ASSERT( !result );
-         TAO_PEGTL_TEST_ASSERT( state_b );
+      bool state_b = false;
+      const bool result = parse< apply0< test1::action2_a, test1::action2_b, test1::action2_c > >( memory_input( "", __FUNCTION__ ), state_b );
+      TAO_PEGTL_TEST_ASSERT( !result );
+      TAO_PEGTL_TEST_ASSERT( state_b );
 
-         verify_analyze< apply0<> >( __LINE__, __FILE__, false, false );
+      verify_analyze< apply0<> >( __LINE__, __FILE__, false, false );
 
-         verify_rule< apply0<> >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
+      verify_rule< apply0<> >( __LINE__, __FILE__, "", result_type::success, 0 );
 
-         for( char i = 1; i < 127; ++i ) {
-            char t[] = { i, 0 };
-            verify_rule< apply0<> >( __LINE__, __FILE__, std::string( t ), result_type::SUCCESS, 1 );
-         }
+      for( char i = 1; i < 127; ++i ) {
+         char t[] = { i, 0 };  // NOLINT
+         verify_rule< apply0<> >( __LINE__, __FILE__, std::string( t ), result_type::success, 1 );
       }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_at.cpp b/packages/PEGTL/src/test/pegtl/rule_at.cpp
index bd4f5d63e2cb6e5612e12fa699de1d87d8e5e0da..6f73c253b658ee6452ebbe7c741934c9f677400d 100644
--- a/packages/PEGTL/src/test/pegtl/rule_at.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_at.cpp
@@ -1,61 +1,55 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      int at_counter = 0;
+   int at_counter = 0;
+
+   template< typename Rule >
+   struct at_action
+   {};
 
-      template< typename Rule >
-      struct at_action
-         : public nothing< Rule >
+   template<>
+   struct at_action< any >
+   {
+      template< typename Input >
+      static void apply( const Input& /*unused*/ )
       {
-      };
+         ++at_counter;
+      }
+   };
 
-      template<>
-      struct at_action< any >
+   void unit_test()
+   {
+      TAO_PEGTL_TEST_ASSERT( at_counter == 0 );
+
+      verify_analyze< at< eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< at< any > >( __LINE__, __FILE__, false, false );
+
+      verify_rule< at< eof > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< at< eof > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< at< any > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< at< any > >( __LINE__, __FILE__, "a", result_type::success, 1 );
+      verify_rule< at< any > >( __LINE__, __FILE__, "aa", result_type::success, 2 );
+      verify_rule< at< any > >( __LINE__, __FILE__, "aaaa", result_type::success, 4 );
+      verify_rule< must< at< alpha > > >( __LINE__, __FILE__, "1", result_type::global_failure, 1 );
+      verify_rule< must< at< alpha, alpha > > >( __LINE__, __FILE__, "a1a", result_type::global_failure, 3 );
       {
-         template< typename Input >
-         static void apply( const Input& /*unused*/ )
-         {
-            ++at_counter;
-         }
-      };
-
-      void unit_test()
+         memory_input in( "f", 1, __FILE__ );
+         parse< any, at_action >( in );
+         TAO_PEGTL_TEST_ASSERT( at_counter == 1 );
+      }
       {
-         TAO_PEGTL_TEST_ASSERT( at_counter == 0 );
-
-         verify_analyze< at< eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< at< any > >( __LINE__, __FILE__, false, false );
-
-         verify_rule< at< eof > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< at< eof > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< at< any > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< at< any > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
-         verify_rule< at< any > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 2 );
-         verify_rule< at< any > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 4 );
-         verify_rule< must< at< alpha > > >( __LINE__, __FILE__, "1", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< must< at< alpha, alpha > > >( __LINE__, __FILE__, "a1a", result_type::GLOBAL_FAILURE, 3 );
-         {
-            memory_input<> in( "f", 1, __FILE__ );
-            parse< any, at_action >( in );
-            TAO_PEGTL_TEST_ASSERT( at_counter == 1 );
-         }
-         {
-            memory_input<> in( "f", 1, __FILE__ );
-            parse< at< any >, at_action >( in );
-            TAO_PEGTL_TEST_ASSERT( at_counter == 1 );
-         }
+         memory_input in( "f", 1, __FILE__ );
+         parse< at< any >, at_action >( in );
+         TAO_PEGTL_TEST_ASSERT( at_counter == 1 );
       }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_bof.cpp b/packages/PEGTL/src/test/pegtl/rule_bof.cpp
index a2fc690ad6ee2426a30666e3a2e82ba8c0a8b57b..ff44dbef1d1413ba6ad53292673446b866036a0e 100644
--- a/packages/PEGTL/src/test/pegtl/rule_bof.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_bof.cpp
@@ -1,33 +1,29 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< bof >( __LINE__, __FILE__, false, false );
+      verify_analyze< bof >( __LINE__, __FILE__, false, false );
 
-         verify_rule< bof >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
+      verify_rule< bof >( __LINE__, __FILE__, "", result_type::success, 0 );
 
-         for( char i = 1; i < 127; ++i ) {
-            const char s[] = { i, 0 };
-            verify_rule< bof >( __LINE__, __FILE__, s, result_type::SUCCESS, 1 );
-         }
-         verify_rule< seq< alpha, bof > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< seq< alpha, bof > >( __LINE__, __FILE__, "ab", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< seq< alpha, bof, alpha > >( __LINE__, __FILE__, "ab", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< seq< alpha, eol, bof > >( __LINE__, __FILE__, "a\n", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< seq< alpha, eol, bof > >( __LINE__, __FILE__, "a\nb", result_type::LOCAL_FAILURE, 3 );
+      for( char i = 1; i < 127; ++i ) {
+         const char s[] = { i, 0 };  // NOLINT
+         verify_rule< bof >( __LINE__, __FILE__, s, result_type::success, 1 );
       }
+      verify_rule< seq< alpha, bof > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< seq< alpha, bof > >( __LINE__, __FILE__, "ab", result_type::local_failure, 2 );
+      verify_rule< seq< alpha, bof, alpha > >( __LINE__, __FILE__, "ab", result_type::local_failure, 2 );
+      verify_rule< seq< alpha, eol, bof > >( __LINE__, __FILE__, "a\n", result_type::local_failure, 2 );
+      verify_rule< seq< alpha, eol, bof > >( __LINE__, __FILE__, "a\nb", result_type::local_failure, 3 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_bol.cpp b/packages/PEGTL/src/test/pegtl/rule_bol.cpp
index b0e14d8982734fd3d70a2afd827f250617c5e1b2..60852c6d8aedcd1e97e3935733df98b701dcfd5b 100644
--- a/packages/PEGTL/src/test/pegtl/rule_bol.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_bol.cpp
@@ -1,32 +1,28 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< bol >( __LINE__, __FILE__, false, false );
+      verify_analyze< bol >( __LINE__, __FILE__, false, false );
 
-         verify_only< bol >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
+      verify_only< bol >( __LINE__, __FILE__, "", result_type::success, 0 );
 
-         for( char i = 1; i < 127; ++i ) {
-            const char s[] = { i, 0 };
-            verify_only< bol >( __LINE__, __FILE__, s, result_type::SUCCESS, 1 );
-         }
-         verify_only< seq< alpha, bol > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_only< seq< alpha, bol > >( __LINE__, __FILE__, "ab", result_type::LOCAL_FAILURE, 2 );
-         verify_only< seq< alpha, bol, alpha > >( __LINE__, __FILE__, "ab", result_type::LOCAL_FAILURE, 2 );
-         verify_only< seq< alpha, eol, bol, alpha, eof > >( __LINE__, __FILE__, "a\nb", result_type::SUCCESS, 0 );
+      for( char i = 1; i < 127; ++i ) {
+         const char s[] = { i, 0 };  // NOLINT
+         verify_only< bol >( __LINE__, __FILE__, s, result_type::success, 1 );
       }
+      verify_only< seq< alpha, bol > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_only< seq< alpha, bol > >( __LINE__, __FILE__, "ab", result_type::local_failure, 2 );
+      verify_only< seq< alpha, bol, alpha > >( __LINE__, __FILE__, "ab", result_type::local_failure, 2 );
+      verify_only< seq< alpha, eol, bol, alpha, eof > >( __LINE__, __FILE__, "a\nb", result_type::success, 0 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_bytes.cpp b/packages/PEGTL/src/test/pegtl/rule_bytes.cpp
index 3bd3d8515ca50e0e50334812985c1551178da373..ad9462640cd24af2a5ea367b3c0258c179da26ce 100644
--- a/packages/PEGTL/src/test/pegtl/rule_bytes.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_bytes.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -6,37 +6,33 @@
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< bytes< 0 > >( __LINE__, __FILE__, false, false );
+      verify_analyze< bytes< 0 > >( __LINE__, __FILE__, false, false );
 
-         verify_rule< bytes< 0 > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< bytes< 0 > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
+      verify_rule< bytes< 0 > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< bytes< 0 > >( __LINE__, __FILE__, "a", result_type::success, 1 );
 
-         verify_analyze< bytes< 1 > >( __LINE__, __FILE__, true, false );
+      verify_analyze< bytes< 1 > >( __LINE__, __FILE__, true, false );
 
-         for( char c = 0; c < 127; ++c ) {
-            verify_char< bytes< 1 > >( __LINE__, __FILE__, c, result_type::SUCCESS );
-         }
-         verify_rule< bytes< 1 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< bytes< 1 > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 1 );
-
-         verify_analyze< bytes< 2 > >( __LINE__, __FILE__, true, false );
-         verify_analyze< bytes< 42 > >( __LINE__, __FILE__, true, false );
+      for( char c = 0; c < 127; ++c ) {
+         verify_char< bytes< 1 > >( __LINE__, __FILE__, c, result_type::success );
+      }
+      verify_rule< bytes< 1 > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< bytes< 1 > >( __LINE__, __FILE__, "aa", result_type::success, 1 );
 
-         verify_rule< bytes< 3 > >( __LINE__, __FILE__, "abcd", result_type::SUCCESS, 1 );
-         verify_rule< bytes< 4 > >( __LINE__, __FILE__, "abcd", result_type::SUCCESS, 0 );
-         verify_rule< bytes< 5 > >( __LINE__, __FILE__, "abcd", result_type::LOCAL_FAILURE, 4 );
+      verify_analyze< bytes< 2 > >( __LINE__, __FILE__, true, false );
+      verify_analyze< bytes< 42 > >( __LINE__, __FILE__, true, false );
 
-         verify_rule< bytes< 4 > >( __LINE__, __FILE__, "abcdefghij", result_type::SUCCESS, 6 );
-      }
+      verify_rule< bytes< 3 > >( __LINE__, __FILE__, "abcd", result_type::success, 1 );
+      verify_rule< bytes< 4 > >( __LINE__, __FILE__, "abcd", result_type::success, 0 );
+      verify_rule< bytes< 5 > >( __LINE__, __FILE__, "abcd", result_type::local_failure, 4 );
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      verify_rule< bytes< 4 > >( __LINE__, __FILE__, "abcdefghij", result_type::success, 6 );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_control.cpp b/packages/PEGTL/src/test/pegtl/rule_control.cpp
index e70fa1faecfcd20c05b99024e876638c397aeb15..c4cc810da2165794086d10a4fd0572c3122b7e3d 100644
--- a/packages/PEGTL/src/test/pegtl/rule_control.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_control.cpp
@@ -1,23 +1,19 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_seqs.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      template< typename... Rules >
-      using test_control_rule = control< normal, Rules... >;
-
-      void unit_test()
-      {
-         verify_seqs< test_control_rule >();
-      }
+   template< typename... Rules >
+   using test_control_rule = control< normal, Rules... >;
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
+   {
+      verify_seqs< test_control_rule >();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_disable.cpp b/packages/PEGTL/src/test/pegtl/rule_disable.cpp
index 638a423943a371bd730cf7fadbf50a02beea721b..db15b8a1ece34ca1ac32519f454608c0d63a01e8 100644
--- a/packages/PEGTL/src/test/pegtl/rule_disable.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_disable.cpp
@@ -1,20 +1,16 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_seqs.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_seqs< disable >();
-      }
+      verify_seqs< disable >();
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_enable.cpp b/packages/PEGTL/src/test/pegtl/rule_enable.cpp
index 1eef732da74ff3967e88b22992f2a723c1383833..de998a6e30c1c932a5208b2dccef0bf1fb202801 100644
--- a/packages/PEGTL/src/test/pegtl/rule_enable.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_enable.cpp
@@ -1,20 +1,16 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_seqs.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_seqs< enable >();
-      }
+      verify_seqs< enable >();
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_eof.cpp b/packages/PEGTL/src/test/pegtl/rule_eof.cpp
index 5e991870943faf2c1d7a703d61a708491a3f55ae..ccb1809f14cbc2b30f7df6285ccc9b2cccf2ba8a 100644
--- a/packages/PEGTL/src/test/pegtl/rule_eof.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_eof.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -6,24 +6,20 @@
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< eof >( __LINE__, __FILE__, false, false );
+      verify_analyze< eof >( __LINE__, __FILE__, false, false );
 
-         verify_rule< eof >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
+      verify_rule< eof >( __LINE__, __FILE__, "", result_type::success, 0 );
 
-         for( char i = 1; i < 127; ++i ) {
-            verify_char< eof >( __LINE__, __FILE__, i, result_type::LOCAL_FAILURE );
-         }
-         verify_rule< eof >( __LINE__, __FILE__, "abcdefghijklmn", result_type::LOCAL_FAILURE, 14 );
+      for( char i = 1; i < 127; ++i ) {
+         verify_char< eof >( __LINE__, __FILE__, i, result_type::local_failure );
       }
+      verify_rule< eof >( __LINE__, __FILE__, "abcdefghijklmn", result_type::local_failure, 14 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_failure.cpp b/packages/PEGTL/src/test/pegtl/rule_failure.cpp
index 169ad72458812bd0a38aaaaa43f49fc2dd519833..01105fed25200931f1a673be0a3ac04678544eb3 100644
--- a/packages/PEGTL/src/test/pegtl/rule_failure.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_failure.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
@@ -6,23 +6,19 @@
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< failure >( __LINE__, __FILE__, true, false );  // "Success implies consumption" is true because "success" never happens.
+      verify_analyze< failure >( __LINE__, __FILE__, true, false );  // "Success implies consumption" is true because "success" never happens.
 
-         verify_rule< failure >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
+      verify_rule< failure >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
 
-         for( char i = 1; i < 127; ++i ) {
-            verify_char< failure >( __LINE__, __FILE__, i, result_type::LOCAL_FAILURE );
-         }
+      for( char i = 1; i < 127; ++i ) {
+         verify_char< failure >( __LINE__, __FILE__, i, result_type::local_failure );
       }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_if_apply.cpp b/packages/PEGTL/src/test/pegtl/rule_if_apply.cpp
index ef05b7ff31512ee57ea96573887bed4f6c7d3e02..ab9576511f4dde1586fd771a28bb188257d275e4 100644
--- a/packages/PEGTL/src/test/pegtl/rule_if_apply.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_if_apply.cpp
@@ -1,129 +1,124 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_seqs.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace test1
    {
-      namespace test1
+      struct action_a
       {
-         struct action_a
+         template< typename Input >
+         static void apply( const Input& in, std::string& r, std::string& s )
          {
-            template< typename Input >
-            static void apply( const Input& in, std::string& r, std::string& s )
-            {
-               TAO_PEGTL_TEST_ASSERT( r.empty() );
-               TAO_PEGTL_TEST_ASSERT( s.empty() );
-               r += in.string();
-            }
-         };
-
-         struct action_b
-         {
-            template< typename Input >
-            static void apply( const Input& in, std::string& r, std::string& s )
-            {
-               TAO_PEGTL_TEST_ASSERT( s.empty() );
-               s += in.string();
-               s += "*";
-               s += r;
-            }
-         };
-
-         struct action2_a
-         {
-            template< typename Input >
-            static void apply( const Input& in, bool& state_b )
-            {
-               TAO_PEGTL_TEST_ASSERT( in.string() == "foo" );
-               TAO_PEGTL_TEST_ASSERT( !state_b );
-            }
-         };
-
-         struct action2_b
-         {
-            template< typename Input >
-            static bool apply( const Input& in, bool& state_b )
-            {
-               TAO_PEGTL_TEST_ASSERT( in.string() == "foo" );
-               TAO_PEGTL_TEST_ASSERT( !state_b );
-               state_b = true;
-               return false;
-            }
-         };
-
-         struct action2_c
-         {
-            template< typename Input >
-            static void apply( const Input& /*unused*/, bool& /*unused*/ )
-            {
-               TAO_PEGTL_TEST_ASSERT( false );
-            }
-         };
-
-         template< typename Rule >
-         struct action : nothing< Rule >
+            TAO_PEGTL_TEST_ASSERT( r.empty() );
+            TAO_PEGTL_TEST_ASSERT( s.empty() );
+            r += in.string();
+         }
+      };
+
+      struct action_b
+      {
+         template< typename Input >
+         static void apply( const Input& in, std::string& r, std::string& s )
          {
-         };
+            TAO_PEGTL_TEST_ASSERT( s.empty() );
+            s += in.string();
+            s += "*";
+            s += r;
+         }
+      };
 
-         int flag = 0;
+      struct action2_a
+      {
+         template< typename Input >
+         static void apply( const Input& in, bool& state_b )
+         {
+            TAO_PEGTL_TEST_ASSERT( in.string_view() == "foo" );
+            TAO_PEGTL_TEST_ASSERT( !state_b );
+         }
+      };
 
-         template<>
-         struct action< one< '-' > >
+      struct action2_b
+      {
+         template< typename Input >
+         static bool apply( const Input& in, bool& state_b )
          {
-            static void apply0( std::string& /*unused*/, std::string& /*unused*/ )
-            {
-               ++flag;
-            }
-         };
+            TAO_PEGTL_TEST_ASSERT( in.string_view() == "foo" );
+            TAO_PEGTL_TEST_ASSERT( !state_b );
+            state_b = true;
+            return false;
+         }
+      };
 
-      }  // namespace test1
+      struct action2_c
+      {
+         template< typename Input >
+         static void apply( const Input& /*unused*/, bool& /*unused*/ )
+         {
+            TAO_PEGTL_TEST_ASSERT( false );
+         }
+      };
 
-      template< typename... Rules >
-      using if_apply_seq = if_apply< seq< Rules... > >;
+      template< typename Rule >
+      struct action
+      {};
 
-      template< typename... Rules >
-      using if_apply_disable = if_apply< disable< Rules... > >;
+      int flag = 0;
 
-      void unit_test()
+      template<>
+      struct action< one< '-' > >
       {
-         std::string state_r;
-         std::string state_s;
-         TAO_PEGTL_TEST_ASSERT( test1::flag == 0 );
-         memory_input<> in1( "-", __FUNCTION__ );
-         parse< must< if_apply< one< '-' >, test1::action_a, test1::action_b > >, test1::action >( in1, state_r, state_s );
-         TAO_PEGTL_TEST_ASSERT( test1::flag == 1 );
-         TAO_PEGTL_TEST_ASSERT( state_r == "-" );
-         TAO_PEGTL_TEST_ASSERT( state_s == "-*-" );
-         memory_input<> in2( "-", __FUNCTION__ );
-         parse< must< disable< if_apply< one< '-' >, test1::action_a, test1::action_b > > >, test1::action >( in2, state_r, state_s );
-         TAO_PEGTL_TEST_ASSERT( test1::flag == 1 );
-         TAO_PEGTL_TEST_ASSERT( state_r == "-" );
-         TAO_PEGTL_TEST_ASSERT( state_s == "-*-" );
-
+         static void apply0( std::string& /*unused*/, std::string& /*unused*/ )
          {
-            bool state_b = false;
-            const bool result = parse< if_apply< plus< alpha >, test1::action2_a, test1::action2_b, test1::action2_c > >( memory_input<>( "foo bar", __FUNCTION__ ), state_b );
-            TAO_PEGTL_TEST_ASSERT( !result );
-            TAO_PEGTL_TEST_ASSERT( state_b );
+            ++flag;
          }
+      };
 
-         {
-            bool state_b = false;
-            const bool result = parse< if_apply< plus< alpha >, test1::action2_a, test1::action2_b, test1::action2_c > >( memory_input<>( "", __FUNCTION__ ), state_b );
-            TAO_PEGTL_TEST_ASSERT( !result );
-            TAO_PEGTL_TEST_ASSERT( !state_b );
-         }
+   }  // namespace test1
+
+   template< typename... Rules >
+   using if_apply_seq = if_apply< seq< Rules... > >;
 
-         verify_seqs< if_apply_seq >();
-         verify_seqs< if_apply_disable >();
+   template< typename... Rules >
+   using if_apply_disable = if_apply< disable< Rules... > >;
+
+   void unit_test()
+   {
+      std::string state_r;
+      std::string state_s;
+      TAO_PEGTL_TEST_ASSERT( test1::flag == 0 );
+      memory_input in1( "-", __FUNCTION__ );
+      parse< must< if_apply< one< '-' >, test1::action_a, test1::action_b > >, test1::action >( in1, state_r, state_s );
+      TAO_PEGTL_TEST_ASSERT( test1::flag == 1 );
+      TAO_PEGTL_TEST_ASSERT( state_r == "-" );
+      TAO_PEGTL_TEST_ASSERT( state_s == "-*-" );
+      memory_input in2( "-", __FUNCTION__ );
+      parse< must< disable< if_apply< one< '-' >, test1::action_a, test1::action_b > > >, test1::action >( in2, state_r, state_s );
+      TAO_PEGTL_TEST_ASSERT( test1::flag == 1 );
+      TAO_PEGTL_TEST_ASSERT( state_r == "-" );
+      TAO_PEGTL_TEST_ASSERT( state_s == "-*-" );
+
+      {
+         bool state_b = false;
+         const bool result = parse< if_apply< plus< alpha >, test1::action2_a, test1::action2_b, test1::action2_c > >( memory_input( "foo bar", __FUNCTION__ ), state_b );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( state_b );
+      }
+
+      {
+         bool state_b = false;
+         const bool result = parse< if_apply< plus< alpha >, test1::action2_a, test1::action2_b, test1::action2_c > >( memory_input( "", __FUNCTION__ ), state_b );
+         TAO_PEGTL_TEST_ASSERT( !result );
+         TAO_PEGTL_TEST_ASSERT( !state_b );
       }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      verify_seqs< if_apply_seq >();
+      verify_seqs< if_apply_disable >();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_if_must.cpp b/packages/PEGTL/src/test/pegtl/rule_if_must.cpp
index 797c4d63d051b88c81d3fe359e43ba293fa6f508..8900d8186bae85608f0fa1c0b403ac8b8e34a5af 100644
--- a/packages/PEGTL/src/test/pegtl/rule_if_must.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_if_must.cpp
@@ -1,48 +1,44 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< if_must< any, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< if_must< eof, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< if_must< opt< any >, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< if_must< any, opt< any > > >( __LINE__, __FILE__, true, false );
-         verify_analyze< if_must< any, eof > >( __LINE__, __FILE__, true, false );
-         verify_analyze< if_must< opt< any >, opt< any > > >( __LINE__, __FILE__, false, false );
-         verify_analyze< if_must< eof, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< if_must< any, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< if_must< eof, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< if_must< opt< any >, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< if_must< any, opt< any > > >( __LINE__, __FILE__, true, false );
+      verify_analyze< if_must< any, eof > >( __LINE__, __FILE__, true, false );
+      verify_analyze< if_must< opt< any >, opt< any > > >( __LINE__, __FILE__, false, false );
+      verify_analyze< if_must< eof, eof > >( __LINE__, __FILE__, false, false );
 
-         verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::GLOBAL_FAILURE, 0 );
-         verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ba", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-         verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::SUCCESS, 1 );
-         verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 2 );
-         verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ac", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "acb", result_type::GLOBAL_FAILURE, 2 );
-         verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bc", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "a", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ab", result_type::GLOBAL_FAILURE, 2 );
-         verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ac", result_type::GLOBAL_FAILURE, 2 );
-         verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abb", result_type::GLOBAL_FAILURE, 3 );
-         verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "acc", result_type::GLOBAL_FAILURE, 3 );
-         verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "acb", result_type::GLOBAL_FAILURE, 3 );
-         verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abc", result_type::SUCCESS, 0 );
-      }
+      verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::global_failure, 0 );
+      verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ba", result_type::local_failure, 2 );
+      verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+      verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::success, 1 );
+      verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::success, 2 );
+      verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ac", result_type::global_failure, 1 );
+      verify_rule< if_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "acb", result_type::global_failure, 2 );
+      verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bc", result_type::local_failure, 2 );
+      verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "a", result_type::global_failure, 1 );
+      verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ab", result_type::global_failure, 2 );
+      verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ac", result_type::global_failure, 2 );
+      verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abb", result_type::global_failure, 3 );
+      verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "acc", result_type::global_failure, 3 );
+      verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "acb", result_type::global_failure, 3 );
+      verify_rule< if_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abc", result_type::success, 0 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_if_must_else.cpp b/packages/PEGTL/src/test/pegtl/rule_if_must_else.cpp
index d360bb6beb4fc2e619d92e8a120dadfe21fe47dd..b8fe63c6ceff4b9b9f914be3343ac03ccf49a108 100644
--- a/packages/PEGTL/src/test/pegtl/rule_if_must_else.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_if_must_else.cpp
@@ -1,20 +1,16 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_ifmt.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_ifmt< if_must_else >( result_type::GLOBAL_FAILURE );
-      }
+      verify_ifmt< if_must_else >( result_type::global_failure );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_if_then_else.cpp b/packages/PEGTL/src/test/pegtl/rule_if_then_else.cpp
index 29a2717b7db5fd991ace7addb93d1dce439a6f5b..7dac12c7ba2b0f202c3f02cf5c1ff668dd136233 100644
--- a/packages/PEGTL/src/test/pegtl/rule_if_then_else.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_if_then_else.cpp
@@ -1,20 +1,16 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_ifmt.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_ifmt< if_then_else >();
-      }
+      verify_ifmt< if_then_else >();
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_list.cpp b/packages/PEGTL/src/test/pegtl/rule_list.cpp
index d423602dc5d56129385d3da237a92a2a7609579d..bed729ec803f4dde68c29c16af6e8c4be04c6c08 100644
--- a/packages/PEGTL/src/test/pegtl/rule_list.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_list.cpp
@@ -1,62 +1,58 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< list< eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list< eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< list< any, eof > >( __LINE__, __FILE__, true, false );
-         verify_analyze< list< any, any > >( __LINE__, __FILE__, true, false );
-
-         verify_analyze< list< eof, eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list< eof, eof, any > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list< eof, any, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list< eof, any, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< list< any, eof, eof > >( __LINE__, __FILE__, true, true );
-         verify_analyze< list< any, eof, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< list< any, any, eof > >( __LINE__, __FILE__, true, true );
-         verify_analyze< list< any, any, any > >( __LINE__, __FILE__, true, false );
-
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",a", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,", result_type::SUCCESS, 1 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a", result_type::SUCCESS, 0 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,b", result_type::SUCCESS, 2 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a", result_type::SUCCESS, 0 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,a", result_type::SUCCESS, 0 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,b", result_type::SUCCESS, 2 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,,", result_type::SUCCESS, 2 );
-
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ", result_type::SUCCESS, 1 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, " a", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ,a", result_type::SUCCESS, 3 );
-         verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a, a", result_type::SUCCESS, 3 );
-
-         verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, ",", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ", result_type::SUCCESS, 1 );
-         verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ,a", result_type::SUCCESS, 0 );
-         verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a", result_type::SUCCESS, 0 );
-         verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a,", result_type::SUCCESS, 1 );
-         verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a ,", result_type::SUCCESS, 2 );
-         verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a , a ", result_type::LOCAL_FAILURE, 7 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< list< eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list< eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< list< any, eof > >( __LINE__, __FILE__, true, false );
+      verify_analyze< list< any, any > >( __LINE__, __FILE__, true, false );
+
+      verify_analyze< list< eof, eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list< eof, eof, any > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list< eof, any, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list< eof, any, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< list< any, eof, eof > >( __LINE__, __FILE__, true, true );
+      verify_analyze< list< any, eof, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< list< any, any, eof > >( __LINE__, __FILE__, true, true );
+      verify_analyze< list< any, any, any > >( __LINE__, __FILE__, true, false );
+
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",", result_type::local_failure, 1 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",a", result_type::local_failure, 2 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,", result_type::success, 1 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a", result_type::success, 0 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,b", result_type::success, 2 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a", result_type::success, 0 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,a", result_type::success, 0 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,b", result_type::success, 2 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,,", result_type::success, 2 );
+
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ", result_type::success, 1 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, " a", result_type::local_failure, 2 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ,a", result_type::success, 3 );
+      verify_rule< list< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a, a", result_type::success, 3 );
+
+      verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, ",", result_type::local_failure, 1 );
+      verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ", result_type::success, 1 );
+      verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a", result_type::local_failure, 2 );
+      verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ,a", result_type::success, 0 );
+      verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a", result_type::success, 0 );
+      verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a,", result_type::success, 1 );
+      verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a ,", result_type::success, 2 );
+      verify_rule< list< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a , a ", result_type::local_failure, 7 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_list_must.cpp b/packages/PEGTL/src/test/pegtl/rule_list_must.cpp
index c1290d763cac0ee386e0ee34b8f7d5ca5cca5d01..e2f2b7fe5ee85a7168bbf8a434ec0e6ea8fd672b 100644
--- a/packages/PEGTL/src/test/pegtl/rule_list_must.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_list_must.cpp
@@ -1,60 +1,56 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< list_must< eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list_must< eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< list_must< any, eof > >( __LINE__, __FILE__, true, false );
-         verify_analyze< list_must< any, any > >( __LINE__, __FILE__, true, false );
-
-         verify_analyze< list_must< eof, eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list_must< eof, eof, any > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list_must< eof, any, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list_must< eof, any, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< list_must< any, eof, eof > >( __LINE__, __FILE__, true, true );
-         verify_analyze< list_must< any, eof, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< list_must< any, any, eof > >( __LINE__, __FILE__, true, true );
-         verify_analyze< list_must< any, any, any > >( __LINE__, __FILE__, true, false );
-
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",a", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,", result_type::GLOBAL_FAILURE, 2 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a", result_type::SUCCESS, 0 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,b", result_type::GLOBAL_FAILURE, 3 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a", result_type::SUCCESS, 0 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,a", result_type::SUCCESS, 0 );
-
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ", result_type::SUCCESS, 1 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, " a", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ,a", result_type::SUCCESS, 3 );
-         verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a, a", result_type::GLOBAL_FAILURE, 0 );
-
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, ",", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ", result_type::SUCCESS, 1 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ,a", result_type::SUCCESS, 0 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a", result_type::SUCCESS, 0 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a,", result_type::GLOBAL_FAILURE, 5 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a ,", result_type::GLOBAL_FAILURE, 6 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a , a ", result_type::LOCAL_FAILURE, 7 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< list_must< eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list_must< eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< list_must< any, eof > >( __LINE__, __FILE__, true, false );
+      verify_analyze< list_must< any, any > >( __LINE__, __FILE__, true, false );
+
+      verify_analyze< list_must< eof, eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list_must< eof, eof, any > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list_must< eof, any, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list_must< eof, any, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< list_must< any, eof, eof > >( __LINE__, __FILE__, true, true );
+      verify_analyze< list_must< any, eof, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< list_must< any, any, eof > >( __LINE__, __FILE__, true, true );
+      verify_analyze< list_must< any, any, any > >( __LINE__, __FILE__, true, false );
+
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",", result_type::local_failure, 1 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",a", result_type::local_failure, 2 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,", result_type::global_failure, 2 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a", result_type::success, 0 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,b", result_type::global_failure, 3 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a", result_type::success, 0 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,a", result_type::success, 0 );
+
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ", result_type::success, 1 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, " a", result_type::local_failure, 2 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ,a", result_type::success, 3 );
+      verify_rule< list_must< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a, a", result_type::global_failure, 0 );
+
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, ",", result_type::local_failure, 1 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ", result_type::success, 1 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a", result_type::local_failure, 2 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ,a", result_type::success, 0 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a", result_type::success, 0 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a,", result_type::global_failure, 5 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a ,", result_type::global_failure, 6 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a , a ", result_type::local_failure, 7 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_list_tail.cpp b/packages/PEGTL/src/test/pegtl/rule_list_tail.cpp
index d44afb94581b6616b0651dc688b150fc844f4d04..50378895c8ed348dce8e21779408d7e54c1f45c2 100644
--- a/packages/PEGTL/src/test/pegtl/rule_list_tail.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_list_tail.cpp
@@ -1,62 +1,58 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< list_tail< eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list_tail< eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< list_tail< any, eof > >( __LINE__, __FILE__, true, false );
-         verify_analyze< list_tail< any, any > >( __LINE__, __FILE__, true, false );
-
-         verify_analyze< list_tail< eof, eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list_tail< eof, eof, any > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list_tail< eof, any, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< list_tail< eof, any, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< list_tail< any, eof, eof > >( __LINE__, __FILE__, true, true );
-         verify_analyze< list_tail< any, eof, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< list_tail< any, any, eof > >( __LINE__, __FILE__, true, true );
-         verify_analyze< list_tail< any, any, any > >( __LINE__, __FILE__, true, false );
-
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",a", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,", result_type::SUCCESS, 0 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a", result_type::SUCCESS, 0 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,b", result_type::SUCCESS, 1 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a", result_type::SUCCESS, 0 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,a", result_type::SUCCESS, 0 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,b", result_type::SUCCESS, 1 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,,", result_type::SUCCESS, 1 );
-
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ", result_type::SUCCESS, 1 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, " a", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ,a", result_type::SUCCESS, 3 );
-         verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a, a", result_type::SUCCESS, 2 );
-
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, ",", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ", result_type::SUCCESS, 1 );
-         verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ,a", result_type::SUCCESS, 0 );
-         verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a", result_type::SUCCESS, 0 );
-         verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a,", result_type::SUCCESS, 0 );
-         verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a ,", result_type::SUCCESS, 0 );
-         verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a , a ", result_type::LOCAL_FAILURE, 7 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< list_tail< eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list_tail< eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< list_tail< any, eof > >( __LINE__, __FILE__, true, false );
+      verify_analyze< list_tail< any, any > >( __LINE__, __FILE__, true, false );
+
+      verify_analyze< list_tail< eof, eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list_tail< eof, eof, any > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list_tail< eof, any, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< list_tail< eof, any, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< list_tail< any, eof, eof > >( __LINE__, __FILE__, true, true );
+      verify_analyze< list_tail< any, eof, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< list_tail< any, any, eof > >( __LINE__, __FILE__, true, true );
+      verify_analyze< list_tail< any, any, any > >( __LINE__, __FILE__, true, false );
+
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",", result_type::local_failure, 1 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, ",a", result_type::local_failure, 2 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,", result_type::success, 0 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a", result_type::success, 0 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,b", result_type::success, 1 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a", result_type::success, 0 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,a", result_type::success, 0 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,b", result_type::success, 1 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a,a,a,,", result_type::success, 1 );
+
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ", result_type::success, 1 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, " a", result_type::local_failure, 2 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a ,a", result_type::success, 3 );
+      verify_rule< list_tail< one< 'a' >, one< ',' > > >( __LINE__, __FILE__, "a, a", result_type::success, 2 );
+
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< list_must< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, ",", result_type::local_failure, 1 );
+      verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ", result_type::success, 1 );
+      verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a", result_type::local_failure, 2 );
+      verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a ,a", result_type::success, 0 );
+      verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a", result_type::success, 0 );
+      verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a,", result_type::success, 0 );
+      verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, "a, a ,", result_type::success, 0 );
+      verify_rule< list_tail< one< 'a' >, one< ',' >, blank > >( __LINE__, __FILE__, " a , a ", result_type::local_failure, 7 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_minus.cpp b/packages/PEGTL/src/test/pegtl/rule_minus.cpp
index de8f5258d2be0ed3f08f3933a4952d03629ab521..2fc804c7ea56311458b7c8cdc2cf85759f3a8ba2 100644
--- a/packages/PEGTL/src/test/pegtl/rule_minus.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_minus.cpp
@@ -1,54 +1,50 @@
-// Copyright (c) 2016-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2016-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< minus< alpha, digit > >( __LINE__, __FILE__, true, false );
-         verify_analyze< minus< opt< alpha >, digit > >( __LINE__, __FILE__, false, false );
-
-         verify_rule< minus< alnum, digit > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< minus< alnum, digit > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< minus< alnum, digit > >( __LINE__, __FILE__, "1", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< minus< alnum, digit > >( __LINE__, __FILE__, "%", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< minus< alnum, digit > >( __LINE__, __FILE__, "a%", result_type::SUCCESS, 1 );
-
-         verify_rule< must< minus< alnum, digit > > >( __LINE__, __FILE__, "%", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< must< minus< alnum, digit > > >( __LINE__, __FILE__, "1", result_type::GLOBAL_FAILURE, 0 );
-
-         verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "1", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "%", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "a%", result_type::SUCCESS, 1 );
-         verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 0 );
-         verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "a1", result_type::SUCCESS, 0 );
-         verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "1a", result_type::SUCCESS, 0 );
-         verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "11", result_type::SUCCESS, 0 );
-         verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "%%", result_type::LOCAL_FAILURE, 2 );
-
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "1", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "%", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "a%", result_type::SUCCESS, 1 );
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 0 );
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "aaa%", result_type::SUCCESS, 1 );
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "111", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "111%", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "a1a", result_type::SUCCESS, 0 );
-         verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "1a1", result_type::SUCCESS, 0 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< minus< alpha, digit > >( __LINE__, __FILE__, true, false );
+      verify_analyze< minus< opt< alpha >, digit > >( __LINE__, __FILE__, false, false );
+
+      verify_rule< minus< alnum, digit > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< minus< alnum, digit > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< minus< alnum, digit > >( __LINE__, __FILE__, "1", result_type::local_failure, 1 );
+      verify_rule< minus< alnum, digit > >( __LINE__, __FILE__, "%", result_type::local_failure, 1 );
+      verify_rule< minus< alnum, digit > >( __LINE__, __FILE__, "a%", result_type::success, 1 );
+
+      verify_rule< must< minus< alnum, digit > > >( __LINE__, __FILE__, "%", result_type::global_failure, 1 );
+      verify_rule< must< minus< alnum, digit > > >( __LINE__, __FILE__, "1", result_type::global_failure, 0 );
+
+      verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "1", result_type::local_failure, 1 );
+      verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "%", result_type::local_failure, 1 );
+      verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "a%", result_type::success, 1 );
+      verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "aa", result_type::success, 0 );
+      verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "a1", result_type::success, 0 );
+      verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "1a", result_type::success, 0 );
+      verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "11", result_type::success, 0 );
+      verify_rule< minus< plus< alnum >, digit > >( __LINE__, __FILE__, "%%", result_type::local_failure, 2 );
+
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "1", result_type::local_failure, 1 );
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "%", result_type::local_failure, 1 );
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "a%", result_type::success, 1 );
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "aaa", result_type::success, 0 );
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "aaa%", result_type::success, 1 );
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "111", result_type::local_failure, 3 );
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "111%", result_type::local_failure, 4 );
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "a1a", result_type::success, 0 );
+      verify_rule< minus< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "1a1", result_type::success, 0 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_must.cpp b/packages/PEGTL/src/test/pegtl/rule_must.cpp
index 60d793096482ef4eaaf9c34556a3203e3ca1c45f..8bbdfc999590bea2a8e2d65d3ece13c56697ca9a 100644
--- a/packages/PEGTL/src/test/pegtl/rule_must.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_must.cpp
@@ -1,20 +1,16 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_seqs.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_seqs< must >( result_type::GLOBAL_FAILURE );
-      }
+      verify_seqs< must >( result_type::global_failure );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_not_at.cpp b/packages/PEGTL/src/test/pegtl/rule_not_at.cpp
index 74dbd86bd0fa9fedbc04a1aa8e38e674b3f1cdcc..4ad66acd8c743a1f9a64efdd87e579b8501f2b0a 100644
--- a/packages/PEGTL/src/test/pegtl/rule_not_at.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_not_at.cpp
@@ -1,66 +1,60 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      int at_counter = 0;
+   int at_counter = 0;
 
-      template< typename Rule >
-      struct at_action
-         : public nothing< Rule >
-      {
-      };
+   template< typename Rule >
+   struct at_action
+   {};
 
-      template<>
-      struct at_action< alpha >
+   template<>
+   struct at_action< alpha >
+   {
+      template< typename Input >
+      static void apply( const Input& /*unused*/ )
       {
-         template< typename Input >
-         static void apply( const Input& /*unused*/ )
-         {
-            ++at_counter;
-         }
-      };
+         ++at_counter;
+      }
+   };
 
-      void unit_test()
+   void unit_test()
+   {
+      TAO_PEGTL_TEST_ASSERT( at_counter == 0 );
+
+      verify_analyze< not_at< eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< not_at< any > >( __LINE__, __FILE__, false, false );
+
+      verify_rule< not_at< eof > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< not_at< eof > >( __LINE__, __FILE__, " ", result_type::success, 1 );
+      verify_rule< not_at< any > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< not_at< any > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< not_at< any > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+      verify_rule< not_at< any > >( __LINE__, __FILE__, "aaaa", result_type::local_failure, 4 );
+      verify_rule< must< not_at< alpha > > >( __LINE__, __FILE__, "a", result_type::global_failure, 1 );
+      verify_rule< must< not_at< alpha, alpha > > >( __LINE__, __FILE__, "aa1", result_type::global_failure, 3 );
       {
-         TAO_PEGTL_TEST_ASSERT( at_counter == 0 );
-
-         verify_analyze< not_at< eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< not_at< any > >( __LINE__, __FILE__, false, false );
-
-         verify_rule< not_at< eof > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< not_at< eof > >( __LINE__, __FILE__, " ", result_type::SUCCESS, 1 );
-         verify_rule< not_at< any > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< not_at< any > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< not_at< any > >( __LINE__, __FILE__, "aa", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< not_at< any > >( __LINE__, __FILE__, "aaaa", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< must< not_at< alpha > > >( __LINE__, __FILE__, "a", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< must< not_at< alpha, alpha > > >( __LINE__, __FILE__, "aa1", result_type::GLOBAL_FAILURE, 3 );
-         {
-            memory_input<> in( "a", 1, __FILE__ );
-            parse< alpha, at_action >( in );
-            TAO_PEGTL_TEST_ASSERT( at_counter == 1 );
-         }
-         {
-            memory_input<> in( "1", 1, __FILE__ );
-            parse< not_at< alpha >, at_action >( in );
-            TAO_PEGTL_TEST_ASSERT( at_counter == 1 );
-         }
-         {
-            memory_input<> in( "a", 1, __FILE__ );
-            parse< not_at< alpha >, at_action >( in );
-            TAO_PEGTL_TEST_ASSERT( at_counter == 1 );
-         }
+         memory_input in( "a", 1, __FILE__ );
+         parse< alpha, at_action >( in );
+         TAO_PEGTL_TEST_ASSERT( at_counter == 1 );
       }
+      {
+         memory_input in( "1", 1, __FILE__ );
+         parse< not_at< alpha >, at_action >( in );
+         TAO_PEGTL_TEST_ASSERT( at_counter == 1 );
+      }
+      {
+         memory_input in( "a", 1, __FILE__ );
+         parse< not_at< alpha >, at_action >( in );
+         TAO_PEGTL_TEST_ASSERT( at_counter == 1 );
+      }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_opt.cpp b/packages/PEGTL/src/test/pegtl/rule_opt.cpp
index 1fd4dc7b638d8857570b71f6a7840ddf03754f31..951bdb7419da9bb262354f39d37cfe7b48aac966 100644
--- a/packages/PEGTL/src/test/pegtl/rule_opt.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_opt.cpp
@@ -1,69 +1,64 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      template< typename Rule >
-      struct my_action : nothing< Rule >
-      {
-      };
-
-      template<>
-      struct my_action< eof >
-      {
-         static void apply0( bool& b )
-         {
-            b = true;
-         }
-      };
+   template< typename Rule >
+   struct my_action
+   {};
 
-      void unit_test()
+   template<>
+   struct my_action< eof >
+   {
+      static void apply0( bool& b )
       {
-         verify_analyze< opt< any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< opt< eof > >( __LINE__, __FILE__, false, false );
+         b = true;
+      }
+   };
 
-         verify_rule< opt< one< 'a' > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< opt< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< opt< one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 1 );
-         verify_rule< opt< one< 'a' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 1 );
-         verify_rule< opt< one< 'a' > > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 2 );
+   void unit_test()
+   {
+      verify_analyze< opt< any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< opt< eof > >( __LINE__, __FILE__, false, false );
 
-         verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
-         verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-         verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 2 );
-         verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bab", result_type::SUCCESS, 3 );
-         verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "cb", result_type::SUCCESS, 2 );
+      verify_rule< opt< one< 'a' > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< opt< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< opt< one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 1 );
+      verify_rule< opt< one< 'a' > > >( __LINE__, __FILE__, "ab", result_type::success, 1 );
+      verify_rule< opt< one< 'a' > > >( __LINE__, __FILE__, "ba", result_type::success, 2 );
 
-         verify_rule< must< opt< one< 'a' > > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< must< opt< one< 'a' > > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< must< opt< one< 'a' > > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 1 );
-         verify_rule< must< opt< one< 'a' > > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 1 );
-         verify_rule< must< opt< one< 'a' > > > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 2 );
+      verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::success, 1 );
+      verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+      verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::success, 2 );
+      verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bab", result_type::success, 3 );
+      verify_rule< opt< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "cb", result_type::success, 2 );
 
-         verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
-         verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-         verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 2 );
-         verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "bab", result_type::SUCCESS, 3 );
-         verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "cb", result_type::SUCCESS, 2 );
+      verify_rule< must< opt< one< 'a' > > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< must< opt< one< 'a' > > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< must< opt< one< 'a' > > > >( __LINE__, __FILE__, "aa", result_type::success, 1 );
+      verify_rule< must< opt< one< 'a' > > > >( __LINE__, __FILE__, "ab", result_type::success, 1 );
+      verify_rule< must< opt< one< 'a' > > > >( __LINE__, __FILE__, "ba", result_type::success, 2 );
 
-         bool success = false;
-         const bool result = parse< opt< eof >, my_action >( memory_input<>( "", __FUNCTION__ ), success );
-         TAO_PEGTL_TEST_ASSERT( result );
-         TAO_PEGTL_TEST_ASSERT( success );
-      }
+      verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "a", result_type::success, 1 );
+      verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+      verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "abab", result_type::success, 2 );
+      verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "bab", result_type::success, 3 );
+      verify_rule< must< opt< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "cb", result_type::success, 2 );
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      bool success = false;
+      const bool result = parse< opt< eof >, my_action >( memory_input( "", __FUNCTION__ ), success );
+      TAO_PEGTL_TEST_ASSERT( result );
+      TAO_PEGTL_TEST_ASSERT( success );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_opt_must.cpp b/packages/PEGTL/src/test/pegtl/rule_opt_must.cpp
index 279e40804a1eec1ebe6bd67aca1862c15c9b9e76..cd06deea9851f3a223e940ad46c07f237b66fb35 100644
--- a/packages/PEGTL/src/test/pegtl/rule_opt_must.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_opt_must.cpp
@@ -1,48 +1,44 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< opt_must< any, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< opt_must< eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< opt_must< opt< any >, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< opt_must< any, opt< any > > >( __LINE__, __FILE__, false, false );
-         verify_analyze< opt_must< any, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< opt_must< opt< any >, opt< any > > >( __LINE__, __FILE__, false, false );
-         verify_analyze< opt_must< eof, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< opt_must< any, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< opt_must< eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< opt_must< opt< any >, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< opt_must< any, opt< any > > >( __LINE__, __FILE__, false, false );
+      verify_analyze< opt_must< any, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< opt_must< opt< any >, opt< any > > >( __LINE__, __FILE__, false, false );
+      verify_analyze< opt_must< eof, eof > >( __LINE__, __FILE__, false, false );
 
-         verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::SUCCESS );
-         verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::GLOBAL_FAILURE, 0 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", result_type::SUCCESS, 1 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 2 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS );
-         verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::SUCCESS, 1 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 2 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ac", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "acb", result_type::GLOBAL_FAILURE, 2 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "", result_type::SUCCESS );
-         verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "b", result_type::SUCCESS, 1 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bc", result_type::SUCCESS, 2 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "a", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ab", result_type::GLOBAL_FAILURE, 2 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ac", result_type::GLOBAL_FAILURE, 2 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abb", result_type::GLOBAL_FAILURE, 3 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "acc", result_type::GLOBAL_FAILURE, 3 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "acb", result_type::GLOBAL_FAILURE, 3 );
-         verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abc", result_type::SUCCESS, 0 );
-      }
+      verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::success );
+      verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::global_failure, 0 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", result_type::success, 1 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ba", result_type::success, 2 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::success );
+      verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::success, 1 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::success, 2 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ac", result_type::global_failure, 1 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "acb", result_type::global_failure, 2 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "", result_type::success );
+      verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "b", result_type::success, 1 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bc", result_type::success, 2 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "a", result_type::global_failure, 1 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ab", result_type::global_failure, 2 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ac", result_type::global_failure, 2 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abb", result_type::global_failure, 3 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "acc", result_type::global_failure, 3 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "acb", result_type::global_failure, 3 );
+      verify_rule< opt_must< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abc", result_type::success, 0 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_pad.cpp b/packages/PEGTL/src/test/pegtl/rule_pad.cpp
index 67c3cdc92859473c4da7e594d04ff0b00ff1c5a5..6cb6fe5fd6e02936ea6b4d2c36b000111ed7c4ae 100644
--- a/packages/PEGTL/src/test/pegtl/rule_pad.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_pad.cpp
@@ -1,53 +1,49 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< pad< eof, eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< pad< eof, eof, any > >( __LINE__, __FILE__, false, true );
-         verify_analyze< pad< eof, any, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< pad< eof, any, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< pad< any, eof, eof > >( __LINE__, __FILE__, true, true );
-         verify_analyze< pad< any, eof, any > >( __LINE__, __FILE__, true, true );
-         verify_analyze< pad< any, any, eof > >( __LINE__, __FILE__, true, true );
-         verify_analyze< pad< any, any, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< pad< eof, eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< pad< eof, eof, any > >( __LINE__, __FILE__, false, true );
+      verify_analyze< pad< eof, any, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< pad< eof, any, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< pad< any, eof, eof > >( __LINE__, __FILE__, true, true );
+      verify_analyze< pad< any, eof, any > >( __LINE__, __FILE__, true, true );
+      verify_analyze< pad< any, any, eof > >( __LINE__, __FILE__, true, true );
+      verify_analyze< pad< any, any, any > >( __LINE__, __FILE__, true, false );
 
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, " ", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "  ", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "ba", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, " a", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "a ", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "  a", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "a  ", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "  a  ", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "   a   ", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 1 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "a a", result_type::SUCCESS, 1 );
-         verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "  a  a ", result_type::SUCCESS, 2 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, " ", result_type::local_failure, 1 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "  ", result_type::local_failure, 2 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "ba", result_type::local_failure, 2 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, " a", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "a ", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "  a", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "a  ", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "  a  ", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "   a   ", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "aa", result_type::success, 1 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "a a", result_type::success, 1 );
+      verify_rule< pad< one< 'a' >, space > >( __LINE__, __FILE__, "  a  a ", result_type::success, 2 );
 
-         verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "1a", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "123a", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "a ", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "a   ", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "123a   ", result_type::SUCCESS, 0 );
-         verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, " a", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "a1", result_type::SUCCESS, 1 );
-      }
+      verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "1a", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "123a", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "a ", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "a   ", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "123a   ", result_type::success, 0 );
+      verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, " a", result_type::local_failure, 2 );
+      verify_rule< pad< one< 'a' >, digit, blank > >( __LINE__, __FILE__, "a1", result_type::success, 1 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_pad_opt.cpp b/packages/PEGTL/src/test/pegtl/rule_pad_opt.cpp
index 198d0f3ed258aff576f3d0c155826ce15ea80642..d16c5064a453a056d23bd3f80725428c57140f5c 100644
--- a/packages/PEGTL/src/test/pegtl/rule_pad_opt.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_pad_opt.cpp
@@ -1,41 +1,37 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< pad_opt< eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< pad_opt< eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< pad_opt< any, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< pad_opt< any, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< pad_opt< eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< pad_opt< eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< pad_opt< any, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< pad_opt< any, any > >( __LINE__, __FILE__, false, false );
 
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, " ", result_type::SUCCESS, 0 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "  ", result_type::SUCCESS, 0 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "b", result_type::SUCCESS, 1 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 2 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, " a", result_type::SUCCESS, 0 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "a ", result_type::SUCCESS, 0 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "  a", result_type::SUCCESS, 0 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "  b", result_type::SUCCESS, 1 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "a  ", result_type::SUCCESS, 0 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "  a  ", result_type::SUCCESS, 0 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "   a   ", result_type::SUCCESS, 0 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 1 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "a a", result_type::SUCCESS, 1 );
-         verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "  a  a ", result_type::SUCCESS, 2 );
-      }
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, " ", result_type::success, 0 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "  ", result_type::success, 0 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "b", result_type::success, 1 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "ba", result_type::success, 2 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, " a", result_type::success, 0 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "a ", result_type::success, 0 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "  a", result_type::success, 0 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "  b", result_type::success, 1 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "a  ", result_type::success, 0 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "  a  ", result_type::success, 0 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "   a   ", result_type::success, 0 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "aa", result_type::success, 1 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "a a", result_type::success, 1 );
+      verify_rule< pad_opt< one< 'a' >, space > >( __LINE__, __FILE__, "  a  a ", result_type::success, 2 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_plus.cpp b/packages/PEGTL/src/test/pegtl/rule_plus.cpp
index 113f2739a5a8de0abe8c2ae93e5db88855ed04de..251cf15bee1d482d2875dc94f0e30a19536a726b 100644
--- a/packages/PEGTL/src/test/pegtl/rule_plus.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_plus.cpp
@@ -1,46 +1,42 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< plus< eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< plus< any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< plus< eof, eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< plus< any, eof, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< plus< eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< plus< any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< plus< eof, eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< plus< any, eof, any > >( __LINE__, __FILE__, true, false );
 
-         verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 0 );
-         verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 0 );
-         verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 1 );
-         verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "aab", result_type::SUCCESS, 1 );
-         verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "aaab", result_type::SUCCESS, 1 );
+      verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 0 );
+      verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::success, 0 );
+      verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "ab", result_type::success, 1 );
+      verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "aab", result_type::success, 1 );
+      verify_rule< plus< one< 'a' > > >( __LINE__, __FILE__, "aaab", result_type::success, 1 );
 
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ac", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aa", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::SUCCESS, 1 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abc", result_type::SUCCESS, 1 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 0 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababa", result_type::SUCCESS, 1 );
-         verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababb", result_type::SUCCESS, 1 );
-      }
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ac", result_type::local_failure, 2 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::success, 1 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abc", result_type::success, 1 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::success, 0 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababa", result_type::success, 1 );
+      verify_rule< plus< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababb", result_type::success, 1 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_rematch.cpp b/packages/PEGTL/src/test/pegtl/rule_rematch.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d6d384469a350c37ca0f1b3998dfb8529438581f
--- /dev/null
+++ b/packages/PEGTL/src/test/pegtl/rule_rematch.cpp
@@ -0,0 +1,97 @@
+// Copyright (c) 2019 Dr. Colin Hirsch and Daniel Frey
+// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
+
+#include "test.hpp"
+#include "verify_analyze.hpp"
+#include "verify_rule.hpp"
+
+namespace TAO_PEGTL_NAMESPACE
+{
+   void unit_test()
+   {
+      verify_rule< rematch< one< 'c' > > >( __LINE__, __FILE__, "c", result_type::success, 0 );
+      verify_rule< rematch< one< 'c' > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rematch< one< 'c' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< rematch< one< 'c' > > >( __LINE__, __FILE__, "cc", result_type::success, 1 );
+      verify_rule< rematch< one< 'c' > > >( __LINE__, __FILE__, "bc", result_type::local_failure, 2 );
+
+      verify_analyze< rematch< alpha, digit > >( __LINE__, __FILE__, true, false );
+      verify_analyze< rematch< opt< alpha >, digit > >( __LINE__, __FILE__, false, false );
+
+      verify_rule< rematch< alnum, digit > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< rematch< alnum, digit > >( __LINE__, __FILE__, "1", result_type::success, 0 );
+      verify_rule< rematch< alnum, digit > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rematch< alnum, digit > >( __LINE__, __FILE__, "%", result_type::local_failure, 1 );
+      verify_rule< rematch< alnum, digit > >( __LINE__, __FILE__, "1%", result_type::success, 1 );
+      verify_rule< rematch< alnum, digit > >( __LINE__, __FILE__, "a%", result_type::local_failure, 2 );
+      verify_rule< rematch< alnum, digit > >( __LINE__, __FILE__, "12", result_type::success, 1 );
+      verify_rule< rematch< alnum, digit > >( __LINE__, __FILE__, "1c", result_type::success, 1 );
+
+      verify_rule< rematch< alnum, digit, success > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< rematch< alnum, digit, success > >( __LINE__, __FILE__, "1", result_type::success, 0 );
+      verify_rule< rematch< alnum, digit, success > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rematch< alnum, digit, success > >( __LINE__, __FILE__, "%", result_type::local_failure, 1 );
+      verify_rule< rematch< alnum, digit, success > >( __LINE__, __FILE__, "1%", result_type::success, 1 );
+      verify_rule< rematch< alnum, digit, success > >( __LINE__, __FILE__, "a%", result_type::local_failure, 2 );
+      verify_rule< rematch< alnum, digit, success > >( __LINE__, __FILE__, "12", result_type::success, 1 );
+      verify_rule< rematch< alnum, digit, success > >( __LINE__, __FILE__, "1c", result_type::success, 1 );
+
+      verify_rule< rematch< alnum, success, digit > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< rematch< alnum, success, digit > >( __LINE__, __FILE__, "1", result_type::success, 0 );
+      verify_rule< rematch< alnum, success, digit > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rematch< alnum, success, digit > >( __LINE__, __FILE__, "%", result_type::local_failure, 1 );
+      verify_rule< rematch< alnum, success, digit > >( __LINE__, __FILE__, "1%", result_type::success, 1 );
+      verify_rule< rematch< alnum, success, digit > >( __LINE__, __FILE__, "a%", result_type::local_failure, 2 );
+      verify_rule< rematch< alnum, success, digit > >( __LINE__, __FILE__, "12", result_type::success, 1 );
+      verify_rule< rematch< alnum, success, digit > >( __LINE__, __FILE__, "1c", result_type::success, 1 );
+
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "1", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "%", result_type::local_failure, 1 );
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "1%", result_type::success, 1 );
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "a%", result_type::local_failure, 1 );
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "12", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "1c", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "a1", result_type::local_failure, 2 );
+      verify_rule< rematch< plus< alnum >, digit > >( __LINE__, __FILE__, "%%", result_type::local_failure, 2 );
+
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "1", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "%", result_type::local_failure, 1 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "1%", result_type::success, 1 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "a%", result_type::local_failure, 1 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "12", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "1c", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "a1", result_type::local_failure, 2 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "%%", result_type::local_failure, 2 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "aaa", result_type::local_failure, 3 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "aaa%", result_type::local_failure, 4 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "111", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "111%", result_type::success, 1 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "a1a", result_type::local_failure, 3 );
+      verify_rule< rematch< plus< alnum >, plus< digit > > >( __LINE__, __FILE__, "1a1", result_type::success, 0 );
+
+      verify_rule< rematch< plus< alnum >, seq< string< 'f', 'o', 'o' >, eof > > >( __LINE__, __FILE__, "foo", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, seq< string< 'f', 'o', 'o' >, eof > > >( __LINE__, __FILE__, "foo%", result_type::success, 1 );
+      verify_rule< rematch< plus< alnum >, seq< string< 'f', 'o', 'o' >, eof > > >( __LINE__, __FILE__, "foo5", result_type::local_failure, 4 );
+
+      verify_rule< rematch< plus< alnum >, success, seq< string< 'f', 'o', 'o' >, eof > > >( __LINE__, __FILE__, "foo", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, success, seq< string< 'f', 'o', 'o' >, eof > > >( __LINE__, __FILE__, "foo%", result_type::success, 1 );
+      verify_rule< rematch< plus< alnum >, success, seq< string< 'f', 'o', 'o' >, eof > > >( __LINE__, __FILE__, "foo5", result_type::local_failure, 4 );
+
+      verify_rule< rematch< plus< alnum >, seq< string< 'f', 'o', 'o' >, eof >, success > >( __LINE__, __FILE__, "foo", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, seq< string< 'f', 'o', 'o' >, eof >, success > >( __LINE__, __FILE__, "foo%", result_type::success, 1 );
+      verify_rule< rematch< plus< alnum >, seq< string< 'f', 'o', 'o' >, eof >, success > >( __LINE__, __FILE__, "foo5", result_type::local_failure, 4 );
+
+      verify_rule< rematch< plus< alnum >, seq< string< 'f', 'o', 'o' >, eof >, string< 'f', 'o', 'o' > > >( __LINE__, __FILE__, "foo", result_type::success, 0 );
+      verify_rule< rematch< plus< alnum >, seq< string< 'f', 'o', 'o' >, eof >, string< 'f', 'o', 'o' > > >( __LINE__, __FILE__, "foo%", result_type::success, 1 );
+      verify_rule< rematch< plus< alnum >, seq< string< 'f', 'o', 'o' >, eof >, string< 'f', 'o', 'o' > > >( __LINE__, __FILE__, "foo5", result_type::local_failure, 4 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
+
+#include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_rep.cpp b/packages/PEGTL/src/test/pegtl/rule_rep.cpp
index fa76d0ca552e1cb7d8cda9b60be6f05cf149f338..0c54cd8512bcd14b1f17a77069c43ebb0c3eded0 100644
--- a/packages/PEGTL/src/test/pegtl/rule_rep.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_rep.cpp
@@ -1,78 +1,74 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< rep< 0, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep< 0, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep< 1, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep< 1, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< rep< 7, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep< 9, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< rep< 0, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep< 0, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep< 1, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep< 1, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< rep< 7, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep< 9, any > >( __LINE__, __FILE__, true, false );
 
-         verify_analyze< rep< 0, eof, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep< 0, any, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep< 0, any, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep< 0, eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep< 1, eof, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep< 1, any, eof > >( __LINE__, __FILE__, true, false );
-         verify_analyze< rep< 1, any, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< rep< 1, eof, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< rep< 0, eof, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep< 0, any, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep< 0, any, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep< 0, eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep< 1, eof, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep< 1, any, eof > >( __LINE__, __FILE__, true, false );
+      verify_analyze< rep< 1, any, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< rep< 1, eof, any > >( __LINE__, __FILE__, true, false );
 
-         verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "bb", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "bbb", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 0 );
-         verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 1 );
-         verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "aaab", result_type::SUCCESS, 1 );
-         verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "baaab", result_type::LOCAL_FAILURE, 5 );
+      verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+      verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "bb", result_type::local_failure, 2 );
+      verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "bbb", result_type::local_failure, 3 );
+      verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::success, 0 );
+      verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::success, 1 );
+      verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "aaab", result_type::success, 1 );
+      verify_rule< rep< 3, one< 'a' > > >( __LINE__, __FILE__, "baaab", result_type::local_failure, 5 );
 
-         verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aa", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 0 );
-         verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaa", result_type::SUCCESS, 1 );
-         verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaa", result_type::SUCCESS, 2 );
-         verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaaa", result_type::SUCCESS, 3 );
+      verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+      verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::local_failure, 3 );
+      verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::success, 0 );
+      verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaa", result_type::success, 1 );
+      verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaa", result_type::success, 2 );
+      verify_rule< rep< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaaa", result_type::success, 3 );
 
-         verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 0 );
-         verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababa", result_type::SUCCESS, 1 );
-         verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababab", result_type::SUCCESS, 2 );
+      verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::local_failure, 2 );
+      verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::local_failure, 3 );
+      verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::success, 0 );
+      verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababa", result_type::success, 1 );
+      verify_rule< rep< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababab", result_type::success, 2 );
 
-         verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "", result_type::GLOBAL_FAILURE, 0 );
-         verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "a", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "ab", result_type::GLOBAL_FAILURE, 0 );
-         verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "aba", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 0 );
-         verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "ababa", result_type::SUCCESS, 1 );
-         verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "ababab", result_type::SUCCESS, 2 );
+      verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "", result_type::global_failure, 0 );
+      verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "a", result_type::global_failure, 1 );
+      verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "ab", result_type::global_failure, 0 );
+      verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "aba", result_type::global_failure, 1 );
+      verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "abab", result_type::success, 0 );
+      verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "ababa", result_type::success, 1 );
+      verify_rule< must< rep< 2, one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "ababab", result_type::success, 2 );
 
-         verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "ab", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "aba", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 0 );
-         verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "ababa", result_type::SUCCESS, 1 );
-         verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "ababab", result_type::SUCCESS, 2 );
-      }
+      verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "ab", result_type::local_failure, 2 );
+      verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "aba", result_type::local_failure, 3 );
+      verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "abab", result_type::success, 0 );
+      verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "ababa", result_type::success, 1 );
+      verify_rule< try_catch< must< rep< 2, one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "ababab", result_type::success, 2 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_rep_max.cpp b/packages/PEGTL/src/test/pegtl/rule_rep_max.cpp
index 30d19ae6c13bbd283601c3e6d39ccbf63ce9669a..60dfb0b341656786f7b038e6456f2755078cbd33 100644
--- a/packages/PEGTL/src/test/pegtl/rule_rep_max.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_rep_max.cpp
@@ -1,58 +1,54 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< rep_max< 1, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_max< 2, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_max< 1, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_max< 2, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_max< 1, any, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_max< 2, any, any > >( __LINE__, __FILE__, false, false );
-
-         verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 0 );
-         verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "b", result_type::SUCCESS, 1 );
-         verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "bb", result_type::SUCCESS, 2 );
-         verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "bbb", result_type::SUCCESS, 3 );
-         verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 0 );
-         verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "aaab", result_type::SUCCESS, 1 );
-         verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "baaab", result_type::SUCCESS, 5 );
-
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 2 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 2 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::SUCCESS, 1 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aab", result_type::SUCCESS, 3 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 0 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababb", result_type::SUCCESS, 1 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababa", result_type::SUCCESS, 1 );
-         verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababab", result_type::LOCAL_FAILURE, 6 );
-
-         verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
-         verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 0 );
-         verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 1 );
-         verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 0 );
-         verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaa", result_type::SUCCESS, 1 );
-         verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaa", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaaa", result_type::LOCAL_FAILURE, 7 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< rep_max< 1, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_max< 2, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_max< 1, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_max< 2, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_max< 1, any, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_max< 2, any, any > >( __LINE__, __FILE__, false, false );
+
+      verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 0 );
+      verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "b", result_type::success, 1 );
+      verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "bb", result_type::success, 2 );
+      verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "bbb", result_type::success, 3 );
+      verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::success, 0 );
+      verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::local_failure, 4 );
+      verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "aaab", result_type::success, 1 );
+      verify_rule< rep_max< 3, one< 'a' > > >( __LINE__, __FILE__, "baaab", result_type::success, 5 );
+
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::success, 1 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aa", result_type::success, 2 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ba", result_type::success, 2 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::success, 1 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aab", result_type::success, 3 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::success, 0 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababb", result_type::success, 1 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababa", result_type::success, 1 );
+      verify_rule< rep_max< 2, one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababab", result_type::local_failure, 6 );
+
+      verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 1 );
+      verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 0 );
+      verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::success, 1 );
+      verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::success, 0 );
+      verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaa", result_type::success, 1 );
+      verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaa", result_type::local_failure, 6 );
+      verify_rule< rep_max< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaaa", result_type::local_failure, 7 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_rep_min.cpp b/packages/PEGTL/src/test/pegtl/rule_rep_min.cpp
index 0db1afde31783a7c96abb3dec89c2e0cf636e025..20a33d5ebb0ae6cac7b5d9e011837ddeaa183c76 100644
--- a/packages/PEGTL/src/test/pegtl/rule_rep_min.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_rep_min.cpp
@@ -1,43 +1,39 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< rep_min< 0, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< rep_min< 1, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< rep_min< 0, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_min< 1, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< rep_min< 0, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< rep_min< 1, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< rep_min< 0, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_min< 1, any > >( __LINE__, __FILE__, true, false );
 
-         verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "bb", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "bbb", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 0 );
-         verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 0 );
-         verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "aaab", result_type::SUCCESS, 1 );
-         verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "baaab", result_type::LOCAL_FAILURE, 5 );
+      verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+      verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "bb", result_type::local_failure, 2 );
+      verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "bbb", result_type::local_failure, 3 );
+      verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::success, 0 );
+      verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::success, 0 );
+      verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "aaab", result_type::success, 1 );
+      verify_rule< rep_min< 3, one< 'a' > > >( __LINE__, __FILE__, "baaab", result_type::local_failure, 5 );
 
-         verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aa", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 0 );
-         verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaa", result_type::SUCCESS, 1 );
-         verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaa", result_type::SUCCESS, 0 );
-         verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaaa", result_type::SUCCESS, 1 );
-      }
+      verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+      verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::local_failure, 3 );
+      verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::success, 0 );
+      verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaa", result_type::success, 1 );
+      verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaa", result_type::success, 0 );
+      verify_rule< rep_min< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaaa", result_type::success, 1 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_rep_min_max.cpp b/packages/PEGTL/src/test/pegtl/rule_rep_min_max.cpp
index 446cd6cd8a9fc7a09320199afb188f03024d149e..8ad8a1119a7ec5b32f61aa4158c32fa418479d59 100644
--- a/packages/PEGTL/src/test/pegtl/rule_rep_min_max.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_rep_min_max.cpp
@@ -1,53 +1,49 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< rep_min_max< 0, 1, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_min_max< 0, 2, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_min_max< 1, 2, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< rep_min_max< 0, 1, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_min_max< 0, 2, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_min_max< 1, 2, eof > >( __LINE__, __FILE__, false, false );
-
-         verify_analyze< rep_min_max< 0, 1, any, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_min_max< 0, 2, any, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_min_max< 1, 2, eof, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< rep_min_max< 0, 1, eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_min_max< 0, 2, eof, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_min_max< 1, 2, eof, eof > >( __LINE__, __FILE__, false, false );
-
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 0 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 0 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 0 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "aaaaa", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "bb", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "bbb", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "bbbb", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "bbbbb", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "ba", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "baa", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "baaa", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "baaaa", result_type::LOCAL_FAILURE, 5 );
-
-         verify_rule< must< rep_min_max< 3, 4, one< 'a' > > > >( __LINE__, __FILE__, "aa", result_type::GLOBAL_FAILURE, 0 );
-
-         verify_rule< try_catch< must< rep_min_max< 3, 4, one< 'a' > > > > >( __LINE__, __FILE__, "aa", result_type::LOCAL_FAILURE, 2 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< rep_min_max< 0, 1, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_min_max< 0, 2, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_min_max< 1, 2, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< rep_min_max< 0, 1, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_min_max< 0, 2, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_min_max< 1, 2, eof > >( __LINE__, __FILE__, false, false );
+
+      verify_analyze< rep_min_max< 0, 1, any, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_min_max< 0, 2, any, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_min_max< 1, 2, eof, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< rep_min_max< 0, 1, eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_min_max< 0, 2, eof, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_min_max< 1, 2, eof, eof > >( __LINE__, __FILE__, false, false );
+
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 0 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::success, 0 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::success, 0 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "aaaaa", result_type::local_failure, 5 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "bb", result_type::local_failure, 2 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "bbb", result_type::local_failure, 3 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "bbbb", result_type::local_failure, 4 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "bbbbb", result_type::local_failure, 5 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "ba", result_type::local_failure, 2 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "baa", result_type::local_failure, 3 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "baaa", result_type::local_failure, 4 );
+      verify_rule< rep_min_max< 2, 4, one< 'a' > > >( __LINE__, __FILE__, "baaaa", result_type::local_failure, 5 );
+
+      verify_rule< must< rep_min_max< 3, 4, one< 'a' > > > >( __LINE__, __FILE__, "aa", result_type::global_failure, 0 );
+
+      verify_rule< try_catch< must< rep_min_max< 3, 4, one< 'a' > > > > >( __LINE__, __FILE__, "aa", result_type::local_failure, 2 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_rep_opt.cpp b/packages/PEGTL/src/test/pegtl/rule_rep_opt.cpp
index 56764e0729bc050b6f9d5bca6c979dc7791eb732..2e232f769405d202a4cdaeef4a6242a7c758507f 100644
--- a/packages/PEGTL/src/test/pegtl/rule_rep_opt.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_rep_opt.cpp
@@ -1,48 +1,44 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< rep_opt< 1, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_opt< 6, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_opt< 1, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_opt< 6, eof > >( __LINE__, __FILE__, false, false );
-
-         verify_analyze< rep_opt< 1, any, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_opt< 1, eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_opt< 1, any, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< rep_opt< 1, eof, eof > >( __LINE__, __FILE__, false, false );
-
-         verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 0 );
-         verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "b", result_type::SUCCESS, 1 );
-         verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "bb", result_type::SUCCESS, 2 );
-         verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "bbb", result_type::SUCCESS, 3 );
-         verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 0 );
-         verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 1 );
-         verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "aaab", result_type::SUCCESS, 1 );
-         verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "baaab", result_type::SUCCESS, 5 );
-
-         verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
-         verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 0 );
-         verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 1 );
-         verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::SUCCESS, 0 );
-         verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaa", result_type::SUCCESS, 1 );
-         verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaa", result_type::SUCCESS, 2 );
-         verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaaa", result_type::SUCCESS, 3 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< rep_opt< 1, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_opt< 6, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_opt< 1, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_opt< 6, eof > >( __LINE__, __FILE__, false, false );
+
+      verify_analyze< rep_opt< 1, any, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_opt< 1, eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_opt< 1, any, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< rep_opt< 1, eof, eof > >( __LINE__, __FILE__, false, false );
+
+      verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 0 );
+      verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "b", result_type::success, 1 );
+      verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "bb", result_type::success, 2 );
+      verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "bbb", result_type::success, 3 );
+      verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::success, 0 );
+      verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::success, 1 );
+      verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "aaab", result_type::success, 1 );
+      verify_rule< rep_opt< 3, one< 'a' > > >( __LINE__, __FILE__, "baaab", result_type::success, 5 );
+
+      verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 1 );
+      verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 0 );
+      verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::success, 1 );
+      verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaa", result_type::success, 0 );
+      verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaa", result_type::success, 1 );
+      verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaa", result_type::success, 2 );
+      verify_rule< rep_opt< 2, two< 'a' > > >( __LINE__, __FILE__, "aaaaaaa", result_type::success, 3 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_require.cpp b/packages/PEGTL/src/test/pegtl/rule_require.cpp
index f020edd3fb09eac1c2aa02120327eb2c73724e8e..0a8e389edb75ea31c2647f5e7551642dda3f3d58 100644
--- a/packages/PEGTL/src/test/pegtl/rule_require.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_require.cpp
@@ -1,41 +1,37 @@
-// Copyright (c) 2017-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< require< 0 > >( __LINE__, __FILE__, false, false );
-         verify_analyze< require< 1 > >( __LINE__, __FILE__, false, false );
-         verify_analyze< require< 9 > >( __LINE__, __FILE__, false, false );
+      verify_analyze< require< 0 > >( __LINE__, __FILE__, false, false );
+      verify_analyze< require< 1 > >( __LINE__, __FILE__, false, false );
+      verify_analyze< require< 9 > >( __LINE__, __FILE__, false, false );
 
-         verify_rule< require< 0 > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< require< 0 > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
-         verify_rule< require< 0 > >( __LINE__, __FILE__, "  ", result_type::SUCCESS, 2 );
-         verify_rule< require< 1 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< require< 1 > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
-         verify_rule< require< 1 > >( __LINE__, __FILE__, "  ", result_type::SUCCESS, 2 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "1", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "12", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "123", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "1234", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "12345", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "123456", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "1234567", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "12345678", result_type::LOCAL_FAILURE, 8 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "123456789", result_type::SUCCESS, 9 );
-         verify_rule< require< 9 > >( __LINE__, __FILE__, "123456789123456789", result_type::SUCCESS, 18 );
-      }
+      verify_rule< require< 0 > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< require< 0 > >( __LINE__, __FILE__, "a", result_type::success, 1 );
+      verify_rule< require< 0 > >( __LINE__, __FILE__, "  ", result_type::success, 2 );
+      verify_rule< require< 1 > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< require< 1 > >( __LINE__, __FILE__, "a", result_type::success, 1 );
+      verify_rule< require< 1 > >( __LINE__, __FILE__, "  ", result_type::success, 2 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "1", result_type::local_failure, 1 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "12", result_type::local_failure, 2 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "123", result_type::local_failure, 3 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "1234", result_type::local_failure, 4 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "12345", result_type::local_failure, 5 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "123456", result_type::local_failure, 6 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "1234567", result_type::local_failure, 7 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "12345678", result_type::local_failure, 8 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "123456789", result_type::success, 9 );
+      verify_rule< require< 9 > >( __LINE__, __FILE__, "123456789123456789", result_type::success, 18 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_seq.cpp b/packages/PEGTL/src/test/pegtl/rule_seq.cpp
index 405ba67982dc1fc1570d0fefa8b9bc12fcbca424..686d6ba9c5557bb6f014c511c8cb9d055beabffb 100644
--- a/packages/PEGTL/src/test/pegtl/rule_seq.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_seq.cpp
@@ -1,20 +1,16 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_seqs.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_seqs< seq >();
-      }
+      verify_seqs< seq >();
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_sor.cpp b/packages/PEGTL/src/test/pegtl/rule_sor.cpp
index d14c20b0c30b79cff1cb3cb1b61ea72931a33d2b..01385de8477cd6c9c14590541871e5f55d431cf6 100644
--- a/packages/PEGTL/src/test/pegtl/rule_sor.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_sor.cpp
@@ -1,53 +1,49 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< sor< eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< sor< any > >( __LINE__, __FILE__, true, false );
-
-         verify_analyze< sor< any, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< sor< eof, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< sor< eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< sor< any, any > >( __LINE__, __FILE__, true, false );
-
-         verify_analyze< sor< any, any, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< sor< any, eof, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< sor< any, eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< sor< any, any, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< sor< eof, any, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< sor< eof, eof, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< sor< eof, eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< sor< eof, any, any > >( __LINE__, __FILE__, false, false );
-
-         verify_rule< sor<> >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< sor<> >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-
-         verify_rule< sor< one< 'a' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< sor< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< sor< one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 1 );
-
-         verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", result_type::SUCCESS, 0 );
-         verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "c", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 1 );
-         verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 1 );
-         verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 1 );
-         verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bb", result_type::SUCCESS, 1 );
-         verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "cb", result_type::LOCAL_FAILURE, 2 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< sor< eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< sor< any > >( __LINE__, __FILE__, true, false );
+
+      verify_analyze< sor< any, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< sor< eof, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< sor< eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< sor< any, any > >( __LINE__, __FILE__, true, false );
+
+      verify_analyze< sor< any, any, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< sor< any, eof, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< sor< any, eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< sor< any, any, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< sor< eof, any, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< sor< eof, eof, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< sor< eof, eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< sor< eof, any, any > >( __LINE__, __FILE__, false, false );
+
+      verify_rule< sor<> >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< sor<> >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+
+      verify_rule< sor< one< 'a' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< sor< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< sor< one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 1 );
+
+      verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", result_type::success, 0 );
+      verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "c", result_type::local_failure, 1 );
+      verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aa", result_type::success, 1 );
+      verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::success, 1 );
+      verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ba", result_type::success, 1 );
+      verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bb", result_type::success, 1 );
+      verify_rule< sor< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "cb", result_type::local_failure, 2 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_star.cpp b/packages/PEGTL/src/test/pegtl/rule_star.cpp
index 4bf89e78faf8bb2c428608fe5b4481abb0a334d4..1689eaff6aece9b6073ccef19a1fe1f67a48e808 100644
--- a/packages/PEGTL/src/test/pegtl/rule_star.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_star.cpp
@@ -1,40 +1,36 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< star< eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< star< any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< star< eof, eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< star< any, eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< star< eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< star< any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< star< eof, eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< star< any, eof, any > >( __LINE__, __FILE__, false, false );
 
-         verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 0 );
-         verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 0 );
-         verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 2 );
-         verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "b", result_type::SUCCESS, 1 );
+      verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 0 );
+      verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::success, 0 );
+      verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "ba", result_type::success, 2 );
+      verify_rule< star< one< 'a' > > >( __LINE__, __FILE__, "b", result_type::success, 1 );
 
-         verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
-         verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-         verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::SUCCESS, 1 );
-         verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 0 );
-         verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababc", result_type::SUCCESS, 1 );
-         verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababab", result_type::SUCCESS, 0 );
-      }
+      verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::success, 1 );
+      verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+      verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::success, 1 );
+      verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::success, 0 );
+      verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababc", result_type::success, 1 );
+      verify_rule< star< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababab", result_type::success, 0 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_star_must.cpp b/packages/PEGTL/src/test/pegtl/rule_star_must.cpp
index ed72bb6dc731682f685d80ec1f2046c268494e7b..b2300c8f723be4045371b5580dfaf9eed1e66da5 100644
--- a/packages/PEGTL/src/test/pegtl/rule_star_must.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_star_must.cpp
@@ -1,40 +1,36 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< star_must< eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< star_must< any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< star_must< eof, eof, eof > >( __LINE__, __FILE__, false, true );
-         verify_analyze< star_must< any, eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< star_must< eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< star_must< any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< star_must< eof, eof, eof > >( __LINE__, __FILE__, false, true );
+      verify_analyze< star_must< any, eof, any > >( __LINE__, __FILE__, false, false );
 
-         verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 0 );
-         verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::SUCCESS, 0 );
-         verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 2 );
-         verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "b", result_type::SUCCESS, 1 );
+      verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 0 );
+      verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "aaa", result_type::success, 0 );
+      verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "ba", result_type::success, 2 );
+      verify_rule< star_must< one< 'a' > > >( __LINE__, __FILE__, "b", result_type::success, 1 );
 
-         verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::GLOBAL_FAILURE, 3 );
-         verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::SUCCESS, 1 );
-         verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 0 );
-         verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababc", result_type::SUCCESS, 1 );
-         verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababab", result_type::SUCCESS, 0 );
-      }
+      verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::global_failure, 1 );
+      verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::global_failure, 3 );
+      verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::success, 1 );
+      verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::success, 0 );
+      verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababc", result_type::success, 1 );
+      verify_rule< star_must< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ababab", result_type::success, 0 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_state.cpp b/packages/PEGTL/src/test/pegtl/rule_state.cpp
index 2db82feb26213d5e878177e6f83b8b9b26f3dca0..34560037b42abd5736d003bd36f81bd95e289dd2 100644
--- a/packages/PEGTL/src/test/pegtl/rule_state.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_state.cpp
@@ -1,57 +1,32 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_seqs.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct test_state_state
    {
-      struct test_state_state
+      template< typename Input >
+      explicit test_state_state( const Input& /*unused*/ )
       {
-         template< typename Input >
-         explicit test_state_state( const Input& /*unused*/ )
-         {
-         }
-
-         template< typename Input >
-         void success( const Input& /*unused*/ ) const
-         {
-         }
-      };
-
-      struct test_state_with_template_parameters_state
-      {
-         template< typename Input >
-         explicit test_state_with_template_parameters_state( const Input& /*unused*/ )
-         {
-         }
-
-         template< apply_mode,
-                   rewind_mode,
-                   template< typename... > class Action,
-                   template< typename... > class Control,
-                   typename Input >
-         void success( const Input& /*unused*/ ) const
-         {
-         }
-      };
-
-      template< typename... Rules >
-      using test_state_rule = state< test_state_state, Rules... >;
-
-      template< typename... Rules >
-      using test_state_with_template_parameters_rule = state< test_state_with_template_parameters_state, Rules... >;
+      }
 
-      void unit_test()
+      template< typename Input >
+      void success( const Input& /*unused*/ ) const
       {
-         verify_seqs< test_state_rule >();
-         verify_seqs< test_state_with_template_parameters_rule >();
       }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename... Rules >
+   using test_state_rule = state< test_state_state, Rules... >;
+
+   void unit_test()
+   {
+      verify_seqs< test_state_rule >();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_success.cpp b/packages/PEGTL/src/test/pegtl/rule_success.cpp
index d927f708ea45ce67b8679ea7c5f2acb6d1433717..08e4185fc017a87050763cd601b6b73c33636d13 100644
--- a/packages/PEGTL/src/test/pegtl/rule_success.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_success.cpp
@@ -1,28 +1,24 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_analyze< success >( __LINE__, __FILE__, false, false );
+      verify_analyze< success >( __LINE__, __FILE__, false, false );
 
-         verify_rule< success >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
+      verify_rule< success >( __LINE__, __FILE__, "", result_type::success, 0 );
 
-         for( char i = 1; i < 127; ++i ) {
-            char t[] = { i, 0 };
-            verify_rule< success >( __LINE__, __FILE__, std::string( t ), result_type::SUCCESS, 1 );
-         }
+      for( char i = 1; i < 127; ++i ) {
+         char t[] = { i, 0 };  // NOLINT
+         verify_rule< success >( __LINE__, __FILE__, std::string( t ), result_type::success, 1 );
       }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_try_catch.cpp b/packages/PEGTL/src/test/pegtl/rule_try_catch.cpp
index 0f6fbc4ff8744c6663282aea4f8b740a7a64ed10..646aa86fdd93506bac293793ffe2f7264d1336d6 100644
--- a/packages/PEGTL/src/test/pegtl/rule_try_catch.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_try_catch.cpp
@@ -1,24 +1,20 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_seqs.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      template< typename... Rules >
-      using test_try_catch_rule = try_catch< must< Rules... > >;
-
-      void unit_test()
-      {
-         verify_seqs< try_catch >();
-         verify_seqs< test_try_catch_rule >();
-      }
+   template< typename... Rules >
+   using test_try_catch_rule = try_catch< must< Rules... > >;
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
+   {
+      verify_seqs< try_catch >();
+      verify_seqs< test_try_catch_rule >();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/rule_until.cpp b/packages/PEGTL/src/test/pegtl/rule_until.cpp
index ade660ac4826a53f220b70951033375e037da7c2..10f315c77993240f4a9dfefe4c86ac59804a7fb9 100644
--- a/packages/PEGTL/src/test/pegtl/rule_until.cpp
+++ b/packages/PEGTL/src/test/pegtl/rule_until.cpp
@@ -1,120 +1,118 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   struct my_rule
    {
-      struct my_rule
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      static bool match( Input& /*unused*/, bool& v, States... /*unused*/ )
       {
-         template< apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control,
-                   typename Input >
-         static bool match( Input& /*unused*/, bool& v )
-         {
-            return v;
-         }
-      };
-
-      template< typename Rule >
-      struct my_action : nothing< Rule >
-      {
-      };
+         return v;
+      }
+   };
 
-      template<>
-      struct my_action< eof >
-      {
-         static void apply0( bool& v )
-         {
-            v = true;
-         }
-      };
+   template< typename Rule >
+   struct my_action
+   {};
 
-      void unit_test()
+   template<>
+   struct my_action< eof >
+   {
+      static void apply0( bool& v )
       {
-         verify_analyze< until< eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< until< any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< until< eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< until< any, any > >( __LINE__, __FILE__, true, false );
-
-         verify_rule< until< eof > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< until< any > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "bba", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbba", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "bab", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "bbab", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbbab", result_type::SUCCESS, 1 );
-
-         verify_rule< must< until< one< 'a' > > > >( __LINE__, __FILE__, "bbb", result_type::GLOBAL_FAILURE, 0 );
-
-         verify_rule< try_catch< must< until< one< 'a' > > > > >( __LINE__, __FILE__, "bbb", result_type::LOCAL_FAILURE, 3 );
-
-         verify_rule< until< eof, any > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< until< any, any > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "bba", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbba", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "bab", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "bbab", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbbab", result_type::SUCCESS, 1 );
-
-         verify_rule< until< eof, one< 'a' > > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< until< eof, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< until< eof, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 0 );
-         verify_rule< until< eof, one< 'a' > > >( __LINE__, __FILE__, "aaaaab", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< until< eof, one< 'a' > > >( __LINE__, __FILE__, "baaaaa", result_type::LOCAL_FAILURE, 6 );
-
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aa", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bb", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ba", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bba", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bbbbbbbbbbbbbba", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "baa", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bbaa", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbaa", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bab", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bbab", result_type::SUCCESS, 1 );
-         verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbab", result_type::SUCCESS, 1 );
-
-         verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "a", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bca", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bcbca", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bcbcbcbcbca", result_type::SUCCESS, 0 );
-         verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "babca", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bcbcb", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "cbcbc", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bcbcbc", result_type::LOCAL_FAILURE, 6 );
-
-         verify_rule< must< until< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "bbb", result_type::GLOBAL_FAILURE, 0 );
-         verify_rule< must< until< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "bbbc", result_type::GLOBAL_FAILURE, 1 );
-
-         verify_rule< try_catch< must< until< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "bbb", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< try_catch< must< until< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "bbbc", result_type::LOCAL_FAILURE, 4 );
-
-         bool success = false;
-         const bool result = parse< until< my_rule, eof >, my_action >( memory_input<>( "", __FUNCTION__ ), success );
-         TAO_PEGTL_TEST_ASSERT( result );
-         TAO_PEGTL_TEST_ASSERT( success );
+         v = true;
       }
+   };
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+   void unit_test()
+   {
+      verify_analyze< until< eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< until< any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< until< eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< until< any, any > >( __LINE__, __FILE__, true, false );
+
+      verify_rule< until< eof > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< until< any > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "ba", result_type::success, 0 );
+      verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "bba", result_type::success, 0 );
+      verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbba", result_type::success, 0 );
+      verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "ab", result_type::success, 1 );
+      verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "bab", result_type::success, 1 );
+      verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "bbab", result_type::success, 1 );
+      verify_rule< until< one< 'a' > > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbbab", result_type::success, 1 );
+
+      verify_rule< must< until< one< 'a' > > > >( __LINE__, __FILE__, "bbb", result_type::global_failure, 0 );
+
+      verify_rule< try_catch< must< until< one< 'a' > > > > >( __LINE__, __FILE__, "bbb", result_type::local_failure, 3 );
+
+      verify_rule< until< eof, any > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< until< any, any > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "ba", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "bba", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbba", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "ab", result_type::success, 1 );
+      verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "bab", result_type::success, 1 );
+      verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "bbab", result_type::success, 1 );
+      verify_rule< until< one< 'a' >, any > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbbab", result_type::success, 1 );
+
+      verify_rule< until< eof, one< 'a' > > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< until< eof, one< 'a' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< until< eof, one< 'a' > > >( __LINE__, __FILE__, "aa", result_type::success, 0 );
+      verify_rule< until< eof, one< 'a' > > >( __LINE__, __FILE__, "aaaaab", result_type::local_failure, 6 );
+      verify_rule< until< eof, one< 'a' > > >( __LINE__, __FILE__, "baaaaa", result_type::local_failure, 6 );
+
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aa", result_type::success, 1 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::success, 1 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bb", result_type::local_failure, 2 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ba", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bba", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bbbbbbbbbbbbbba", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "baa", result_type::success, 1 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bbaa", result_type::success, 1 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbaa", result_type::success, 1 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bab", result_type::success, 1 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bbab", result_type::success, 1 );
+      verify_rule< until< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "bbbbbbbbbbbbbbab", result_type::success, 1 );
+
+      verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "a", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bca", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bcbca", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bcbcbcbcbca", result_type::success, 0 );
+      verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "babca", result_type::local_failure, 5 );
+      verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bcbcb", result_type::local_failure, 5 );
+      verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "cbcbc", result_type::local_failure, 5 );
+      verify_rule< until< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "bcbcbc", result_type::local_failure, 6 );
+
+      verify_rule< must< until< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "bbb", result_type::global_failure, 0 );
+      verify_rule< must< until< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "bbbc", result_type::global_failure, 1 );
+
+      verify_rule< try_catch< must< until< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "bbb", result_type::local_failure, 3 );
+      verify_rule< try_catch< must< until< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "bbbc", result_type::local_failure, 4 );
+
+      bool success = false;
+      const bool result = parse< until< my_rule, eof >, my_action >( memory_input<>( "", __FUNCTION__ ), success );
+      TAO_PEGTL_TEST_ASSERT( result );
+      TAO_PEGTL_TEST_ASSERT( success );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/test.hpp b/packages/PEGTL/src/test/pegtl/test.hpp
index 6094d02af525ee9f6787cd54ddae9e1fbbbdc6cc..e00d7b47c5537a738f8df99bd571fc25f907cf5f 100644
--- a/packages/PEGTL/src/test/pegtl/test.hpp
+++ b/packages/PEGTL/src/test/pegtl/test.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_TEST_HPP  // NOLINT
@@ -6,22 +6,19 @@
 
 #include <cstddef>
 #include <iostream>
-#include <string>
-#include <utility>
-#include <vector>
 
 #include <tao/pegtl.hpp>
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      std::size_t failed = 0;                                        // NOLINT
-      std::vector< std::pair< std::string, std::string > > applied;  // NOLINT
+   std::size_t failed = 0;  // NOLINT
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+#define TAO_TEST_STRINGIZE_INTERNAL( ... ) #__VA_ARGS__
+#define TAO_TEST_STRINGIZE( ... ) TAO_TEST_STRINGIZE_INTERNAL( __VA_ARGS__ )
 
-}  // namespace tao
+#define TAO_TEST_LINE TAO_TEST_STRINGIZE( __LINE__ )
 
 #define TAO_PEGTL_TEST_UNWRAP( ... ) __VA_ARGS__
 
@@ -39,11 +36,11 @@ namespace tao
       ++failed;                                     \
    } while( false )
 
-#define TAO_PEGTL_TEST_ASSERT( eXPReSSioN )        \
+#define TAO_PEGTL_TEST_ASSERT( ... )               \
    do {                                            \
-      if( !( eXPReSSioN ) ) {                      \
+      if( !( __VA_ARGS__ ) ) {                     \
          std::cerr << "pegtl: unit test assert [ " \
-                   << ( #eXPReSSioN )              \
+                   << ( #__VA_ARGS__ )             \
                    << " ] failed in line [ "       \
                    << __LINE__                     \
                    << " ] file [ "                 \
@@ -70,44 +67,32 @@ namespace tao
       }                                             \
    } while( false )
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< unsigned Size, apply_mode B, rewind_mode N, typename... Rules >
+   struct test_rule
    {
-      template< unsigned Size, apply_mode B, rewind_mode N, typename... Rules >
-      struct test_rule
+      using analyze_t = typename seq< Rules... >::analyze_t;
+
+      template< apply_mode A,
+                rewind_mode M,
+                template< typename... >
+                class Action,
+                template< typename... >
+                class Control,
+                typename Input,
+                typename... States >
+      static bool match( Input& in, States&&... st )
       {
-         using analyze_t = typename seq< Rules... >::analyze_t;
-
-         template< apply_mode A,
-                   rewind_mode M,
-                   template< typename... > class Action,
-                   template< typename... > class Control,
-                   typename Input,
-                   typename... States >
-         static bool match( Input& in, States&&... st )
-         {
-            static_assert( A == B, "unexpected apply mode" );
-            static_assert( M == N, "unexpected rewind mode" );
-
-            TAO_PEGTL_TEST_ASSERT( in.size() == Size );
-
-            return seq< Rules... >::template match< A, M, Action, Control >( in, st... );
-         }
-      };
-
-      template< typename Rule >
-      struct test_action
-      {
-         template< typename Input >
-         static void apply( const Input& in )
-         {
-            applied.push_back( std::make_pair( internal::demangle< Rule >(), in.string() ) );
-         }
-      };
+         static_assert( A == B, "unexpected apply mode" );
+         static_assert( M == N, "unexpected rewind mode" );
+
+         TAO_PEGTL_TEST_ASSERT( in.size() == Size );
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+         return seq< Rules... >::template match< A, M, Action, Control >( in, st... );
+      }
+   };
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/src/test/pegtl/tester.cpp b/packages/PEGTL/src/test/pegtl/tester.cpp
index 9d8ffbf7cd852f972fcee1ea3960c27fa6203409..42fdeceb44261b8dcd37c8b7a21cff89f281dc28 100644
--- a/packages/PEGTL/src/test/pegtl/tester.cpp
+++ b/packages/PEGTL/src/test/pegtl/tester.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include <iostream>
diff --git a/packages/PEGTL/src/test/pegtl/uint16_general.cpp b/packages/PEGTL/src/test/pegtl/uint16_general.cpp
index 4e1fbd88b9b41d644c07911dbf98fcf49f9dc955..18e6748eee7ab3c2ace5ab07db8c53308035084f 100644
--- a/packages/PEGTL/src/test/pegtl/uint16_general.cpp
+++ b/packages/PEGTL/src/test/pegtl/uint16_general.cpp
@@ -1,178 +1,174 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_rule< uint16_be::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::any >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint16_le::any >( __LINE__, __FILE__, "", result_type::local_failure );
 
-         verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x01", result_type::local_failure );
+      verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x01", result_type::local_failure );
 
-         verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x01\x02", result_type::SUCCESS );
-         verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x71\x72", result_type::SUCCESS );
-         verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x01\x02", result_type::SUCCESS );
-         verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x71\x72", result_type::SUCCESS );
+      verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x01\x02", result_type::success );
+      verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x71\x72", result_type::success );
+      verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x01\x02", result_type::success );
+      verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x71\x72", result_type::success );
 
-         verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x01\x02\x03", result_type::SUCCESS, 1 );
-         verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::SUCCESS, 1 );
-         verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x01\x02\x03", result_type::SUCCESS, 1 );
-         verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::SUCCESS, 1 );
+      verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x01\x02\x03", result_type::success, 1 );
+      verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::success, 1 );
+      verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x01\x02\x03", result_type::success, 1 );
+      verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::success, 1 );
 
-         verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x01\x02\x03\x55", result_type::SUCCESS, 2 );
-         verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::SUCCESS, 2 );
-         verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x01\x02\x03\x55", result_type::SUCCESS, 2 );
-         verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::SUCCESS, 2 );
+      verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x01\x02\x03\x55", result_type::success, 2 );
+      verify_rule< uint16_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::success, 2 );
+      verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x01\x02\x03\x55", result_type::success, 2 );
+      verify_rule< uint16_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::success, 2 );
 
-         verify_rule< uint16_be::mask_not_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::mask_not_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01", result_type::local_failure );
 
-         verify_rule< uint16_be::mask_not_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::mask_not_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::SUCCESS );
+      verify_rule< uint16_be::mask_not_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::local_failure );
+      verify_rule< uint16_be::mask_not_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::success );
 
-         verify_rule< uint16_le::mask_not_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::SUCCESS );
-         verify_rule< uint16_le::mask_not_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_le::mask_not_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::success );
+      verify_rule< uint16_le::mask_not_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::local_failure );
 
-         verify_rule< uint16_be::mask_not_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\xf3\x11", result_type::SUCCESS );
-         verify_rule< uint16_be::mask_not_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\xf1\x11", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::mask_not_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\xf3\x11", result_type::success );
+      verify_rule< uint16_be::mask_not_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\xf1\x11", result_type::local_failure );
 
-         verify_rule< uint16_le::mask_not_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\xf3", result_type::SUCCESS );
-         verify_rule< uint16_le::mask_not_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\xf1", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_le::mask_not_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\xf3", result_type::success );
+      verify_rule< uint16_le::mask_not_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\xf1", result_type::local_failure );
 
-         verify_rule< uint16_be::mask_not_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::mask_not_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::SUCCESS );
+      verify_rule< uint16_be::mask_not_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::local_failure );
+      verify_rule< uint16_be::mask_not_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::success );
 
-         verify_rule< uint16_le::mask_not_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::SUCCESS );
-         verify_rule< uint16_le::mask_not_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_le::mask_not_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::success );
+      verify_rule< uint16_le::mask_not_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::local_failure );
 
-         verify_rule< uint16_be::mask_not_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x52\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::mask_not_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x56\x77", result_type::SUCCESS );
+      verify_rule< uint16_be::mask_not_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x52\x77", result_type::local_failure );
+      verify_rule< uint16_be::mask_not_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x56\x77", result_type::success );
 
-         verify_rule< uint16_le::mask_not_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x52", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::mask_not_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x56", result_type::SUCCESS );
+      verify_rule< uint16_le::mask_not_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x52", result_type::local_failure );
+      verify_rule< uint16_le::mask_not_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x56", result_type::success );
 
-         verify_rule< uint16_be::mask_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::SUCCESS );
-         verify_rule< uint16_be::mask_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::mask_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::success );
+      verify_rule< uint16_be::mask_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::local_failure );
 
-         verify_rule< uint16_le::mask_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::mask_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::SUCCESS );
+      verify_rule< uint16_le::mask_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::local_failure );
+      verify_rule< uint16_le::mask_one< 0xffff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::success );
 
-         verify_rule< uint16_be::mask_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\xf3\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::mask_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\xf1\x11", result_type::SUCCESS );
+      verify_rule< uint16_be::mask_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\xf3\x11", result_type::local_failure );
+      verify_rule< uint16_be::mask_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\xf1\x11", result_type::success );
 
-         verify_rule< uint16_le::mask_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\xf3", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::mask_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\xf1", result_type::SUCCESS );
+      verify_rule< uint16_le::mask_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\xf3", result_type::local_failure );
+      verify_rule< uint16_le::mask_one< 0x0fff, 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\xf1", result_type::success );
 
-         verify_rule< uint16_be::mask_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::SUCCESS );
-         verify_rule< uint16_be::mask_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::mask_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::success );
+      verify_rule< uint16_be::mask_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::local_failure );
 
-         verify_rule< uint16_le::mask_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::mask_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::SUCCESS );
+      verify_rule< uint16_le::mask_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::local_failure );
+      verify_rule< uint16_le::mask_range< 0xffff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::success );
 
-         verify_rule< uint16_be::mask_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x52\x77", result_type::SUCCESS );
-         verify_rule< uint16_be::mask_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x56\x77", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::mask_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x52\x77", result_type::success );
+      verify_rule< uint16_be::mask_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x56\x77", result_type::local_failure );
 
-         verify_rule< uint16_le::mask_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x52", result_type::SUCCESS );
-         verify_rule< uint16_le::mask_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x56", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_le::mask_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x52", result_type::success );
+      verify_rule< uint16_le::mask_range< 0x0fff, 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x56", result_type::local_failure );
 
-         verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x01\x23", result_type::SUCCESS );
-         verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x02\x34", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x03\x45", result_type::SUCCESS );
-         verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x67\x89", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x01\x23", result_type::success );
+      verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x02\x34", result_type::local_failure );
+      verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x03\x45", result_type::success );
+      verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x67\x89", result_type::local_failure );
 
-         verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x23\x01", result_type::SUCCESS );
-         verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x45\x03", result_type::SUCCESS );
-         verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x89\x67", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x23\x01", result_type::success );
+      verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x34\x02", result_type::local_failure );
+      verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x45\x03", result_type::success );
+      verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x89\x67", result_type::local_failure );
 
-         verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x01\x23", result_type::SUCCESS );
-         verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x02\x34", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x03\x45", result_type::SUCCESS );
-         verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x67\x89", result_type::SUCCESS );
+      verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x01\x23", result_type::success );
+      verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x02\x34", result_type::local_failure );
+      verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x03\x45", result_type::success );
+      verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x67\x89", result_type::success );
 
-         verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x23\x01", result_type::SUCCESS );
-         verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x45\x03", result_type::SUCCESS );
-         verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x89\x67", result_type::SUCCESS );
+      verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x23\x01", result_type::success );
+      verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x34\x02", result_type::local_failure );
+      verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x45\x03", result_type::success );
+      verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x89\x67", result_type::success );
 
-         verify_rule< uint16_be::mask_ranges< 0xff0f, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x02\x50", result_type::SUCCESS );
-         verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x02\x50", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::mask_ranges< 0xff0f, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x02\x50", result_type::success );
+      verify_rule< uint16_be::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x02\x50", result_type::local_failure );
 
-         verify_rule< uint16_le::mask_ranges< 0xff0f, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x50\x02", result_type::SUCCESS );
-         verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x50\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_le::mask_ranges< 0xff0f, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x50\x02", result_type::success );
+      verify_rule< uint16_le::mask_ranges< 0xffff, 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x50\x02", result_type::local_failure );
 
-         verify_rule< uint16_be::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::SUCCESS );
-         verify_rule< uint16_be::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x01\x67\x45", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::success );
+      verify_rule< uint16_be::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x01\x67\x45", result_type::local_failure );
 
-         verify_rule< uint16_le::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x01\x67\x45", result_type::SUCCESS );
+      verify_rule< uint16_le::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::local_failure );
+      verify_rule< uint16_le::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x01\x67\x45", result_type::success );
 
-         verify_rule< uint16_be::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x81\x23\x45\x67", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::mask_string< 0x4fff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x81\x23\x45\x67", result_type::SUCCESS );
+      verify_rule< uint16_be::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x81\x23\x45\x67", result_type::local_failure );
+      verify_rule< uint16_be::mask_string< 0x4fff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x81\x23\x45\x67", result_type::success );
 
-         verify_rule< uint16_le::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x81\x67\x45", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::mask_string< 0x4fff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x81\x67\x45", result_type::SUCCESS );
+      verify_rule< uint16_le::mask_string< 0xffff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x81\x67\x45", result_type::local_failure );
+      verify_rule< uint16_le::mask_string< 0x4fff, 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x81\x67\x45", result_type::success );
 
-         verify_rule< uint16_be::not_one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::not_one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::SUCCESS );
+      verify_rule< uint16_be::not_one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::local_failure );
+      verify_rule< uint16_be::not_one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::success );
 
-         verify_rule< uint16_le::not_one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::SUCCESS );
-         verify_rule< uint16_le::not_one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_le::not_one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::success );
+      verify_rule< uint16_le::not_one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::local_failure );
 
-         verify_rule< uint16_be::not_range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::not_range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::SUCCESS );
+      verify_rule< uint16_be::not_range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::local_failure );
+      verify_rule< uint16_be::not_range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::success );
 
-         verify_rule< uint16_le::not_range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::SUCCESS );
-         verify_rule< uint16_le::not_range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_le::not_range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::success );
+      verify_rule< uint16_le::not_range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::local_failure );
 
-         verify_rule< uint16_be::one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::SUCCESS );
-         verify_rule< uint16_be::one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::success );
+      verify_rule< uint16_be::one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::local_failure );
 
-         verify_rule< uint16_le::one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::SUCCESS );
+      verify_rule< uint16_le::one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x01\x11", result_type::local_failure );
+      verify_rule< uint16_le::one< 0x0111, 0x0222 > >( __LINE__, __FILE__, "\x11\x01", result_type::success );
 
-         verify_rule< uint16_be::range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::SUCCESS );
-         verify_rule< uint16_be::range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::success );
+      verify_rule< uint16_be::range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::local_failure );
 
-         verify_rule< uint16_le::range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::SUCCESS );
+      verify_rule< uint16_le::range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x02\x77", result_type::local_failure );
+      verify_rule< uint16_le::range< 0x0100, 0x0400 > >( __LINE__, __FILE__, "\x77\x02", result_type::success );
 
-         verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x01\x23", result_type::SUCCESS );
-         verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x02\x34", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x03\x45", result_type::SUCCESS );
-         verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x67\x89", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x01\x23", result_type::success );
+      verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x02\x34", result_type::local_failure );
+      verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x03\x45", result_type::success );
+      verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x67\x89", result_type::local_failure );
 
-         verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x23\x01", result_type::SUCCESS );
-         verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x45\x03", result_type::SUCCESS );
-         verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x89\x67", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x23\x01", result_type::success );
+      verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x34\x02", result_type::local_failure );
+      verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x45\x03", result_type::success );
+      verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444 > >( __LINE__, __FILE__, "\x89\x67", result_type::local_failure );
 
-         verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x01\x23", result_type::SUCCESS );
-         verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x02\x34", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x03\x45", result_type::SUCCESS );
-         verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x67\x89", result_type::SUCCESS );
+      verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x01\x23", result_type::success );
+      verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x02\x34", result_type::local_failure );
+      verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x03\x45", result_type::success );
+      verify_rule< uint16_be::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x67\x89", result_type::success );
 
-         verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x23\x01", result_type::SUCCESS );
-         verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x45\x03", result_type::SUCCESS );
-         verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x89\x67", result_type::SUCCESS );
+      verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x23\x01", result_type::success );
+      verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x34\x02", result_type::local_failure );
+      verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x45\x03", result_type::success );
+      verify_rule< uint16_le::ranges< 0x0111, 0x0222, 0x0333, 0x0444, 0x6789 > >( __LINE__, __FILE__, "\x89\x67", result_type::success );
 
-         verify_rule< uint16_be::string< 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::SUCCESS );
-         verify_rule< uint16_be::string< 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x01\x67\x45", result_type::LOCAL_FAILURE );
+      verify_rule< uint16_be::string< 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::success );
+      verify_rule< uint16_be::string< 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x01\x67\x45", result_type::local_failure );
 
-         verify_rule< uint16_le::string< 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::LOCAL_FAILURE );
-         verify_rule< uint16_le::string< 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x01\x67\x45", result_type::SUCCESS );
-      }
+      verify_rule< uint16_le::string< 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::local_failure );
+      verify_rule< uint16_le::string< 0x0123, 0x4567 > >( __LINE__, __FILE__, "\x23\x01\x67\x45", result_type::success );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/uint32_general.cpp b/packages/PEGTL/src/test/pegtl/uint32_general.cpp
index 3c4c6f3ce20c14250ec3d5553de17d1c7b55172f..4ed62de18774e756fe7e91e54941f32200bbe72a 100644
--- a/packages/PEGTL/src/test/pegtl/uint32_general.cpp
+++ b/packages/PEGTL/src/test/pegtl/uint32_general.cpp
@@ -1,183 +1,179 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_rule< uint32_be::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::any >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint32_le::any >( __LINE__, __FILE__, "", result_type::local_failure );
 
-         verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x01", result_type::local_failure );
+      verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x01", result_type::local_failure );
 
-         verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x01\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x71\x72", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x01\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x71\x72", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x01\x02", result_type::local_failure );
+      verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x71\x72", result_type::local_failure );
+      verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x01\x02", result_type::local_failure );
+      verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x71\x72", result_type::local_failure );
 
-         verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x01\x02\x03", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x01\x02\x03", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x01\x02\x03", result_type::local_failure );
+      verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::local_failure );
+      verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x01\x02\x03", result_type::local_failure );
+      verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::local_failure );
 
-         verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x01\x02\x03\x55", result_type::SUCCESS );
-         verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::SUCCESS );
-         verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x01\x02\x03\x55", result_type::SUCCESS );
-         verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::SUCCESS );
+      verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x01\x02\x03\x55", result_type::success );
+      verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::success );
+      verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x01\x02\x03\x55", result_type::success );
+      verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::success );
 
-         verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x01\x02\x03\x55\x44", result_type::SUCCESS, 1 );
-         verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44", result_type::SUCCESS, 1 );
-         verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x01\x02\x03\x55\x44", result_type::SUCCESS, 1 );
-         verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44", result_type::SUCCESS, 1 );
+      verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x01\x02\x03\x55\x44", result_type::success, 1 );
+      verify_rule< uint32_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44", result_type::success, 1 );
+      verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x01\x02\x03\x55\x44", result_type::success, 1 );
+      verify_rule< uint32_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44", result_type::success, 1 );
 
-         verify_rule< uint32_be::mask_not_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::mask_not_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11", result_type::local_failure );
 
-         verify_rule< uint32_be::mask_not_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::mask_not_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::SUCCESS );
+      verify_rule< uint32_be::mask_not_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::local_failure );
+      verify_rule< uint32_be::mask_not_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::success );
 
-         verify_rule< uint32_le::mask_not_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::SUCCESS );
-         verify_rule< uint32_le::mask_not_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_le::mask_not_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::success );
+      verify_rule< uint32_le::mask_not_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::local_failure );
 
-         verify_rule< uint32_be::mask_not_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\xf3\x11\x11\x11", result_type::SUCCESS );
-         verify_rule< uint32_be::mask_not_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\xf1\x11\x11\x11", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::mask_not_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\xf3\x11\x11\x11", result_type::success );
+      verify_rule< uint32_be::mask_not_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\xf1\x11\x11\x11", result_type::local_failure );
 
-         verify_rule< uint32_le::mask_not_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\xf3", result_type::SUCCESS );
-         verify_rule< uint32_le::mask_not_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\xf1", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_le::mask_not_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\xf3", result_type::success );
+      verify_rule< uint32_le::mask_not_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\xf1", result_type::local_failure );
 
-         verify_rule< uint32_be::mask_not_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::mask_not_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::SUCCESS );
+      verify_rule< uint32_be::mask_not_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::local_failure );
+      verify_rule< uint32_be::mask_not_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::success );
 
-         verify_rule< uint32_le::mask_not_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::SUCCESS );
-         verify_rule< uint32_le::mask_not_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_le::mask_not_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::success );
+      verify_rule< uint32_le::mask_not_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::local_failure );
 
-         verify_rule< uint32_be::mask_not_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x52\x77\x77\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::mask_not_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x56\x77\x77\x77", result_type::SUCCESS );
+      verify_rule< uint32_be::mask_not_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x52\x77\x77\x77", result_type::local_failure );
+      verify_rule< uint32_be::mask_not_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x56\x77\x77\x77", result_type::success );
 
-         verify_rule< uint32_le::mask_not_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x52", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::mask_not_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x56", result_type::SUCCESS );
+      verify_rule< uint32_le::mask_not_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x52", result_type::local_failure );
+      verify_rule< uint32_le::mask_not_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x56", result_type::success );
 
-         verify_rule< uint32_be::mask_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::SUCCESS );
-         verify_rule< uint32_be::mask_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::mask_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::success );
+      verify_rule< uint32_be::mask_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::local_failure );
 
-         verify_rule< uint32_le::mask_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::mask_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::SUCCESS );
+      verify_rule< uint32_le::mask_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::local_failure );
+      verify_rule< uint32_le::mask_one< 0xffffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::success );
 
-         verify_rule< uint32_be::mask_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\xf3\x11\x11\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::mask_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\xf1\x11\x11\x11", result_type::SUCCESS );
+      verify_rule< uint32_be::mask_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\xf3\x11\x11\x11", result_type::local_failure );
+      verify_rule< uint32_be::mask_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\xf1\x11\x11\x11", result_type::success );
 
-         verify_rule< uint32_le::mask_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\xf3", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::mask_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\xf1", result_type::SUCCESS );
+      verify_rule< uint32_le::mask_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\xf3", result_type::local_failure );
+      verify_rule< uint32_le::mask_one< 0x0fffffff, 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\xf1", result_type::success );
 
-         verify_rule< uint32_be::mask_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::SUCCESS );
-         verify_rule< uint32_be::mask_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::mask_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::success );
+      verify_rule< uint32_be::mask_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::local_failure );
 
-         verify_rule< uint32_le::mask_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::mask_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::SUCCESS );
+      verify_rule< uint32_le::mask_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::local_failure );
+      verify_rule< uint32_le::mask_range< 0xffffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::success );
 
-         verify_rule< uint32_be::mask_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x52\x77\x77\x77", result_type::SUCCESS );
-         verify_rule< uint32_be::mask_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x56\x77\x77\x77", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::mask_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x52\x77\x77\x77", result_type::success );
+      verify_rule< uint32_be::mask_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x56\x77\x77\x77", result_type::local_failure );
 
-         verify_rule< uint32_le::mask_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x52", result_type::SUCCESS );
-         verify_rule< uint32_le::mask_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x56", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_le::mask_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x52", result_type::success );
+      verify_rule< uint32_le::mask_range< 0x0fffffff, 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x56", result_type::local_failure );
 
-         verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::SUCCESS );
-         verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x34\x56\x78", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x03\x45\x67\x89", result_type::SUCCESS );
-         verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x67\x89\x12\x34", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::success );
+      verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x34\x56\x78", result_type::local_failure );
+      verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x03\x45\x67\x89", result_type::success );
+      verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x67\x89\x12\x34", result_type::local_failure );
 
-         verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x67\x45\x23\x01", result_type::SUCCESS );
-         verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x78\x56\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x89\x67\x45\x03", result_type::SUCCESS );
-         verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x34\x12\x89\x67", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x67\x45\x23\x01", result_type::success );
+      verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x78\x56\x34\x02", result_type::local_failure );
+      verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x89\x67\x45\x03", result_type::success );
+      verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x34\x12\x89\x67", result_type::local_failure );
 
-         verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::SUCCESS );
-         verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x02\x34\x56\x78", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x03\x45\x67\x89", result_type::SUCCESS );
-         verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x67\x89\x01\x02", result_type::SUCCESS );
+      verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::success );
+      verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x02\x34\x56\x78", result_type::local_failure );
+      verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x03\x45\x67\x89", result_type::success );
+      verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x67\x89\x01\x02", result_type::success );
 
-         verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x67\x45\x23\x01", result_type::SUCCESS );
-         verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x78\x56\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x89\x67\x45\x03", result_type::SUCCESS );
-         verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x02\x01\x89\x67", result_type::SUCCESS );
+      verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x67\x45\x23\x01", result_type::success );
+      verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x78\x56\x34\x02", result_type::local_failure );
+      verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x89\x67\x45\x03", result_type::success );
+      verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x02\x01\x89\x67", result_type::success );
 
-         verify_rule< uint32_be::mask_ranges< 0xff0fffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x50\x02\x02", result_type::SUCCESS );
-         verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x50\x02\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::mask_ranges< 0xff0fffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x50\x02\x02", result_type::success );
+      verify_rule< uint32_be::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x50\x02\x02", result_type::local_failure );
 
-         verify_rule< uint32_le::mask_ranges< 0xff0fffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x02\x50\x02", result_type::SUCCESS );
-         verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x02\x50\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_le::mask_ranges< 0xff0fffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x02\x50\x02", result_type::success );
+      verify_rule< uint32_le::mask_ranges< 0xffffffff, 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x02\x50\x02", result_type::local_failure );
 
-         verify_rule< uint32_be::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x01\x23\x32\x10\x45\x67\x76\x54", result_type::SUCCESS );
-         verify_rule< uint32_be::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x01\x54\x76\x67\x45", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x01\x23\x32\x10\x45\x67\x76\x54", result_type::success );
+      verify_rule< uint32_be::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x01\x54\x76\x67\x45", result_type::local_failure );
 
-         verify_rule< uint32_le::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x01\x23\x32\x10\x45\x67\x76\x54", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x01\x54\x76\x67\x45", result_type::SUCCESS );
+      verify_rule< uint32_le::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x01\x23\x32\x10\x45\x67\x76\x54", result_type::local_failure );
+      verify_rule< uint32_le::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x01\x54\x76\x67\x45", result_type::success );
 
-         verify_rule< uint32_be::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x81\x23\x32\x10\x45\x67\x76\x54", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::mask_string< 0x4fffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x81\x23\x32\x10\x45\x67\x76\x54", result_type::SUCCESS );
+      verify_rule< uint32_be::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x81\x23\x32\x10\x45\x67\x76\x54", result_type::local_failure );
+      verify_rule< uint32_be::mask_string< 0x4fffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x81\x23\x32\x10\x45\x67\x76\x54", result_type::success );
 
-         verify_rule< uint32_le::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x81\x54\x76\x67\x45", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::mask_string< 0x4fffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x81\x54\x76\x67\x45", result_type::SUCCESS );
+      verify_rule< uint32_le::mask_string< 0xffffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x81\x54\x76\x67\x45", result_type::local_failure );
+      verify_rule< uint32_le::mask_string< 0x4fffffff, 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x81\x54\x76\x67\x45", result_type::success );
 
-         verify_rule< uint32_be::not_one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::not_one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::SUCCESS );
+      verify_rule< uint32_be::not_one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::local_failure );
+      verify_rule< uint32_be::not_one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::success );
 
-         verify_rule< uint32_le::not_one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::SUCCESS );
-         verify_rule< uint32_le::not_one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_le::not_one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::success );
+      verify_rule< uint32_le::not_one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::local_failure );
 
-         verify_rule< uint32_be::not_range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::not_range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::SUCCESS );
+      verify_rule< uint32_be::not_range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::local_failure );
+      verify_rule< uint32_be::not_range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::success );
 
-         verify_rule< uint32_le::not_range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::SUCCESS );
-         verify_rule< uint32_le::not_range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_le::not_range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::success );
+      verify_rule< uint32_le::not_range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::local_failure );
 
-         verify_rule< uint32_be::one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::SUCCESS );
-         verify_rule< uint32_be::one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::success );
+      verify_rule< uint32_be::one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::local_failure );
 
-         verify_rule< uint32_le::one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::SUCCESS );
+      verify_rule< uint32_le::one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11", result_type::local_failure );
+      verify_rule< uint32_le::one< 0x01111111, 0x02222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x01", result_type::success );
 
-         verify_rule< uint32_be::range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::SUCCESS );
-         verify_rule< uint32_be::range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::success );
+      verify_rule< uint32_be::range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::local_failure );
 
-         verify_rule< uint32_le::range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::SUCCESS );
+      verify_rule< uint32_le::range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77", result_type::local_failure );
+      verify_rule< uint32_le::range< 0x01000000, 0x04000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x02", result_type::success );
 
-         verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::SUCCESS );
-         verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x34\x56\x78", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x03\x45\x67\x89", result_type::SUCCESS );
-         verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x67\x89\x12\x34", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::success );
+      verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x02\x34\x56\x78", result_type::local_failure );
+      verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x03\x45\x67\x89", result_type::success );
+      verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x67\x89\x12\x34", result_type::local_failure );
 
-         verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x67\x45\x23\x01", result_type::SUCCESS );
-         verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x78\x56\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x89\x67\x45\x03", result_type::SUCCESS );
-         verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x34\x12\x89\x67", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x67\x45\x23\x01", result_type::success );
+      verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x78\x56\x34\x02", result_type::local_failure );
+      verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x89\x67\x45\x03", result_type::success );
+      verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444 > >( __LINE__, __FILE__, "\x34\x12\x89\x67", result_type::local_failure );
 
-         verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::SUCCESS );
-         verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x02\x34\x56\x78", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x03\x45\x67\x89", result_type::SUCCESS );
-         verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x67\x89\x01\x02", result_type::SUCCESS );
+      verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x01\x23\x45\x67", result_type::success );
+      verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x02\x34\x56\x78", result_type::local_failure );
+      verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x03\x45\x67\x89", result_type::success );
+      verify_rule< uint32_be::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x67\x89\x01\x02", result_type::success );
 
-         verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x67\x45\x23\x01", result_type::SUCCESS );
-         verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x78\x56\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x89\x67\x45\x03", result_type::SUCCESS );
-         verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x02\x01\x89\x67", result_type::SUCCESS );
+      verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x67\x45\x23\x01", result_type::success );
+      verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x78\x56\x34\x02", result_type::local_failure );
+      verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x89\x67\x45\x03", result_type::success );
+      verify_rule< uint32_le::ranges< 0x01111111, 0x02222222, 0x03333333, 0x04444444, 0x67890102 > >( __LINE__, __FILE__, "\x02\x01\x89\x67", result_type::success );
 
-         verify_rule< uint32_be::string< 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x01\x23\x32\x10\x45\x67\x76\x54", result_type::SUCCESS );
-         verify_rule< uint32_be::string< 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x01\x54\x76\x67\x45", result_type::LOCAL_FAILURE );
+      verify_rule< uint32_be::string< 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x01\x23\x32\x10\x45\x67\x76\x54", result_type::success );
+      verify_rule< uint32_be::string< 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x01\x54\x76\x67\x45", result_type::local_failure );
 
-         verify_rule< uint32_le::string< 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x01\x23\x32\x10\x45\x67\x76\x54", result_type::LOCAL_FAILURE );
-         verify_rule< uint32_le::string< 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x01\x54\x76\x67\x45", result_type::SUCCESS );
-      }
+      verify_rule< uint32_le::string< 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x01\x23\x32\x10\x45\x67\x76\x54", result_type::local_failure );
+      verify_rule< uint32_le::string< 0x01233210, 0x45677654 > >( __LINE__, __FILE__, "\x10\x32\x23\x01\x54\x76\x67\x45", result_type::success );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/uint64_general.cpp b/packages/PEGTL/src/test/pegtl/uint64_general.cpp
index fc0eb0d63fff1d211766e3ab8fa7b5181035aefb..b32701eedc4fe67eb42a04f238f56366accc6e62 100644
--- a/packages/PEGTL/src/test/pegtl/uint64_general.cpp
+++ b/packages/PEGTL/src/test/pegtl/uint64_general.cpp
@@ -1,187 +1,183 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_rule< uint64_be::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::any >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint64_le::any >( __LINE__, __FILE__, "", result_type::local_failure );
 
-         verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x01", result_type::local_failure );
+      verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x01", result_type::local_failure );
 
-         verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72", result_type::local_failure );
+      verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72", result_type::local_failure );
 
-         verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::local_failure );
+      verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03", result_type::local_failure );
 
-         verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::local_failure );
+      verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55", result_type::local_failure );
 
-         verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44", result_type::local_failure );
+      verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44", result_type::local_failure );
 
-         verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33", result_type::local_failure );
+      verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33", result_type::local_failure );
 
-         verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22", result_type::local_failure );
+      verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22", result_type::local_failure );
 
-         verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22\x11", result_type::SUCCESS );
-         verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22\x11", result_type::SUCCESS );
+      verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22\x11", result_type::success );
+      verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22\x11", result_type::success );
 
-         verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22\x11\x99", result_type::SUCCESS, 1 );
-         verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22\x11\x99", result_type::SUCCESS, 1 );
+      verify_rule< uint64_be::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22\x11\x99", result_type::success, 1 );
+      verify_rule< uint64_le::any >( __LINE__, __FILE__, "\x71\x72\x03\x55\x44\x33\x22\x11\x99", result_type::success, 1 );
 
-         verify_rule< uint64_be::mask_not_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::mask_not_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11", result_type::local_failure );
 
-         verify_rule< uint64_be::mask_not_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_be::mask_not_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::SUCCESS );
+      verify_rule< uint64_be::mask_not_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::local_failure );
+      verify_rule< uint64_be::mask_not_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::success );
 
-         verify_rule< uint64_le::mask_not_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::SUCCESS );
-         verify_rule< uint64_le::mask_not_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_le::mask_not_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::success );
+      verify_rule< uint64_le::mask_not_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::local_failure );
 
-         verify_rule< uint64_be::mask_not_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\xf3\x11\x11\x11\x11\x11\x11\x11", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_not_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\xf1\x11\x11\x11\x11\x11\x11\x11", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::mask_not_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\xf3\x11\x11\x11\x11\x11\x11\x11", result_type::success );
+      verify_rule< uint64_be::mask_not_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\xf1\x11\x11\x11\x11\x11\x11\x11", result_type::local_failure );
 
-         verify_rule< uint64_le::mask_not_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\xf3", result_type::SUCCESS );
-         verify_rule< uint64_le::mask_not_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\xf1", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_le::mask_not_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\xf3", result_type::success );
+      verify_rule< uint64_le::mask_not_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\xf1", result_type::local_failure );
 
-         verify_rule< uint64_be::mask_not_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_be::mask_not_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::SUCCESS );
+      verify_rule< uint64_be::mask_not_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::local_failure );
+      verify_rule< uint64_be::mask_not_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::success );
 
-         verify_rule< uint64_le::mask_not_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::SUCCESS );
-         verify_rule< uint64_le::mask_not_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_le::mask_not_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::success );
+      verify_rule< uint64_le::mask_not_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::local_failure );
 
-         verify_rule< uint64_be::mask_not_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x52\x77\x77\x77\x77\x77\x77\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_be::mask_not_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x56\x77\x77\x77\x77\x77\x77\x77", result_type::SUCCESS );
+      verify_rule< uint64_be::mask_not_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x52\x77\x77\x77\x77\x77\x77\x77", result_type::local_failure );
+      verify_rule< uint64_be::mask_not_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x56\x77\x77\x77\x77\x77\x77\x77", result_type::success );
 
-         verify_rule< uint64_le::mask_not_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x52", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::mask_not_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x56", result_type::SUCCESS );
+      verify_rule< uint64_le::mask_not_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x52", result_type::local_failure );
+      verify_rule< uint64_le::mask_not_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x56", result_type::success );
 
-         verify_rule< uint64_be::mask_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::mask_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::success );
+      verify_rule< uint64_be::mask_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::local_failure );
 
-         verify_rule< uint64_le::mask_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::mask_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::SUCCESS );
+      verify_rule< uint64_le::mask_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::local_failure );
+      verify_rule< uint64_le::mask_one< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::success );
 
-         verify_rule< uint64_be::mask_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\xf3\x11\x11\x11\x11\x11\x11\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_be::mask_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\xf1\x11\x11\x11\x11\x11\x11\x11", result_type::SUCCESS );
+      verify_rule< uint64_be::mask_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\xf3\x11\x11\x11\x11\x11\x11\x11", result_type::local_failure );
+      verify_rule< uint64_be::mask_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\xf1\x11\x11\x11\x11\x11\x11\x11", result_type::success );
 
-         verify_rule< uint64_le::mask_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\xf3", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::mask_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\xf1", result_type::SUCCESS );
+      verify_rule< uint64_le::mask_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\xf3", result_type::local_failure );
+      verify_rule< uint64_le::mask_one< 0x0fffffffffffffff, 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\xf1", result_type::success );
 
-         verify_rule< uint64_be::mask_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::mask_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::success );
+      verify_rule< uint64_be::mask_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::local_failure );
 
-         verify_rule< uint64_le::mask_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::mask_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::SUCCESS );
+      verify_rule< uint64_le::mask_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::local_failure );
+      verify_rule< uint64_le::mask_range< 0xffffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::success );
 
-         verify_rule< uint64_be::mask_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x52\x77\x77\x77\x77\x77\x77\x77", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x56\x77\x77\x77\x77\x77\x77\x77", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::mask_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x52\x77\x77\x77\x77\x77\x77\x77", result_type::success );
+      verify_rule< uint64_be::mask_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x56\x77\x77\x77\x77\x77\x77\x77", result_type::local_failure );
 
-         verify_rule< uint64_le::mask_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x52", result_type::SUCCESS );
-         verify_rule< uint64_le::mask_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x56", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_le::mask_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x52", result_type::success );
+      verify_rule< uint64_le::mask_range< 0x0fffffffffffffff, 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x56", result_type::local_failure );
 
-         verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x01\x23\x45\x67\x99\x99\x99\x99", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x02\x34\x56\x78\x99\x99\x99\x99", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x03\x45\x67\x89\x99\x99\x99\x99", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x67\x89\x12\x34\x99\x99\x99\x99", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x01\x23\x45\x67\x99\x99\x99\x99", result_type::success );
+      verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x02\x34\x56\x78\x99\x99\x99\x99", result_type::local_failure );
+      verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x03\x45\x67\x89\x99\x99\x99\x99", result_type::success );
+      verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x67\x89\x12\x34\x99\x99\x99\x99", result_type::local_failure );
 
-         verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x67\x45\x23\x01", result_type::SUCCESS );
-         verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x78\x56\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x89\x67\x45\x03", result_type::SUCCESS );
-         verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x34\x12\x89\x67", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x67\x45\x23\x01", result_type::success );
+      verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x78\x56\x34\x02", result_type::local_failure );
+      verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x89\x67\x45\x03", result_type::success );
+      verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x34\x12\x89\x67", result_type::local_failure );
 
-         verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x01\x23\x45\x67\x99\x99\x99\x99", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x02\x34\x56\x78\x99\x99\x99\x99", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x03\x45\x67\x89\x99\x99\x99\x99", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x67\x89\x01\x02\x99\x99\x99\x99", result_type::SUCCESS );
+      verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x01\x23\x45\x67\x99\x99\x99\x99", result_type::success );
+      verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x02\x34\x56\x78\x99\x99\x99\x99", result_type::local_failure );
+      verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x03\x45\x67\x89\x99\x99\x99\x99", result_type::success );
+      verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x67\x89\x01\x02\x99\x99\x99\x99", result_type::success );
 
-         verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x67\x45\x23\x01", result_type::SUCCESS );
-         verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x78\x56\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x89\x67\x45\x03", result_type::SUCCESS );
-         verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x02\x01\x89\x67", result_type::SUCCESS );
+      verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x67\x45\x23\x01", result_type::success );
+      verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x78\x56\x34\x02", result_type::local_failure );
+      verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x89\x67\x45\x03", result_type::success );
+      verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x02\x01\x89\x67", result_type::success );
 
-         verify_rule< uint64_be::mask_ranges< 0xff0fffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x02\x50\x02\x02\x99\x99\x99\x99", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x02\x50\x02\x02\x99\x99\x99\x99", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::mask_ranges< 0xff0fffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x02\x50\x02\x02\x99\x99\x99\x99", result_type::success );
+      verify_rule< uint64_be::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x02\x50\x02\x02\x99\x99\x99\x99", result_type::local_failure );
 
-         verify_rule< uint64_le::mask_ranges< 0xff0fffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x02\x02\x50\x02", result_type::SUCCESS );
-         verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x02\x02\x50\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_le::mask_ranges< 0xff0fffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x02\x02\x50\x02", result_type::success );
+      verify_rule< uint64_le::mask_ranges< 0xffffffffffffffff, 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x02\x02\x50\x02", result_type::local_failure );
 
-         verify_rule< uint64_be::mask_string< 0xffffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x01\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_string< 0xffffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x01\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::mask_string< 0xffffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x01\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::success );
+      verify_rule< uint64_be::mask_string< 0xffffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x01\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::local_failure );
 
-         verify_rule< uint64_le::mask_string< 0xffffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x01\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::mask_string< 0xffffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x01\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::SUCCESS );
+      verify_rule< uint64_le::mask_string< 0xffffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x01\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::local_failure );
+      verify_rule< uint64_le::mask_string< 0xffffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x01\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::success );
 
-         verify_rule< uint64_be::mask_string< 0x4fffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x81\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::SUCCESS );
-         verify_rule< uint64_be::mask_string< 0x8fffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x81\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::mask_string< 0x4fffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x81\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::success );
+      verify_rule< uint64_be::mask_string< 0x8fffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x81\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::local_failure );
 
-         verify_rule< uint64_le::mask_string< 0x4fffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x81\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::SUCCESS );
-         verify_rule< uint64_le::mask_string< 0x8fffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x81\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_le::mask_string< 0x4fffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x81\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::success );
+      verify_rule< uint64_le::mask_string< 0x8fffffffffffffff, 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x81\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::local_failure );
 
-         verify_rule< uint64_be::not_one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_be::not_one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::SUCCESS );
+      verify_rule< uint64_be::not_one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::local_failure );
+      verify_rule< uint64_be::not_one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::success );
 
-         verify_rule< uint64_le::not_one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::SUCCESS );
-         verify_rule< uint64_le::not_one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_le::not_one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::success );
+      verify_rule< uint64_le::not_one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::local_failure );
 
-         verify_rule< uint64_be::not_range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_be::not_range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::SUCCESS );
+      verify_rule< uint64_be::not_range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::local_failure );
+      verify_rule< uint64_be::not_range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::success );
 
-         verify_rule< uint64_le::not_range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::SUCCESS );
-         verify_rule< uint64_le::not_range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_le::not_range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::success );
+      verify_rule< uint64_le::not_range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::local_failure );
 
-         verify_rule< uint64_be::one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::SUCCESS );
-         verify_rule< uint64_be::one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::success );
+      verify_rule< uint64_be::one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::local_failure );
 
-         verify_rule< uint64_le::one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::SUCCESS );
+      verify_rule< uint64_le::one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x01\x11\x11\x11\x11\x11\x11\x11", result_type::local_failure );
+      verify_rule< uint64_le::one< 0x0111111111111111, 0x0222222222222222 > >( __LINE__, __FILE__, "\x11\x11\x11\x11\x11\x11\x11\x01", result_type::success );
 
-         verify_rule< uint64_be::range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::SUCCESS );
-         verify_rule< uint64_be::range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::success );
+      verify_rule< uint64_be::range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::local_failure );
 
-         verify_rule< uint64_le::range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::SUCCESS );
+      verify_rule< uint64_le::range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x02\x77\x77\x77\x77\x77\x77\x77", result_type::local_failure );
+      verify_rule< uint64_le::range< 0x0100000000000000, 0x0400000000000000 > >( __LINE__, __FILE__, "\x77\x77\x77\x77\x77\x77\x77\x02", result_type::success );
 
-         verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x01\x23\x45\x67\x99\x99\x99\x99", result_type::SUCCESS );
-         verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x02\x34\x56\x78\x99\x99\x99\x99", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x03\x45\x67\x89\x99\x99\x99\x99", result_type::SUCCESS );
-         verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x67\x89\x12\x34\x99\x99\x99\x99", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x01\x23\x45\x67\x99\x99\x99\x99", result_type::success );
+      verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x02\x34\x56\x78\x99\x99\x99\x99", result_type::local_failure );
+      verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x03\x45\x67\x89\x99\x99\x99\x99", result_type::success );
+      verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x67\x89\x12\x34\x99\x99\x99\x99", result_type::local_failure );
 
-         verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x67\x45\x23\x01", result_type::SUCCESS );
-         verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x78\x56\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x89\x67\x45\x03", result_type::SUCCESS );
-         verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x34\x12\x89\x67", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x67\x45\x23\x01", result_type::success );
+      verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x78\x56\x34\x02", result_type::local_failure );
+      verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x89\x67\x45\x03", result_type::success );
+      verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x34\x12\x89\x67", result_type::local_failure );
 
-         verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x01\x23\x45\x67\x99\x99\x99\x99", result_type::SUCCESS );
-         verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x02\x34\x56\x78\x99\x99\x99\x99", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x03\x45\x67\x89\x99\x99\x99\x99", result_type::SUCCESS );
-         verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x67\x89\x01\x02\x99\x99\x99\x99", result_type::SUCCESS );
+      verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x01\x23\x45\x67\x99\x99\x99\x99", result_type::success );
+      verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x02\x34\x56\x78\x99\x99\x99\x99", result_type::local_failure );
+      verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x03\x45\x67\x89\x99\x99\x99\x99", result_type::success );
+      verify_rule< uint64_be::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x67\x89\x01\x02\x99\x99\x99\x99", result_type::success );
 
-         verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x67\x45\x23\x01", result_type::SUCCESS );
-         verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x78\x56\x34\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x89\x67\x45\x03", result_type::SUCCESS );
-         verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x02\x01\x89\x67", result_type::SUCCESS );
+      verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x67\x45\x23\x01", result_type::success );
+      verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x78\x56\x34\x02", result_type::local_failure );
+      verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x89\x67\x45\x03", result_type::success );
+      verify_rule< uint64_le::ranges< 0x0111111111111111, 0x0222222222222222, 0x0333333333333333, 0x0444444444444444, 0x6789010299999999 > >( __LINE__, __FILE__, "\x99\x99\x99\x99\x02\x01\x89\x67", result_type::success );
 
-         verify_rule< uint64_be::string< 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x01\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::SUCCESS );
-         verify_rule< uint64_be::string< 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x01\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::LOCAL_FAILURE );
+      verify_rule< uint64_be::string< 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x01\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::success );
+      verify_rule< uint64_be::string< 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x01\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::local_failure );
 
-         verify_rule< uint64_le::string< 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x01\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::LOCAL_FAILURE );
-         verify_rule< uint64_le::string< 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x01\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::SUCCESS );
-      }
+      verify_rule< uint64_le::string< 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\x01\x23\x32\x10\xde\xad\xca\xfe\x45\x67\x76\x54\xba\xff\xb1\xff", result_type::local_failure );
+      verify_rule< uint64_le::string< 0x01233210deadcafe, 0x45677654baffb1ff > >( __LINE__, __FILE__, "\xfe\xca\xad\xde\x10\x32\x23\x01\xff\xb1\xff\xba\x54\x76\x67\x45", result_type::success );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/uint8_general.cpp b/packages/PEGTL/src/test/pegtl/uint8_general.cpp
index c1642686fc1bfa2ccf350478dd4574bb12e6adae..75ec3268a711a38a787f0968d1c24f7a5c6fa062 100644
--- a/packages/PEGTL/src/test/pegtl/uint8_general.cpp
+++ b/packages/PEGTL/src/test/pegtl/uint8_general.cpp
@@ -1,251 +1,247 @@
-// Copyright (c) 2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2018-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_rule< uint8::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-
-         for( int i = -100; i < 200; ++i ) {
-            verify_char< uint8::any >( __LINE__, __FILE__, char( i ), true );
-         }
-         verify_rule< uint8::mask_not_one< 0xff, 0x01, 0x02 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_one< 0xff, 0x01, 0x02 > >( __LINE__, __FILE__, "\x03", result_type::SUCCESS );
-         verify_rule< uint8::mask_not_one< 0xff, 0x01, 0x02 > >( __LINE__, __FILE__, "\x03\x01", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_not_one< 0xff, 0x01, 0x10 > >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_one< 0xff, 0x01, 0x10 > >( __LINE__, __FILE__, "\x01\x01", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x02 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x02 > >( __LINE__, __FILE__, "\x03", result_type::SUCCESS );
-         verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x02 > >( __LINE__, __FILE__, "\x03\x01", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x01", result_type::SUCCESS );
-         verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x01\x01", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x31", result_type::SUCCESS );
-         verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x31\x01", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x11\x01", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x0f", result_type::SUCCESS );
-         verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x0f\x0f", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x30", result_type::SUCCESS );
-         verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x30\x30", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x10", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x10\x10", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x2f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x2f\x2f", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x0f", result_type::SUCCESS );
-         verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x0f\x0f", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x40", result_type::SUCCESS );
-         verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x40\x40", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x30", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x30\x30", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x31", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x31\x31", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x10", result_type::SUCCESS );
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x10\x10", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x40", result_type::SUCCESS );
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x40\x40", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x20", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x20\x20", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x11\x10", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x3f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x3f\x10", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\x10", result_type::SUCCESS );
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\x10\x10", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\xf0", result_type::SUCCESS );
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\xf0\x10", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\x54", result_type::SUCCESS );
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\x54\x54", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x40 > >( __LINE__, __FILE__, "\x11", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x40 > >( __LINE__, __FILE__, "\x11\x10", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x40 > >( __LINE__, __FILE__, "\x3f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_one< 0x1f, 0x10, 0x40 > >( __LINE__, __FILE__, "\x3f\x10", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x16", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x16\x17", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x17", result_type::SUCCESS );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x17\x17", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x27", result_type::SUCCESS );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x27\x17", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x28", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x28\x17", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x7f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\xff", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x91", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x16", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x16\x17", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x96", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x96\x17", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x17", result_type::SUCCESS );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x17\x17", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x57", result_type::SUCCESS );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x57\x17", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x27", result_type::SUCCESS );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x27\x17", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x67", result_type::SUCCESS );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x67\x17", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x28", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x28\x17", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x68", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x68\x17", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x7f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\xff", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x0f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x18", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x3f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x48", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x94", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x10", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x17", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x40", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x47", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\xf0", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\xf1", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x0f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x18", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x3f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x48", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x94", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x10", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x17", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x40", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x47", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\xf0", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\xf1", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x0f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x18", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x3f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x48", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x94", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x10", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x11", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x40", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x47", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x0f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x18", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x3f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x48", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x94", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x10", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x11", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x40", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x47", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x73", result_type::SUCCESS );
-         verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x72", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20\x30", result_type::SUCCESS );
-         verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20\x30\x10", result_type::SUCCESS, 1 );
-         verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x11\x22\x33", result_type::SUCCESS );
-         verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x1f\x2f\x3f", result_type::SUCCESS );
-
-         verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x10", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x20", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x20\x02", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x02", result_type::SUCCESS );
-         verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x02\x20", result_type::SUCCESS, 1 );
-         verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x11", result_type::SUCCESS );
-         verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x1f", result_type::SUCCESS );
-
-         verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x0f", result_type::SUCCESS );
-         verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x21", result_type::SUCCESS );
-         verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x10", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x17", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x20", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\xab", result_type::SUCCESS );
-
-         verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x0f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x21", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x10", result_type::SUCCESS );
-         verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x17", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x20", result_type::SUCCESS );
-
-         verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x0f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x21", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x10", result_type::SUCCESS );
-         verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x17", result_type::SUCCESS );
-         verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x20", result_type::SUCCESS );
-         verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\xab", result_type::LOCAL_FAILURE );
-
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x0f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x21", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x2f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x41", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x8f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x10", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x16", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x1f", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x20", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x30", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x36", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x3f", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x40", result_type::SUCCESS );
-
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x0f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x21", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x2f", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x41", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x8f", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x10", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x16", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x1f", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x20", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x30", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x36", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x3f", result_type::SUCCESS );
-         verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x40", result_type::SUCCESS );
-
-         verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20\x30", result_type::SUCCESS );
-         verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20\x30\x10", result_type::SUCCESS, 1 );
-         verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x11\x22\x33", result_type::LOCAL_FAILURE );
-         verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x1f\x21\x31", result_type::LOCAL_FAILURE );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+      verify_rule< uint8::any >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
 
-}  // namespace tao
+      for( int i = -100; i < 200; ++i ) {
+         verify_char< uint8::any >( __LINE__, __FILE__, char( i ), true );
+      }
+      verify_rule< uint8::mask_not_one< 0xff, 0x01, 0x02 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_not_one< 0xff, 0x01, 0x02 > >( __LINE__, __FILE__, "\x03", result_type::success );
+      verify_rule< uint8::mask_not_one< 0xff, 0x01, 0x02 > >( __LINE__, __FILE__, "\x03\x01", result_type::success, 1 );
+      verify_rule< uint8::mask_not_one< 0xff, 0x01, 0x10 > >( __LINE__, __FILE__, "\x01", result_type::local_failure );
+      verify_rule< uint8::mask_not_one< 0xff, 0x01, 0x10 > >( __LINE__, __FILE__, "\x01\x01", result_type::local_failure );
+
+      verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x02 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x02 > >( __LINE__, __FILE__, "\x03", result_type::success );
+      verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x02 > >( __LINE__, __FILE__, "\x03\x01", result_type::success, 1 );
+      verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x01", result_type::success );
+      verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x01\x01", result_type::success, 1 );
+      verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x31", result_type::success );
+      verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x31\x01", result_type::success, 1 );
+      verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x11", result_type::local_failure );
+      verify_rule< uint8::mask_not_one< 0xf0, 0x01, 0x10 > >( __LINE__, __FILE__, "\x11\x01", result_type::local_failure );
+
+      verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x0f", result_type::success );
+      verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x0f\x0f", result_type::success, 1 );
+      verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x30", result_type::success );
+      verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x30\x30", result_type::success, 1 );
+      verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x10", result_type::local_failure );
+      verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x10\x10", result_type::local_failure );
+      verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x2f", result_type::local_failure );
+      verify_rule< uint8::mask_not_range< 0xff, 0x10, 0x2f > >( __LINE__, __FILE__, "\x2f\x2f", result_type::local_failure );
+
+      verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x0f", result_type::success );
+      verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x0f\x0f", result_type::success, 1 );
+      verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x40", result_type::success );
+      verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x40\x40", result_type::success, 1 );
+      verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x30", result_type::local_failure );
+      verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x30\x30", result_type::local_failure );
+      verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x31", result_type::local_failure );
+      verify_rule< uint8::mask_not_range< 0xf0, 0x10, 0x30 > >( __LINE__, __FILE__, "\x31\x31", result_type::local_failure );
+
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x10", result_type::success );
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x10\x10", result_type::success, 1 );
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x40", result_type::success );
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x40\x40", result_type::success, 1 );
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x20", result_type::local_failure );
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x20\x20", result_type::local_failure );
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x11", result_type::local_failure );
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x11\x10", result_type::local_failure );
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x3f", result_type::local_failure );
+      verify_rule< uint8::mask_one< 0xff, 0x10, 0x40 > >( __LINE__, __FILE__, "\x3f\x10", result_type::local_failure );
+
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\x10", result_type::success );
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\x10\x10", result_type::success, 1 );
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\xf0", result_type::success );
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\xf0\x10", result_type::success, 1 );
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\x54", result_type::success );
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x14 > >( __LINE__, __FILE__, "\x54\x54", result_type::success, 1 );
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x40 > >( __LINE__, __FILE__, "\x11", result_type::local_failure );
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x40 > >( __LINE__, __FILE__, "\x11\x10", result_type::local_failure );
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x40 > >( __LINE__, __FILE__, "\x3f", result_type::local_failure );
+      verify_rule< uint8::mask_one< 0x1f, 0x10, 0x40 > >( __LINE__, __FILE__, "\x3f\x10", result_type::local_failure );
+
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x01", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x16", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x16\x17", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x17", result_type::success );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x17\x17", result_type::success, 1 );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x27", result_type::success );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x27\x17", result_type::success, 1 );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x28", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x28\x17", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\x7f", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xff, 0x17, 0x27 > >( __LINE__, __FILE__, "\xff", result_type::local_failure );
+
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x01", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x91", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x16", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x16\x17", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x96", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x96\x17", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x17", result_type::success );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x17\x17", result_type::success, 1 );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x57", result_type::success );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x57\x17", result_type::success, 1 );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x27", result_type::success );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x27\x17", result_type::success, 1 );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x67", result_type::success );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x67\x17", result_type::success, 1 );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x28", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x28\x17", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x68", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x68\x17", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\x7f", result_type::local_failure );
+      verify_rule< uint8::mask_range< 0xbf, 0x17, 0x27 > >( __LINE__, __FILE__, "\xff", result_type::local_failure );
+
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x01", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x0f", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x18", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x3f", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x48", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x94", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x10", result_type::success );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x17", result_type::success );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x40", result_type::success );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\x47", result_type::success );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\xf0", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47 > >( __LINE__, __FILE__, "\xf1", result_type::local_failure );
+
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x01", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x0f", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x18", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x3f", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x48", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x94", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x10", result_type::success );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x17", result_type::success );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x40", result_type::success );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\x47", result_type::success );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\xf0", result_type::success );
+      verify_rule< uint8::mask_ranges< 0xff, 0x10, 0x17, 0x40, 0x47, 0xf0 > >( __LINE__, __FILE__, "\xf1", result_type::local_failure );
+
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x01", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x0f", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x18", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x3f", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x48", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x94", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x10", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x11", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x40", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41 > >( __LINE__, __FILE__, "\x47", result_type::local_failure );
+
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x01", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x0f", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x18", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x3f", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x48", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x94", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x10", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x11", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x40", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x47", result_type::local_failure );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x73", result_type::success );
+      verify_rule< uint8::mask_ranges< 0x73, 0x10, 0x11, 0x40, 0x41, 0x73 > >( __LINE__, __FILE__, "\x72", result_type::local_failure );
+
+      verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10", result_type::local_failure );
+      verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20", result_type::local_failure );
+      verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20\x30", result_type::success );
+      verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20\x30\x10", result_type::success, 1 );
+      verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x11\x22\x33", result_type::success );
+      verify_rule< uint8::mask_string< 0xf0, 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x1f\x2f\x3f", result_type::success );
+
+      verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x10", result_type::local_failure );
+      verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x20", result_type::local_failure );
+      verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x20\x02", result_type::local_failure );
+      verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x02", result_type::success );
+      verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x02\x20", result_type::success, 1 );
+      verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x11", result_type::success );
+      verify_rule< uint8::not_one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x1f", result_type::success );
+
+      verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x0f", result_type::success );
+      verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x21", result_type::success );
+      verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x10", result_type::local_failure );
+      verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x17", result_type::local_failure );
+      verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x20", result_type::local_failure );
+      verify_rule< uint8::not_range< 0x10, 0x20 > >( __LINE__, __FILE__, "\xab", result_type::success );
+
+      verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x0f", result_type::local_failure );
+      verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x21", result_type::local_failure );
+      verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x10", result_type::success );
+      verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x17", result_type::local_failure );
+      verify_rule< uint8::one< 0x10, 0x20 > >( __LINE__, __FILE__, "\x20", result_type::success );
+
+      verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x0f", result_type::local_failure );
+      verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x21", result_type::local_failure );
+      verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x10", result_type::success );
+      verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x17", result_type::success );
+      verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\x20", result_type::success );
+      verify_rule< uint8::range< 0x10, 0x20 > >( __LINE__, __FILE__, "\xab", result_type::local_failure );
+
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x0f", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x21", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x2f", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x41", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x8f", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x10", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x16", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x1f", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x20", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x30", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x36", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x3f", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40 > >( __LINE__, __FILE__, "\x40", result_type::success );
+
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x0f", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x21", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x2f", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x41", result_type::local_failure );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x8f", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x10", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x16", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x1f", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x20", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x30", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x36", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x3f", result_type::success );
+      verify_rule< uint8::ranges< 0x10, 0x20, 0x30, 0x40, 0x8f > >( __LINE__, __FILE__, "\x40", result_type::success );
+
+      verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "", result_type::local_failure );
+      verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10", result_type::local_failure );
+      verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20", result_type::local_failure );
+      verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20\x30", result_type::success );
+      verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x10\x20\x30\x10", result_type::success, 1 );
+      verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x11\x22\x33", result_type::local_failure );
+      verify_rule< uint8::string< 0x10, 0x20, 0x30 > >( __LINE__, __FILE__, "\x1f\x21\x31", result_type::local_failure );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/utf16_general.cpp b/packages/PEGTL/src/test/pegtl/utf16_general.cpp
index 38eb6a18ee018b4c75c63c56087669578c1eae3e..1a9521612ede6d3230f1bc5bae4fd17f2d66fbbb 100644
--- a/packages/PEGTL/src/test/pegtl/utf16_general.cpp
+++ b/packages/PEGTL/src/test/pegtl/utf16_general.cpp
@@ -1,157 +1,153 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace
    {
-      namespace
+      std::string u16s( const char16_t u )
       {
-         std::string u16s( const char16_t u )
-         {
-            return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
-         }
-
-         std::string u16s_be( const char16_t v )
-         {
-            const std::uint16_t u = internal::h_to_be( std::uint16_t( v ) );
-            return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
-         }
-
-         std::string u16s_le( const char16_t v )
-         {
-            const std::uint16_t u = internal::h_to_le( std::uint16_t( v ) );
-            return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
-         }
-
-      }  // namespace
-
-      void test_utf16()
-      {
-         verify_rule< utf16::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, "\xff", result_type::LOCAL_FAILURE, 1 );
-
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 1 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, "  ", result_type::SUCCESS, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0x00ff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0x0100 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0x0fff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0x1000 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd800 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd900 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xde00 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xfffe ) + " ", result_type::SUCCESS, 1 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xffff ) + "  ", result_type::SUCCESS, 2 );
-
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd7ff ) + u16s( 0xdfff ), result_type::SUCCESS, 2 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xdc00 ) + u16s( 0xdfff ), result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd800 ) + u16s( 0x0020 ), result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd800 ) + u16s( 0xff20 ), result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd800 ) + u16s( 0xdf00 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd800 ) + u16s( 0xdfff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xdbff ) + u16s( 0xdc00 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xdbff ) + u16s( 0xdfff ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf16::one< 0x20 > >( __LINE__, __FILE__, u16s( 0x20 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::one< 0x20ac > >( __LINE__, __FILE__, u16s( 0x20ac ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::one< 0x10437 > >( __LINE__, __FILE__, u16s( 0xd801 ) + u16s( 0xdc37 ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf16::bom >( __LINE__, __FILE__, u16s( 0xfeff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16::bom >( __LINE__, __FILE__, u16s( 0xfffe ), result_type::LOCAL_FAILURE, 2 );
-
-         verify_rule< utf16::string< 0x20, 0x20ac, 0x10437 > >( __LINE__, __FILE__, u16s( 0x20 ) + u16s( 0x20ac ) + u16s( 0xd801 ) + u16s( 0xdc37 ) + u16s( 0x20 ), result_type::SUCCESS, 2 );
+         return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
       }
 
-      void test_utf16_be()
+      std::string u16s_be( const char16_t v )
       {
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, "\xff", result_type::LOCAL_FAILURE, 1 );
-
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 1 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, "  ", result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0x00ff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0x0100 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0x0fff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0x1000 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd800 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd900 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xde00 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xfffe ) + " ", result_type::SUCCESS, 1 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xffff ) + "  ", result_type::SUCCESS, 2 );
-
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd7ff ) + u16s_be( 0xdfff ), result_type::SUCCESS, 2 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xdc00 ) + u16s_be( 0xdfff ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd800 ) + u16s_be( 0x0020 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd800 ) + u16s_be( 0xff20 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd800 ) + u16s_be( 0xdf00 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd800 ) + u16s_be( 0xdfff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xdbff ) + u16s_be( 0xdc00 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xdbff ) + u16s_be( 0xdfff ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf16_be::one< 0x20 > >( __LINE__, __FILE__, u16s_be( 0x20 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::one< 0x20ac > >( __LINE__, __FILE__, u16s_be( 0x20ac ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::one< 0x10437 > >( __LINE__, __FILE__, u16s_be( 0xd801 ) + u16s_be( 0xdc37 ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf16_be::bom >( __LINE__, __FILE__, u16s_be( 0xfeff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_be::bom >( __LINE__, __FILE__, u16s_be( 0xfffe ), result_type::LOCAL_FAILURE, 2 );
-
-         verify_rule< utf16_be::string< 0x20, 0x20ac, 0x10437 > >( __LINE__, __FILE__, u16s_be( 0x20 ) + u16s_be( 0x20ac ) + u16s_be( 0xd801 ) + u16s_be( 0xdc37 ) + u16s_be( 0x20 ), result_type::SUCCESS, 2 );
+         const std::uint16_t u = internal::h_to_be( std::uint16_t( v ) );
+         return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
       }
 
-      void test_utf16_le()
+      std::string u16s_le( const char16_t v )
       {
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, "\x01", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, "\xff", result_type::LOCAL_FAILURE, 1 );
-
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 1 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, "  ", result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0x00ff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0x0100 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0x0fff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0x1000 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd800 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd900 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xde00 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xfffe ) + " ", result_type::SUCCESS, 1 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xffff ) + "  ", result_type::SUCCESS, 2 );
-
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd7ff ) + u16s_le( 0xdfff ), result_type::SUCCESS, 2 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xdc00 ) + u16s_le( 0xdfff ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd800 ) + u16s_le( 0x0020 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd800 ) + u16s_le( 0xff20 ), result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd800 ) + u16s_le( 0xdf00 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd800 ) + u16s_le( 0xdfff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xdbff ) + u16s_le( 0xdc00 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xdbff ) + u16s_le( 0xdfff ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf16_le::one< 0x20 > >( __LINE__, __FILE__, u16s_le( 0x20 ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::one< 0x20ac > >( __LINE__, __FILE__, u16s_le( 0x20ac ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::one< 0x10437 > >( __LINE__, __FILE__, u16s_le( 0xd801 ) + u16s_le( 0xdc37 ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf16_le::bom >( __LINE__, __FILE__, u16s_le( 0xfeff ), result_type::SUCCESS, 0 );
-         verify_rule< utf16_le::bom >( __LINE__, __FILE__, u16s_le( 0xfffe ), result_type::LOCAL_FAILURE, 2 );
-
-         verify_rule< utf16_le::string< 0x20, 0x20ac, 0x10437 > >( __LINE__, __FILE__, u16s_le( 0x20 ) + u16s_le( 0x20ac ) + u16s_le( 0xd801 ) + u16s_le( 0xdc37 ) + u16s_le( 0x20 ), result_type::SUCCESS, 2 );
+         const std::uint16_t u = internal::h_to_le( std::uint16_t( v ) );
+         return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
       }
 
-      void unit_test()
-      {
-         test_utf16();
-         test_utf16_be();
-         test_utf16_le();
-      }
+   }  // namespace
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   void test_utf16()
+   {
+      verify_rule< utf16::any >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, "\x01", result_type::local_failure, 1 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, "\xff", result_type::local_failure, 1 );
+
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0 ), result_type::success, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 1 ), result_type::success, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, "  ", result_type::success, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0x00ff ), result_type::success, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0x0100 ), result_type::success, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0x0fff ), result_type::success, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0x1000 ), result_type::success, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd800 ), result_type::local_failure, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd900 ), result_type::local_failure, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xde00 ), result_type::local_failure, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xfffe ) + " ", result_type::success, 1 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xffff ) + "  ", result_type::success, 2 );
+
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd7ff ) + u16s( 0xdfff ), result_type::success, 2 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xdc00 ) + u16s( 0xdfff ), result_type::local_failure, 4 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd800 ) + u16s( 0x0020 ), result_type::local_failure, 4 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd800 ) + u16s( 0xff20 ), result_type::local_failure, 4 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd800 ) + u16s( 0xdf00 ), result_type::success, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xd800 ) + u16s( 0xdfff ), result_type::success, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xdbff ) + u16s( 0xdc00 ), result_type::success, 0 );
+      verify_rule< utf16::any >( __LINE__, __FILE__, u16s( 0xdbff ) + u16s( 0xdfff ), result_type::success, 0 );
+
+      verify_rule< utf16::one< 0x20 > >( __LINE__, __FILE__, u16s( 0x20 ), result_type::success, 0 );
+      verify_rule< utf16::one< 0x20ac > >( __LINE__, __FILE__, u16s( 0x20ac ), result_type::success, 0 );
+      verify_rule< utf16::one< 0x10437 > >( __LINE__, __FILE__, u16s( 0xd801 ) + u16s( 0xdc37 ), result_type::success, 0 );
+
+      verify_rule< utf16::bom >( __LINE__, __FILE__, u16s( 0xfeff ), result_type::success, 0 );
+      verify_rule< utf16::bom >( __LINE__, __FILE__, u16s( 0xfffe ), result_type::local_failure, 2 );
+
+      verify_rule< utf16::string< 0x20, 0x20ac, 0x10437 > >( __LINE__, __FILE__, u16s( 0x20 ) + u16s( 0x20ac ) + u16s( 0xd801 ) + u16s( 0xdc37 ) + u16s( 0x20 ), result_type::success, 2 );
+   }
+
+   void test_utf16_be()
+   {
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, "\x01", result_type::local_failure, 1 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, "\xff", result_type::local_failure, 1 );
+
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0 ), result_type::success, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 1 ), result_type::success, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, "  ", result_type::success, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0x00ff ), result_type::success, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0x0100 ), result_type::success, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0x0fff ), result_type::success, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0x1000 ), result_type::success, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd800 ), result_type::local_failure, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd900 ), result_type::local_failure, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xde00 ), result_type::local_failure, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xfffe ) + " ", result_type::success, 1 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xffff ) + "  ", result_type::success, 2 );
+
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd7ff ) + u16s_be( 0xdfff ), result_type::success, 2 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xdc00 ) + u16s_be( 0xdfff ), result_type::local_failure, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd800 ) + u16s_be( 0x0020 ), result_type::local_failure, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd800 ) + u16s_be( 0xff20 ), result_type::local_failure, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd800 ) + u16s_be( 0xdf00 ), result_type::success, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xd800 ) + u16s_be( 0xdfff ), result_type::success, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xdbff ) + u16s_be( 0xdc00 ), result_type::success, 0 );
+      verify_rule< utf16_be::any >( __LINE__, __FILE__, u16s_be( 0xdbff ) + u16s_be( 0xdfff ), result_type::success, 0 );
+
+      verify_rule< utf16_be::one< 0x20 > >( __LINE__, __FILE__, u16s_be( 0x20 ), result_type::success, 0 );
+      verify_rule< utf16_be::one< 0x20ac > >( __LINE__, __FILE__, u16s_be( 0x20ac ), result_type::success, 0 );
+      verify_rule< utf16_be::one< 0x10437 > >( __LINE__, __FILE__, u16s_be( 0xd801 ) + u16s_be( 0xdc37 ), result_type::success, 0 );
+
+      verify_rule< utf16_be::bom >( __LINE__, __FILE__, u16s_be( 0xfeff ), result_type::success, 0 );
+      verify_rule< utf16_be::bom >( __LINE__, __FILE__, u16s_be( 0xfffe ), result_type::local_failure, 2 );
+
+      verify_rule< utf16_be::string< 0x20, 0x20ac, 0x10437 > >( __LINE__, __FILE__, u16s_be( 0x20 ) + u16s_be( 0x20ac ) + u16s_be( 0xd801 ) + u16s_be( 0xdc37 ) + u16s_be( 0x20 ), result_type::success, 2 );
+   }
+
+   void test_utf16_le()
+   {
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, "\x01", result_type::local_failure, 1 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, "\xff", result_type::local_failure, 1 );
+
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0 ), result_type::success, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 1 ), result_type::success, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, "  ", result_type::success, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0x00ff ), result_type::success, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0x0100 ), result_type::success, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0x0fff ), result_type::success, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0x1000 ), result_type::success, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd800 ), result_type::local_failure, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd900 ), result_type::local_failure, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xde00 ), result_type::local_failure, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xfffe ) + " ", result_type::success, 1 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xffff ) + "  ", result_type::success, 2 );
+
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd7ff ) + u16s_le( 0xdfff ), result_type::success, 2 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xdc00 ) + u16s_le( 0xdfff ), result_type::local_failure, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd800 ) + u16s_le( 0x0020 ), result_type::local_failure, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd800 ) + u16s_le( 0xff20 ), result_type::local_failure, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd800 ) + u16s_le( 0xdf00 ), result_type::success, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xd800 ) + u16s_le( 0xdfff ), result_type::success, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xdbff ) + u16s_le( 0xdc00 ), result_type::success, 0 );
+      verify_rule< utf16_le::any >( __LINE__, __FILE__, u16s_le( 0xdbff ) + u16s_le( 0xdfff ), result_type::success, 0 );
+
+      verify_rule< utf16_le::one< 0x20 > >( __LINE__, __FILE__, u16s_le( 0x20 ), result_type::success, 0 );
+      verify_rule< utf16_le::one< 0x20ac > >( __LINE__, __FILE__, u16s_le( 0x20ac ), result_type::success, 0 );
+      verify_rule< utf16_le::one< 0x10437 > >( __LINE__, __FILE__, u16s_le( 0xd801 ) + u16s_le( 0xdc37 ), result_type::success, 0 );
+
+      verify_rule< utf16_le::bom >( __LINE__, __FILE__, u16s_le( 0xfeff ), result_type::success, 0 );
+      verify_rule< utf16_le::bom >( __LINE__, __FILE__, u16s_le( 0xfffe ), result_type::local_failure, 2 );
+
+      verify_rule< utf16_le::string< 0x20, 0x20ac, 0x10437 > >( __LINE__, __FILE__, u16s_le( 0x20 ) + u16s_le( 0x20ac ) + u16s_le( 0xd801 ) + u16s_le( 0xdc37 ) + u16s_le( 0x20 ), result_type::success, 2 );
+   }
+
+   void unit_test()
+   {
+      test_utf16();
+      test_utf16_be();
+      test_utf16_le();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/utf32_general.cpp b/packages/PEGTL/src/test/pegtl/utf32_general.cpp
index f9fc058a915f8782bbdce05e4c04eedad9eab45c..d00da771d978885e77ac582da9d0a6a80ea9f007 100644
--- a/packages/PEGTL/src/test/pegtl/utf32_general.cpp
+++ b/packages/PEGTL/src/test/pegtl/utf32_general.cpp
@@ -1,136 +1,132 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   namespace
    {
-      namespace
+      std::string u32s( const char32_t u )
       {
-         std::string u32s( const char32_t u )
-         {
-            return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
-         }
-
-         std::string u32s_be( const char32_t v )
-         {
-            const std::uint32_t u = internal::h_to_be( std::uint32_t( v ) );
-            return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
-         }
-
-         std::string u32s_le( const char32_t v )
-         {
-            const std::uint32_t u = internal::h_to_le( std::uint32_t( v ) );
-            return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
-         }
-
-      }  // namespace
-
-      void test_utf32()
-      {
-         verify_rule< utf32::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, "\xff", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, "\xff\xff", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, "\xff\xff\xff", result_type::LOCAL_FAILURE, 3 );
-
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 1 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x00ff ) + " ", result_type::SUCCESS, 1 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x0100 ) + "  ", result_type::SUCCESS, 2 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x0fff ) + "   ", result_type::SUCCESS, 3 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x1000 ) + "    ", result_type::SUCCESS, 4 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xd7ff ), result_type::SUCCESS, 0 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xe000 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xfffe ), result_type::SUCCESS, 0 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xffff ), result_type::SUCCESS, 0 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x100000 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x10fffe ), result_type::SUCCESS, 0 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x10ffff ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xd800 ), result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xd900 ), result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xdc00 ), result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xdfff ), result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x110000 ), result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x110000 ) + u32s( 0 ), result_type::LOCAL_FAILURE, 8 );
-
-         verify_rule< utf32::one< 0x20 > >( __LINE__, __FILE__, u32s( 0x20 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32::one< 0x20ac > >( __LINE__, __FILE__, u32s( 0x20ac ), result_type::SUCCESS, 0 );
-         verify_rule< utf32::one< 0x10fedc > >( __LINE__, __FILE__, u32s( 0x10fedc ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf32::string< 0x20, 0x20ac, 0x10fedc > >( __LINE__, __FILE__, u32s( 0x20 ) + u32s( 0x20ac ) + u32s( 0x10fedc ) + u32s( 0x20 ), result_type::SUCCESS, 4 );
+         return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
       }
 
-      void test_utf32_be()
+      std::string u32s_be( const char32_t v )
       {
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, "\xff", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, "\xff\xff", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, "\xff\xff\xff", result_type::LOCAL_FAILURE, 3 );
-
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 1 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x00ff ) + " ", result_type::SUCCESS, 1 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x0100 ) + "  ", result_type::SUCCESS, 2 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x0fff ) + "   ", result_type::SUCCESS, 3 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x1000 ) + "    ", result_type::SUCCESS, 4 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0xfffe ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0xffff ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x100000 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x10fffe ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x10ffff ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x110000 ), result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x110000 ) + u32s_be( 0 ), result_type::LOCAL_FAILURE, 8 );
-
-         verify_rule< utf32_be::one< 0x20 > >( __LINE__, __FILE__, u32s_be( 0x20 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_be::one< 0x20ac > >( __LINE__, __FILE__, u32s_be( 0x20ac ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_be::one< 0x10fedc > >( __LINE__, __FILE__, u32s_be( 0x10fedc ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf32_be::string< 0x20, 0x20ac, 0x10fedc > >( __LINE__, __FILE__, u32s_be( 0x20 ) + u32s_be( 0x20ac ) + u32s_be( 0x10fedc ) + u32s_be( 0x20 ), result_type::SUCCESS, 4 );
+         const std::uint32_t u = internal::h_to_be( std::uint32_t( v ) );
+         return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
       }
 
-      void test_utf32_le()
+      std::string u32s_le( const char32_t v )
       {
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, "\xff", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, "\xff\xff", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, "\xff\xff\xff", result_type::LOCAL_FAILURE, 3 );
-
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 1 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x00ff ) + " ", result_type::SUCCESS, 1 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x0100 ) + "  ", result_type::SUCCESS, 2 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x0fff ) + "   ", result_type::SUCCESS, 3 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x1000 ) + "    ", result_type::SUCCESS, 4 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0xfffe ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0xffff ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x100000 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x10fffe ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x10ffff ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x110000 ), result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x110000 ) + u32s_le( 0 ), result_type::LOCAL_FAILURE, 8 );
-
-         verify_rule< utf32_le::one< 0x20 > >( __LINE__, __FILE__, u32s_le( 0x20 ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_le::one< 0x20ac > >( __LINE__, __FILE__, u32s_le( 0x20ac ), result_type::SUCCESS, 0 );
-         verify_rule< utf32_le::one< 0x10fedc > >( __LINE__, __FILE__, u32s_le( 0x10fedc ), result_type::SUCCESS, 0 );
-
-         verify_rule< utf32_le::string< 0x20, 0x20ac, 0x10fedc > >( __LINE__, __FILE__, u32s_le( 0x20 ) + u32s_le( 0x20ac ) + u32s_le( 0x10fedc ) + u32s_le( 0x20 ), result_type::SUCCESS, 4 );
+         const std::uint32_t u = internal::h_to_le( std::uint32_t( v ) );
+         return std::string( static_cast< const char* >( static_cast< const void* >( &u ) ), sizeof( u ) );
       }
 
-      void unit_test()
-      {
-         test_utf32();
-         test_utf32_be();
-         test_utf32_le();
-      }
+   }  // namespace
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   void test_utf32()
+   {
+      verify_rule< utf32::any >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, "\xff", result_type::local_failure, 1 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, "\xff\xff", result_type::local_failure, 2 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, "\xff\xff\xff", result_type::local_failure, 3 );
+
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0 ), result_type::success, 0 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 1 ), result_type::success, 0 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x00ff ) + " ", result_type::success, 1 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x0100 ) + "  ", result_type::success, 2 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x0fff ) + "   ", result_type::success, 3 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x1000 ) + "    ", result_type::success, 4 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xd7ff ), result_type::success, 0 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xe000 ), result_type::success, 0 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xfffe ), result_type::success, 0 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xffff ), result_type::success, 0 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x100000 ), result_type::success, 0 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x10fffe ), result_type::success, 0 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x10ffff ), result_type::success, 0 );
+
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xd800 ), result_type::local_failure, 4 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xd900 ), result_type::local_failure, 4 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xdc00 ), result_type::local_failure, 4 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0xdfff ), result_type::local_failure, 4 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x110000 ), result_type::local_failure, 4 );
+      verify_rule< utf32::any >( __LINE__, __FILE__, u32s( 0x110000 ) + u32s( 0 ), result_type::local_failure, 8 );
+
+      verify_rule< utf32::one< 0x20 > >( __LINE__, __FILE__, u32s( 0x20 ), result_type::success, 0 );
+      verify_rule< utf32::one< 0x20ac > >( __LINE__, __FILE__, u32s( 0x20ac ), result_type::success, 0 );
+      verify_rule< utf32::one< 0x10fedc > >( __LINE__, __FILE__, u32s( 0x10fedc ), result_type::success, 0 );
+
+      verify_rule< utf32::string< 0x20, 0x20ac, 0x10fedc > >( __LINE__, __FILE__, u32s( 0x20 ) + u32s( 0x20ac ) + u32s( 0x10fedc ) + u32s( 0x20 ), result_type::success, 4 );
+   }
+
+   void test_utf32_be()
+   {
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, "\xff", result_type::local_failure, 1 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, "\xff\xff", result_type::local_failure, 2 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, "\xff\xff\xff", result_type::local_failure, 3 );
+
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0 ), result_type::success, 0 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 1 ), result_type::success, 0 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x00ff ) + " ", result_type::success, 1 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x0100 ) + "  ", result_type::success, 2 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x0fff ) + "   ", result_type::success, 3 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x1000 ) + "    ", result_type::success, 4 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0xfffe ), result_type::success, 0 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0xffff ), result_type::success, 0 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x100000 ), result_type::success, 0 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x10fffe ), result_type::success, 0 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x10ffff ), result_type::success, 0 );
+
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x110000 ), result_type::local_failure, 4 );
+      verify_rule< utf32_be::any >( __LINE__, __FILE__, u32s_be( 0x110000 ) + u32s_be( 0 ), result_type::local_failure, 8 );
+
+      verify_rule< utf32_be::one< 0x20 > >( __LINE__, __FILE__, u32s_be( 0x20 ), result_type::success, 0 );
+      verify_rule< utf32_be::one< 0x20ac > >( __LINE__, __FILE__, u32s_be( 0x20ac ), result_type::success, 0 );
+      verify_rule< utf32_be::one< 0x10fedc > >( __LINE__, __FILE__, u32s_be( 0x10fedc ), result_type::success, 0 );
+
+      verify_rule< utf32_be::string< 0x20, 0x20ac, 0x10fedc > >( __LINE__, __FILE__, u32s_be( 0x20 ) + u32s_be( 0x20ac ) + u32s_be( 0x10fedc ) + u32s_be( 0x20 ), result_type::success, 4 );
+   }
+
+   void test_utf32_le()
+   {
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, "\xff", result_type::local_failure, 1 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, "\xff\xff", result_type::local_failure, 2 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, "\xff\xff\xff", result_type::local_failure, 3 );
+
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0 ), result_type::success, 0 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 1 ), result_type::success, 0 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x00ff ) + " ", result_type::success, 1 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x0100 ) + "  ", result_type::success, 2 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x0fff ) + "   ", result_type::success, 3 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x1000 ) + "    ", result_type::success, 4 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0xfffe ), result_type::success, 0 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0xffff ), result_type::success, 0 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x100000 ), result_type::success, 0 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x10fffe ), result_type::success, 0 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x10ffff ), result_type::success, 0 );
+
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x110000 ), result_type::local_failure, 4 );
+      verify_rule< utf32_le::any >( __LINE__, __FILE__, u32s_le( 0x110000 ) + u32s_le( 0 ), result_type::local_failure, 8 );
+
+      verify_rule< utf32_le::one< 0x20 > >( __LINE__, __FILE__, u32s_le( 0x20 ), result_type::success, 0 );
+      verify_rule< utf32_le::one< 0x20ac > >( __LINE__, __FILE__, u32s_le( 0x20ac ), result_type::success, 0 );
+      verify_rule< utf32_le::one< 0x10fedc > >( __LINE__, __FILE__, u32s_le( 0x10fedc ), result_type::success, 0 );
+
+      verify_rule< utf32_le::string< 0x20, 0x20ac, 0x10fedc > >( __LINE__, __FILE__, u32s_le( 0x20 ) + u32s_le( 0x20ac ) + u32s_le( 0x10fedc ) + u32s_le( 0x20 ), result_type::success, 4 );
+   }
+
+   void unit_test()
+   {
+      test_utf32();
+      test_utf32_be();
+      test_utf32_le();
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/utf8_general.cpp b/packages/PEGTL/src/test/pegtl/utf8_general.cpp
index 6d3267e231667cfee36bcc69879e58f9b8bdc9f6..fe0f85f415bb64d818e660be33bbad6125bd7f8a 100644
--- a/packages/PEGTL/src/test/pegtl/utf8_general.cpp
+++ b/packages/PEGTL/src/test/pegtl/utf8_general.cpp
@@ -1,267 +1,263 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #include "test.hpp"
 #include "verify_char.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   void unit_test()
    {
-      void unit_test()
-      {
-         verify_rule< utf8::any >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-
-         for( int i = -100; i < 200; ++i ) {
-            verify_char< utf8::any >( __LINE__, __FILE__, char( i ), ( i & 0x80 ) == 0 );
-         }
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x30", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc2\xa2", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe2\x82\xac", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x90\x8d\x88", result_type::SUCCESS, 0 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x30\x20", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc2\xa2\x20", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe2\x82\xac\x20", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x90\x8d\x88\x20", result_type::SUCCESS, 1 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf", result_type::LOCAL_FAILURE, 1 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x01", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x3c", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x7f", result_type::LOCAL_FAILURE, 2 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x01", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x3c", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x7f", result_type::LOCAL_FAILURE, 2 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x01\x81", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x3c\x81", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x7f\x81", result_type::LOCAL_FAILURE, 3 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x01\x81", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x3c\x81", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x7f\x81", result_type::LOCAL_FAILURE, 3 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc3\x81", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc3\x81\x81", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc3\x81\x81\x81", result_type::SUCCESS, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xc3\x81\x81\x81\x81", result_type::SUCCESS, 3 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x80", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x80\x80", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x80\x80\x80", result_type::SUCCESS, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x80\x80\x80\x80", result_type::SUCCESS, 3 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xbf", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xbf\xbf", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xbf\xbf\xbf", result_type::SUCCESS, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xbf\xbf\xbf\xbf", result_type::SUCCESS, 3 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xff", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xff\xff", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xff\xff\xff", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xff\xff\xff\xff", result_type::LOCAL_FAILURE, 5 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef", result_type::LOCAL_FAILURE, 1 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\x0f", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\x0f", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\x0f", result_type::LOCAL_FAILURE, 2 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\x80", result_type::LOCAL_FAILURE, 2 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\xff", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\xff", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff", result_type::LOCAL_FAILURE, 2 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\x80\x80", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\xff\xff", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff\xff", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff\xff", result_type::LOCAL_FAILURE, 4 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\x80\x80", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\x80\x80\x80", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\x80\x80\x80\x80", result_type::SUCCESS, 2 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xbf\xbf", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xbf\xbf\xbf", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xbf\xbf\xbf\xbf", result_type::SUCCESS, 2 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\x80\xff", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\x80\xff\xff", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\x80\xff\xff\xff", result_type::LOCAL_FAILURE, 5 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff\xff", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff\xff\xff", result_type::LOCAL_FAILURE, 5 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x80\x80", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\x80\x80", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x80\x80\xff", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\x80\x80\xff", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\xc0\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\xc0\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x80\xf0\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\x80\xf0\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf5\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf6\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf4\x9f\xbf\xbf", result_type::LOCAL_FAILURE, 4 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf1\x80\x80\x80", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf2\x80\x80\x80", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf3\x80\x80\x80", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf4\x80\x80\x80", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\xa0\x80\x80", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x90\x80\x80", result_type::SUCCESS, 0 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf4\x8f\xbf\xbf", result_type::SUCCESS, 0 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf1\x80\x80\x80\x80", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf2\x80\x80\x80\x80", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf3\x80\x80\x80\x80", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf4\x80\x80\x80\x80", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\xa0\x80\x80\x80", result_type::SUCCESS, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x90\x80\x80\x80", result_type::SUCCESS, 1 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff ", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff  ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff   ", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff    ", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff     ", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff      ", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff       ", result_type::LOCAL_FAILURE, 8 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 8 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe ", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe  ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe   ", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe    ", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe     ", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe      ", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe       ", result_type::LOCAL_FAILURE, 8 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 8 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc ", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc  ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc   ", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc    ", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc     ", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc      ", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc       ", result_type::LOCAL_FAILURE, 8 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 8 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8 ", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8  ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8   ", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8    ", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8     ", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8      ", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8       ", result_type::LOCAL_FAILURE, 8 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 8 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80 ", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80  ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80   ", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80    ", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80     ", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80      ", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80       ", result_type::LOCAL_FAILURE, 8 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 8 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81 ", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81  ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81   ", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81    ", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81     ", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81      ", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81       ", result_type::LOCAL_FAILURE, 8 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 8 );
-
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f ", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f  ", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f   ", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f    ", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f     ", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f      ", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f       ", result_type::LOCAL_FAILURE, 8 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80", result_type::LOCAL_FAILURE, 2 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80", result_type::LOCAL_FAILURE, 3 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80\x80", result_type::LOCAL_FAILURE, 4 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 5 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 6 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 7 );
-         verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80\x80\x80\x80\x80\x80", result_type::LOCAL_FAILURE, 8 );
-
-         verify_rule< utf8::one< 0x20 > >( __LINE__, __FILE__, "\x20", result_type::SUCCESS, 0 );
-         verify_rule< utf8::one< 0xa2 > >( __LINE__, __FILE__, "\xc2\xa2", result_type::SUCCESS, 0 );
-         verify_rule< utf8::one< 0x20ac > >( __LINE__, __FILE__, "\xe2\x82\xac", result_type::SUCCESS, 0 );
-         verify_rule< utf8::one< 0x10348 > >( __LINE__, __FILE__, "\xf0\x90\x8d\x88", result_type::SUCCESS, 0 );
-
-         verify_rule< utf8::bom >( __LINE__, __FILE__, "\xef\xbb\xbf", result_type::SUCCESS, 0 );
-         verify_rule< utf8::bom >( __LINE__, __FILE__, "\xef\xbb\xbf ", result_type::SUCCESS, 1 );
-
-         verify_rule< utf8::string< 0x20, 0xa2, 0x20ac, 0x10348 > >( __LINE__, __FILE__, "\x20\xc2\xa2\xe2\x82\xac\xf0\x90\x8d\x88\x20", result_type::SUCCESS, 1 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+      verify_rule< utf8::any >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
 
-}  // namespace tao
+      for( int i = -100; i < 200; ++i ) {
+         verify_char< utf8::any >( __LINE__, __FILE__, char( i ), ( i & 0x80 ) == 0 );
+      }
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x30", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc2\xa2", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe2\x82\xac", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x90\x8d\x88", result_type::success, 0 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x30\x20", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc2\xa2\x20", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe2\x82\xac\x20", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x90\x8d\x88\x20", result_type::success, 1 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf", result_type::local_failure, 1 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x01", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x3c", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x7f", result_type::local_failure, 2 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x01", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x3c", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x7f", result_type::local_failure, 2 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x01\x81", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x3c\x81", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc0\x7f\x81", result_type::local_failure, 3 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x01\x81", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x3c\x81", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x7f\x81", result_type::local_failure, 3 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc3\x81", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc3\x81\x81", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc3\x81\x81\x81", result_type::success, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xc3\x81\x81\x81\x81", result_type::success, 3 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x80", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x80\x80", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x80\x80\x80", result_type::success, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\x80\x80\x80\x80", result_type::success, 3 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xbf", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xbf\xbf", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xbf\xbf\xbf", result_type::success, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xbf\xbf\xbf\xbf", result_type::success, 3 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xff", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xff\xff", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xff\xff\xff", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xcf\xff\xff\xff\xff", result_type::local_failure, 5 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef", result_type::local_failure, 1 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\x0f", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\x0f", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\x0f", result_type::local_failure, 2 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\x80", result_type::local_failure, 2 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\xff", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\xff", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff", result_type::local_failure, 2 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\x80\x80", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe0\xff\xff", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff\xff", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff\xff", result_type::local_failure, 4 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\x80\x80", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\x80\x80\x80", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xe7\x80\x80\x80\x80", result_type::success, 2 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xbf\xbf", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xbf\xbf\xbf", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xbf\xbf\xbf\xbf", result_type::success, 2 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\x80\xff", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\x80\xff\xff", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\x80\xff\xff\xff", result_type::local_failure, 5 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff\xff", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xef\xff\xff\xff\xff", result_type::local_failure, 5 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x80\x80", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\x80\x80", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x80\x80\xff", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\x80\x80\xff", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\xc0\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\xc0\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x80\xf0\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\x80\xf0\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf5\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf6\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf7\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf4\x9f\xbf\xbf", result_type::local_failure, 4 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf1\x80\x80\x80", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf2\x80\x80\x80", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf3\x80\x80\x80", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf4\x80\x80\x80", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\xa0\x80\x80", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x90\x80\x80", result_type::success, 0 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf4\x8f\xbf\xbf", result_type::success, 0 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf1\x80\x80\x80\x80", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf2\x80\x80\x80\x80", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf3\x80\x80\x80\x80", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf4\x80\x80\x80\x80", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\xa0\x80\x80\x80", result_type::success, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf0\x90\x80\x80\x80", result_type::success, 1 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff ", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff  ", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff   ", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff    ", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff     ", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff      ", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff       ", result_type::local_failure, 8 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80\x80\x80", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80\x80\x80\x80", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80\x80\x80\x80\x80", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xff\x80\x80\x80\x80\x80\x80\x80", result_type::local_failure, 8 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe ", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe  ", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe   ", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe    ", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe     ", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe      ", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe       ", result_type::local_failure, 8 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80\x80\x80", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80\x80\x80\x80", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80\x80\x80\x80\x80", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfe\x80\x80\x80\x80\x80\x80\x80", result_type::local_failure, 8 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc ", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc  ", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc   ", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc    ", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc     ", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc      ", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc       ", result_type::local_failure, 8 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80\x80\x80", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80\x80\x80\x80", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80\x80\x80\x80\x80", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xfc\x80\x80\x80\x80\x80\x80\x80", result_type::local_failure, 8 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8 ", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8  ", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8   ", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8    ", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8     ", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8      ", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8       ", result_type::local_failure, 8 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80\x80\x80", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80\x80\x80\x80", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80\x80\x80\x80\x80", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\xf8\x80\x80\x80\x80\x80\x80\x80", result_type::local_failure, 8 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80 ", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80  ", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80   ", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80    ", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80     ", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80      ", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80       ", result_type::local_failure, 8 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80\x80\x80", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80\x80\x80\x80", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80\x80\x80\x80\x80", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x80\x80\x80\x80\x80\x80\x80\x80", result_type::local_failure, 8 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81 ", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81  ", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81   ", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81    ", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81     ", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81      ", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81       ", result_type::local_failure, 8 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80\x80\x80", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80\x80\x80\x80", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80\x80\x80\x80\x80", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x81\x80\x80\x80\x80\x80\x80\x80", result_type::local_failure, 8 );
+
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f", result_type::local_failure, 1 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f ", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f  ", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f   ", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f    ", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f     ", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f      ", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f       ", result_type::local_failure, 8 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80", result_type::local_failure, 2 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80", result_type::local_failure, 3 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80\x80", result_type::local_failure, 4 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80\x80\x80", result_type::local_failure, 5 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80\x80\x80\x80", result_type::local_failure, 6 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80\x80\x80\x80\x80", result_type::local_failure, 7 );
+      verify_rule< utf8::any >( __LINE__, __FILE__, "\x8f\x80\x80\x80\x80\x80\x80\x80", result_type::local_failure, 8 );
+
+      verify_rule< utf8::one< 0x20 > >( __LINE__, __FILE__, "\x20", result_type::success, 0 );
+      verify_rule< utf8::one< 0xa2 > >( __LINE__, __FILE__, "\xc2\xa2", result_type::success, 0 );
+      verify_rule< utf8::one< 0x20ac > >( __LINE__, __FILE__, "\xe2\x82\xac", result_type::success, 0 );
+      verify_rule< utf8::one< 0x10348 > >( __LINE__, __FILE__, "\xf0\x90\x8d\x88", result_type::success, 0 );
+
+      verify_rule< utf8::bom >( __LINE__, __FILE__, "\xef\xbb\xbf", result_type::success, 0 );
+      verify_rule< utf8::bom >( __LINE__, __FILE__, "\xef\xbb\xbf ", result_type::success, 1 );
+
+      verify_rule< utf8::string< 0x20, 0xa2, 0x20ac, 0x10348 > >( __LINE__, __FILE__, "\x20\xc2\xa2\xe2\x82\xac\xf0\x90\x8d\x88\x20", result_type::success, 1 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #include "main.hpp"
diff --git a/packages/PEGTL/src/test/pegtl/verify_analyze.hpp b/packages/PEGTL/src/test/pegtl/verify_analyze.hpp
index 703ce0bba6538bac2e764f543442e14bb299b8d7..4787e8aff703e485e050ac9b7f903968d5407cde 100644
--- a/packages/PEGTL/src/test/pegtl/verify_analyze.hpp
+++ b/packages/PEGTL/src/test/pegtl/verify_analyze.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_VERIFY_ANALYZE_HPP  // NOLINT
@@ -8,28 +8,24 @@
 
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule >
+   void verify_analyze( const unsigned line, const char* file, const bool expect_consume, const bool expect_problems )
    {
-      template< typename Rule >
-      void verify_analyze( const unsigned line, const char* file, const bool expect_consume, const bool expect_problems )
-      {
-         analysis::analyze_cycles< Rule > a( false );
-
-         const bool has_problems = ( a.problems() != 0 );
-         const bool does_consume = a.template consumes< Rule >();
-
-         if( has_problems != expect_problems ) {
-            TAO_PEGTL_TEST_FAILED( "analyze -- problems received/expected [ " << has_problems << " / " << expect_problems << " ]" );
-         }
-         if( does_consume != expect_consume ) {
-            TAO_PEGTL_TEST_FAILED( "analyze -- consumes received/expected [ " << does_consume << " / " << expect_consume << " ]" );
-         }
-      }
+      analysis::analyze_cycles< Rule > a( false );
+
+      const bool has_problems = ( a.problems() != 0 );
+      const bool does_consume = a.template consumes< Rule >();
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+      if( has_problems != expect_problems ) {
+         TAO_PEGTL_TEST_FAILED( "analyze -- problems received/expected [ " << has_problems << " / " << expect_problems << " ]" );
+      }
+      if( does_consume != expect_consume ) {
+         TAO_PEGTL_TEST_FAILED( "analyze -- consumes received/expected [ " << does_consume << " / " << expect_consume << " ]" );
+      }
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/src/test/pegtl/verify_char.hpp b/packages/PEGTL/src/test/pegtl/verify_char.hpp
index e8159107627249191641c4e72ba4a5c6476b6b26..94800209d22e437fe9a78ae89c4478db015f42d2 100644
--- a/packages/PEGTL/src/test/pegtl/verify_char.hpp
+++ b/packages/PEGTL/src/test/pegtl/verify_char.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_VERIFY_CHAR_HPP  // NOLINT
@@ -10,24 +10,20 @@
 #include "result_type.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule >
+   void verify_char( const std::size_t line, const char* file, const char data, const result_type result )
    {
-      template< typename Rule >
-      void verify_char( const std::size_t line, const char* file, const char data, const result_type result )
-      {
-         verify_rule< Rule >( line, file, std::string( std::size_t( 1 ), data ), result, ( result == result_type::SUCCESS ) ? 0 : 1 );
-      }
+      verify_rule< Rule >( line, file, std::string( std::size_t( 1 ), data ), result, ( result == result_type::success ) ? 0 : 1 );
+   }
 
-      template< typename Rule >
-      void verify_char( const std::size_t line, const char* file, const char data, const bool result )
-      {
-         verify_char< Rule >( line, file, data, result ? result_type::SUCCESS : result_type::LOCAL_FAILURE );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule >
+   void verify_char( const std::size_t line, const char* file, const char data, const bool result )
+   {
+      verify_char< Rule >( line, file, data, result ? result_type::success : result_type::local_failure );
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/src/test/pegtl/verify_fail.hpp b/packages/PEGTL/src/test/pegtl/verify_fail.hpp
index a843b7e6fa836fa46c9ace2b9994cf4dba2fcd51..4ca68eec1a1459ace3f4b2a2154ef8fe7906f9c1 100644
--- a/packages/PEGTL/src/test/pegtl/verify_fail.hpp
+++ b/packages/PEGTL/src/test/pegtl/verify_fail.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2015-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_VERIFY_FAIL_HPP  // NOLINT
@@ -13,24 +13,20 @@
 
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule, template< typename > class Action = nothing, typename... States >
+   void verify_fail( const std::size_t line, const char* file, const std::string& s, States&&... st )
    {
-      template< typename Rule, template< typename > class Action = nothing, typename... States >
-      void verify_fail( const std::size_t line, const char* file, const std::string& s, States&&... st )
-      {
-         try {
-            memory_input<> in( s, "expect exception" );
-            parse< Rule, Action >( in, st... );
-            TAO_PEGTL_TEST_FAILED( "expected exception" );
-         }
-         catch( ... ) {
-         }
+      try {
+         memory_input in( s, "expect exception" );
+         parse< Rule, Action >( in, st... );
+         TAO_PEGTL_TEST_FAILED( "expected exception" );
       }
+      catch( ... ) {
+      }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/src/test/pegtl/verify_file.hpp b/packages/PEGTL/src/test/pegtl/verify_file.hpp
index ad581503c6987754bf0cdf5d71f4a953ebef6690..3b3d4ad429fb42dd9efa83e772e55ffe380feb37 100644
--- a/packages/PEGTL/src/test/pegtl/verify_file.hpp
+++ b/packages/PEGTL/src/test/pegtl/verify_file.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_VERIFY_FILE_HPP  // NOLINT
@@ -8,152 +8,143 @@
 
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
-   {
-      struct file_content : seq< TAO_PEGTL_STRING( "dummy content" ), eol, discard >
-      {
-      };
+   struct file_content : seq< TAO_PEGTL_STRING( "dummy content" ), eol, discard >
+   {};
 
-      struct file_grammar : seq< rep_min_max< 11, 11, file_content >, eof >
-      {
-      };
+   struct file_grammar : seq< rep_min_max< 11, 11, file_content >, eof >
+   {};
 
-      template< typename Rule >
-      struct file_action
-         : nothing< Rule >
-      {
-      };
+   template< typename Rule >
+   struct file_action
+   {};
 
-      template<>
-      struct file_action< eof >
+   template<>
+   struct file_action< eof >
+   {
+      static void apply0( bool& flag )
       {
-         static void apply0( bool& flag )
-         {
-            flag = true;
-         }
-      };
+         flag = true;
+      }
+   };
 
-      template< typename Rule >
-      struct file_control
-         : normal< Rule >
-      {
-      };
+   template< typename Rule >
+   struct file_control
+      : normal< Rule >
+   {};
 
-      template<>
-      struct file_control< eof >
-         : normal< eof >
+   template<>
+   struct file_control< eof >
+      : normal< eof >
+   {
+      template< typename Input >
+      static void success( const Input& /*unused*/, bool& flag )
       {
-         template< typename Input >
-         static void success( const Input& /*unused*/, bool& flag )
-         {
-            flag = true;
-         }
-      };
+         flag = true;
+      }
+   };
 
-      template< typename T >
-      void verify_file()
+   template< typename T >
+   void verify_file()
+   {
       {
-         {
-            const std::string f{ "src/test/pegtl/no_such_file.txt" };
-            try {
-               T in( f );
-               parse< file_grammar >( in );
-               TAO_PEGTL_TEST_ASSERT( !"no error on opening non-existing file" );
-            }
-            catch( const input_error& ) {
-            }
-         }
-         {
-            const std::string f{ "src/test/pegtl/file_data.txt" };
+         const std::string f{ "src/test/pegtl/no_such_file.txt" };
+         try {
             T in( f );
-            std::cout << in.source() << std::endl;
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-            TAO_PEGTL_TEST_ASSERT( parse< file_grammar >( in ) );
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
+            parse< file_grammar >( in );
+            TAO_PEGTL_TEST_ASSERT( !"no error on opening non-existing file" );
          }
-         {
-            const std::string f{ "src/test/pegtl/file_data.txt" };
-            T in( f );
-            bool flag = true;
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-            TAO_PEGTL_TEST_ASSERT( parse< file_grammar >( in, flag ) );
-            TAO_PEGTL_TEST_ASSERT( flag == true );
-         }
-         {
-            const std::string f{ "src/test/pegtl/file_data.txt" };
-            T in( f );
-            bool flag = false;
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-            TAO_PEGTL_TEST_ASSERT( parse< file_grammar >( in, flag ) );
-            TAO_PEGTL_TEST_ASSERT( flag == false );
-         }
-         {
-            const std::string f{ "src/test/pegtl/file_data.txt" };
-            T in( f );
-            bool flag = false;
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-            const bool result = parse< file_grammar, file_action >( in, flag );
-            TAO_PEGTL_TEST_ASSERT( result );
-            TAO_PEGTL_TEST_ASSERT( flag == true );
-         }
-         {
-            const std::string f{ "src/test/pegtl/file_data.txt" };
-            T in( f );
-            bool flag = false;
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-            const bool result = parse< file_grammar, nothing, file_control >( in, flag );
-            TAO_PEGTL_TEST_ASSERT( result );
-            TAO_PEGTL_TEST_ASSERT( flag == true );
-         }
-         const char* foo = "foo";
-         const memory_input<> m( foo, foo + 3, foo );
-         {
-            const std::string f{ "src/test/pegtl/file_data.txt" };
-            T in( f );
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-            TAO_PEGTL_TEST_ASSERT( parse_nested< file_grammar >( m, in ) );
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-         }
-         {
-            const std::string f{ "src/test/pegtl/file_data.txt" };
-            T in( f );
-            bool flag = true;
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-            TAO_PEGTL_TEST_ASSERT( parse_nested< file_grammar >( m, in, flag ) );
-            TAO_PEGTL_TEST_ASSERT( flag == true );
-         }
-         {
-            const std::string f{ "src/test/pegtl/file_data.txt" };
-            T in( f );
-            bool flag = false;
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-            TAO_PEGTL_TEST_ASSERT( parse_nested< file_grammar >( m, in, flag ) );
-            TAO_PEGTL_TEST_ASSERT( flag == false );
-         }
-         {
-            const std::string f{ "src/test/pegtl/file_data.txt" };
-            T in( f );
-            bool flag = false;
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-            const bool result = parse_nested< file_grammar, file_action >( m, in, flag );
-            TAO_PEGTL_TEST_ASSERT( result );
-            TAO_PEGTL_TEST_ASSERT( flag == true );
-         }
-         {
-            const std::string f{ "src/test/pegtl/file_data.txt" };
-            T in( f );
-            bool flag = false;
-            TAO_PEGTL_TEST_ASSERT( in.source() == f );
-            const bool result = parse_nested< file_grammar, nothing, file_control >( m, in, flag );
-            TAO_PEGTL_TEST_ASSERT( result );
-            TAO_PEGTL_TEST_ASSERT( flag == true );
+         catch( const std::system_error& ) {
          }
       }
+      {
+         const std::string f{ "src/test/pegtl/file_data.txt" };
+         T in( f );
+         std::cout << in.source() << std::endl;
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+         TAO_PEGTL_TEST_ASSERT( parse< file_grammar >( in ) );
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+      }
+      {
+         const std::string f{ "src/test/pegtl/file_data.txt" };
+         T in( f );
+         bool flag = true;
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+         TAO_PEGTL_TEST_ASSERT( parse< file_grammar >( in, flag ) );
+         TAO_PEGTL_TEST_ASSERT( flag == true );
+      }
+      {
+         const std::string f{ "src/test/pegtl/file_data.txt" };
+         T in( f );
+         bool flag = false;
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+         TAO_PEGTL_TEST_ASSERT( parse< file_grammar >( in, flag ) );
+         TAO_PEGTL_TEST_ASSERT( flag == false );
+      }
+      {
+         const std::string f{ "src/test/pegtl/file_data.txt" };
+         T in( f );
+         bool flag = false;
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+         const bool result = parse< file_grammar, file_action >( in, flag );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( flag == true );
+      }
+      {
+         const std::string f{ "src/test/pegtl/file_data.txt" };
+         T in( f );
+         bool flag = false;
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+         const bool result = parse< file_grammar, nothing, file_control >( in, flag );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( flag == true );
+      }
+      const char* foo = "foo";
+      const memory_input m( foo, foo + 3, foo );
+      {
+         const std::string f{ "src/test/pegtl/file_data.txt" };
+         T in( f );
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+         TAO_PEGTL_TEST_ASSERT( parse_nested< file_grammar >( m, in ) );
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+      }
+      {
+         const std::string f{ "src/test/pegtl/file_data.txt" };
+         T in( f );
+         bool flag = true;
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+         TAO_PEGTL_TEST_ASSERT( parse_nested< file_grammar >( m, in, flag ) );
+         TAO_PEGTL_TEST_ASSERT( flag == true );
+      }
+      {
+         const std::string f{ "src/test/pegtl/file_data.txt" };
+         T in( f );
+         bool flag = false;
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+         TAO_PEGTL_TEST_ASSERT( parse_nested< file_grammar >( m, in, flag ) );
+         TAO_PEGTL_TEST_ASSERT( flag == false );
+      }
+      {
+         const std::string f{ "src/test/pegtl/file_data.txt" };
+         T in( f );
+         bool flag = false;
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+         const bool result = parse_nested< file_grammar, file_action >( m, in, flag );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( flag == true );
+      }
+      {
+         const std::string f{ "src/test/pegtl/file_data.txt" };
+         T in( f );
+         bool flag = false;
+         TAO_PEGTL_TEST_ASSERT( in.source() == f );
+         const bool result = parse_nested< file_grammar, nothing, file_control >( m, in, flag );
+         TAO_PEGTL_TEST_ASSERT( result );
+         TAO_PEGTL_TEST_ASSERT( flag == true );
+      }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/src/test/pegtl/verify_ifmt.hpp b/packages/PEGTL/src/test/pegtl/verify_ifmt.hpp
index 4b7c265d5d14f0e9525c0a07555a54edabbaed4b..b7ea5e99c1130d1b4ce42c81e3234c8cd0799f1f 100644
--- a/packages/PEGTL/src/test/pegtl/verify_ifmt.hpp
+++ b/packages/PEGTL/src/test/pegtl/verify_ifmt.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_VERIFY_IFMT_HPP  // NOLINT
@@ -9,39 +9,35 @@
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< template< typename, typename, typename > class S >
+   void verify_ifmt( const result_type failure = result_type::local_failure )
    {
-      template< template< typename, typename, typename > class S >
-      void verify_ifmt( const result_type failure = result_type::LOCAL_FAILURE )
-      {
-         verify_analyze< S< eof, eof, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< S< eof, eof, any > >( __LINE__, __FILE__, false, false );
-         verify_analyze< S< eof, any, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< S< eof, any, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< S< any, eof, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< S< any, eof, any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< S< any, any, eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< S< any, any, any > >( __LINE__, __FILE__, true, false );
-
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "", failure, 0 );
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "b", failure, 1 );
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "c", result_type::SUCCESS, 0 );
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ac", failure, 2 );
-
-         verify_rule< must< S< one< 'a' >, one< 'b' >, one< 'c' > > > >( __LINE__, __FILE__, "", result_type::GLOBAL_FAILURE, 0 );
-         verify_rule< must< S< one< 'a' >, one< 'b' >, one< 'c' > > > >( __LINE__, __FILE__, "a", result_type::GLOBAL_FAILURE, 0 );
-         verify_rule< must< S< one< 'a' >, one< 'b' >, one< 'c' > > > >( __LINE__, __FILE__, "ac", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< must< S< one< 'a' >, one< 'b' >, one< 'c' > > > >( __LINE__, __FILE__, "b", result_type::GLOBAL_FAILURE, 1 );
-
-         verify_rule< must< S< one< 'a' >, one< 'b' >, seq< one< 'c' >, one< 'd' > > > > >( __LINE__, __FILE__, "c", result_type::GLOBAL_FAILURE, 0 );
-         verify_rule< must< S< one< 'a' >, one< 'b' >, seq< one< 'c' >, one< 'd' > > > > >( __LINE__, __FILE__, "cc", result_type::GLOBAL_FAILURE, 1 );
-      }
-
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+      verify_analyze< S< eof, eof, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< S< eof, eof, any > >( __LINE__, __FILE__, false, false );
+      verify_analyze< S< eof, any, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< S< eof, any, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< S< any, eof, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< S< any, eof, any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< S< any, any, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< S< any, any, any > >( __LINE__, __FILE__, true, false );
+
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "", failure, 0 );
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "b", failure, 1 );
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "c", result_type::success, 0 );
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ac", failure, 2 );
+
+      verify_rule< must< S< one< 'a' >, one< 'b' >, one< 'c' > > > >( __LINE__, __FILE__, "", result_type::global_failure, 0 );
+      verify_rule< must< S< one< 'a' >, one< 'b' >, one< 'c' > > > >( __LINE__, __FILE__, "a", result_type::global_failure, 0 );
+      verify_rule< must< S< one< 'a' >, one< 'b' >, one< 'c' > > > >( __LINE__, __FILE__, "ac", result_type::global_failure, 1 );
+      verify_rule< must< S< one< 'a' >, one< 'b' >, one< 'c' > > > >( __LINE__, __FILE__, "b", result_type::global_failure, 1 );
+
+      verify_rule< must< S< one< 'a' >, one< 'b' >, seq< one< 'c' >, one< 'd' > > > > >( __LINE__, __FILE__, "c", result_type::global_failure, 0 );
+      verify_rule< must< S< one< 'a' >, one< 'b' >, seq< one< 'c' >, one< 'd' > > > > >( __LINE__, __FILE__, "cc", result_type::global_failure, 1 );
+   }
+
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/src/test/pegtl/verify_impl.hpp b/packages/PEGTL/src/test/pegtl/verify_impl.hpp
index 255fbe61ea417c4dbd229ca02c0f48e02de14822..59559840665bb6041b0015224f0a8816429211ba 100644
--- a/packages/PEGTL/src/test/pegtl/verify_impl.hpp
+++ b/packages/PEGTL/src/test/pegtl/verify_impl.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_VERIFY_IMPL_HPP  // NOLINT
@@ -16,41 +16,37 @@
 #include "result_type.hpp"
 #include "test.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule, template< typename... > class Action, typename Input >
+   result_type verify_impl_two( Input& in )
    {
-      template< typename Rule, template< typename... > class Action, typename Input >
-      result_type verify_impl_two( Input& in )
-      {
-         try {
-            if( normal< Rule >::template match< apply_mode::ACTION, rewind_mode::REQUIRED, Action, normal >( in ) ) {
-               return result_type::SUCCESS;
-            }
-            return result_type::LOCAL_FAILURE;
-         }
-         catch( const std::exception& ) {
-            return result_type::GLOBAL_FAILURE;
-         }
-         catch( ... ) {
-            std::cerr << "Code should be unreachable in " << __FUNCTION__ << " (" << __FILE__ << ':' << __LINE__ << ')' << std::endl;
-            std::abort();
+      try {
+         if( normal< Rule >::template match< apply_mode::action, rewind_mode::required, Action, normal >( in ) ) {
+            return result_type::success;
          }
+         return result_type::local_failure;
+      }
+      catch( const std::exception& ) {
+         return result_type::global_failure;
+      }
+      catch( ... ) {
+         std::cerr << "Code should be unreachable in " << __FUNCTION__ << " (" << __FILE__ << ':' << __LINE__ << ')' << std::endl;
+         std::abort();
       }
+   }
 
-      template< typename Rule, template< typename... > class Action, typename Input >
-      void verify_impl_one( const std::size_t line, const char* file, const std::string& data, Input& in, const result_type expected, const std::size_t remain )
-      {
-         const result_type received = verify_impl_two< Rule, Action >( in );
+   template< typename Rule, template< typename... > class Action, typename Input >
+   void verify_impl_one( const std::size_t line, const char* file, const std::string& data, Input& in, const result_type expected, const std::size_t remain )
+   {
+      const result_type received = verify_impl_two< Rule, Action >( in );
 
-         if( ( received == expected ) && ( ( received == result_type::GLOBAL_FAILURE ) || ( in.size( 999999999 ) == remain ) ) ) {
-            return;
-         }
-         TAO_PEGTL_TEST_FAILED( "input data [ '" << data << "' ] result received/expected [ " << received << " / " << expected << " ] remain received/expected [ " << in.size( 999999999 ) << " / " << remain << " ]" );
+      if( ( received == expected ) && ( ( received == result_type::global_failure ) || ( in.size( 999999999 ) == remain ) ) ) {
+         return;
       }
+      TAO_PEGTL_TEST_FAILED( "input data [ '" << data << "' ] result received/expected [ " << received << " / " << expected << " ] remain received/expected [ " << in.size( 999999999 ) << " / " << remain << " ]" );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/src/test/pegtl/verify_rule.hpp b/packages/PEGTL/src/test/pegtl/verify_rule.hpp
index 522cc2a75d094254dbc40214e57d25fcf05c8784..a6a8ef4a8ccc0981739278154d24cb757752746d 100644
--- a/packages/PEGTL/src/test/pegtl/verify_rule.hpp
+++ b/packages/PEGTL/src/test/pegtl/verify_rule.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_VERIFY_RULE_HPP  // NOLINT
@@ -14,71 +14,67 @@
 #include "result_type.hpp"
 #include "verify_impl.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule >
+   struct verify_action_impl
    {
-      template< typename Rule >
-      struct verify_action_impl
+      template< typename Input, typename... States >
+      static void apply( const Input& /*unused*/, States&&... /*unused*/ )
       {
-         template< typename Input, typename... States >
-         static void apply( const Input& /*unused*/, States&&... /*unused*/ )
-         {
-         }
-      };
+      }
+   };
 
-      template< typename Rule >
-      struct verify_action_impl0
+   template< typename Rule >
+   struct verify_action_impl0
+   {
+      template< typename... States >
+      static void apply0( States&&... /*unused*/ )
       {
-         template< typename... States >
-         static void apply0( States&&... /*unused*/ )
-         {
-         }
-      };
+      }
+   };
 
-      template< typename Rule, typename Eol = eol::lf_crlf >
-      void verify_rule( const std::size_t line, const char* file, const std::string& data, const result_type expected, std::size_t remain = 0 )
+   template< typename Rule, typename Eol = eol::lf_crlf >
+   void verify_rule( const std::size_t line, const char* file, const std::string& data, const result_type expected, std::size_t remain = 0 )
+   {
+      remain = ( expected == result_type::success ) ? remain : data.size();
       {
-         remain = ( expected == result_type::SUCCESS ) ? remain : data.size();
-         {
-            memory_input< tracking_mode::IMMEDIATE, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
-            verify_impl_one< Rule, nothing >( line, file, data, in, expected, remain );
-            memory_input< tracking_mode::LAZY, Eol > i2( data.data(), data.data() + data.size(), file );
-            verify_impl_one< Rule, nothing >( line, file, data, i2, expected, remain );
-         }
-         {
-            memory_input< tracking_mode::IMMEDIATE, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
-            verify_impl_one< Rule, verify_action_impl >( line, file, data, in, expected, remain );
-            memory_input< tracking_mode::LAZY, Eol > i2( data.data(), data.data() + data.size(), file );
-            verify_impl_one< Rule, verify_action_impl >( line, file, data, i2, expected, remain );
-         }
-         {
-            memory_input< tracking_mode::IMMEDIATE, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
-            verify_impl_one< Rule, verify_action_impl0 >( line, file, data, in, expected, remain );
-            memory_input< tracking_mode::LAZY, Eol > i2( data.data(), data.data() + data.size(), file );
-            verify_impl_one< Rule, verify_action_impl0 >( line, file, data, i2, expected, remain );
-         }
+         memory_input< tracking_mode::eager, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
+         verify_impl_one< Rule, nothing >( line, file, data, in, expected, remain );
+         memory_input< tracking_mode::lazy, Eol > i2( data.data(), data.data() + data.size(), file );
+         verify_impl_one< Rule, nothing >( line, file, data, i2, expected, remain );
+      }
+      {
+         memory_input< tracking_mode::eager, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
+         verify_impl_one< Rule, verify_action_impl >( line, file, data, in, expected, remain );
+         memory_input< tracking_mode::lazy, Eol > i2( data.data(), data.data() + data.size(), file );
+         verify_impl_one< Rule, verify_action_impl >( line, file, data, i2, expected, remain );
       }
-
-      template< typename Rule, typename Eol = eol::lf_crlf >
-      void verify_only( const std::size_t line, const char* file, const std::string& data, const result_type expected, const std::size_t remain )
       {
-         {
-            memory_input< tracking_mode::IMMEDIATE, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
-            verify_impl_one< Rule, nothing >( line, file, data, in, expected, remain );
-         }
-         {
-            memory_input< tracking_mode::IMMEDIATE, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
-            verify_impl_one< Rule, verify_action_impl >( line, file, data, in, expected, remain );
-         }
-         {
-            memory_input< tracking_mode::IMMEDIATE, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
-            verify_impl_one< Rule, verify_action_impl0 >( line, file, data, in, expected, remain );
-         }
+         memory_input< tracking_mode::eager, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
+         verify_impl_one< Rule, verify_action_impl0 >( line, file, data, in, expected, remain );
+         memory_input< tracking_mode::lazy, Eol > i2( data.data(), data.data() + data.size(), file );
+         verify_impl_one< Rule, verify_action_impl0 >( line, file, data, i2, expected, remain );
       }
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
+   template< typename Rule, typename Eol = eol::lf_crlf >
+   void verify_only( const std::size_t line, const char* file, const std::string& data, const result_type expected, const std::size_t remain )
+   {
+      {
+         memory_input< tracking_mode::eager, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
+         verify_impl_one< Rule, nothing >( line, file, data, in, expected, remain );
+      }
+      {
+         memory_input< tracking_mode::eager, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
+         verify_impl_one< Rule, verify_action_impl >( line, file, data, in, expected, remain );
+      }
+      {
+         memory_input< tracking_mode::eager, Eol > in( data.data(), data.data() + data.size(), file, 0, line, 0 );
+         verify_impl_one< Rule, verify_action_impl0 >( line, file, data, in, expected, remain );
+      }
+   }
 
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif
diff --git a/packages/PEGTL/src/test/pegtl/verify_seqs.hpp b/packages/PEGTL/src/test/pegtl/verify_seqs.hpp
index 70b7e39c3c07cdfcd4a6fdda7c775df28cfa0b65..1de8bcf445ccfca9fc10a52c8322334e4b958dd3 100644
--- a/packages/PEGTL/src/test/pegtl/verify_seqs.hpp
+++ b/packages/PEGTL/src/test/pegtl/verify_seqs.hpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2014-2019 Dr. Colin Hirsch and Daniel Frey
 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
 
 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_VERIFY_SEQS_HPP  // NOLINT
@@ -9,63 +9,59 @@
 #include "verify_analyze.hpp"
 #include "verify_rule.hpp"
 
-namespace tao
+namespace TAO_PEGTL_NAMESPACE
 {
-   namespace TAO_PEGTL_NAMESPACE
+   template< template< typename... > class S >
+   void verify_seqs( const result_type failure = result_type::local_failure )
    {
-      template< template< typename... > class S >
-      void verify_seqs( const result_type failure = result_type::LOCAL_FAILURE )
-      {
-         verify_analyze< S< any > >( __LINE__, __FILE__, true, false );
-         verify_analyze< S< eof > >( __LINE__, __FILE__, false, false );
-         verify_analyze< S< any, eof > >( __LINE__, __FILE__, true, false );
-         verify_analyze< S< opt< any >, eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< S< any > >( __LINE__, __FILE__, true, false );
+      verify_analyze< S< eof > >( __LINE__, __FILE__, false, false );
+      verify_analyze< S< any, eof > >( __LINE__, __FILE__, true, false );
+      verify_analyze< S< opt< any >, eof > >( __LINE__, __FILE__, false, false );
 
-         verify_rule< S<> >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< S<> >( __LINE__, __FILE__, "a", result_type::SUCCESS, 1 );
+      verify_rule< S<> >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< S<> >( __LINE__, __FILE__, "a", result_type::success, 1 );
 
-         verify_rule< S< eof > >( __LINE__, __FILE__, "", result_type::SUCCESS, 0 );
-         verify_rule< S< eof > >( __LINE__, __FILE__, "a", failure, 1 );
-         verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "", failure, 0 );
-         verify_rule< S< one< 'c' >, eof > >( __LINE__, __FILE__, "", failure, 0 );
-         verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "c", result_type::SUCCESS, 0 );
-         verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "a", failure, 1 );
-         verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "b", failure, 1 );
-         verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "cc", result_type::SUCCESS, 1 );
-         verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "bc", failure, 2 );
-         verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", failure, 0 );
-         verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", failure, 1 );
-         verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", failure, 1 );
-         verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "c", failure, 1 );
-         verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-         verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::SUCCESS, 1 );
-         verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abc", result_type::SUCCESS, 1 );
-         verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::SUCCESS, 2 );
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "", failure, 0 );
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "a", failure, 1 );
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ab", failure, 2 );
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abc", result_type::SUCCESS, 0 );
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' >, eof > >( __LINE__, __FILE__, "abc", result_type::SUCCESS, 0 );
-         verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abcd", result_type::SUCCESS, 1 );
+      verify_rule< S< eof > >( __LINE__, __FILE__, "", result_type::success, 0 );
+      verify_rule< S< eof > >( __LINE__, __FILE__, "a", failure, 1 );
+      verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "", failure, 0 );
+      verify_rule< S< one< 'c' >, eof > >( __LINE__, __FILE__, "", failure, 0 );
+      verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "c", result_type::success, 0 );
+      verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "a", failure, 1 );
+      verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "b", failure, 1 );
+      verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "cc", result_type::success, 1 );
+      verify_rule< S< one< 'c' > > >( __LINE__, __FILE__, "bc", failure, 2 );
+      verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "", failure, 0 );
+      verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "a", failure, 1 );
+      verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "b", failure, 1 );
+      verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "c", failure, 1 );
+      verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+      verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abb", result_type::success, 1 );
+      verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abc", result_type::success, 1 );
+      verify_rule< S< one< 'a' >, one< 'b' > > >( __LINE__, __FILE__, "abab", result_type::success, 2 );
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "", failure, 0 );
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "a", failure, 1 );
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "ab", failure, 2 );
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abc", result_type::success, 0 );
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' >, eof > >( __LINE__, __FILE__, "abc", result_type::success, 0 );
+      verify_rule< S< one< 'a' >, one< 'b' >, one< 'c' > > >( __LINE__, __FILE__, "abcd", result_type::success, 1 );
 
-         verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "", result_type::GLOBAL_FAILURE, 0 );
-         verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "a", result_type::GLOBAL_FAILURE, 0 );
-         verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "b", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "c", result_type::GLOBAL_FAILURE, 1 );
-         verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
+      verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "", result_type::global_failure, 0 );
+      verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "a", result_type::global_failure, 0 );
+      verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "b", result_type::global_failure, 1 );
+      verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "c", result_type::global_failure, 1 );
+      verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< must< S< one< 'a' >, one< 'b' > > > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
 
-         verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "", result_type::LOCAL_FAILURE, 0 );
-         verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "a", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "b", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "c", result_type::LOCAL_FAILURE, 1 );
-         verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "ab", result_type::SUCCESS, 0 );
-         verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "aba", result_type::SUCCESS, 1 );
-      }
+      verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "", result_type::local_failure, 0 );
+      verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "a", result_type::local_failure, 1 );
+      verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "b", result_type::local_failure, 1 );
+      verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "c", result_type::local_failure, 1 );
+      verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "ab", result_type::success, 0 );
+      verify_rule< try_catch< must< S< one< 'a' >, one< 'b' > > > > >( __LINE__, __FILE__, "aba", result_type::success, 1 );
+   }
 
-   }  // namespace TAO_PEGTL_NAMESPACE
-
-}  // namespace tao
+}  // namespace TAO_PEGTL_NAMESPACE
 
 #endif