Skip to content

Not finding Macro definitions #3

@nerdyVanilla

Description

@nerdyVanilla

Trying to validate a sugarcube game I decomplied. The findAllCustomMacros function is not finding the macro definitions. Here's the hack I put in to get the macros. Pretty sure this is ignoring the tag attribute, but this removes the false errors for my validation.

        let startIndex = 0;
        let index = userscript.indexOf(macroStartSyntax, startIndex);
        while (index !== -1) {
            if (index === -1) return;
            let innerStartIndex = index + macroStartSyntax.length;
            const possibleEndIndex = userscript.indexOf(',', innerStartIndex);
            const macroCode = userscript.substring(innerStartIndex, possibleEndIndex).replace(/["']/g, "").trim();
            addSimpleMacro(macroCode, false)
            startIndex =  possibleEndIndex;
            index = userscript.indexOf(macroStartSyntax, startIndex);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions