In the identifiers used in the metamodel and in the error messages.
Signed-off-by: Jean Privat <jean@pryen.org>
end
for cls in program.main_module.global_classes do
end
for cls in program.main_module.global_classes do
- if not cls.is_universal then continue
+ if not cls.is_enum then continue
add_instantiated_class(program.main_module[cls])
end
end
add_instantiated_class(program.main_module[cls])
end
end
# Is the global class an abstract class?
readable writable var _is_abstract: Bool = false
# Is the global class an abstract class?
readable writable var _is_abstract: Bool = false
- # Is the global class a universal class?
- readable writable var _is_universal: Bool = false
+ # Is the global class a enum class?
+ readable writable var _is_enum: Bool = false
# Visibility of the global class
# 1 -> public
# Visibility of the global class
# 1 -> public
# Return the primitive information of the class.
# Return null if the class is not primitive
# Return the primitive information of the class.
# Return null if the class is not primitive
- # FIXME: Only here since there is no universal type yet
fun primitive_info: nullable PrimitiveInfo
do
if _primitive_info_b == true then return _primitive_info_cache
fun primitive_info: nullable PrimitiveInfo
do
if _primitive_info_b == true then return _primitive_info_cache
c.accept_class_visitor(mmbv2)
# Default and inherited constructor if needed
c.accept_class_visitor(mmbv2)
# Default and inherited constructor if needed
- if c isa MMSrcLocalClass and c.global.intro == c and not c.global.is_universal and not c.global.is_interface then
+ if c isa MMSrcLocalClass and c.global.intro == c and not c.global.is_enum and not c.global.is_interface then
c.process_default_constructors(mmbv2)
end
c.process_default_constructors(mmbv2)
end
var super_inits = new ArraySet[MMLocalProperty]
var super_constructors = new ArraySet[MMGlobalProperty]
for sc in che.direct_greaters do
var super_inits = new ArraySet[MMLocalProperty]
var super_constructors = new ArraySet[MMGlobalProperty]
for sc in che.direct_greaters do
- if sc.global.is_universal or sc.global.is_interface then continue
+ if sc.global.is_enum or sc.global.is_interface then continue
for gp in sc.global_properties do
if not gp.is_init then continue
super_constructors.add(gp)
for gp in sc.global_properties do
if not gp.is_init then continue
super_constructors.add(gp)
redef class AClasskind
fun is_interface: Bool do return false
redef class AClasskind
fun is_interface: Bool do return false
- fun is_universal: Bool do return false
+ fun is_enum: Bool do return false
fun is_abstract: Bool do return false
end
fun is_abstract: Bool do return false
end
redef fun is_interface do return true
end
redef class AEnumClasskind
redef fun is_interface do return true
end
redef class AEnumClasskind
- redef fun is_universal do return true
+ redef fun is_enum do return true
end
redef class AAbstractClasskind
redef fun is_abstract do return true
end
redef class AAbstractClasskind
redef fun is_abstract do return true
glob.visibility_level = visibility_level
glob.is_interface = n_classkind.is_interface
glob.is_abstract = n_classkind.is_abstract
glob.visibility_level = visibility_level
glob.is_interface = n_classkind.is_interface
glob.is_abstract = n_classkind.is_abstract
- glob.is_universal = n_classkind.is_universal
+ glob.is_enum = n_classkind.is_enum
if n_kwredef != null then
v.error(self, "Redef error: No class {name} is imported. Remove the redef keyword to define a new class.")
end
if n_kwredef != null then
v.error(self, "Redef error: No class {name} is imported. Remove the redef keyword to define a new class.")
end
for c in _local_class.cshe.direct_greaters do
var cg = c.global
if glob.is_interface then
for c in _local_class.cshe.direct_greaters do
var cg = c.global
if glob.is_interface then
- if cg.is_universal then
- v.error(self, "Special error: Interface {name} try to specialise universal class {c.name}.")
+ if cg.is_enum then
+ v.error(self, "Special error: Interface {name} try to specialise enum class {c.name}.")
else if not cg.is_interface then
v.error(self, "Special error: Interface {name} try to specialise class {c.name}.")
end
else if not cg.is_interface then
v.error(self, "Special error: Interface {name} try to specialise class {c.name}.")
end
- else if glob.is_universal then
- if not cg.is_interface and not cg.is_universal then
- v.error(self, "Special error: Universal class {name} try to specialise class {c.name}.")
+ else if glob.is_enum then
+ if not cg.is_interface and not cg.is_enum then
+ v.error(self, "Special error: Enum class {name} try to specialise class {c.name}.")
- if cg.is_universal then
- v.error(self, "Special error: Class {name} try to specialise universal class {c.name}.")
+ if cg.is_enum then
+ v.error(self, "Special error: Class {name} try to specialise enum class {c.name}.")
if
not glob.is_interface and n_classkind.is_interface or
not glob.is_abstract and n_classkind.is_abstract or
if
not glob.is_interface and n_classkind.is_interface or
not glob.is_abstract and n_classkind.is_abstract or
- not glob.is_universal and n_classkind.is_universal
+ not glob.is_enum and n_classkind.is_enum
then
v.error(self, "Redef error: cannot change kind of class {name}.")
end
then
v.error(self, "Redef error: cannot change kind of class {name}.")
end
if glob.is_attribute then
if gbc.is_interface then
v.error(self, "Error: Attempt to define attribute {prop} in the interface {prop.local_class}.")
if glob.is_attribute then
if gbc.is_interface then
v.error(self, "Error: Attempt to define attribute {prop} in the interface {prop.local_class}.")
- else if gbc.is_universal then
- v.error(self, "Error: Attempt to define attribute {prop} in the universal class {prop.local_class}.")
+ else if gbc.is_enum then
+ v.error(self, "Error: Attempt to define attribute {prop} in the enum class {prop.local_class}.")
end
else if glob.is_init then
if gbc.is_interface then
v.error(self, "Error: Attempt to define a constructor {prop} in the class {prop.local_class}.")
end
else if glob.is_init then
if gbc.is_interface then
v.error(self, "Error: Attempt to define a constructor {prop} in the class {prop.local_class}.")
- else if gbc.is_universal then
- v.error(self, "Error: Attempt to define a constructor {prop} in the universal {prop.local_class}.")
+ else if gbc.is_enum then
+ v.error(self, "Error: Attempt to define a constructor {prop} in the enum {prop.local_class}.")
end
end
if prop.signature == null then
end
end
if prop.signature == null then
var j = 0
while j < v.local_class.cshe.direct_greaters.length do
var c = v.local_class.cshe.direct_greaters[j]
var j = 0
while j < v.local_class.cshe.direct_greaters.length do
var c = v.local_class.cshe.direct_greaters[j]
- if c.global.is_interface or c.global.is_universal or c.global.is_mixin then
+ if c.global.is_interface or c.global.is_enum or c.global.is_mixin then
j += 1
else if cur_c != null and (c.cshe <= cur_c or cur_c.global.is_mixin) then
if c == cur_c then j += 1
j += 1
else if cur_c != null and (c.cshe <= cur_c or cur_c.global.is_mixin) then
if c == cur_c then j += 1
-./error_kern_attr_int.nit:18,2--18: Error: Attempt to define attribute _toto in the universal class Int.
+./error_kern_attr_int.nit:18,2--18: Error: Attempt to define attribute _toto in the enum class Int.