Skip to content

Commit

Permalink
fix: generate_aztecnr_reference.js not getting generics or multi-line…
Browse files Browse the repository at this point in the history
… params (#5679)
  • Loading branch information
jzaki authored Apr 15, 2024
1 parent 1dfbe7b commit a22bc3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/src/preprocess/generate_aztecnr_reference.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ function parseFunctions(content) {
}

const implBlockContent = content.substring(implMatch.index, currentPos);
const methodRegex = /(?:pub )?fn (\w+)\((.*?)\)(?: -> (.*?))? {/g;
const methodRegex =
/(?:pub\s+)?fn\s+(\w+)(?:<.*?>)?\s*\(([\s\S]*?)\)\s*(?:->\s*(.*?))?\s*{/g;
let methodMatch;

while ((methodMatch = methodRegex.exec(implBlockContent)) !== null) {
Expand All @@ -119,7 +120,7 @@ function parseFunctions(content) {
}
}

const standaloneFunctionRegex = /(?:pub\s+)?fn\s+(\w+)(?:<.*?>)?\s*\((.*?)\)\s*(?:->\s*(.*?))?\s*{/g;
const standaloneFunctionRegex = /(?:pub\s+)?fn\s+(\w+)(?:<.*?>)?\s*\(([\s\S]*?)\)\s*(?:->\s*(.*?))?\s*{/g;
let standaloneFunctionMatch;
while ((standaloneFunctionMatch = standaloneFunctionRegex.exec(content)) !== null) {
const name = standaloneFunctionMatch[1];
Expand Down

0 comments on commit a22bc3d

Please sign in to comment.