diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-16 17:27:23 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-16 17:27:23 -0700 |
commit | bc218e3c21b9e3372bddcde6320e70463bfc0120 (patch) | |
tree | 6485ec9126ddaa0f2c1c93cc3f8cbcff03d0a5e0 /src/intertyper.js | |
parent | 87cdaae25aa168a0850a278f07616d97b580234d (diff) |
optimize test for merging of *'s to last token
Diffstat (limited to 'src/intertyper.js')
-rw-r--r-- | src/intertyper.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index d6b1f911..d0bb2b15 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -28,8 +28,9 @@ function tokenize(text, lineNum, indent) { var totalEnclosing = 0; function makeToken(text) { if (text.length == 0) return; - // merge certain tokens - if (lastToken && /^\**$/.test(text)) { + // merge *..* into last token + if (lastToken && text[0] === '*') { + //assert(/^\**$/.test(text)); //assert(!(lastToken.text in tokenCache)); lastToken.text += text; return; @@ -55,7 +56,7 @@ function tokenize(text, lineNum, indent) { } token.type = text[0]; } - // merge certain tokens + // merge function definitions together if (lastToken && isType(lastToken.text) && isFunctionDef(token)) { if (lastToken.text in tokenCache) { // create a copy of the cached value |