]> git.ardis.lu - 4-byte-gen/commitdiff
Add basic lookahead for multi-line function definitions
authorArdis Lu <ardisglu@gmail.com>
Mon, 12 Feb 2024 05:04:06 +0000 (21:04 -0800)
committerArdis Lu <ardisglu@gmail.com>
Mon, 12 Feb 2024 05:04:06 +0000 (21:04 -0800)
index.html

index e584440dc472e5055073b5aa0e7e836580898172..186b6f94e2e014e334d533ac8b110d5269528b13 100644 (file)
           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 {
This page took 0.032324 seconds and 4 git commands to generate.