aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 81fa61d9..158e6340 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -169,7 +169,15 @@ function isFunctionDef(token, out) {
function isFunctionType(type, out) {
type = type.replace(/"[^"]+"/g, '".."');
- var parts = type.split(' ');
+ var parts;
+ // hackish, but quick splitting of function def parts. this must be fast as it happens a lot
+ if (type[0] != '[') {
+ parts = type.split(' ');
+ } else {
+ var index = type.search(']');
+ index += type.substr(index).search(' ');
+ parts = [type.substr(0, index), type.substr(index+1)];
+ }
if (pointingLevels(type) !== 1) return false;
var text = removeAllPointing(parts.slice(1).join(' '));
if (!text) return false;