diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2024-06-28 02:53:10 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2024-06-28 02:53:10 +0000 |
commit | 7d5010e88ad90c016faacc541088a4bb74cef5b6 (patch) | |
tree | faad3af4791fdb4a230b10d062867996df4cbe56 /Build/source/texk/web2c/tests | |
parent | d9c3647c8c6ea8cf5f05305338aece52920fa21a (diff) |
[C/WEB] Simpler check for 'change section'.
git-svn-id: svn://tug.org/texlive/trunk@71638 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/tests')
-rwxr-xr-x | Build/source/texk/web2c/tests/fix-changefile-lines.py | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/Build/source/texk/web2c/tests/fix-changefile-lines.py b/Build/source/texk/web2c/tests/fix-changefile-lines.py index 888ea6fdb13..2866101488c 100755 --- a/Build/source/texk/web2c/tests/fix-changefile-lines.py +++ b/Build/source/texk/web2c/tests/fix-changefile-lines.py @@ -151,6 +151,12 @@ class ChangeReader: eprint(self._match_lines[0]) sys.exit(1) if tex_line == self._match_lines[0]: + if tex_line.startswith("@*"): + part += 1 + section +=1 + elif tex_line.startswith("@ ") or tex_line == "@": + section += 1 + for i in range(1, len(self._match_lines)): try: _, tex_line = web_reader.next_line() @@ -168,24 +174,6 @@ class ChangeReader: while self.advance_to_next_chunk(): part, section, line_number = self.find_match_in_web(web_reader) - # Attempt to catch the case where something is inserted just before - # the start of a section. - match_start = self._match_lines[0].strip()[:2] - for repl_index in range(self._pos + 1, len(self._lines)): - repl_start = self._lines[repl_index].strip()[:2] - # CWEB @qcomments@> are ignored; see ctwill-w2c.ch - if repl_start != "@q": - break - if match_start == "@ " or match_start == "@": - if repl_start in ["@ ", "@*", "@"]: - section += 1 - elif match_start == "@*": - if repl_start == "@*": - part += 1 - section += 1 - elif repl_start in ["@ ", "@"]: - section += 1 - # Replace '@x' line with updated information. new_line = self._lines[self._chunk_start] |