URL:
https://svn.lrde.epita.fr/svn/scool/trunk
ChangeLog:
2008-04-12 Maxime van Noppen <yabo(a)lrde.epita.fr>
Add tests on concept usages
* input/concept_use_1.scl: New.
* input/concept_use_2.scl: New.
* parser/concept_use_1.ref: New.
* parser/concept_use_2.ref: New.
* transformer/concept_1.ref,
* transformer/concept_2.ref,
* transformer/concept_3.ref,
* transformer/concept_4.ref: Minor changes in layout.
* transformer/concept_use_1.ref: New.
* transformer/concept_use_2.ref: New.
input/concept_use_1.scl | 10 ++++++++++
input/concept_use_2.scl | 10 ++++++++++
parser/concept_use_1.ref | 1 +
parser/concept_use_2.ref | 1 +
transformer/concept_1.ref | 2 +-
transformer/concept_2.ref | 2 +-
transformer/concept_3.ref | 2 +-
transformer/concept_4.ref | 2 +-
transformer/concept_use_1.ref | 21 +++++++++++++++++++++
transformer/concept_use_2.ref | 21 +++++++++++++++++++++
10 files changed, 68 insertions(+), 4 deletions(-)
Index: trunk/tests/input/concept_use_1.scl
===================================================================
--- trunk/tests/input/concept_use_1.scl (revision 0)
+++ trunk/tests/input/concept_use_1.scl (revision 59)
@@ -0,0 +1,10 @@
+box : concept =
+{
+ value : type;
+
+ decl get_value : () -> value;
+}
+
+foo : [ T : type where (T models box) ] (pbox : T) -> void =
+{
+}
Index: trunk/tests/input/concept_use_2.scl
===================================================================
--- trunk/tests/input/concept_use_2.scl (revision 0)
+++ trunk/tests/input/concept_use_2.scl (revision 59)
@@ -0,0 +1,10 @@
+box : concept =
+{
+ value : type;
+
+ decl get_value : () -> value;
+}
+
+foo : [ T : type where T models box ] (pbox : T) -> void =
+{
+}
Index: trunk/tests/transformer/concept_use_1.ref
===================================================================
--- trunk/tests/transformer/concept_use_1.ref (revision 0)
+++ trunk/tests/transformer/concept_use_1.ref (revision 59)
@@ -0,0 +1,21 @@
+template < typename E >
+class box
+{
+ // To be provided by classes that model this concept.
+
+ // typedef value;
+ // value get_value();
+ protected:
+ box();
+};
+template < class T >
+void foo(const box<T>& c)
+{
+}
+template < typename E >
+ box<E>::box()
+{
+ typedef typename E::value value;
+ value (E::*m1)() = &E::get_value;
+ m1 = 0;
+}
Index: trunk/tests/transformer/concept_use_2.ref
===================================================================
--- trunk/tests/transformer/concept_use_2.ref (revision 0)
+++ trunk/tests/transformer/concept_use_2.ref (revision 59)
@@ -0,0 +1,21 @@
+template < typename E >
+class box
+{
+ // To be provided by classes that model this concept.
+
+ // typedef value;
+ // value get_value();
+ protected:
+ box();
+};
+template < class T >
+void foo(const box<T>& c)
+{
+}
+template < typename E >
+ box<E>::box()
+{
+ typedef typename E::value value;
+ value (E::*m1)() = &E::get_value;
+ m1 = 0;
+}
Index: trunk/tests/transformer/concept_1.ref
===================================================================
--- trunk/tests/transformer/concept_1.ref (revision 58)
+++ trunk/tests/transformer/concept_1.ref (revision 59)
@@ -1,7 +1,7 @@
template < typename E >
class box
{
- // To be provided by classes that models this concept
+ // To be provided by classes that model this concept.
// typedef value;
// value get_value();
Index: trunk/tests/transformer/concept_2.ref
===================================================================
--- trunk/tests/transformer/concept_2.ref (revision 58)
+++ trunk/tests/transformer/concept_2.ref (revision 59)
@@ -1,7 +1,7 @@
template < typename E >
class box
{
- // To be provided by classes that models this concept
+ // To be provided by classes that model this concept.
// typedef value;
// value set_value(value val);
Index: trunk/tests/transformer/concept_3.ref
===================================================================
--- trunk/tests/transformer/concept_3.ref (revision 58)
+++ trunk/tests/transformer/concept_3.ref (revision 59)
@@ -1,7 +1,7 @@
template < typename E >
class box
{
- // To be provided by classes that models this concept
+ // To be provided by classes that model this concept.
// typedef value;
// value set_value(value val);
Index: trunk/tests/transformer/concept_4.ref
===================================================================
--- trunk/tests/transformer/concept_4.ref (revision 58)
+++ trunk/tests/transformer/concept_4.ref (revision 59)
@@ -1,7 +1,7 @@
template < typename E >
class box
{
- // To be provided by classes that models this concept
+ // To be provided by classes that model this concept.
// typedef value;
// value set_value(value val);
Index: trunk/tests/parser/concept_use_1.ref
===================================================================
--- trunk/tests/parser/concept_use_1.ref (revision 0)
+++ trunk/tests/parser/concept_use_1.ref (revision 59)
@@ -0,0 +1 @@
+Program([Concept("box",[ConstDec([],"value",None,Var("type")),ConstDec(["decl"],"get_value",None,FunType([],Var("value")))]),BiFunDec([],"foo",[("T",Var("type"),Some((Parenthesis(Model("T","box")))))],[("pbox",Var("T"))],Var("void"),[])])
Index: trunk/tests/parser/concept_use_2.ref
===================================================================
--- trunk/tests/parser/concept_use_2.ref (revision 0)
+++ trunk/tests/parser/concept_use_2.ref (revision 59)
@@ -0,0 +1 @@
+Program([Concept("box",[ConstDec([],"value",None,Var("type")),ConstDec(["decl"],"get_value",None,FunType([],Var("value")))]),BiFunDec([],"foo",[("T",Var("type"),Some((Model("T","box"))))],[("pbox",Var("T"))],Var("void"),[])])
--
\__/ \__/
(00) Maxime `yabo` van Noppen (00)
___) \ Epita 2009 / (___
(_____/ Président de Prologin \_____)