summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2024-06-23 15:27:20 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2024-06-23 15:27:20 +0000
commit88095a6fd0357a19ddb407b70e301be826c6bb46 (patch)
tree11aadb39ab56c9cfd41eda5749728fa2613e481a /Build/source/texk/web2c
parentf63c10f9f691979d2bdc86fbd986789da7d2e885 (diff)
Try to match error messages with CWEB.
We could (a) calculate the distance of a mismatch and print "! Hmm... N of the preceeding lines failed to match." (b) issue a warning/error about a missing @z. git-svn-id: svn://tug.org/texlive/trunk@71598 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rwxr-xr-xBuild/source/texk/web2c/tests/fix-changefile-lines.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/Build/source/texk/web2c/tests/fix-changefile-lines.py b/Build/source/texk/web2c/tests/fix-changefile-lines.py
index 6a40e5127f5..1f763fbda99 100755
--- a/Build/source/texk/web2c/tests/fix-changefile-lines.py
+++ b/Build/source/texk/web2c/tests/fix-changefile-lines.py
@@ -127,9 +127,7 @@ class ChangeReader:
while True:
self._pos += 1
if self._pos >= len(self._lines):
- eprint(
- f"ERROR: Missing @y for @x on l.{self._chunk_start + 1} in change file"
- )
+ eprint(f"! Change file ended before @y. (l. {self._pos+1} of change file)")
sys.exit(1)
line = self._lines[self._pos]
if line.startswith("@y"):
@@ -137,6 +135,10 @@ class ChangeReader:
self._chunk_start + 1 : self._pos
]
return True
+ elif line.startswith("@x") or line.startswith("@z"):
+ eprint(f"! Where is the matching @y?. (l. {self._pos+1} of change file)")
+ eprint(line)
+ sys.exit(1)
self._pos += 1
return False
@@ -149,8 +151,8 @@ class ChangeReader:
try:
(part, section, line_number), tex_line = web_reader.next_line()
except:
- eprint("ERROR: Could not find match for line:")
- eprint(f" {self._match_lines[0]}")
+ eprint(f"! Change file entry did not match. (l. {self._chunk_start+2} of change file)")
+ eprint(self._match_lines[0])
sys.exit(1)
if tex_line == self._match_lines[0]:
for i in range(1, len(self._match_lines)):
@@ -159,8 +161,8 @@ class ChangeReader:
except:
tex_line = None
if tex_line is None or tex_line != self._match_lines[i]:
- eprint("ERROR: Could not match all lines following match line:")
- eprint(f" {self._match_lines[0]}")
+ eprint(f"! Change file entry did not match. (l. {self._chunk_start+2+i} of change file)")
+ eprint(self._match_lines[i])
sys.exit(1)
return part, section, line_number