diff options
author | Ian Lance Taylor <iant@golang.org> | 2022-02-11 15:02:44 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2022-02-11 15:02:44 -0800 |
commit | 9a510fb0970d3d9a4201bce8965cabe67850386b (patch) | |
tree | 43d7fd2bbfd7ad8c9625a718a5e8718889351994 /contrib/check-params-in-docs.py | |
parent | a6d3012b274f38b20e2a57162106f625746af6c6 (diff) | |
parent | 8dc2499aa62f768c6395c9754b8cabc1ce25c494 (diff) | |
download | gcc-9a510fb0970d3d9a4201bce8965cabe67850386b.zip gcc-9a510fb0970d3d9a4201bce8965cabe67850386b.tar.gz gcc-9a510fb0970d3d9a4201bce8965cabe67850386b.tar.bz2 |
Merge from trunk revision 8dc2499aa62f768c6395c9754b8cabc1ce25c494
Diffstat (limited to 'contrib/check-params-in-docs.py')
-rwxr-xr-x | contrib/check-params-in-docs.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/contrib/check-params-in-docs.py b/contrib/check-params-in-docs.py index 440549f..d570550 100755 --- a/contrib/check-params-in-docs.py +++ b/contrib/check-params-in-docs.py @@ -47,7 +47,7 @@ ignored = {'logical-op-non-short-circuit'} params = {} for line in open(args.params_output).readlines(): - if line.startswith(' '): + if line.startswith(' ' * 2) and not line.startswith(' ' * 8): r = get_param_tuple(line) params[r[0]] = r[1] @@ -57,15 +57,20 @@ texi = dropwhile(lambda x: 'item --param' not in x, texi) texi = takewhile(lambda x: '@node Instrumentation Options' not in x, texi) texi = list(texi)[1:] -token = '@item ' -texi = [x[len(token):] for x in texi if x.startswith(token)] +texi_params = [] +for line in texi: + for token in ('@item ', '@itemx '): + if line.startswith(token): + texi_params.append(line[len(token):]) + break + # skip digits -texi = [x for x in texi if not x[0].isdigit()] +texi_params = [x for x in texi_params if not x[0].isdigit()] # skip aarch64 params -texi = [x for x in texi if not x.startswith('aarch64')] -sorted_texi = sorted(texi) +texi_params = [x for x in texi_params if not x.startswith('aarch64')] +sorted_params = sorted(texi_params) -texi_set = set(texi) - ignored +texi_set = set(texi_params) - ignored params_set = set(params.keys()) - ignored success = True @@ -84,7 +89,4 @@ if len(missing): print() success = False -if texi != sorted_texi: - print('WARNING: not sorted alphabetically!') - sys.exit(0 if success else 1) |