void (final RegExpChar ch) { final PsiElement child = ch.getFirstChild(); final IElementType type = child.getNode().getElementType(); if (type == RegExpTT.CHARACTER) { if (ch.getTextLength() > 1) { myHolder.newSilentAnnotation(HighlightInfoType.SYMBOL_TYPE_SEVERITY) .range(ch) .textAttributes(RegExpHighlighter.ESC_CHARACTER) .create(); } } else if (type == StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN) { myHolder.newAnnotation(HighlightSeverity.ERROR, RegExpBundle.message("error.illegal.unsupported.escape.sequence")).create(); return; } else if (type == RegExpTT.BAD_HEX_VALUE) { myHolder.newAnnotation(HighlightSeverity.ERROR, RegExpBundle.message("error.illegal.hexadecimal.escape.sequence")).create(); return; } else if (type == RegExpTT.BAD_OCT_VALUE) { myHolder.newAnnotation(HighlightSeverity.ERROR, RegExpBundle.message("error.illegal.octal.escape.sequence")).create(); return; } else if (type == StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN) { myHolder.newAnnotation(HighlightSeverity.ERROR, RegExpBundle.message("error.illegal.unicode.escape.sequence")).create(); return; } final String text = ch.getUnescapedText(); if (type == RegExpTT.ESC_CTRL_CHARACTER && text.equals("\\b") && !myLanguageHosts.supportsLiteralBackspace(ch)) { myHolder.newAnnotation(HighlightSeverity.ERROR, RegExpBundle.message("error.illegal.unsupported.escape.sequence")).create(); } final RegExpChar.Type charType = ch.getType(); if (charType == RegExpChar.Type.HEX || charType == RegExpChar.Type.UNICODE) { if (ch.getValue() == -1) { myHolder.newAnnotation(HighlightSeverity.ERROR, RegExpBundle.message("error.illegal.unicode.escape.sequence")).create(); return; } if (text.charAt(text.length() - 1) == '}') { if (!myLanguageHosts.supportsExtendedHexCharacter(ch)) { myHolder.newAnnotation(HighlightSeverity.ERROR, RegExpBundle.message("error.this.hex.character.syntax.is.not.supported.in.this.regex.dialect")).create(); } } }