
Add some primitive syntax highlighting to our code snippet output. This adds "checkpoints" to the Preprocessor, which we can use to start lexing from. When printing a code snippet, we lex from the nearest checkpoint and highlight the tokens based on their token type.
10 lines
286 B
C
10 lines
286 B
C
|
|
_Static_assert(0, "");
|
|
|
|
/// Test that piping the output into another process disables syntax
|
|
/// highlighting of code snippets.
|
|
|
|
// RUN: not %clang_cc1 %s -o /dev/null 2>&1 | FileCheck %s
|
|
// CHECK: error: static assertion failed:
|
|
// CHECK-NEXT: {{^}} 2 | _Static_assert(0, "");{{$}}
|