Merge: Extract sdl, mnit_display and mnit_input from mnit
authorJean Privat <jean@pryen.org>
Mon, 7 Apr 2014 17:37:47 +0000 (13:37 -0400)
committerJean Privat <jean@pryen.org>
Mon, 7 Apr 2014 17:37:47 +0000 (13:37 -0400)
This is the beginning of the division of mnitt into a portable application framework (paninit) and the game framework (gammit). For now, allows to write an SDL application without all of the portable part of mnit.

Also solves problems as noted in #236.

#193 will be fixed after the numerics are merged.

Pull-Request: #384
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

1  2 
src/modelize_class.nit

diff --combined src/modelize_class.nit
@@@ -120,7 -120,7 +120,7 @@@ redef class ModelBuilde
                                        error(nfd, "Error: A formal parameter type `{ptname}' already exists")
                                        return
                                end
 -                              for c in ptname do if c >= 'a' and c<= 'z' then
 +                              for c in ptname.chars do if c >= 'a' and c<= 'z' then
                                        warning(nfd, "Warning: lowercase in the formal parameter type {ptname}")
                                        break
                                end
                var mclass = nclassdef.mclass.as(not null)
                var mclassdef = nclassdef.mclassdef.as(not null)
  
+               # Do we need to specify Object as a super class?
                var specobject = true
+               # Do we need to specify Pointer as a super class? (is only valid
+               # if `nclassdef` is an extern class)
+               var specpointer = true
                var supertypes = new Array[MClassType]
                if nclassdef isa AStdClassdef then
                        for nsc in nclassdef.n_superclasses do
                                end
                                supertypes.add mtype
                                #print "new super : {mclass} < {mtype}"
+                               if mtype.mclass.kind == extern_kind then specpointer = false
                        end
                end
-               if specobject and mclassdef.is_intro then
-                       if mclass.kind == extern_kind then
-                               if mclass.name == "Pointer" then
-                                       supertypes.add objectclass.mclass_type
-                               else
-                                       supertypes.add pointerclass.mclass_type
-                               end
-                       else if mclass.name != "Object" and objectclass != null then
+               if mclassdef.is_intro and objectclass != null then
+                       if mclass.kind == extern_kind and mclass.name != "Pointer" then
+                               # it is an extern class, but not a Pointer
+                               if specpointer then supertypes.add pointerclass.mclass_type
+                       else if specobject and mclass.name != "Object" then
+                               # it is a standard class without super class (but is not Object)
                                supertypes.add objectclass.mclass_type
                        end
                end