IDEA-127533 int field is displayed as char - show \n etc as chars

This commit is contained in:
Egor.Ushakov
2017-05-04 14:40:09 +03:00
parent 844177d33e
commit bbc76e7cb4
4 changed files with 46 additions and 9 deletions

View File

@@ -371,7 +371,8 @@ public class ConstExprent extends Exprent {
// BYTECHAR and SHORTCHAR => CHAR in the CHAR context
if (expectedType.equals(VarType.VARTYPE_CHAR) &&
(constType.equals(VarType.VARTYPE_BYTECHAR) || constType.equals(VarType.VARTYPE_SHORTCHAR))) {
if (isPrintableAscii(getIntValue())) {
int intValue = getIntValue();
if (isPrintableAscii(intValue) || CHAR_ESCAPES.containsKey(intValue)) {
setConstType(VarType.VARTYPE_CHAR);
}
}