@Override
  @NotNull
  public Lexer createLexer(Project project) {
    return new RegExpLexer(CAPABILITIES) {
      @Nullable
      @Override
      public IElementType getTokenType() {
        final IElementType baseType = super.getTokenType();
        if (baseType == StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN ||
            baseType == StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN) {
          return RegExpTT.REDUNDANT_ESCAPE;
        }
        else if (baseType == RegExpTT.BAD_OCT_VALUE) {
          return RegExpTT.OCT_CHAR;
        }
        return baseType;
      }
    };
  }
@Override
  @NotNull
  public Lexer createLexer(Project project)