TokenSequence (@Nullable Object parentCachingNode) { TokenSequence fromParent = null; if (parentCachingNode instanceof LazyParseableToken && shouldReuseCollapsedTokens(((LazyParseableToken)parentCachingNode).getTokenType())) { fromParent = ((LazyParseableToken)parentCachingNode).getParsedTokenSequence(); assert fromParent == null || fromParent.lexStarts[fromParent.lexemeCount] == myText.length(); ProgressIndicatorProvider.checkCanceled(); } else if (parentCachingNode instanceof LazyParseableElement) { LazyParseableElement parentElement = (LazyParseableElement)parentCachingNode; fromParent = parentElement.getUserData(LAZY_PARSEABLE_TOKENS); parentElement.putUserData(LAZY_PARSEABLE_TOKENS, null); } if (fromParent != null) { if (doLexingOptimizationCorrectionCheck()) { fromParent.assertMatches(myText, myLexer); } return fromParent; } long startTime = System.nanoTime(); try{ return TokenSequence.performLexing(myText, myLexer); } finally { myLexingTimeNs = System.nanoTime() - startTime; } }