We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f9f897 commit 10eb43eCopy full SHA for 10eb43e
commands/currentdoc/rtn-regex-name.js
@@ -1,12 +1,8 @@
1
// routine: routine name must be declared in a routine
2
-const regex = /ROUTINE ([^\s]+)/i
3
-const regexType = /ROUTINE\s+[^\s]+\s+\[.*Type=([a-z]{3,})/i
+const regex = /ROUTINE ([^\s]+)(?:\s+\[.*Type=([a-z]{3,})\])?/i
4
5
module.exports = code => {
6
-
7
- const arr = code.match( regex )
8
- const rtn = ( arr || [] )[ 1 ] || ''
9
- const ext = ( code.match( regexType ) || [] )[ 1 ] || 'MAC'
10
- return rtn + '.' + ext
11
12
-}
+ let [ meta, name, ext ] = code.match( regex )
+ ext = ext || 'MAC'
+ return { name, ext }
+}
0 commit comments