dasm: detect unquoted filenames in detect.ts, but incbin needs quotes

This commit is contained in:
Steven Hugg committed 2026-09-27 13:31:11 +02:00
1 parent 9c2c1c6ed2
commit 31b382cd1a
2 files changed
+6 -3

No files matched your search

+4 -3
View File
@@ -217,11 +217,12 @@ export async function detectProject(input: DetectInput): Promise<Detection[]> {
var text = await input.read(file);
if (text == null) continue;
texts.set(file, text);
// includes, with their line numbers for the evidence
var re = /^[ \t]*[#.]?[ \t]*include\s+[<"]([^>"]+)[>"]/gim;
// includes, with their line numbers for the evidence. Quoted (C, ca65),
// angle-bracketed (C), or bare (DASM, bB) -- name is whichever matched.
var re = /^[ \t]*[#.]?[ \t]*include\s+(?:"([^"]+)"|<([^>]+)>|([^\s;]+))/gim;
var inc: RegExpExecArray | null;
while ((inc = re.exec(text)) != null) {
var name = inc[1];
var name = inc[1] || inc[2] || inc[3];
// a local copy of a library header (neslib.h) still counts
var list = headers[name] || headers[basename(name)];
if (!list) continue;
+2
View File
@@ -41,6 +41,8 @@ directives:
.incbin "tileset.chr"
```
With DASM, make sure to quote the filename in `incbin`.
## C preprocessor defines
The preprocessor macro `__MAIN__` is defined when compiling the main C