From 845d084658cdc8da5990de9a11f506a9a456a1fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Tue, 19 Apr 2011 13:08:35 +0200 Subject: [PATCH] Preserve the order of type and classes definitions --- compiler/obc/obc_utils.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/obc/obc_utils.ml b/compiler/obc/obc_utils.ml index fa1b3c0..1914d19 100644 --- a/compiler/obc/obc_utils.ml +++ b/compiler/obc/obc_utils.ml @@ -197,15 +197,15 @@ let rec copy_array pass dest src = match dest.l_ty with *) let program_types p = - let add_type acc pd = match pd with + let add_type pd acc = match pd with | Ptype ty -> ty :: acc | _ -> acc in - List.fold_left add_type [] p.p_desc + List.fold_right add_type p.p_desc [] let program_classes p = - let add_class acc pd = match pd with + let add_class pd acc = match pd with | Pclass cd -> cd :: acc | _ -> acc in - List.fold_left add_class [] p.p_desc + List.fold_right add_class p.p_desc []