Skip to content

Commit 2c8ac45

Browse files
authored
detect subroutine definitions without parentesis (#64)
1 parent ead0a77 commit 2c8ac45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const parseSubroutine = (line: TextLine) => {
7575
};
7676
export const _parse = (line: TextLine, type: MethodType) => {
7777
const functionRegEx = /([a-zA-Z]+(\([\w.=]+\))*)*\s*function\s*([a-zA-Z_][a-z0-9_]*)\s*\((\s*[a-z_][a-z0-9_,\s]*)*\s*\)\s*(result\([a-z_][\w]*\))*/i;
78-
const subroutineRegEx = /subroutine\s*([a-z][a-z0-9_]*)\s*\((\s*[a-z][a-z0-9_,\s]*)*\s*(\)|&)/i;
78+
const subroutineRegEx = /^\s*subroutine\s*([a-z][a-z0-9_]*)\s*(?:\((\s*[a-z][a-z0-9_,\s]*)*\s*\))*/i;
7979
const regEx =
8080
type === MethodType.Subroutine ? subroutineRegEx : functionRegEx;
8181

0 commit comments

Comments
 (0)