From b9eec84872aba13a0fc2af393ccd9a7356409e30 Mon Sep 17 00:00:00 2001 From: andy <1414772332@qq.com> Date: Thu, 23 Jan 2025 15:55:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=8D=E8=83=BD=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E5=A4=9A=E8=A1=8C=E5=87=BD=E6=95=B0=E5=A3=B0=E6=98=8E?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- create_empty_fun.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/create_empty_fun.py b/create_empty_fun.py index 0bec7d9..11679e2 100644 --- a/create_empty_fun.py +++ b/create_empty_fun.py @@ -56,6 +56,7 @@ def find_func_decl(file:str): list_str=f.readlines() text="" ignore=False + go_on=False for i in list_str: line=i.strip() if(len(line)==0): @@ -71,13 +72,23 @@ def find_func_decl(file:str): if(ignore): ignore=False continue - if(line[-1]==';'): - text+=line[:-1] + if(line.find('(')>0): + text=line + if(line.find(');')<0): + go_on=True + continue + if go_on: + text+=line + if(line.find(');')>0): + go_on=False + if not go_on: par_start=text.find('(') - par_end=text.find(')') + par_end=text.find(');') + if(text.count('(')!=1 or text.count(')')!=1): + continue if(par_start>0 and par_end>0 and par_start