(Corpus corpus, InputDocument doc, TerminalNode node)
| 641 | |
| 642 | |
| 643 | public static int getMatchingSymbolStartsLine(Corpus corpus, |
| 644 | InputDocument doc, |
| 645 | TerminalNode node) |
| 646 | { |
| 647 | TerminalNode matchingLeftNode = getMatchingLeftSymbol(corpus, doc, node); |
| 648 | if ( matchingLeftNode != null ) { |
| 649 | Token matchingLeftToken = matchingLeftNode.getSymbol(); |
| 650 | int i = matchingLeftToken.getTokenIndex(); |
| 651 | if ( i==0 ) return 1; // first token is considered first on line |
| 652 | Token tokenBeforeMatchingToken = doc.tokens.getPreviousRealToken(i); |
| 653 | // System.out.printf("doc=%s node=%s, pair=%s, before=%s\n", |
| 654 | // new File(doc.fileName).getName(), node.getSymbol(), matchingLeftToken, tokenBeforeMatchingToken); |
| 655 | if ( tokenBeforeMatchingToken!=null ) { |
| 656 | return matchingLeftToken.getLine()>tokenBeforeMatchingToken.getLine() ? 1 : 0; |
| 657 | } |
| 658 | else { // matchingLeftToken must be first in file |
| 659 | return 1; |
| 660 | } |
| 661 | } |
| 662 | return NOT_PAIR; |
| 663 | } |
| 664 | |
| 665 | public static int getMatchingSymbolEndsLine(Corpus corpus, |
| 666 | InputDocument doc, |
no test coverage detected