aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories')
-rw-r--r--paludis/repositories/e/dep_parser.cc14
-rw-r--r--paludis/repositories/fake/dep_parser.cc36
2 files changed, 38 insertions, 12 deletions
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 147974f5f..afe6c63d5 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -219,6 +219,13 @@ namespace
throw EDepParseError(s, "Any dep specs not allowed here");
}
+ void exactly_one_not_allowed_handler(const std::string & s) PALUDIS_ATTRIBUTE((noreturn));
+
+ void exactly_one_not_allowed_handler(const std::string & s)
+ {
+ throw EDepParseError(s, "Exactly one dep specs not allowed here");
+ }
+
void arrows_not_allowed_handler(const std::string & s, const std::string & f, const std::string & t) PALUDIS_ATTRIBUTE((noreturn));
void arrows_not_allowed_handler(const std::string & s, const std::string & f, const std::string & t)
@@ -414,6 +421,7 @@ paludis::erepository::parse_depend(const std::string & s,
n::on_any() = std::bind(&any_all_handler<DependencySpecTree, AnyDepSpec>, std::ref(stack)),
n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&dependency_label_handler<DependencySpecTree>,
std::ref(stack),
ParseStackTypes<DependencySpecTree>::AnnotationsGoHere(std::bind(
@@ -457,6 +465,7 @@ paludis::erepository::parse_provide(const std::string & s,
n::on_any() = std::bind(&any_not_allowed_handler, s),
n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&labels_not_allowed_handler, s, _1),
n::on_pop() = std::bind(&pop_handler<ProvideSpecTree>, std::ref(stack),
ParseStackTypes<ProvideSpecTree>::AnnotationsGoHere(std::bind(
@@ -498,6 +507,7 @@ paludis::erepository::parse_fetchable_uri(const std::string & s,
ParseStackTypes<FetchableURISpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), s, _1, _2, std::cref(eapi)),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&fetchable_label_handler<FetchableURISpecTree>, std::ref(stack),
ParseStackTypes<FetchableURISpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1, std::cref(eapi)),
@@ -539,6 +549,7 @@ paludis::erepository::parse_simple_uri(const std::string & s,
n::on_any() = std::bind(&any_not_allowed_handler, s),
n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&labels_not_allowed_handler, s, _1),
n::on_pop() = std::bind(&pop_handler<SimpleURISpecTree>, std::ref(stack),
ParseStackTypes<SimpleURISpecTree>::AnnotationsGoHere(std::bind(
@@ -578,6 +589,7 @@ paludis::erepository::parse_license(const std::string & s,
n::on_any() = std::bind(&any_all_handler<LicenseSpecTree, AnyDepSpec>, std::ref(stack)),
n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&labels_not_allowed_handler, s, _1),
n::on_pop() = std::bind(&pop_handler<LicenseSpecTree>, std::ref(stack),
ParseStackTypes<LicenseSpecTree>::AnnotationsGoHere(std::bind(
@@ -617,6 +629,7 @@ paludis::erepository::parse_plain_text(const std::string & s,
n::on_any() = std::bind(&any_not_allowed_handler, s),
n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&labels_not_allowed_handler, s, _1),
n::on_pop() = std::bind(&pop_handler<PlainTextSpecTree>, std::ref(stack),
ParseStackTypes<PlainTextSpecTree>::AnnotationsGoHere(std::bind(
@@ -656,6 +669,7 @@ paludis::erepository::parse_myoptions(const std::string & s,
n::on_any() = std::bind(&any_not_allowed_handler, s),
n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&plain_text_label_handler<PlainTextSpecTree>, std::ref(stack),
ParseStackTypes<PlainTextSpecTree>::AnnotationsGoHere(std::bind(
&set_thing_to_annotate, std::ref(thing_to_annotate), _1)), _1),
diff --git a/paludis/repositories/fake/dep_parser.cc b/paludis/repositories/fake/dep_parser.cc
index b627b1c5c..806115edd 100644
--- a/paludis/repositories/fake/dep_parser.cc
+++ b/paludis/repositories/fake/dep_parser.cc
@@ -104,6 +104,13 @@ namespace
throw FakeDepParseError(s, "Any dep specs not allowed here");
}
+ void exactly_one_not_allowed_handler(const std::string & s) PALUDIS_ATTRIBUTE((noreturn));
+
+ void exactly_one_not_allowed_handler(const std::string & s)
+ {
+ throw FakeDepParseError(s, "Exactly one dep specs not allowed here");
+ }
+
void arrows_not_allowed_handler(const std::string & s, const std::string & f, const std::string & t) PALUDIS_ATTRIBUTE((noreturn));
void arrows_not_allowed_handler(const std::string & s, const std::string & f, const std::string & t)
@@ -180,6 +187,7 @@ paludis::fakerepository::parse_depend(const std::string & s,
n::on_any() = std::bind(&any_all_handler<DependencySpecTree, AnyDepSpec>, std::ref(stack)),
n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&labels_not_allowed_handler, s, _1),
n::on_pop() = std::bind(&pop_handler<DependencySpecTree>, std::ref(stack), s),
n::on_should_be_empty() = std::bind(&should_be_empty_handler<DependencySpecTree>, std::ref(stack), s),
@@ -210,6 +218,7 @@ paludis::fakerepository::parse_provide(const std::string & s,
n::on_any() = std::bind(&any_not_allowed_handler, s),
n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&labels_not_allowed_handler, s, _1),
n::on_pop() = std::bind(&pop_handler<ProvideSpecTree>, std::ref(stack), s),
n::on_should_be_empty() = std::bind(&should_be_empty_handler<ProvideSpecTree>, std::ref(stack), s),
@@ -240,6 +249,7 @@ paludis::fakerepository::parse_fetchable_uri(const std::string & s,
n::on_any() = std::bind(&any_not_allowed_handler, s),
n::on_arrow() = std::bind(&arrow_handler<FetchableURISpecTree>, std::ref(stack), _1, _2),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&labels_not_allowed_handler, s, _1),
n::on_pop() = std::bind(&pop_handler<FetchableURISpecTree>, std::ref(stack), s),
n::on_should_be_empty() = std::bind(&should_be_empty_handler<FetchableURISpecTree>, std::ref(stack), s),
@@ -270,6 +280,7 @@ paludis::fakerepository::parse_simple_uri(const std::string & s,
n::on_any() = std::bind(&any_not_allowed_handler, s),
n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
n::on_label() = std::bind(&labels_not_allowed_handler, s, _1),
n::on_pop() = std::bind(&pop_handler<SimpleURISpecTree>, std::ref(stack), s),
n::on_should_be_empty() = std::bind(&should_be_empty_handler<SimpleURISpecTree>, std::ref(stack), s),
@@ -295,18 +306,19 @@ paludis::fakerepository::parse_license(const std::string & s,
ELikeDepParserCallbacks callbacks(
make_named_values<ELikeDepParserCallbacks>(
- n::on_all() = std::bind(&any_all_handler<LicenseSpecTree, AllDepSpec>, std::ref(stack)),
- n::on_annotations() = &discard_annotations,
- n::on_any() = std::bind(&any_all_handler<LicenseSpecTree, AnyDepSpec>, std::ref(stack)),
- n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
- n::on_error() = std::bind(&error_handler, s, _1),
- n::on_label() = std::bind(&labels_not_allowed_handler, s, _1),
- n::on_pop() = std::bind(&pop_handler<LicenseSpecTree>, std::ref(stack), s),
- n::on_should_be_empty() = std::bind(&should_be_empty_handler<LicenseSpecTree>, std::ref(stack), s),
- n::on_string() = std::bind(&license_handler<LicenseSpecTree>, std::ref(stack), _1),
- n::on_use() = std::bind(&use_handler<LicenseSpecTree>, std::ref(stack), _1, env, id),
- n::on_use_under_any() = &do_nothing
- ));
+ n::on_all() = std::bind(&any_all_handler<LicenseSpecTree, AllDepSpec>, std::ref(stack)),
+ n::on_annotations() = &discard_annotations,
+ n::on_any() = std::bind(&any_all_handler<LicenseSpecTree, AnyDepSpec>, std::ref(stack)),
+ n::on_arrow() = std::bind(&arrows_not_allowed_handler, s, _1, _2),
+ n::on_error() = std::bind(&error_handler, s, _1),
+ n::on_exactly_one() = std::bind(&exactly_one_not_allowed_handler, s),
+ n::on_label() = std::bind(&labels_not_allowed_handler, s, _1),
+ n::on_pop() = std::bind(&pop_handler<LicenseSpecTree>, std::ref(stack), s),
+ n::on_should_be_empty() = std::bind(&should_be_empty_handler<LicenseSpecTree>, std::ref(stack), s),
+ n::on_string() = std::bind(&license_handler<LicenseSpecTree>, std::ref(stack), _1),
+ n::on_use() = std::bind(&use_handler<LicenseSpecTree>, std::ref(stack), _1, env, id),
+ n::on_use_under_any() = &do_nothing
+ ));
parse_elike_dependencies(s, callbacks);