nitg: add more info (for -v)
[nit.git] / src / primitive_info.nit
index 44bf63a..039cc88 100644 (file)
@@ -22,6 +22,9 @@ package primitive_info
 import metamodel
 
 redef class MMLocalClass
+       # extern type of extern classes
+       fun extern_c_type : String is abstract
+
        # Cached primitive_info result
        var _primitive_info_cache: nullable PrimitiveInfo = null
 
@@ -40,6 +43,12 @@ redef class MMLocalClass
                        _primitive_info_b = true
                        return _primitive_info_cache
                end
+               if global.is_extern then
+                       var pi = new PrimitiveInfo( name, false, extern_c_type )
+                       _primitive_info_cache = pi
+                       _primitive_info_b = true
+                       return _primitive_info_cache
+               end
                var i = ctypes.iterator
                while i.is_ok do
                        var n = i.key