# # spec file for package perl-Regexp-Grammars # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define cpan_name Regexp-Grammars Name: perl-Regexp-Grammars Version: 1.58.0 Release: 0 # 1.058 -> normalize -> 1.58.0 %define cpan_version 1.058 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Add grammatical parsing features to Perl 5.10 regexes URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/D/DC/DCONWAY/%{cpan_name}-%{cpan_version}.tar.gz Source1: cpanspec.yml Source100: README.md BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Module::Build) BuildRequires: perl(version) Requires: perl(version) Provides: perl(Regexp::Grammars) = %{version} Provides: perl(Regexp::Grammars::Precursor) %undefine __perllib_provides %{perl_requires} %description This module adds a small number of new regex constructs that can be used within Perl 5.10 patterns to implement complete recursive-descent parsing. Perl 5.10 already supports recursive-descent _matching_, via the new '(?...)' and '(?&name)' constructs. For example, here is a simple matcher for a subset of the LaTeX markup language: $matcher = qr{ (?&File) (?(DEFINE) (? (?&Element)* ) (? \s* (?&Command) | \s* (?&Literal) ) (? \\ \s* (?&Literal) \s* (?&Options)? \s* (?&Args)? ) (? \[ \s* (?:(?&Option) (?:\s*,\s* (?&Option) )*)? \s* \]) (? \{ \s* (?&Element)* \s* \} ) (?