From e1a49821e64c98519738100430b7b84784fca6de Mon Sep 17 00:00:00 2001 From: xwashere Date: Mon, 27 Nov 2023 10:43:06 -0500 Subject: [PATCH] fuck --- backend/templates/parser.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/templates/parser.ts b/backend/templates/parser.ts index 0a94b43..70d7400 100644 --- a/backend/templates/parser.ts +++ b/backend/templates/parser.ts @@ -186,8 +186,8 @@ export function prepareTemplate(src: string): TemplateOp { args: joined, srcRange: { file: file, - from: tokens[Math.min(tokens.length - 1, start)].from, - to: tokens[Math.min(tokens.length, pos) - 1].to + from: tokens[start]?.from ?? 0, + to: tokens[pos - 1]?.to ?? src.length - 1 } }; } @@ -286,8 +286,8 @@ export function prepareTemplate(src: string): TemplateOp { args: args, srcRange: { file: file, - from: tokens[start].from, - to: tokens[pos - 1].to + from: tokens[start]?.from ?? 0, + to: tokens[pos - 1]?.to ?? src.length - 1 } }; }