From 21808acf757775bbba9d9a1e56cfba600995154e Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sun, 11 Feb 2024 21:04:06 -0800 Subject: [PATCH] Add basic lookahead for multi-line function definitions --- index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.html b/index.html index e584440..186b6f9 100644 --- a/index.html +++ b/index.html @@ -384,6 +384,13 @@ continue; } + // Basic lookahead for function definitions that span multiple lines + if ((fn.match(/\(/g)?.length ?? 0) > (fn.match(/\)/g)?.length ?? 0)) { + const start = code.indexOf(fn); + const end = code.indexOf(')', start); + fn = code.substring(start, end + 1).replaceAll('\n', ''); + } + // Split out the name from the parameters let name, parametersTypes; try { -- 2.47.3