commit 515742c063c7e1ceed04ef83907944ae3373174b
parent f67bc9acf77f8ba0c71d4b8d0148394415ba7b3c
Author: Morel BĂ©renger <berengermorel76@gmail.com>
Date: Mon, 4 Sep 2023 19:08:35 +0200
uml: simplify code and support struct
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/uml b/uml
@@ -1,5 +1,9 @@
#!/usr/bin/awk -f
+function is_class( identifier ) {
+ return identifier == "struct" || identifier == "class";
+}
+
function print_ft_name() {
printf( "\"" );
for( i = 2; i < NF; ++i )
@@ -108,7 +112,7 @@ $1 == "link_font" {
printf( "];\n" );
}
-$1 == "class" || $1 == "enum" || $1 == "bitfield" {
+$1 == "enum" || $1 == "bitfield" || is_class( $1 ) {
end_class();
scope = "[ ]";
printf( "\n\n" );
@@ -163,7 +167,7 @@ $1 == "val" {
error = "EE: "
}
}
- if ( class_type == "class" )
+ if ( is_class( class_type ) )
{
printf( "%s%s %s", error, scope, $2 );
}