aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-09-07 23:06:07 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-09-07 23:06:07 +0000
commit561157f88812146329da3a24cc09607150dc0f63 (patch)
tree1f8d6a451f2aac21ba64e0bc65f7b033b20f360c
parent887cd86cddd9ec7e387f5478450c243627335742 (diff)
downloadpaludis-561157f88812146329da3a24cc09607150dc0f63.tar.gz
paludis-561157f88812146329da3a24cc09607150dc0f63.tar.xz
Fix CRAN tests and Python.
-rw-r--r--paludis/repositories/cran/cran_dep_parser_TEST.cc5
-rw-r--r--python/dep_spec.cc51
-rw-r--r--python/dep_spec.hh17
3 files changed, 72 insertions, 1 deletions
diff --git a/paludis/repositories/cran/cran_dep_parser_TEST.cc b/paludis/repositories/cran/cran_dep_parser_TEST.cc
index 14450cb..5463d5b 100644
--- a/paludis/repositories/cran/cran_dep_parser_TEST.cc
+++ b/paludis/repositories/cran/cran_dep_parser_TEST.cc
@@ -47,6 +47,11 @@ namespace
s << "!!!BLOCK!!!";
}
+ void visit_leaf(const LabelsDepSpec<DependencyLabelVisitorTypes> &)
+ {
+ s << "!!!LABEL!!!";
+ }
+
void visit_sequence(const AllDepSpec &,
DependencySpecTree::ConstSequenceIterator cur,
DependencySpecTree::ConstSequenceIterator end)
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index 38f2b8f..2fec22a 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -48,6 +48,7 @@ template class ConstAcceptInterfaceVisitsThis<PythonDepSpecVisitorTypes, PythonB
template class ConstAcceptInterfaceVisitsThis<PythonDepSpecVisitorTypes, PythonPlainTextDepSpec>;
template class ConstAcceptInterfaceVisitsThis<PythonDepSpecVisitorTypes, PythonURIDepSpec>;
template class ConstAcceptInterfaceVisitsThis<PythonDepSpecVisitorTypes, PythonURILabelsDepSpec>;
+template class ConstAcceptInterfaceVisitsThis<PythonDepSpecVisitorTypes, PythonDependencyLabelsDepSpec>;
template class Visits<const PythonAllDepSpec>;
template class Visits<const PythonAnyDepSpec>;
@@ -57,6 +58,7 @@ template class Visits<const PythonBlockDepSpec>;
template class Visits<const PythonPlainTextDepSpec>;
template class Visits<const PythonURIDepSpec>;
template class Visits<const PythonURILabelsDepSpec>;
+template class Visits<const PythonDependencyLabelsDepSpec>;
PythonDepSpec::PythonDepSpec()
{
@@ -452,6 +454,14 @@ PythonURILabelsDepSpec::PythonURILabelsDepSpec(const LabelsDepSpec<URILabelVisit
{
}
+PythonDependencyLabelsDepSpec::PythonDependencyLabelsDepSpec(const std::string &)
+{
+}
+
+PythonDependencyLabelsDepSpec::PythonDependencyLabelsDepSpec(const LabelsDepSpec<DependencyLabelVisitorTypes> &)
+{
+}
+
SpecTreeToPython::SpecTreeToPython() :
_current_parent(new PythonAllDepSpec())
{
@@ -524,6 +534,12 @@ SpecTreeToPython::visit_leaf(const LabelsDepSpec<URILabelVisitorTypes> & d)
_current_parent->add_child(tr1::shared_ptr<PythonURILabelsDepSpec>(new PythonURILabelsDepSpec(d)));
}
+void
+SpecTreeToPython::visit_leaf(const LabelsDepSpec<DependencyLabelVisitorTypes> & d)
+{
+ _current_parent->add_child(tr1::shared_ptr<PythonDependencyLabelsDepSpec>(new PythonDependencyLabelsDepSpec(d)));
+}
+
const tr1::shared_ptr<const PythonDepSpec>
SpecTreeToPython::result() const
{
@@ -597,6 +613,7 @@ struct AllowedTypes<DependencySpecTree>
AllowedTypes(const UseDepSpec &) {};
AllowedTypes(const PackageDepSpec &) {};
AllowedTypes(const BlockDepSpec &) {};
+ AllowedTypes(const LabelsDepSpec<DependencyLabelVisitorTypes> &) {};
};
template<>
@@ -674,6 +691,13 @@ struct NiceClassNames<LabelsDepSpec<URILabelVisitorTypes> >
const char * NiceClassNames<LabelsDepSpec<URILabelVisitorTypes> >::name = "URILabelsDepSpec";
template<>
+struct NiceClassNames<LabelsDepSpec<DependencyLabelVisitorTypes> >
+{
+ static const char * name;
+};
+const char * NiceClassNames<LabelsDepSpec<DependencyLabelVisitorTypes> >::name = "DependencyLabelsDepSpec";
+
+template<>
struct NiceClassNames<BlockDepSpec>
{
static const char * name;
@@ -843,6 +867,13 @@ SpecTreeFromPython<H_>::visit(const PythonURILabelsDepSpec & d)
template <typename H_>
void
+SpecTreeFromPython<H_>::visit(const PythonDependencyLabelsDepSpec & d)
+{
+ dispatch<H_, LabelsDepSpec<DependencyLabelVisitorTypes> >(this, d);
+}
+
+template <typename H_>
+void
SpecTreeFromPython<H_>::visit(const PythonBlockDepSpec & d)
{
dispatch<H_, BlockDepSpec>(this, d);
@@ -935,6 +966,15 @@ SpecTreeFromPython<H_>::real_visit(const PythonURILabelsDepSpec &)
template <typename H_>
void
+SpecTreeFromPython<H_>::real_visit(const PythonDependencyLabelsDepSpec &)
+{
+ _add(tr1::shared_ptr<TreeLeaf<H_, LabelsDepSpec<DependencyLabelVisitorTypes> > >(
+ new TreeLeaf<H_, LabelsDepSpec<DependencyLabelVisitorTypes> >(tr1::shared_ptr<LabelsDepSpec<DependencyLabelVisitorTypes> >(
+ new LabelsDepSpec<DependencyLabelVisitorTypes>))));
+}
+
+template <typename H_>
+void
SpecTreeFromPython<H_>::real_visit(const PythonBlockDepSpec & d)
{
_add(tr1::shared_ptr<TreeLeaf<H_, BlockDepSpec> >(
@@ -1363,6 +1403,17 @@ void expose_dep_spec()
;
/**
+ * DependencyLabelsDepSpec
+ */
+ bp::class_<PythonDependencyLabelsDepSpec, bp::bases<PythonDepSpec>, boost::noncopyable>
+ (
+ "DependencyLabelsDepSpec",
+ "A DependencyLabelsDepSpec represents a dependency label.",
+ bp::init<const std::string &>("__init__(str)")
+ )
+ ;
+
+ /**
* BlockDepSpec
*/
bp::class_<PythonBlockDepSpec, bp::bases<PythonStringDepSpec>, boost::noncopyable >
diff --git a/python/dep_spec.hh b/python/dep_spec.hh
index ca2aa69..2e1cce1 100644
--- a/python/dep_spec.hh
+++ b/python/dep_spec.hh
@@ -38,6 +38,7 @@ namespace paludis
class PythonURIDepSpec;
class PythonBlockDepSpec;
class PythonURILabelsDepSpec;
+ class PythonDependencyLabelsDepSpec;
struct PythonDepSpecVisitorTypes :
VisitorTypes<
@@ -50,7 +51,8 @@ namespace paludis
PythonPlainTextDepSpec,
PythonPackageDepSpec,
PythonURIDepSpec,
- PythonURILabelsDepSpec
+ PythonURILabelsDepSpec,
+ PythonDependencyLabelsDepSpec
>
{
};
@@ -220,6 +222,15 @@ namespace paludis
PythonURILabelsDepSpec(const LabelsDepSpec<URILabelVisitorTypes> &);
};
+ class PALUDIS_VISIBLE PythonDependencyLabelsDepSpec :
+ public PythonDepSpec,
+ public ConstAcceptInterfaceVisitsThis<PythonDepSpecVisitorTypes, PythonDependencyLabelsDepSpec>
+ {
+ public:
+ PythonDependencyLabelsDepSpec(const std::string &);
+ PythonDependencyLabelsDepSpec(const LabelsDepSpec<DependencyLabelVisitorTypes> &);
+ };
+
/**
* Used to convert one of the SpecTrees to PythonDepSpec.
*/
@@ -258,6 +269,8 @@ namespace paludis
void visit_leaf(const URIDepSpec &);
void visit_leaf(const LabelsDepSpec<URILabelVisitorTypes> &);
+
+ void visit_leaf(const LabelsDepSpec<DependencyLabelVisitorTypes> &);
};
/**
@@ -287,6 +300,7 @@ namespace paludis
void visit(const PythonBlockDepSpec &);
void visit(const PythonURIDepSpec &);
void visit(const PythonURILabelsDepSpec &);
+ void visit(const PythonDependencyLabelsDepSpec &);
void real_visit(const PythonAllDepSpec &);
void real_visit(const PythonAnyDepSpec &);
@@ -296,6 +310,7 @@ namespace paludis
void real_visit(const PythonBlockDepSpec &);
void real_visit(const PythonURIDepSpec &);
void real_visit(const PythonURILabelsDepSpec &);
+ void real_visit(const PythonDependencyLabelsDepSpec &);
};
}
}