Skip to content

Commit f5d13dc

Browse files
committed
Make getModuleDesignation rely on formatListEltToDisplay
Use formatListEltToDisplay in getModuleDesignation to render module designation.
1 parent da6ca79 commit f5d13dc

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

tcl/report.tcl.in

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -741,36 +741,24 @@ proc getModuleDesignation {from {mod {}} {sgr 1}} {
741741
}
742742
743743
# build module designation
744-
# add module name and version to the designation
745-
if {$sgr > 1} {
746-
set desig [sgr hi $moddesig]
747-
} else {
748-
set desig $moddesig
749-
}
750-
# enclose module name between quotes if a space is found
751-
if {[string first { } $moddesig] != -1} {
752-
set desig '$desig'
753-
}
754-
755-
# add variant specification to the designation
756-
if {[llength $vrlist] > 0} {
757-
foreach vr $vrlist {
758-
switch -- $sgr {
759-
2 {set vrdesig [sgr va $vr]}
760-
1 {set vrdesig [sgr {se va} $vr]}
761-
0 {set vrdesig $vr}
762-
}
763-
lappend vrdesiglist $vrdesig
744+
switch -- $sgr {
745+
2 {
746+
set vrsgr va
747+
set himatchmap [list $moddesig [sgr hi $moddesig]]
764748
}
765-
if {$sgr > 0} {
766-
append desig [sgr se "\{"] [join $vrdesiglist [sgr se :]] [sgr se\
767-
"\}"]
768-
} else {
769-
append desig "\{" [join $vrdesiglist :] "\}"
749+
1 {
750+
set vrsgr {se va}
751+
set himatchmap {}
752+
}
753+
0 {
754+
set vrsgr {}
755+
set himatchmap {}
770756
}
771757
}
758+
lassign [formatListEltToDisplay $moddesig {} {} {} {} 0 0 {} 0 $vrlist\
759+
$vrsgr 1 $himatchmap] disp dispsgr displen
772760
773-
return $desig
761+
return $dispsgr
774762
}
775763
776764
#

0 commit comments

Comments
 (0)