redef class AType
private init make
do
- _n_id = new TClassid
+ var n_id = new TClassid
+ var n_qid = new AQclassid
+ n_qid.n_id = n_id
+ _n_qid = n_qid
end
end
# Try to get the name of the class
if nmethdef.parent isa AStdClassdef then
- classname += nmethdef.parent.as(AStdClassdef).n_id.text
+ classname += nmethdef.parent.as(AStdClassdef).n_qid.n_id.text
end
# Try to get the name of the method
var has_rvalue = nmethdef.n_signature.n_type != null
var vtype = ""
if has_rvalue then
- vtype = "redef type E: " + nmethdef.n_signature.n_type.n_id.text
+ vtype = "redef type E: " + nmethdef.n_signature.n_type.n_qid.n_id.text
end
# create a return type
var n_id = new TClassid
n_id.text = classname
+ var n_qid = new AQclassid
+ n_qid.n_id = n_id
var n_type = new AType
- n_type.n_id = n_id
+ n_type.n_qid = n_qid
nmethdef.n_signature.n_type = n_type
var params = new Array[String]
for param in nmethdef.n_signature.n_params do
- var typ = param.n_type.n_id.text
+ var typ = param.n_type.n_qid.n_id.text
if param.n_type.n_kwnullable != null then typ = "nullable {typ}"
params.add """
var {{{param.n_id.text}}}: {{{typ}}}
end
for nclassdef in nclassdefs do
- var name = nclassdef.n_id.text
+ var name = nclassdef.n_qid.n_id.text
if nclassdef.n_formaldefs.is_empty and
nclassdef.n_classkind isa AConcreteClasskind then
redef class AType
private fun type_name: String
do
- var name = n_id.text
+ var name = n_qid.n_id.text
if n_kwnullable != null then name = "nullable {name}"
private fun deserializer_nclassdef: nullable AStdClassdef
do
for nclassdef in n_classdefs do
- if nclassdef isa AStdClassdef and nclassdef.n_id.text == "Deserializer" then
+ if nclassdef isa AStdClassdef and nclassdef.n_qid.n_id.text == "Deserializer" then
return nclassdef
end
end
# FIXME: the name "resolve_mtype" is awful
fun resolve_mtype_unchecked(mmodule: MModule, mclassdef: nullable MClassDef, ntype: AType, with_virtual: Bool): nullable MType
do
- var name = ntype.n_id.text
+ var name = ntype.n_qid.n_id.text
var res: MType
# Check virtual type
var arity = 0
var names = new Array[String]
if nclassdef isa AStdClassdef then
- name = nclassdef.n_id.text
+ name = nclassdef.n_qid.n_id.text
nkind = nclassdef.n_classkind
mkind = nkind.mkind
nvisibility = nclassdef.n_visibility
redef fun build_property(modelbuilder, mclassdef)
do
- var name = self.n_id.text
- var mprop = modelbuilder.try_get_mproperty_by_name(self.n_id, mclassdef, name)
+ var name = self.n_qid.n_id.text
+ var mprop = modelbuilder.try_get_mproperty_by_name(self.n_qid, mclassdef, name)
if mprop == null then
var mvisibility = new_property_visibility(modelbuilder, mclassdef, self.n_visibility)
mprop = new MVirtualTypeProp(mclassdef, name, mvisibility)
for c in name.chars do if c >= 'a' and c<= 'z' then
- modelbuilder.warning(n_id, "bad-type-name", "Warning: lowercase in the virtual type `{name}`.")
+ modelbuilder.warning(n_qid, "bad-type-name", "Warning: lowercase in the virtual type `{name}`.")
break
end
else
v.visit n_classkind
v.adds
- v.visit n_id
+ v.visit n_qid
if not n_formaldefs.is_empty then
v.consume "["
v.adds
end
- v.visit n_id
+ v.visit n_qid
if not n_types.is_empty then
v.consume "["
super
v.visit n_kwtype
v.adds
- v.visit n_id
+ v.visit n_qid
v.consume ":"
v.adds
v.visit n_type