From: Ardis Lu Date: Mon, 12 Feb 2024 05:04:06 +0000 (-0800) Subject: Add basic lookahead for multi-line function definitions X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=21808acf757775bbba9d9a1e56cfba600995154e;p=4-byte-gen Add basic lookahead for multi-line function definitions --- 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 {