about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYotam Ofek <yotam.ofek@gmail.com>2025-02-15 22:49:21 +0000
committerYotam Ofek <yotam.ofek@gmail.com>2025-03-01 10:31:46 +0000
commit797ef6455e782ec0ec4b6dd725c8ec70746e3e2d (patch)
tree423aad9da0955645e64c57937a0a8640f0a90039
parent94645f6d102b2e7e720ffa1c759069c378bfd219 (diff)
downloadrust-797ef6455e782ec0ec4b6dd725c8ec70746e3e2d.tar.gz
rust-797ef6455e782ec0ec4b6dd725c8ec70746e3e2d.zip
htmldocck: catch and error on deprecated syntax
-rwxr-xr-xsrc/etc/htmldocck.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/etc/htmldocck.py b/src/etc/htmldocck.py
index d6b594aca71..06fc6518e3b 100755
--- a/src/etc/htmldocck.py
+++ b/src/etc/htmldocck.py
@@ -297,10 +297,24 @@ LINE_PATTERN = re.compile(
     re.X | re.UNICODE,
 )
 
+DEPRECATED_LINE_PATTERN = re.compile(
+    r"""
+    //\s+@
+""",
+    re.X | re.UNICODE,
+)
+
 
 def get_commands(template):
     with io.open(template, encoding="utf-8") as f:
         for lineno, line in concat_multi_lines(f):
+            if DEPRECATED_LINE_PATTERN.search(line):
+                print_err(
+                    lineno,
+                    line,
+                    "Deprecated command syntax, replace `// @` with `//@ `",
+                )
+                continue
             m = LINE_PATTERN.search(line)
             if not m:
                 continue