(identifier, word)
| 142741 | } |
| 142742 | ts.breakIntoWordSpans = breakIntoWordSpans; |
| 142743 | function breakIntoSpans(identifier, word) { |
| 142744 | var result = []; |
| 142745 | var wordStart = 0; |
| 142746 | for (var i = 1; i < identifier.length; i++) { |
| 142747 | var lastIsDigit = isDigit(identifier.charCodeAt(i - 1)); |
| 142748 | var currentIsDigit = isDigit(identifier.charCodeAt(i)); |
| 142749 | var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); |
| 142750 | var hasTransitionFromUpperToLower = word && transitionFromUpperToLower(identifier, i, wordStart); |
| 142751 | if (charIsPunctuation(identifier.charCodeAt(i - 1)) || |
| 142752 | charIsPunctuation(identifier.charCodeAt(i)) || |
| 142753 | lastIsDigit !== currentIsDigit || |
| 142754 | hasTransitionFromLowerToUpper || |
| 142755 | hasTransitionFromUpperToLower) { |
| 142756 | if (!isAllPunctuation(identifier, wordStart, i)) { |
| 142757 | result.push(ts.createTextSpan(wordStart, i - wordStart)); |
| 142758 | } |
| 142759 | wordStart = i; |
| 142760 | } |
| 142761 | } |
| 142762 | if (!isAllPunctuation(identifier, wordStart, identifier.length)) { |
| 142763 | result.push(ts.createTextSpan(wordStart, identifier.length - wordStart)); |
| 142764 | } |
| 142765 | return result; |
| 142766 | } |
| 142767 | function charIsPunctuation(ch) { |
| 142768 | switch (ch) { |
| 142769 | case 33 /* CharacterCodes.exclamation */: |
no test coverage detected
searching dependent graphs…