src/share/classes/com/sun/tools/javac/jvm/CRTable.java

changeset 1389
2443d24d096a
parent 1326
30c36e23f154
child 2525
2eb010b6cb22
equal deleted inserted replaced
1385:75c936d14c6a 1389:2443d24d096a
501 sr.mergeWith(csp(tree.clazz)); 501 sr.mergeWith(csp(tree.clazz));
502 sr.mergeWith(csp(tree.arguments)); 502 sr.mergeWith(csp(tree.arguments));
503 result = sr; 503 result = sr;
504 } 504 }
505 505
506 @Override
507 public void visitLetExpr(LetExpr tree) {
508 SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
509 sr.mergeWith(csp(tree.defs));
510 sr.mergeWith(csp(tree.expr));
511 result = sr;
512 }
513
506 public void visitTypeParameter(JCTypeParameter tree) { 514 public void visitTypeParameter(JCTypeParameter tree) {
507 SourceRange sr = new SourceRange(startPos(tree), endPos(tree)); 515 SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
508 sr.mergeWith(csp(tree.bounds)); 516 sr.mergeWith(csp(tree.bounds));
509 result = sr; 517 result = sr;
510 } 518 }
523 531
524 /** The start position of given tree. 532 /** The start position of given tree.
525 */ 533 */
526 public int startPos(JCTree tree) { 534 public int startPos(JCTree tree) {
527 if (tree == null) return Position.NOPOS; 535 if (tree == null) return Position.NOPOS;
528 return tree.pos; 536 return TreeInfo.getStartPos(tree);
529 } 537 }
530 538
531 /** The end position of given tree, if it has 539 /** The end position of given tree, if it has
532 * defined endpos, NOPOS otherwise. 540 * defined endpos, NOPOS otherwise.
533 */ 541 */
534 public int endPos(JCTree tree) { 542 public int endPos(JCTree tree) {
535 if (tree == null) return Position.NOPOS; 543 if (tree == null) return Position.NOPOS;
536 if (tree.hasTag(JCTree.Tag.BLOCK)) 544 return TreeInfo.getEndPos(tree, endPosTable);
537 return ((JCBlock) tree).endpos;
538 return endPosTable.getEndPos(tree);
539 } 545 }
540 } 546 }
541 547
542 /** This class contains a CharacterRangeTableEntry. 548 /** This class contains a CharacterRangeTableEntry.
543 */ 549 */

mercurial