From a2732f91acb0b06238c5d620e0f429a8deb08d2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Correnson?= <loic.correnson@cea.fr>
Date: Tue, 20 Aug 2024 11:25:23 +0200
Subject: [PATCH] [modules] extended logic name printing

---
 src/kernel_services/ast_printing/cil_printer.ml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/kernel_services/ast_printing/cil_printer.ml b/src/kernel_services/ast_printing/cil_printer.ml
index 4f20868204..611431bf02 100644
--- a/src/kernel_services/ast_printing/cil_printer.ml
+++ b/src/kernel_services/ast_printing/cil_printer.ml
@@ -2727,9 +2727,8 @@ class cil_printer () = object (self)
   method logic_name fmt a =
     try
       let prefix = Stack.top module_stack in
-      match Extlib.string_del_prefix prefix a with
-      | Some x -> pp_print_string fmt x
-      | None -> self#varname fmt a
+      let shortname = Extlib.string_del_prefix prefix a in
+      self#varname fmt @@ Option.value ~default:a shortname
     with Stack.Empty ->
       self#varname fmt a
 
-- 
GitLab