summaryrefslogtreecommitdiff
path: root/gcc/diagnostic-color.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2016-09-02 18:00:57 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2016-09-02 18:00:57 +0000
commitc65236d682789b6a33510aaebfd7e83fe0f30d1a (patch)
tree796b73d02c02186aeafa76ffa1d0047c651425fa /gcc/diagnostic-color.c
parentbad9b2889af54110857416e4f9e65f4032f2f5f4 (diff)
Introduce class edit_context
gcc/ChangeLog: * Makefile.in (OBJS-libcommon): Add edit-context.o. * diagnostic-color.c (color_dict): Add "diff-filename", "diff-hunk", "diff-delete", and "diff-insert". (parse_gcc_colors): Update default value of GCC_COLORS in comment to reflect above changes. * doc/invoke.texi (-fdiagnostics-color): Update description of default GCC_COLORS, and of the supported capabilities. * edit-context.c: New file. * edit-context.h: New file. * input.c (struct fcache): Add field "missing_trailing_newline". (diagnostics_file_cache_forcibly_evict_file): Initialize it to true. (add_file_to_cache_tab): Likewise. (fcache::fcache): Likewise. (get_next_line): Update c->missing_trailing_newline. (location_missing_trailing_newline): New function. * input.h (location_missing_trailing_newline): New decl. * selftest-run-tests.c (selftest::run_tests): Call edit_context_c_tests. * selftest.h (edit_context_c_tests): New decl. libcpp/ChangeLog: * include/line-map.h (rich_location::seen_impossible_fixit_p): New accessor. From-SVN: r239963
Diffstat (limited to 'gcc/diagnostic-color.c')
-rw-r--r--gcc/diagnostic-color.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/diagnostic-color.c b/gcc/diagnostic-color.c
index 42aa1b60226..0bd8170253d 100644
--- a/gcc/diagnostic-color.c
+++ b/gcc/diagnostic-color.c
@@ -170,6 +170,10 @@ static struct color_cap color_dict[] =
{ "quote", SGR_SEQ (COLOR_BOLD), 5, false },
{ "fixit-insert", SGR_SEQ (COLOR_FG_GREEN), 12, false },
{ "fixit-delete", SGR_SEQ (COLOR_FG_RED), 12, false },
+ { "diff-filename", SGR_SEQ (COLOR_BOLD), 13, false },
+ { "diff-hunk", SGR_SEQ (COLOR_FG_CYAN), 9, false },
+ { "diff-delete", SGR_SEQ (COLOR_FG_RED), 11, false },
+ { "diff-insert", SGR_SEQ (COLOR_FG_GREEN), 11, false },
{ NULL, NULL, 0, false }
};
@@ -200,7 +204,8 @@ colorize_stop (bool show_color)
/* Parse GCC_COLORS. The default would look like:
GCC_COLORS='error=01;31:warning=01;35:note=01;36:\
range1=32:range2=34:locus=01:quote=01:\
- fixit-insert=32:fixit-delete=31'
+ fixit-insert=32:fixit-delete=31'\
+ diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32'
No character escaping is needed or supported. */
static bool
parse_gcc_colors (void)