nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Functional api
[nit.git]
/
tests
/
test_ffi_c_types.nit
diff --git
a/tests/test_ffi_c_types.nit
b/tests/test_ffi_c_types.nit
index
9391d7c
..
7607127
100644
(file)
--- a/
tests/test_ffi_c_types.nit
+++ b/
tests/test_ffi_c_types.nit
@@
-8,7
+8,7
@@
in "C header" `{
};
`}
};
`}
-extern A in "C" `{struct s_a*`}
+extern class A in "C" `{struct s_a*`}
new `{
struct s_a* v = malloc(sizeof(struct s_a));
v->x = 1;
new `{
struct s_a* v = malloc(sizeof(struct s_a));
v->x = 1;
@@
-16,11
+16,11
@@
extern A in "C" `{struct s_a*`}
return v;
`}
fun p `{
return v;
`}
fun p `{
- printf( "A< %d %d >\n", recv->x, recv->y );
+ printf( "A< %d %d >\n", self->x, self->y );
`}
end
`}
end
-extern B in "C" `{struct s_b*`}
+extern class B in "C" `{struct s_b*`}
super A
new `{
struct s_b* v = malloc(sizeof(struct s_b));
super A
new `{
struct s_b* v = malloc(sizeof(struct s_b));
@@
-32,12
+32,12
@@
extern B in "C" `{struct s_b*`}
`}
redef fun p import super `{
printf( "B< " );
`}
redef fun p import super `{
printf( "B< " );
- B_p___super(recv);
- printf( " %d %d >\n", recv->w, recv->h );
+ B_p___super(self);
+ printf( " %d %d >\n", self->w, self->h );
`}
end
`}
end
-extern C
+extern class C
super A
new `{
struct s_a* v = malloc(sizeof(struct s_a));
super A
new `{
struct s_a* v = malloc(sizeof(struct s_a));
@@
-46,7
+46,7
@@
extern C
return v;
`}
redef fun p `{
return v;
`}
redef fun p `{
- printf( "C< %d %d >\n", recv->x, recv->y );
+ printf( "C< %d %d >\n", self->x, self->y );
`}
end
`}
end