private Node applySourceInfo(Node n, HasSourceInfo srcNode) {
   if (n != null && srcNode != null) {
     SourceInfo info = srcNode.getSourceInfo();
     if (info != null && info.getFileName() != null) {
       n.setStaticSourceFile(getClosureSourceFile(info.getFileName()));
       n.setLineno(info.getStartLine());
       n.setCharno(0);
     }
   }
   return n;
 }
示例#2
0
 public JStringLiteral getStringLiteral(SourceInfo sourceInfo, String s) {
   sourceInfo.addCorrelation(sourceInfo.getCorrelator().by(Literal.STRING));
   return new JStringLiteral(sourceInfo, StringInterner.get().intern(s), typeString);
 }