doc-links(md): built and shipped files are file names

A code span naming `OliveTin.exe` was read as member `exe` of the
module stem of OliveTin.exe.manifest. Extensions of built and shipped
files (exe, msi, deb, rpm, dmg, tar, xz, bz2, 7z, apk, ipa, manifest,
csv, tsv) now make a dotted token a file name; none of them is a
common member name.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
Martin Vogel committed 2026-10-09 02:55:23 +02:00
1 parent ef0f4807eb
commit 0d80f9cd55
2 files changed
+18 -18

No files matched your search

+14 -18
View File
@@ -144,24 +144,20 @@ static bool md_in_list(const char *s, size_t n, const char *const *list, bool ci
/* File extensions that make a dotted token a FILE NAME. Strict: none of them
* is a common member name (`.log`, `.get` and `.map` are not here). */
static const char *const MD_FILE_EXT[] = {
"py", "pyi", "js", "jsx", "mjs", "cjs", "ts",
"tsx", "mts", "cts", "go", "rs", "c", "h",
"cc", "cpp", "cxx", "hpp", "hh", "java", "kt",
"kts", "scala", "groovy", "cs", "php", "rb", "sh",
"bash", "zsh", "ps1", "md", "mdx", "rst", "adoc",
"txt", "json", "jsonc", "yaml", "yml", "toml", "ini",
"cfg", "xml", "html", "htm", "css", "scss", "sass",
"less", "vue", "svelte", "proto", "sql", "lock", "gradle",
"csproj", "sln", "fsproj", "props", "targets", "cmake", "mk",
"tf", "tfvars", "hcl", "png", "jpg", "jpeg", "gif",
"svg", "pdf", "ipynb", "dockerfile", "swift", "dart", "lua",
"pl", "pm", "ex", "exs", "erl", "clj", "hs",
"ml", "zig", "sol", "graphql", "gql", "bzl", "nix",
"plist", "env", "conf", "properties", "editorconfig", "gitignore", "npmrc",
"nvmrc", "j2", "jinja", "tmpl", "tpl", "erb", "hbs",
"mustache", "patch", "diff", "whl", "jar", "zip", "gz",
"tgz", "so", "dll", "dylib", "wasm", "service", "socket",
"timer", "mod", "sum", NULL};
"py", "pyi", "js", "jsx", "mjs", "cjs", "ts", "tsx", "mts", "cts", "go", "rs", "c", "h", "cc",
"cpp", "cxx", "hpp", "hh", "java", "kt", "kts", "scala", "groovy", "cs", "php", "rb", "sh",
"bash", "zsh", "ps1", "md", "mdx", "rst", "adoc", "txt", "json", "jsonc", "yaml", "yml", "toml",
"ini", "cfg", "xml", "html", "htm", "css", "scss", "sass", "less", "vue", "svelte", "proto",
"sql", "lock", "gradle", "csproj", "sln", "fsproj", "props", "targets", "cmake", "mk", "tf",
"tfvars", "hcl", "png", "jpg", "jpeg", "gif", "svg", "pdf", "ipynb", "dockerfile", "swift",
"dart", "lua", "pl", "pm", "ex", "exs", "erl", "clj", "hs", "ml", "zig", "sol", "graphql",
"gql", "bzl", "nix", "plist", "env", "conf", "properties", "editorconfig", "gitignore", "npmrc",
"nvmrc", "j2", "jinja", "tmpl", "tpl", "erb", "hbs", "mustache", "patch", "diff", "whl", "jar",
"zip", "gz", "tgz", "so", "dll", "dylib", "wasm", "service", "socket", "timer", "mod", "sum",
/* built and shipped files, never a member's name (`OliveTin.exe` took the
* module stem of OliveTin.exe.manifest in a held-out audit) */
"exe", "msi", "deb", "rpm", "dmg", "tar", "xz", "bz2", "7z", "apk", "ipa", "manifest", "csv",
"tsv", NULL};
/* File names that are files without an extension. */
static const char *const MD_SPECIAL_FILES[] = {
+4
View File
@@ -216,6 +216,10 @@ TEST(doc_links_md_classify_span) {
{"main.go:7-8", CBM_DOCLINK_MD_FILENAME, "main.go", NULL, 7, 8, false, false},
{"README.md", CBM_DOCLINK_MD_FILENAME, "README.md", NULL, 0, 0, false, false},
{"Makefile", CBM_DOCLINK_MD_FILENAME, "Makefile", NULL, 0, 0, false, false},
/* a built or shipped file is a file name, never a member (`OliveTin.exe`
* took the module stem of OliveTin.exe.manifest in a held-out audit) */
{"OliveTin.exe", CBM_DOCLINK_MD_FILENAME, "OliveTin.exe", NULL, 0, 0, false, false},
{"app.manifest", CBM_DOCLINK_MD_FILENAME, "app.manifest", NULL, 0, 0, false, false},
{"main.rs::run", CBM_DOCLINK_MD_FILENAME, "main.rs", "run", 0, 0, false, false},
{"fastapi.routing.APIRouter", CBM_DOCLINK_MD_QUALIFIED, "fastapi.routing.APIRouter", NULL,
0, 0, false, false},