mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-23 20:29:06 -05:00
fix: point source refs at paths held at the pin
trident cites the Panda3DS fork 3dsTrident vendors as a submodule, now its upstream at the submodule pin 69095ee6. pce-emu, uqm and stonesoup wrote paths from a subdirectory (PCE.emu/, sc2/, crawl-ref/), nesoid named two Java files without their directory; lines unchanged, each read at the pin. The pages no longer take a binary citation (DesktopKinect.dll, an address continuing a BAM.dll range) for a source path, and a Forgejo tree is read page by page: mirrors/Ryujinx holds 4704 entries, 1000 a page.
This commit is contained in:
1 parent
aeb68fe753
commit
36427edbb2
10 files changed
+198
-44
No files matched your search
+3
-24
@@ -46,6 +46,8 @@ from sourceref import ( # noqa: F401 (re-exported for callers and tests) # no
|
||||
_PROSE_LIST_DELIMITERS,
|
||||
_REF_RE,
|
||||
_SPLIT_RE,
|
||||
_BINARY_SUFFIXES,
|
||||
_HEX_ADDRESS_RE,
|
||||
PROSE_CITE_RE,
|
||||
PROSE_CONT_RE,
|
||||
PROSE_CONT_SPACED_RE,
|
||||
@@ -58,6 +60,7 @@ from sourceref import ( # noqa: F401 (re-exported for callers and tests) # no
|
||||
_prose_external,
|
||||
_prose_runs,
|
||||
_trim_prose,
|
||||
is_binary_citation,
|
||||
parse_source_ref,
|
||||
ref_prose_text,
|
||||
ref_role,
|
||||
@@ -195,33 +198,9 @@ def is_external_citation(path: str) -> bool:
|
||||
return "/" not in head and "." not in head
|
||||
|
||||
|
||||
_BINARY_SUFFIXES = (
|
||||
".dll", ".exe", ".so", ".dylib", ".apk", ".elf", ".o", ".a", ".jar", ".dex",
|
||||
)
|
||||
_HEX_ADDRESS_RE = re.compile(r"\b0x[0-9a-fA-F]{2,}")
|
||||
_VERSION_WORD_RE = re.compile(r"v?\d+(\.\d+)+[\w.-]*")
|
||||
|
||||
|
||||
def is_binary_citation(path: str) -> bool:
|
||||
"""True when a ref locates code inside a shipped binary, not a source file.
|
||||
|
||||
`BAM.dll 1.5-408 .text:0x100c3960-0x100c3a97`, `libmain.so LoadNES
|
||||
0x3bb49` and `.rdata dialog filter` were read by disassembly. No revision
|
||||
of any repository holds those bytes, so the ref can neither anchor nor
|
||||
break: 77 parts of `future-pinball-fploader` alone were reported GONE.
|
||||
"""
|
||||
if _HEX_ADDRESS_RE.search(path):
|
||||
return True
|
||||
if " " not in path:
|
||||
# A bare `DesktopKinect.dll` names a shipped library, never a source
|
||||
# file: no directory, no line, only its import table to read.
|
||||
return "/" not in path and path.lower().endswith(_BINARY_SUFFIXES)
|
||||
head = path.split(" ", 1)[0]
|
||||
if head.lower().endswith(_BINARY_SUFFIXES):
|
||||
return True
|
||||
return head.startswith(".") and "/" not in head
|
||||
|
||||
|
||||
def strip_repo_word(
|
||||
path: str, known: frozenset[str] | set[str] = frozenset()
|
||||
) -> str:
|
||||
|
||||
Reference in new issue
Block a user