Property definitions

nitc $ DerivingPhase :: generate_inspect_method
	fun generate_inspect_method(nclassdef: AClassdef)
	do
		var npropdefs = nclassdef.n_propdefs

		var code = new Array[String]
		code.add "redef fun inspect"
		code.add "do"
		code.add "	var res = super"
		code.add "	res = res.substring(0,res.length-1)"

		for attribute in npropdefs do if attribute isa AAttrPropdef then
			var name = attribute.n_id2.text
			code.add """	res += " {{{name}}}: {self.{{{name}}}.inspect}""""
		end

		code.add "	res += \">\""
		code.add "	return res"
		code.add "end"

		# Create method Node and add it to the AST
		npropdefs.push(toolcontext.parse_propdef(code.join("\n")))
	end
src/frontend/deriving.nit:55,2--76,4