Project

General

Profile

Feature #1598

Remove return datatype from headers with empty parenthesis

Added by Nandini Bansal about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
09/02/2021
Due date:
% Done:

0%

Estimated time:
2.50 h

Description

The remove_function_signature function removes datatype and parenthesized string only when parenthesized string contains some text or parameters. We leave the headers with empty parenthesis from this processing as sometimes such functions are present between the text such as "comparing finalizers with del() methods".

However, we now need to add a function that will strip the return datatype from the header if it follows the pattern "datatype func_name ()" such as:
1. void pyeval_acquirelock ()
2. const char * pyimport_getmagictag ()

The processed forms will look like this:
1. pyeval_acquirelock ()
2. pyimport_getmagictag ()

Create a new function called "*remove_return_dtype*" in BR3_IR3_tagger.py that will take care of this. It will first check whether the function contains empty parenthesis or not and will process only those header which does. To check if the word/words on the left side of the function are data types, you can use the "*built_in_types*" list.

Note: The header must be processed before the generate_variations function is called.

Also available in: Atom PDF