commit 02314bf67f8f408ec26a44b8db641d43312bbdb8
parent 515742c063c7e1ceed04ef83907944ae3373174b
Author: Morel Bérenger <berengermorel76@gmail.com>
Date: Mon, 4 Sep 2023 19:08:59 +0200
uml: now shows the "type" of classes
Diffstat:
M | uml | | | 19 | +++++++++++++++---- |
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/uml b/uml
@@ -114,16 +114,27 @@ $1 == "link_font" {
$1 == "enum" || $1 == "bitfield" || is_class( $1 ) {
end_class();
+
+ if( NF == 3 )
+ {
+ fields_max = $3
+ fields_cur = 0
+ }
scope = "[ ]";
printf( "\n\n" );
class = $2;
class_type = $1;
- printf( "%s\n[\n\tshape=\"record\";\n\tlabel=\"{%s", class, class );
- if( NF == 3 )
+ special = ""; # for templates, enums, bitfields, structs (why not)...
+ if ( class_type != "class" )
{
- fields_max = $3
- fields_cur = 0
+ special = "«" class_type;
+ if ( fields_max != 0 )
+ {
+ special = special "(" fields_max ")";
+ }
+ special = special "» ";
}
+ printf( "%s\n[\n\tshape=\"record\";\n\tlabel=\"{%s%s", class, special, class );
}
$1 == "fun" {