From 923adaf09cca84c8e9bc7dc1fe87d9ea67628d48 Mon Sep 17 00:00:00 2001 From: "Magomed Kostoev (mkostoevr)" Date: Thu, 8 Jul 2021 16:56:05 +0000 Subject: [PATCH] [asmxygen] Document label function parameters according to @param directives git-svn-id: svn://kolibrios.org@9028 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/asmxygen.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/kernel/trunk/asmxygen.py b/kernel/trunk/asmxygen.py index 60d0bbed57..efe253c006 100644 --- a/kernel/trunk/asmxygen.py +++ b/kernel/trunk/asmxygen.py @@ -1454,6 +1454,24 @@ class AsmFunction(AsmElement): doxycomment += self.comment if '@brief' not in doxycomment: doxycomment = '@brief ' + doxycomment + # If there was no arguments, maybe that's just a label + # then parse parameters from its comment + if len(self.args) == 0 and '@param' in self.comment: + i = 0 + while '@param' in self.comment[i:]: + i = self.comment.index('@param', i) + # Skip '@param' + i += len('@param') + # Skip spaces after '@param' + while self.comment[i].isspace(): + i += 1 + # Get the parameter name + name = '' + while is_id(self.comment[i]): + name += self.comment[i] + i += 1 + # Save the parameter + self.args.append((name, 'arg_t')) # Build the arg list for declaration arg_list = '(' if len(self.args) > 0: