diff --git a/src/loader.ts b/src/loader.ts index 88f7ba6..2f1b720 100644 --- a/src/loader.ts +++ b/src/loader.ts @@ -42,16 +42,16 @@ function parseProperty(args: string) { // Parse Method function parseMethod(args: string, self: string, insertSelfArg: boolean) { - const argsStart = args.indexOf(' ('); + const argsStart = args.indexOf('('); if (argsStart === -1) { syntaxError('Cannot Find Arguments'); } - const start = args.substring(0, argsStart).split(' '); + const start = args.substring(0, argsStart).trim().split(' '); if (start.length !== 2) { syntaxError('Invalid Piece Count'); } const {type, name} = parseTypeAndName([start[0]!, start[1]!]); - const end = args.substring(argsStart + 1).split(' = '); + const end = args.substring(argsStart).trim().split(' = '); if (end.length !== 2) { syntaxError('Invalid Piece Count'); } @@ -90,7 +90,7 @@ export function load(target: Struct, name: string, isExtended: boolean) { } data = lines.join('\n'); - // Line-By-Line + // Iterate Over Pieces let cursor = 0; for (let piece of data.split(';')) { // Find Start Of Command For Error Handling