()
| 61 | } |
| 62 | |
| 63 | @Override |
| 64 | public String toString() { |
| 65 | int line = 0; |
| 66 | int charPos = -1; |
| 67 | if ( token!=null ) { |
| 68 | line = token.getLine(); |
| 69 | charPos = token.getCharPositionInLine(); |
| 70 | // check the input streams - if different then token is embedded in templateToken and we need to adjust the offset |
| 71 | if ( templateToken!=null && |
| 72 | !templateToken.getInputStream().equals(token.getInputStream()) ) { |
| 73 | int templateDelimiterSize = 1; |
| 74 | if ( templateToken.getType()==GroupParser.BIGSTRING || templateToken.getType()==GroupParser.BIGSTRING_NO_NL ) { |
| 75 | templateDelimiterSize = 2; |
| 76 | } |
| 77 | line += templateToken.getLine()-1; |
| 78 | charPos += templateToken.getCharPositionInLine()+templateDelimiterSize; |
| 79 | } |
| 80 | } |
| 81 | String filepos = line+":"+charPos; |
| 82 | if ( srcName!=null ) { |
| 83 | return srcName+" "+filepos+": "+String.format(error.message, arg, arg2); |
| 84 | } |
| 85 | |
| 86 | return filepos+": "+String.format(error.message, arg, arg2); |
| 87 | } |
| 88 | } |
nothing calls this directly
no test coverage detected