# Location is set during AST building. Once built, location cannon be null
# However, manual instanciated nodes may need mode care
fun location: Location do return _location.as(not null)
+ # The location of the important part of the node (identifier or whatever)
+ fun hot_location: Location do return location
end
# Ancestor of all tokens
readable var _n_doc: nullable ADoc = null
readable var _n_kwmodule: TKwmodule
readable var _n_id: TId
+ redef fun hot_location do return n_id.location
end
class AImport super Prod end
class AStdImport
readable var _n_formaldefs: List[AFormaldef] = new List[AFormaldef]
readable var _n_superclasses: List[ASuperclass] = new List[ASuperclass]
readable var _n_propdefs: List[APropdef] = new List[APropdef]
+ redef fun hot_location do return n_id.location
end
class ATopClassdef
super AClassdef
readable var _n_readable: nullable AAble = null
readable var _n_writable: nullable AAble = null
readable var _n_expr: nullable AExpr = null
+ redef fun hot_location
+ do
+ if n_id != null then return n_id.location else return n_id2.location
+ end
end
class AMethPropdef
super APropdef
readable var _n_visibility: nullable AVisibility
readable var _n_methid: nullable AMethid = null
readable var _n_signature: nullable ASignature
+ redef fun hot_location
+ do
+ if n_methid != null then
+ return n_methid.location
+ else
+ return location
+ end
+ end
end
class ADeferredMethPropdef
super AMethPropdef
class AConcreteInitPropdef
super AConcreteMethPropdef
readable var _n_kwinit: TKwinit
+ redef fun hot_location do return n_kwinit.location
end
class AMainMethPropdef
super AConcreteMethPropdef