From 64b8c0592ac8a86e3d6a8d014a34163acd69c920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwena=C3=ABl=20Delaval?= Date: Mon, 18 Jan 2016 14:31:04 +0100 Subject: [PATCH] Pretty-printing class parameters in obc --- compiler/obc/obc_printer.ml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/compiler/obc/obc_printer.ml b/compiler/obc/obc_printer.ml index 67dd414..1bef3ec 100644 --- a/compiler/obc/obc_printer.ml +++ b/compiler/obc/obc_printer.ml @@ -177,8 +177,20 @@ let print_method ff md = print_block md.m_body let print_class_def ff - { cd_name = id; cd_mems = mem; cd_objs = objs; cd_methods = m_list } = - fprintf ff "@[machine "; print_qualname ff id; fprintf ff " =@,"; + { cd_name = id; + cd_mems = mem; + cd_objs = objs; + cd_params = params; + cd_methods = m_list; + } = + fprintf ff "@[machine "; print_qualname ff id; + if params <> [] then + begin + fprintf ff "@["; + print_list_r print_param "<<" "," ">>" ff params; + fprintf ff "@]"; + end; + fprintf ff " =@,"; if mem <> [] then begin fprintf ff "@[var "; print_list_r print_vd "" ";" "" ff mem;