(previousToken, parent, sourceFile)
| 127533 | } |
| 127534 | ts.findTokenOnLeftOfPosition = findTokenOnLeftOfPosition; |
| 127535 | function findNextToken(previousToken, parent, sourceFile) { |
| 127536 | return find(parent); |
| 127537 | function find(n) { |
| 127538 | if (ts.isToken(n) && n.pos === previousToken.end) { |
| 127539 | // this is token that starts at the end of previous token - return it |
| 127540 | return n; |
| 127541 | } |
| 127542 | return ts.firstDefined(n.getChildren(sourceFile), function (child) { |
| 127543 | var shouldDiveInChildNode = |
| 127544 | // previous token is enclosed somewhere in the child |
| 127545 | (child.pos <= previousToken.pos && child.end > previousToken.end) || |
| 127546 | // previous token ends exactly at the beginning of child |
| 127547 | (child.pos === previousToken.end); |
| 127548 | return shouldDiveInChildNode && nodeHasTokens(child, sourceFile) ? find(child) : undefined; |
| 127549 | }); |
| 127550 | } |
| 127551 | } |
| 127552 | ts.findNextToken = findNextToken; |
| 127553 | function findPrecedingToken(position, sourceFile, startNode, excludeJsdoc) { |
| 127554 | var result = find((startNode || sourceFile)); |
no test coverage detected