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