From: Maxime van Noppen <yabo(a)lrde.epita.fr>
To: transformers-patches(a)lrde.epita.fr, olena-patches(a)lrde.epita.fr
Subject: scool r126: Add reference files for tests on typedefs and fix tests
URL:
https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2008-11-12 Maxime van Noppen <yabo(a)lrde.epita.fr>
Add reference files for tests on typedefs and fix tests.
* class/c++_ast/typedef_001.aterm: New.
* class/c++_build/typedef_001.g++: New.
* class/c++_src/typedef_001.cc: New.
* variable/c++_build/declaration_001.g++: New.
* variable/c++_build/declaration_005.g++: New.
* variable/c++_build/declaration_007.g++: New.
* variable/c++_build/declaration_008.g++: New.
* class/scool_ast/typedef_001.aterm: New.
* class/scool_src/typedef_001.scl:,
* variable/c++_ast/declaration_001.aterm:,
* variable/c++_ast/declaration_005.aterm:,
* variable/c++_ast/declaration_007.aterm:,
* variable/c++_ast/declaration_008.aterm:,
* variable/c++_src/declaration_001.cc:,
* variable/c++_src/declaration_005.cc:,
* variable/c++_src/declaration_007.cc:,
* variable/c++_src/declaration_008.cc:,
* variable/scool_ast/declaration_001.aterm:,
* variable/scool_ast/declaration_005.aterm:,
* variable/scool_ast/declaration_007.aterm:,
* variable/scool_ast/declaration_008.aterm:,
* variable/scool_src/declaration_001.scl:,
* variable/scool_src/declaration_005.scl:,
* variable/scool_src/declaration_007.scl:,
* variable/scool_src/declaration_008.scl: Here.
---
class/c++_ast/typedef_001.aterm | 1 +
class/c++_src/typedef_001.cc | 6 ++++++
class/scool_ast/typedef_001.aterm | 1 +
class/scool_src/typedef_001.scl | 3 +++
variable/c++_ast/declaration_001.aterm | 2 +-
variable/c++_ast/declaration_005.aterm | 2 +-
variable/c++_ast/declaration_007.aterm | 2 +-
variable/c++_ast/declaration_008.aterm | 2 +-
variable/c++_src/declaration_001.cc | 2 +-
variable/c++_src/declaration_005.cc | 4 ++++
variable/c++_src/declaration_007.cc | 3 ++-
variable/c++_src/declaration_008.cc | 1 +
variable/scool_ast/declaration_001.aterm | 2 +-
variable/scool_ast/declaration_005.aterm | 2 +-
variable/scool_ast/declaration_007.aterm | 2 +-
variable/scool_ast/declaration_008.aterm | 2 +-
variable/scool_src/declaration_001.scl | 2 +-
variable/scool_src/declaration_005.scl | 6 ++++++
variable/scool_src/declaration_007.scl | 3 ++-
variable/scool_src/declaration_008.scl | 1 +
20 files changed, 37 insertions(+), 12 deletions(-)
Index: branches/scool-ng/tests/class/c++_ast/typedef_001.aterm
===================================================================
--- branches/scool-ng/tests/class/c++_ast/typedef_001.aterm (revision 0)
+++ branches/scool-ng/tests/class/c++_ast/typedef_001.aterm (revision 126)
@@ -0,0 +1 @@
+CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("foo"),[],[CxxPublic([CxxTypedef(CxxType("int"),CxxId("new_type"))])])])
Index: branches/scool-ng/tests/class/c++_src/typedef_001.cc
===================================================================
--- branches/scool-ng/tests/class/c++_src/typedef_001.cc (revision 0)
+++ branches/scool-ng/tests/class/c++_src/typedef_001.cc (revision 126)
@@ -0,0 +1,6 @@
+template < typename Exact >
+class foo
+{
+ public:
+ typedef int new_type;
+};
Index: branches/scool-ng/tests/class/scool_ast/typedef_001.aterm
===================================================================
--- branches/scool-ng/tests/class/scool_ast/typedef_001.aterm (revision 0)
+++ branches/scool-ng/tests/class/scool_ast/typedef_001.aterm (revision 126)
@@ -0,0 +1 @@
+Program([ClassDefinition(Identifier("foo"),None,None,ClassBlock([AccessBlock(Public,[TypeDefinition(None,Identifier("new_type"),StaticInitialiser(SimpleType("int")))])]))])
Index: branches/scool-ng/tests/class/scool_src/typedef_001.scl
===================================================================
--- branches/scool-ng/tests/class/scool_src/typedef_001.scl (revision 125)
+++ branches/scool-ng/tests/class/scool_src/typedef_001.scl (revision 126)
@@ -1,4 +1,7 @@
foo : class =
{
+ public
+ {
new_type: type = int;
}
+}
Index: branches/scool-ng/tests/class/c++_build/typedef_001.g++
===================================================================
Index: branches/scool-ng/tests/variable/c++_ast/declaration_005.aterm
===================================================================
--- branches/scool-ng/tests/variable/c++_ast/declaration_005.aterm (revision 125)
+++ branches/scool-ng/tests/variable/c++_ast/declaration_005.aterm (revision 126)
@@ -1 +1 @@
-CxxProgram([CxxDecl(CxxType(CxxId("list"),[CxxType("int")]),CxxId("l"))])
+CxxProgram([CxxProgram("#include <list>\n\nusing
std::list;\n"),CxxDecl(CxxType(CxxId("list"),[CxxType("int")]),CxxId("l"))])
Index: branches/scool-ng/tests/variable/c++_ast/declaration_007.aterm
===================================================================
--- branches/scool-ng/tests/variable/c++_ast/declaration_007.aterm (revision 125)
+++ branches/scool-ng/tests/variable/c++_ast/declaration_007.aterm (revision 126)
@@ -1 +1 @@
-CxxProgram([CxxDecl(CxxConstType(CxxType("int")),CxxId("i"))])
+CxxProgram([CxxDecl(CxxConstType(CxxType("int")),CxxId("i"),CxxInt("42")),CxxDecl(CxxConstType(CxxType("int")),CxxId("j"),CxxInt("51"))])
Index: branches/scool-ng/tests/variable/c++_ast/declaration_008.aterm
===================================================================
--- branches/scool-ng/tests/variable/c++_ast/declaration_008.aterm (revision 125)
+++ branches/scool-ng/tests/variable/c++_ast/declaration_008.aterm (revision 126)
@@ -1 +1 @@
-CxxProgram([CxxDecl(CxxType("int"),CxxId("i"),CxxId("j"))])
+CxxProgram([CxxDecl(CxxConstType(CxxType("int")),CxxId("j"),CxxInt("42")),CxxDecl(CxxType("int"),CxxId("i"),CxxId("j"))])
Index: branches/scool-ng/tests/variable/c++_ast/declaration_001.aterm
===================================================================
--- branches/scool-ng/tests/variable/c++_ast/declaration_001.aterm (revision 125)
+++ branches/scool-ng/tests/variable/c++_ast/declaration_001.aterm (revision 126)
@@ -1 +1 @@
-CxxProgram([CxxDecl(CxxConstType(CxxType("int")),CxxId("i"))])
+CxxProgram([CxxDecl(CxxConstType(CxxType("int")),CxxId("i"),CxxInt("42"))])
Index: branches/scool-ng/tests/variable/c++_src/declaration_007.cc
===================================================================
--- branches/scool-ng/tests/variable/c++_src/declaration_007.cc (revision 125)
+++ branches/scool-ng/tests/variable/c++_src/declaration_007.cc (revision 126)
@@ -1 +1,2 @@
-const int i;
+const int i = 42;
+const int j = 51;
Index: branches/scool-ng/tests/variable/c++_src/declaration_008.cc
===================================================================
--- branches/scool-ng/tests/variable/c++_src/declaration_008.cc (revision 125)
+++ branches/scool-ng/tests/variable/c++_src/declaration_008.cc (revision 126)
@@ -1 +1,2 @@
+const int j = 42;
int i = j;
Index: branches/scool-ng/tests/variable/c++_src/declaration_001.cc
===================================================================
--- branches/scool-ng/tests/variable/c++_src/declaration_001.cc (revision 125)
+++ branches/scool-ng/tests/variable/c++_src/declaration_001.cc (revision 126)
@@ -1 +1 @@
-const int i;
+const int i = 42;
Index: branches/scool-ng/tests/variable/c++_src/declaration_005.cc
===================================================================
--- branches/scool-ng/tests/variable/c++_src/declaration_005.cc (revision 125)
+++ branches/scool-ng/tests/variable/c++_src/declaration_005.cc (revision 126)
@@ -1 +1,5 @@
+#include <list>
+
+using std::list;
+
list< int > l;
Index: branches/scool-ng/tests/variable/scool_ast/declaration_005.aterm
===================================================================
--- branches/scool-ng/tests/variable/scool_ast/declaration_005.aterm (revision 125)
+++ branches/scool-ng/tests/variable/scool_ast/declaration_005.aterm (revision 126)
@@ -1 +1 @@
-Program([SimpleDeclaration(Some("var"),Identifier("l"),StaticFunctionCall(Identifier("list"),Parameters([SimpleType("int")])),None)])
+Program([Cxx("#include <list>\n\nusing
std::list;\n"),SimpleDeclaration(Some("var"),Identifier("l"),StaticFunctionCall(Identifier("list"),Parameters([SimpleType("int")])),None)])
Index: branches/scool-ng/tests/variable/scool_ast/declaration_007.aterm
===================================================================
--- branches/scool-ng/tests/variable/scool_ast/declaration_007.aterm (revision 125)
+++ branches/scool-ng/tests/variable/scool_ast/declaration_007.aterm (revision 126)
@@ -1 +1 @@
-Program([SimpleDeclaration(None,Identifier("i"),SimpleType("int"),None)])
+Program([SimpleDeclaration(None,Identifier("i"),SimpleType("int"),Some(Initialiser(Integer("42")))),SimpleDeclaration(None,Identifier("j"),SimpleType("int"),Some(Initialiser(Integer("51"))))])
Index: branches/scool-ng/tests/variable/scool_ast/declaration_008.aterm
===================================================================
--- branches/scool-ng/tests/variable/scool_ast/declaration_008.aterm (revision 125)
+++ branches/scool-ng/tests/variable/scool_ast/declaration_008.aterm (revision 126)
@@ -1 +1 @@
-Program([SimpleDeclaration(Some("var"),Identifier("i"),SimpleType("int"),Some(Initialiser(Identifier("j"))))])
+Program([SimpleDeclaration(None,Identifier("j"),SimpleType("int"),Some(Initialiser(Integer("42")))),SimpleDeclaration(Some("var"),Identifier("i"),SimpleType("int"),Some(Initialiser(Identifier("j"))))])
Index: branches/scool-ng/tests/variable/scool_ast/declaration_001.aterm
===================================================================
--- branches/scool-ng/tests/variable/scool_ast/declaration_001.aterm (revision 125)
+++ branches/scool-ng/tests/variable/scool_ast/declaration_001.aterm (revision 126)
@@ -1 +1 @@
-Program([SimpleDeclaration(None,Identifier("i"),SimpleType("int"),None)])
+Program([SimpleDeclaration(None,Identifier("i"),SimpleType("int"),Some(Initialiser(Integer("42"))))])
Index: branches/scool-ng/tests/variable/scool_src/declaration_001.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_001.scl (revision 125)
+++ branches/scool-ng/tests/variable/scool_src/declaration_001.scl (revision 126)
@@ -1 +1 @@
-i : int;
+i : int = 42;
Index: branches/scool-ng/tests/variable/scool_src/declaration_005.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_005.scl (revision 125)
+++ branches/scool-ng/tests/variable/scool_src/declaration_005.scl (revision 126)
@@ -1 +1,7 @@
+|[
+#include <list>
+
+using std::list;
+]|
+
var l : list[int];
Index: branches/scool-ng/tests/variable/scool_src/declaration_007.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_007.scl (revision 125)
+++ branches/scool-ng/tests/variable/scool_src/declaration_007.scl (revision 126)
@@ -1 +1,2 @@
-i : int ;
+i : int = 42;
+j : int = 51;
Index: branches/scool-ng/tests/variable/scool_src/declaration_008.scl
===================================================================
--- branches/scool-ng/tests/variable/scool_src/declaration_008.scl (revision 125)
+++ branches/scool-ng/tests/variable/scool_src/declaration_008.scl (revision 126)
@@ -1 +1,2 @@
+j : int = 42;
var i : int = j;
Index: branches/scool-ng/tests/variable/c++_build/declaration_001.g++
===================================================================
Index: branches/scool-ng/tests/variable/c++_build/declaration_005.g++
===================================================================
Index: branches/scool-ng/tests/variable/c++_build/declaration_007.g++
===================================================================
Index: branches/scool-ng/tests/variable/c++_build/declaration_008.g++
===================================================================