Skip to content

Commit f23cf3b

Browse files
committed
allow function with result keyword
1 parent 1042ad7 commit f23cf3b

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/lib/functions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const _parse = (line: string, type: MethodType) => {
6565
const subroutineRegEx = /subroutine\s*([a-zA-Z][a-zA-Z0-9_]*)\s*\((\s*[a-zA-z][a-zA-z0-9_,\s]*)*\s*\)/g
6666
const regEx = (type === MethodType.Subroutine)?subroutineRegEx: functionRegEx;
6767
if (line.match(regEx)) {
68-
let [name, argsstr] = functionRegEx.exec(line).slice(1, 3);
68+
let [attr, kind_descriptor, name, argsstr, result] = functionRegEx.exec(line).slice(1, 5);
6969
let args = (argsstr)? parseArgs(argsstr): [];
7070
return {
7171
name: name,

src/lib/helper.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,13 @@ export function isPositionInString(document: vscode.TextDocument, position: vsco
9494
doubleQuotesCnt -= escapedDoubleQuotesCnt;
9595
return doubleQuotesCnt % 2 === 1;
9696
}
97+
98+
99+
let saveKeywordToJson = (keyword) => {
100+
let doc = _loadDocString(keyword);
101+
let docObject = JSON.stringify({"keyword": keyword, "docstr": doc});
102+
fs.appendFile( "src/docs/" + keyword + ".json", docObject, function (err) {
103+
if (err) throw err;
104+
console.log('Saved!');
105+
});
106+
};

test/extension.test.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,9 @@ suite("Extension Tests", () => {
2222
assert.equal(-1, [1, 2, 3].indexOf(0));
2323
});
2424

25-
let saveKeywordToJson = (keyword) => {
26-
let doc = _loadDocString(keyword);
27-
let docObject = JSON.stringify({"keyword": keyword, "docstr": doc});
28-
fs.appendFile( "src/docs/" + keyword + ".json", docObject, function (err) {
29-
if (err) throw err;
30-
console.log('Saved!');
31-
});
32-
};
33-
34-
test.skip("load doc files", () => {
35-
intrinsics.map( keyword => saveKeywordToJson(keyword));
36-
});
25+
26+
27+
3728
});
3829

3930

0 commit comments

Comments
 (0)