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