diff options
author | Martin Liska <mliska@suse.cz> | 2020-05-19 12:33:46 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2020-05-19 12:33:46 +0200 |
commit | 4f85a52c9424bb9ac606ec0f6f3da30e020161ad (patch) | |
tree | 9c8b5604b95502ec54111b1a7ec9d083674cc768 /contrib/mklog.py | |
parent | 53cc8cf9f0880128ffe150d7410e9339b6f04f2c (diff) | |
download | gcc-4f85a52c9424bb9ac606ec0f6f3da30e020161ad.tar.gz |
mklog.py: improve parsing of struct names (ignore GTY).
* mklog.py: Skip GTY for struct names. Make flake8 happy.
* test_mklog.py: Add test for GTY.
Diffstat (limited to 'contrib/mklog.py')
-rwxr-xr-x | contrib/mklog.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/mklog.py b/contrib/mklog.py index cc3f937c253..45559afbe6b 100755 --- a/contrib/mklog.py +++ b/contrib/mklog.py @@ -27,18 +27,21 @@ # Author: Martin Liska <mliska@suse.cz> import argparse -import bs4 import os import re -import requests import sys +import bs4 + +import requests + from unidiff import PatchSet pr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<pr>PR [a-z+-]+\/[0-9]+)') identifier_regex = re.compile(r'^([a-zA-Z0-9_#].*)') comment_regex = re.compile(r'^\/\*') -struct_regex = re.compile(r'^((class|struct|union|enum)\s+[a-zA-Z0-9_]+)') +struct_regex = re.compile(r'^(class|struct|union|enum)\s+' + r'(GTY\(.*\)\s+)?([a-zA-Z0-9_]+)') macro_regex = re.compile(r'#\s*(define|undef)\s+([a-zA-Z0-9_]+)') super_macro_regex = re.compile(r'^DEF[A-Z0-9_]+\s*\(([a-zA-Z0-9_]+)') fn_regex = re.compile(r'([a-zA-Z_][^()\s]*)\s*\([^*]') @@ -73,7 +76,7 @@ def extract_function_name(line): m = struct_regex.search(line) if m: # Struct declaration - return m.group(1) + return m.group(1) + ' ' + m.group(3) m = macro_regex.search(line) if m: # Macro definition @@ -117,6 +120,7 @@ def get_pr_titles(prs): output += '\n' return output + def generate_changelog(data, no_functions=False, fill_pr_titles=False): changelogs = {} changelog_list = [] |