summaryrefslogtreecommitdiff
blob: a7c41231f4b1209788a8fa719da40fabdc4623fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Based on patch from Zoltán Fridrich <zfridric@redhat.com>
Reworked by Vyacheslav Perestoronin <perestoronin@gmail.com>
Little fixes by Vadim Misbakh-Soloviov <mva@gentoo.org>

--- a/IO/MotionFX/vtkMotionFXCFGGrammar.h
+++ b/IO/MotionFX/vtkMotionFXCFGGrammar.h
@@ -23,7 +23,12 @@
 
 // for debugging
 // clang-format off
+#if TAO_PEGTL_VERSION_MAJOR >= 3
+#include VTK_PEGTL(pegtl/contrib/trace.hpp)
+#else
 #include VTK_PEGTL(pegtl/contrib/tracer.hpp)
+#endif
+
 // clang-format on
 
 namespace MotionFX
--- a/IO/MotionFX/vtkMotionFXCFGReader.cxx
+++ b/IO/MotionFX/vtkMotionFXCFGReader.cxx
@@ -1014,14 +1014,24 @@
     if (this->isOrientation)
     {
       std::vector<double> numbers;
+#if TAO_PEGTL_VERSION_MAJOR >= 3
+      tao::pegtl::complete_trace<MotionFX::OrientationsPositionFile::Grammar,
+        Actions::PositionFile::action>(in, numbers, this->positions);
+#else
       tao::pegtl::parse<MotionFX::OrientationsPositionFile::Grammar,
         Actions::PositionFile::action /*, tao::pegtl::tracer*/>(in, numbers, this->positions);
+#endif
     }
     else
     {
       std::vector<double> numbers;
+#if TAO_PEGTL_VERSION_MAJOR >= 3
+      tao::pegtl::complete_trace<MotionFX::LegacyPositionFile::Grammar,
+        Actions::PositionFile::action>(in, numbers, this->positions);
+#else
       tao::pegtl::parse<MotionFX::LegacyPositionFile::Grammar,
         Actions::PositionFile::action /*, tao::pegtl::tracer*/>(in, numbers, this->positions);
+#endif
     }
     return true;
   }
-  catch (const tao::pegtl::input_error& e)
+  catch (const std::filesystem::filesystem_error& e)
   {
     vtkGenericWarningMacro("PositionFileMotion::read_position_file failed: " << e.what());
   }
@@ -1050,7 +1060,11 @@
   {
     tao::pegtl::read_input<> in(filename);
     Actions::CFG::ActiveState state(this->Motions);
+#if TAO_PEGTL_VERSION_MAJOR >= 3
+    tao::pegtl::complete_trace<MotionFX::CFG::Grammar, Actions::CFG::action>(in, state);
+#else
     tao::pegtl::parse<MotionFX::CFG::Grammar, Actions::CFG::action>(in, state);
+#endif
     if (this->Motions.size() == 0)
     {
       vtkGenericWarningMacro(
@@ -1061,7 +1075,11 @@
       if (getenv("MOTIONFX_DEBUG_GRAMMAR") != nullptr)
       {
         tao::pegtl::read_input<> in2(filename);
+#if TAO_PEGTL_VERSION_MAJOR >= 3
+        tao::pegtl::complete_trace<MotionFX::CFG::Grammar, tao::pegtl::nothing>(in2);
+#else
         tao::pegtl::parse<MotionFX::CFG::Grammar, tao::pegtl::nothing, tao::pegtl::tracer>(in2);
+#endif
       }
       return false;
     }