add TorqueScript transpiler and runtime

This commit is contained in:
Brian Beck 2025-11-30 11:44:47 -08:00
parent c8391a1056
commit 7d10fb7dee
49 changed files with 12324 additions and 2075 deletions

17
src/imageFileList.ts Normal file
View file

@ -0,0 +1,17 @@
export function parseImageFileList(source: string) {
const lines = source
.split(/(?:\r\n|\r|\n)/g)
.map((line) => line.trim())
.filter(Boolean)
.filter((line) => !line.startsWith(";")); // discard comments
return lines.map((line) => {
const fileWithCount = line.match(/^(.+)\s(\d+)$/);
if (fileWithCount) {
const frameCount = parseInt(fileWithCount[2], 10);
return { name: fileWithCount[1], frameCount };
} else {
return { name: line, frameCount: 1 };
}
});
}