update to 3.2.7

This commit is contained in:
lyn1001 2023-09-15 11:16:35 +08:00
parent c0d9fef5e7
commit c42c9cbd2e
4 changed files with 21 additions and 50 deletions

Binary file not shown.

BIN
3.2.7.tar.gz Normal file

Binary file not shown.

View File

@ -1,17 +1,15 @@
%global debug_package %{nil}
Name: PEGTL
Version: 2.8.0
Release: 3
Version: 3.2.7
Release: 1
Summary: Parsing Expression Grammar Template Library
License: MIT
URL: https://github.com/taocpp/PEGTL/
Source0: https://github.com/taocpp/%{name}/archive/%{version}.tar.gz
BuildRequires: gcc-c++
BuildRequires: make
Patch0001: bugfix-gcc-10.patch
BuildRequires: make cmake
%description
The Parsing Expression Grammar Template Library (PEGTL) is a zero-dependency
@ -30,24 +28,34 @@ applications that use %{name}.
%prep
%setup -q -n %{name}-%{version}
%patch0001 -p1
%build
%cmake \
-DPEGTL_INSTALL_DOC_DIR:PATH=%{_defaultdocdir}/pegtl \
-DPEGTL_INSTALL_CMAKE_DIR:PATH=%{_datadir}/cmake/Modules \
-DPEGTL_BUILD_EXAMPLES:BOOL=OFF \
-DPEGTL_BUILD_TESTS:BOOL=ON
%make_build
%check
make
/usr/bin/ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags}
%install
install -d -m 0755 %{buildroot}%{_includedir}
pushd include/
cp -R tao/ %{buildroot}%{_includedir}
popd
%make_install
rm %{buildroot}%{_defaultdocdir}/pegtl/LICENSE
%files devel
%doc README.md doc/
%license LICENSE
%{_includedir}/tao/pegtl.hpp
%{_includedir}/tao/pegtl
%{_includedir}/*
%{_datadir}/cmake/Modules
%changelog
* Thu Sep 14 2023 liyanan <thistleslyn@163.com> - 3.2.7-1
- update to 3.2.7
* Mon Aug 2 2021 Shenmei Tu <tushenmei@huawei.com> - 2.8.0-3
- bugfix-gcc-10.patch

View File

@ -1,37 +0,0 @@
diff -Nur PEGTL-2.8.0/include/tao/pegtl/contrib/rep_one_min_max.hpp PEGTL-2.8.0-new/include/tao/pegtl/contrib/rep_one_min_max.hpp
--- PEGTL-2.8.0/include/tao/pegtl/contrib/rep_one_min_max.hpp 2019-04-10 02:27:36.000000000 +0800
+++ PEGTL-2.8.0-new/include/tao/pegtl/contrib/rep_one_min_max.hpp 2021-08-02 10:13:41.000000000 +0800
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2019 Dr. Colin Hirsch and Daniel Frey
+// Copyright (c) 2017-2020 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
@@ -41,6 +41,27 @@
bump_help< result_on_found::success, Input, char, C >( in, i );
return true;
}
+ return false;
+ }
+ };
+
+ template< unsigned Max, char C >
+ struct rep_one_min_max< 0, Max, C >
+ {
+ using analyze_t = analysis::counted< analysis::rule_type::any, 0 >;
+
+ template< typename Input >
+ static bool match( Input& in )
+ {
+ const auto size = in.size( Max + 1 );
+ std::size_t i = 0;
+ while( ( i < size ) && ( in.peek_char( i ) == C ) ) {
+ ++i;
+ }
+ if( i <= Max ) {
+ bump_help< result_on_found::success, Input, char, C >( in, i );
+ return true;
+ }
return false;
}
};