int main(void)
-{
+{
puts("Hello, World!");
return 0;
-}
+}
diff --git a/autotests/folding/preprocessor-bug363280.cpp.fold b/autotests/folding/preprocessor-bug363280.cpp.fold
index 3430631..f9aabcc 100644
--- a/autotests/folding/preprocessor-bug363280.cpp.fold
+++ b/autotests/folding/preprocessor-bug363280.cpp.fold
@@ -1,8 +1,8 @@
-#if 1
+#if 1
int x; // variable shall not be grey
-#endif
-#if defined (A)
+#endif
+#if defined (A)
int y; // variable shall not be grey
-#elif defined (B)
+#elif defined (B)elif defined (B)
int z; // variable shall not be grey
-#endif
+#endif
diff --git a/autotests/html/folding.cpp.html b/autotests/html/folding.cpp.html
index d20112c..a920612 100644
--- a/autotests/html/folding.cpp.html
+++ b/autotests/html/folding.cpp.html
@@ -1,22 +1,22 @@
folding.cpp
/**
* multi-line comment
*/
/* comment */
{ { } {
//BEGIN
}
//END
}
#if 0
-#elif 1
+#elif 1
#else
#endif
diff --git a/autotests/html/highlight.cpp.html b/autotests/html/highlight.cpp.html
index bc32516..064bc08 100644
--- a/autotests/html/highlight.cpp.html
+++ b/autotests/html/highlight.cpp.html
@@ -1,303 +1,501 @@
highlight.cpp
#pragma once
#include <cassert>
#include <assert.h>
#include "assert.h"
-#include "assert.hpp"
+#include "assert.hpp" // abc
#include "path/assert.hpp"
+#include "assert.h"a
+#include "assert.h" a
+#include <cassert>a
+#include <cassert> a
+#include FOO() error
+#include_next <cassert> a
+#include_next <cassert> /* a
+ */ b
+#include PATH_IN_MACRO
#include PATH_IN_MACRO()
+#include PATH_IN_MACRO(a, b)
-#define SOME_VAR 1
+#define SOME_VAR 1
#ifdef SOME_VAR
#define MULTILINE_MACRO one \
two \
three
# define MULTILINE_MACRO_TEXT \
- /* NOTE The contents of macro is too green :D */ \
- char const s[] = "a\\b" \
- "c\nd"
+ /* NOTE The contents of macro is too green :D */ \
+ char const s[] = "a\\b" \
+ "c\nd"
+
+# define VARIADIC(a, ...) \
+ f(a##a) \
+ f(__VA_ARGS__) \
+ f(#__VA_ARGS__) \
+ f(__VA_ARGS__) \
+ f(0 __VA_OPT__(,) __VA_ARGS__) \
+ x __VA_OPT__(= { __VA_ARGS__ })
+
+# define MACRO() BAD \ ESCAPED
# error dds
# warning dds
# line 2 "file.cpp"
-# define A(x, y) x##y x#y
+# define A(x, y) x##y x#y
// OK(L, a) -> L"a"
-# define OK(x, y) x###y
-# define BAD(x, y) x####y
+# define OK(x, y) x###y
+# define BAD(x, y) x####y
+# define A /* multi line
+with comment */ expr
+# define A /* multi line
+with comment */
+23
+#else // x
+#42 // gcc extension = #line 42
+
+// error
+#wrong
+# wrong
+#endif x
+#if DS()
+#else x
+#else /* */x
+#else /* x
+y */ z
+#endif
static int g_global;
template<class T, typename U, template<class> class = std::is_pointer>
struct class1
: private std::vector<T>, public U
{
class1()
try
: _member1(xxx)
{}
catch(...)
{}
+ class1(class1&&) = default;
+
~class1()
{}
void foo() { return; }
void foo() const { return; }
void foo() noexcept { return; }
void foo() const noexcept { return; }
virtual void foo() const noexcept { return; }
static void foo() { return; }
constexpr static void foo() const
noexcept(noexcept(std::is_pointer<U>::value)) override
{
xxx::template ttt<U>::type {};
xxx.template get<U>();
xxx.std::rdbuf();
auto x = C<'a'> + y;
}
int operator->*(T (C::*m)(int));
operator value_t ();
private:
protected:
public:
value_type _member1; // NOTE internal ?
value_type __internal;
value_type internal__;
value_type _M_internal;
value_t member2_;
value_type m_member3;
static int s_static;
+ static constexpr int s_static;
+ static inline int s_static;
+ static inline constexpr int s_static;
};
constexpr struct : xyz
{
using xyz::xyz;
using xyz::operator=;
int a : 1;
int b : 7;
} x {};
template<class T>
using is_pointer = std::is_pointer<T>::type;
template<class T>
constexpr auto is_pointer_v = std::is_pointer<T>::value;
uint64_t namespaces()
{
std::vector<T>;
boost::vector<T>;
detail::vector<T>;
details::vector<T>;
aux::vector<T>;
internals::vector<T>;
other::vector<T>;
}
#if 1
double foo(const A);
-#else
+#else // else
double foo(const A);
-#endif
+#endif // end
#if 0
double foo(const A);
-#else
+#else // else
double foo(const A);
-#endif
+#endif // end
+
+#if 1
+ double foo(const A);
+#elif 1
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#endif // end
+
+#if 0
+ double foo(const A);
+#elif 1
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#endif // end
+
+#if 0
+ double foo(const A);
+#elif a
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#elif a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 0 // blah blah
+ double foo(const A);
+#elif 1 // blah blah
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 0 || a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 1 || a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 0 && a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 1 && a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if a
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#endif // end
+
+#if a
+ double foo(const A);
+#elif 1
+ double foo(const A);
+#endif // end
+
+#if a
+ double foo(const A);
+#elif a
+ double foo(const A);
+#endif // end
int bar(void*p, void * pp)
{
# if 0
double foo();
-# else
+# else // else
double foo();
-# endif
+# endif // end
}
-static uint64_t intWithSuffix = 42ull;
-static long intWithSuffixAndPrefix = 0b0101L;
+#if abc 0
+ double foo();
+#endif // end
+
+#if xxx
+ double foo();
+#else
+ double foo();
+#endif // end
+
+#if xxx
+ double foo();
+#elif xxx // elseif
+ double foo();
+#elif xxx // elseif
+ double foo();
+#endif // end
+
+// error
+#
+#d
+# d
+#if
+#elif
+#endif
+#ifndef
+#endif
+#ifdef 0
+#endif // end
+
+static uint64_t intWithSuffix = 42ull;
+static long intWithSuffixAndPrefix = 0b0101L;
static int octNum = 07232;
static int invalidOctNum = 09231;
static uint64_t hexNum = 0xDEADBEEF42;
static uint64_t invalidHexNum = 0xGLDFKG;
static char binNum = 0b0101010;
-static int64_t intWithSuffix = -42LL;
-static long intWithSuffixAndPrefix = -0b0101L; // BUG
-static int octNum = -07232;
-static int invalidOctNum = -09231;
-static int64_t hexNum = -0xDEADBEEF42;
-static int64_t invalidHexNum = -0xGLDFKG;
-static char binNum = -0b0101010;
+static int64_t intWithSuffix = -42LL;
+static long intWithSuffixAndPrefix = -0b0101L;
+static int octNum = -07232;
+static int invalidOctNum = -09231;
+static int64_t hexNum = -0xDEADBEEF42;
+static int64_t invalidHexNum = -0xGLDFKG;
+static char binNum = -0b0101010;
-static uint64_t intWithSuffixWithSep = 4'2ull;
-static long intWithSuffixAndPrefixWithSep = 0b0'10'1L;
+static uint64_t intWithSuffixWithSep = 4'2ull;
+static long intWithSuffixAndPrefixWithSep = 0b0'10'1L;
static int octNumWithSep = 07'232;
-static int invalidOctNumWithSep = 09'23'1;
+static int invalidOctNumWithSep = 09'23'1;
static uint64_t hexNumWithSep = 0xD'EAD'BE'EF'42;
-static uint64_t invalidHexNumWithSep = 0xGLD'FKG;
+static uint64_t invalidHexNumWithSep = 0xGLD'FKG;
static char binNumWithSep = 0b0'1010'10;
+static uint64_t invalidSep = 42'ull;
+static uint64_t invalidSep = 42';
+
static double d1 = 42.;
static double d2 = .42;
-static double d2a = -0.49;
-static double d2b = -0.09;
+static double d2a = -0.49;
+static double d2b = -0.09;
static double d3 = 42.3e1;
static double d4 = .2e-12;
static double d5 = 32.e+12;
-static double invalidD1 = 32.e+a12;
-static float floatQualifier = 23.123f;
-// TODO c++17
-static double d6 = 0x1ffp10;
-static double d7 = 0X0p-1;
-static double d8 = 0x1.p0;
-static double d9 = 0xf.p-1;
-static double d10 = 0x0.123p-1;
-static double d11 = 0xa.bp10l;
-static double invalidD2 = 0x0.123p-a;
-static float floatQualifier = 0xf.p-1f;
+static double invalidD1 = 32.e+a12;
+static float floatQualifier = 23.123f;
+// Hexadecimal floating point (c++17)
+static double d6 = 0x1ffp10;
+static double d7 = 0X0p-1;
+static double d8 = 0x1.p0;
+static double d9 = 0xf.p-1L;
+static double d10 = 0x0.123p-1;
+static double d11 = 0xa.bp10l;
+static double invalidD2 = 0x0.123p-a;
+static float floatQualifier = 0xf.p-1f;
+
+60min; // c++17
+23._f
+23._fd
+2.3_f
+2.3_fd
+2._f
+2._fd
+2e4_f
+2e4_fd
+
+// error
+23.fd
+2e_fd
+2e
+1.y
+1.0_E+2.0
+1.0_E +2.0 // ok
+1_p+2
+1_p +2 // ok
+4s.count()
+4s. count()
+4s .count() // ok
static bool yes = true;
static bool no = false;
-
-static const char c1 = 'c';
-static const char c1a = u8'c'; // TODO c++17
-static const char16_t c1b = u'c';
-static const char32_t c1c = U'c';
-static const wchar_t c1d = L'c';
+// *char*
+static const char c1 = 'c';
+static const char c1a = u8'c'; // utf-8 char (c++17)
+static const char16_t c1b = u'c';
+static const char32_t c1c = U'c';
+static const wchar_t c1d = L'c';
static const char c2 = '\n';
static const char c2a = '\120'; // octal
static const char c2b = '\x1f'; // hex
static const char c2c = '\'';
static const char c2d = '\\';
+static const wchar_t c2e = L'\x1ff'; // hex
+static const wchar_t c2e = U'\x1fffffff'; // hex
+// error
+'\x123';
+'\u1234';
+'\U12345678';
+U'\u12345';
+u'\u123';
+U'\U1234567';
+U'\U123456789';
+U'\x123456789';
+
+// string
static const char* c3 = "string";
static const char* c4 = "\"string\n\t\012\x12\"";
static const char* c5 = "multiline \
string";
static const char* c6 = "multifragment" "other""string";
static const char* c6a = u8"string";
static const char16_t* c6b = u"string";
static const char32_t* c6c = U"string";
static const wchar_t* c6d = L"string";
static const char* rawString1 = R"(string)";
static const char* rawString1a = u8R"(string)";
static const char16_t* rawString1b = uR"(string)";
static const char32_t* rawString1c = UR"(string)";
static const wchar_t* rawString1d = LR"(string\nstring)";
static const char* rawString2 = R"ab(string\nstring)ab";
static const char* rawString3 = R"ab(string
string)ab";
+" %d %df fd" U"ds %d" R"(a%d)";
+ "\x123xsk";
+ u"\x123xsk";
+// error
+u8"\x123xsk";
// UDL (c++11)
-operator""_a(const char*); // BUG operator not colorized
-operator ""_a(const char*); // BUG colorized or
-operator "" _a(const char*); // BUG or not colorized
-operator "" a(const char*);
-operator ""a(const char*); // BUG
-operator""a(const char*); // BUG
+operator""_a(const char*);
+operator ""_a(const char*);
+operator "" _a(const char*);
+// invalid suffix
+operator "" a(const char*);
+operator ""a(const char*);
+operator""a(const char*);
-"string"_s; // BUG colorized or
-"string"s; // BUG or not colorized
-"string"_s-b; // -b is not part of the string
+"string"_s; // user
+"string"s; // standard
+"string"_s-b; // -b is not part of the string
// Macro
MY_XXX;
BOOST_XXX;
__STDC_VERSION__;
__TIME__;
__cplusplus;
// Attributes
[[noreturn]] void foo();
[[deprecated]] void foo();
[[deprecated("because")]] void foo();
void foo([[carries_dependency]] int);
-[[opt(1), debug]]
-[[using CC: opt(1), debug]] // c++17
-[[using CC: CC::opt(1)]] // c++17
+[[opt(1), debug]]
+[[using CC: opt(1), debug]] // c++17
+[[using CC: CC::opt(1)]] // c++17
+
+[[gnu::assume_aligned(3'2l,2)]] void* f();
+[[using gnu: assume_aligned(3)]]
+[[clang::assume_aligned(3)]]
void f([[maybe_unused]] int val)
{
[[maybe_unused]] int x;
switch (x = foo(); x) {
case 1:
[[fallthrough]];
case XXX:
case Class::foo():
[[fallthrough]];
default:
;
}
// c++17: fold expression
(args + ... + (1 * 2));
(v.push_back(args), ...);
- [[omp::parallel]] for (auto&& x : v)
+ [[omp::parallel]] for (auto&& x : v)
x;
for (auto&& [first,second] : mymap) {
}
auto [x, y] = foo();
[x = 1, =y](){};
decltype((auto)) x = foo();
}
auto f() -> decltype(foo());
__attribute__((pure)) void f();
label:
goto label;
//BEGIN region
// TODO comment FIXME comment ### comment BUG comment
//END region
-#wrong
-
// \brief blah blah
/// \brief blah blah
/**
* Doxygen
* @param p1 text
* \brief <b>bold text</b>
* \dot
* a -> b
* \enddot
*
* \verbatim
* <dummy>
* \endverbatim
* <html>text</html>
*/
#endif
// Some GNU macros, cross-referenced from gcc.xml to isocpp.xml
__GCC_ATOMIC_CHAR16_T_LOCK_FREE
__GNUC__
__linux__
diff --git a/autotests/input/highlight.cpp b/autotests/input/highlight.cpp
index de8c033..f09c0d6 100644
--- a/autotests/input/highlight.cpp
+++ b/autotests/input/highlight.cpp
@@ -1,296 +1,494 @@
#pragma once
#include
#include
#include "assert.h"
-#include "assert.hpp"
+#include "assert.hpp" // abc
#include "path/assert.hpp"
+#include "assert.h"a
+#include "assert.h" a
+#include a
+#include a
+#include FOO() error
+#include_next a
+#include_next /* a
+ */ b
+#include PATH_IN_MACRO
#include PATH_IN_MACRO()
+#include PATH_IN_MACRO(a, b)
#define SOME_VAR 1
#ifdef SOME_VAR
#define MULTILINE_MACRO one \
two \
three
# define MULTILINE_MACRO_TEXT \
/* NOTE The contents of macro is too green :D */ \
char const s[] = "a\\b" \
"c\nd"
+# define VARIADIC(a, ...) \
+ f(a##a) \
+ f(__VA_ARGS__) \
+ f(#__VA_ARGS__) \
+ f(__VA_ARGS__) \
+ f(0 __VA_OPT__(,) __VA_ARGS__) \
+ x __VA_OPT__(= { __VA_ARGS__ })
+
+# define MACRO() BAD \ ESCAPED
+
# error dds
# warning dds
# line 2 "file.cpp"
# define A(x, y) x##y x#y
// OK(L, a) -> L"a"
# define OK(x, y) x###y
# define BAD(x, y) x####y
+# define A /* multi line
+with comment */ expr
+# define A /* multi line
+with comment */
+23
+#else // x
+#42 // gcc extension = #line 42
+
+// error
+#wrong
+# wrong
+#endif x
+#if DS()
+#else x
+#else /* */x
+#else /* x
+y */ z
+#endif
static int g_global;
template class = std::is_pointer>
struct class1
: private std::vector, public U
{
class1()
try
: _member1(xxx)
{}
catch(...)
{}
+ class1(class1&&) = default;
+
~class1()
{}
void foo() { return; }
void foo() const { return; }
void foo() noexcept { return; }
void foo() const noexcept { return; }
virtual void foo() const noexcept { return; }
static void foo() { return; }
constexpr static void foo() const
noexcept(noexcept(std::is_pointer::value)) override
{
xxx::template ttt::type {};
xxx.template get();
xxx.std::rdbuf();
auto x = C<'a'> + y;
}
int operator->*(T (C::*m)(int));
operator value_t ();
private:
protected:
public:
value_type _member1; // NOTE internal ?
value_type __internal;
value_type internal__;
value_type _M_internal;
value_t member2_;
value_type m_member3;
static int s_static;
+ static constexpr int s_static;
+ static inline int s_static;
+ static inline constexpr int s_static;
};
constexpr struct : xyz
{
using xyz::xyz;
using xyz::operator=;
int a : 1;
int b : 7;
} x {};
template
using is_pointer = std::is_pointer::type;
template
constexpr auto is_pointer_v = std::is_pointer::value;
uint64_t namespaces()
{
std::vector;
boost::vector;
detail::vector;
details::vector;
aux::vector;
internals::vector;
other::vector;
}
#if 1
double foo(const A);
-#else
+#else // else
double foo(const A);
-#endif
+#endif // end
#if 0
double foo(const A);
-#else
+#else // else
double foo(const A);
-#endif
+#endif // end
+
+#if 1
+ double foo(const A);
+#elif 1
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#endif // end
+
+#if 0
+ double foo(const A);
+#elif 1
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#endif // end
+
+#if 0
+ double foo(const A);
+#elif a
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#elif a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 0 // blah blah
+ double foo(const A);
+#elif 1 // blah blah
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 0 || a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 1 || a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 0 && a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 1 && a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if a
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#endif // end
+
+#if a
+ double foo(const A);
+#elif 1
+ double foo(const A);
+#endif // end
+
+#if a
+ double foo(const A);
+#elif a
+ double foo(const A);
+#endif // end
int bar(void*p, void * pp)
{
# if 0
double foo();
-# else
+# else // else
double foo();
-# endif
+# endif // end
}
+#if abc 0
+ double foo();
+#endif // end
+
+#if xxx
+ double foo();
+#else
+ double foo();
+#endif // end
+
+#if xxx
+ double foo();
+#elif xxx // elseif
+ double foo();
+#elif xxx // elseif
+ double foo();
+#endif // end
+
+// error
+#
+#d
+# d
+#if
+#elif
+#endif
+#ifndef
+#endif
+#ifdef 0
+#endif // end
+
static uint64_t intWithSuffix = 42ull;
static long intWithSuffixAndPrefix = 0b0101L;
static int octNum = 07232;
static int invalidOctNum = 09231;
static uint64_t hexNum = 0xDEADBEEF42;
static uint64_t invalidHexNum = 0xGLDFKG;
static char binNum = 0b0101010;
static int64_t intWithSuffix = -42LL;
-static long intWithSuffixAndPrefix = -0b0101L; // BUG
+static long intWithSuffixAndPrefix = -0b0101L;
static int octNum = -07232;
static int invalidOctNum = -09231;
static int64_t hexNum = -0xDEADBEEF42;
static int64_t invalidHexNum = -0xGLDFKG;
static char binNum = -0b0101010;
static uint64_t intWithSuffixWithSep = 4'2ull;
static long intWithSuffixAndPrefixWithSep = 0b0'10'1L;
static int octNumWithSep = 07'232;
static int invalidOctNumWithSep = 09'23'1;
static uint64_t hexNumWithSep = 0xD'EAD'BE'EF'42;
static uint64_t invalidHexNumWithSep = 0xGLD'FKG;
static char binNumWithSep = 0b0'1010'10;
+static uint64_t invalidSep = 42'ull;
+static uint64_t invalidSep = 42';
+
static double d1 = 42.;
static double d2 = .42;
static double d2a = -0.49;
static double d2b = -0.09;
static double d3 = 42.3e1;
static double d4 = .2e-12;
static double d5 = 32.e+12;
static double invalidD1 = 32.e+a12;
static float floatQualifier = 23.123f;
-// TODO c++17
+// Hexadecimal floating point (c++17)
static double d6 = 0x1ffp10;
static double d7 = 0X0p-1;
static double d8 = 0x1.p0;
-static double d9 = 0xf.p-1;
+static double d9 = 0xf.p-1L;
static double d10 = 0x0.123p-1;
static double d11 = 0xa.bp10l;
static double invalidD2 = 0x0.123p-a;
static float floatQualifier = 0xf.p-1f;
+60min; // c++17
+23._f
+23._fd
+2.3_f
+2.3_fd
+2._f
+2._fd
+2e4_f
+2e4_fd
+
+// error
+23.fd
+2e_fd
+2e
+1.y
+1.0_E+2.0
+1.0_E +2.0 // ok
+1_p+2
+1_p +2 // ok
+4s.count()
+4s. count()
+4s .count() // ok
+
static bool yes = true;
static bool no = false;
-
-static const char c1 = 'c';
-static const char c1a = u8'c'; // TODO c++17
-static const char16_t c1b = u'c';
-static const char32_t c1c = U'c';
-static const wchar_t c1d = L'c';
+// *char*
+static const char c1 = 'c';
+static const char c1a = u8'c'; // utf-8 char (c++17)
+static const char16_t c1b = u'c';
+static const char32_t c1c = U'c';
+static const wchar_t c1d = L'c';
static const char c2 = '\n';
static const char c2a = '\120'; // octal
static const char c2b = '\x1f'; // hex
static const char c2c = '\'';
static const char c2d = '\\';
+static const wchar_t c2e = L'\x1ff'; // hex
+static const wchar_t c2e = U'\x1fffffff'; // hex
+// error
+'\x123';
+'\u1234';
+'\U12345678';
+U'\u12345';
+u'\u123';
+U'\U1234567';
+U'\U123456789';
+U'\x123456789';
+
+// string
static const char* c3 = "string";
static const char* c4 = "\"string\n\t\012\x12\"";
static const char* c5 = "multiline \
string";
static const char* c6 = "multifragment" "other""string";
static const char* c6a = u8"string";
static const char16_t* c6b = u"string";
static const char32_t* c6c = U"string";
static const wchar_t* c6d = L"string";
static const char* rawString1 = R"(string)";
static const char* rawString1a = u8R"(string)";
static const char16_t* rawString1b = uR"(string)";
static const char32_t* rawString1c = UR"(string)";
static const wchar_t* rawString1d = LR"(string\nstring)";
static const char* rawString2 = R"ab(string\nstring)ab";
static const char* rawString3 = R"ab(string
string)ab";
+" %d %df fd" U"ds %d" R"(a%d)";
+ "\x123xsk";
+ u"\x123xsk";
+// error
+u8"\x123xsk";
// UDL (c++11)
-operator""_a(const char*); // BUG operator not colorized
-operator ""_a(const char*); // BUG colorized or
-operator "" _a(const char*); // BUG or not colorized
+operator""_a(const char*);
+operator ""_a(const char*);
+operator "" _a(const char*);
+// invalid suffix
operator "" a(const char*);
-operator ""a(const char*); // BUG
-operator""a(const char*); // BUG
+operator ""a(const char*);
+operator""a(const char*);
-"string"_s; // BUG colorized or
-"string"s; // BUG or not colorized
+"string"_s; // user
+"string"s; // standard
"string"_s-b; // -b is not part of the string
// Macro
MY_XXX;
BOOST_XXX;
__STDC_VERSION__;
__TIME__;
__cplusplus;
// Attributes
[[noreturn]] void foo();
[[deprecated]] void foo();
[[deprecated("because")]] void foo();
void foo([[carries_dependency]] int);
[[opt(1), debug]]
[[using CC: opt(1), debug]] // c++17
[[using CC: CC::opt(1)]] // c++17
+[[gnu::assume_aligned(3'2l,2)]] void* f();
+[[using gnu: assume_aligned(3)]]
+[[clang::assume_aligned(3)]]
+
void f([[maybe_unused]] int val)
{
[[maybe_unused]] int x;
switch (x = foo(); x) {
case 1:
[[fallthrough]];
case XXX:
case Class::foo():
[[fallthrough]];
default:
;
}
// c++17: fold expression
(args + ... + (1 * 2));
(v.push_back(args), ...);
[[omp::parallel]] for (auto&& x : v)
x;
for (auto&& [first,second] : mymap) {
}
auto [x, y] = foo();
[x = 1, =y](){};
decltype((auto)) x = foo();
}
auto f() -> decltype(foo());
__attribute__((pure)) void f();
label:
goto label;
//BEGIN region
// TODO comment FIXME comment ### comment BUG comment
//END region
-#wrong
-
// \brief blah blah
/// \brief blah blah
/**
* Doxygen
* @param p1 text
* \brief bold text
* \dot
* a -> b
* \enddot
*
* \verbatim
*
* \endverbatim
* text
*/
#endif
// Some GNU macros, cross-referenced from gcc.xml to isocpp.xml
__GCC_ATOMIC_CHAR16_T_LOCK_FREE
__GNUC__
__linux__
diff --git a/autotests/reference/folding.cpp.ref b/autotests/reference/folding.cpp.ref
index bb11920..1152f0d 100644
--- a/autotests/reference/folding.cpp.ref
+++ b/autotests/reference/folding.cpp.ref
@@ -1,15 +1,15 @@
/**
* multi-line comment
*/
/* comment */
{ { } {
//BEGIN
}
//END
}
#if 0
-#elif 1
+#elif 1
#else
#endif
diff --git a/autotests/reference/highlight.cpp.ref b/autotests/reference/highlight.cpp.ref
index 575a81c..484cde2 100644
--- a/autotests/reference/highlight.cpp.ref
+++ b/autotests/reference/highlight.cpp.ref
@@ -1,296 +1,494 @@
#pragma once
#include
#include
#include "assert.h"
-#include "assert.hpp"
+#include "assert.hpp" // abc
#include "path/assert.hpp"
+#include "assert.h"a
+#include "assert.h" a
+#include a
+#include a
+#include FOO() error
+#include_next a
+#include_next /* a
+ */ b
+#include PATH_IN_MACRO
#include PATH_IN_MACRO()
+#include PATH_IN_MACRO(a, b)
-#define SOME_VAR 1
+#define SOME_VAR 1
#ifdef SOME_VAR
#define MULTILINE_MACRO one \
two \
three
# define MULTILINE_MACRO_TEXT \
- /* NOTE The contents of macro is too green :D */ \
- char const s[] = "a\\b" \
- "c\nd"
+ /* NOTE The contents of macro is too green :D */ \
+ char const s[] = "a\\b" \
+ "c\nd"
+
+# define VARIADIC(a, ...) \
+ f(a##a) \
+ f(__VA_ARGS__) \
+ f(#__VA_ARGS__) \
+ f(__VA_ARGS__) \
+ f(0 __VA_OPT__(,) __VA_ARGS__) \
+ x __VA_OPT__(= { __VA_ARGS__ })
+
+# define MACRO() BAD \ ESCAPED
# error dds
# warning dds
# line 2 "file.cpp"
-# define A(x, y) x##y x#y
+# define A(x, y) x##y x#y
// OK(L, a) -> L"a"
-# define OK(x, y) x###y
-# define BAD(x, y) x####y
+# define OK(x, y) x###y
+# define BAD(x, y) x####y
+# define A /* multi line
+with comment */ expr
+# define A /* multi line
+with comment */
+23
+#else // x
+#42 // gcc extension = #line 42
+
+// error
+#wrong
+# wrong
+#endif x
+#if DS()
+#else x
+#else /* */x
+#else /* x
+y */ z
+#endif
static int g_global;
template<class T, typename U, template<class> class = std::is_pointer>
struct class1
: private std::vector<T>, public U
{
class1()
try
: _member1(xxx)
{}
catch(...)
{}
+ class1(class1&&) = default;
+
~class1()
{}
void foo() { return; }
void foo() const { return; }
void foo() noexcept { return; }
void foo() const noexcept { return; }
virtual void foo() const noexcept { return; }
static void foo() { return; }
constexpr static void foo() const
noexcept(noexcept(std::is_pointer<U>::value)) override
{
xxx::template ttt<U>::type {};
xxx.template get<U>();
xxx.std::rdbuf();
auto x = C<'a'> + y;
}
int operator->*(T (C::*m)(int));
operator value_t ();
private:
protected:
public:
value_type _member1; // NOTE internal ?
value_type __internal;
value_type internal__;
value_type _M_internal;
value_t member2_;
value_type m_member3;
static int s_static;
+ static constexpr int s_static;
+ static inline int s_static;
+ static inline constexpr int s_static;
};
constexpr struct : xyz
{
using xyz::xyz;
using xyz::operator=;
int a : 1;
int b : 7;
} x {};
template<class T>
using is_pointer = std::is_pointer<T>::type;
template<class T>
constexpr auto is_pointer_v = std::is_pointer<T>::value;
uint64_t namespaces()
{
std::vector<T>;
boost::vector<T>;
detail::vector<T>;
details::vector<T>;
aux::vector<T>;
internals::vector<T>;
other::vector<T>;
}
#if 1
double foo(const A);
-#else
+#else // else
double foo(const A);
-#endif
+#endif // end
#if 0
double foo(const A);
-#else
+#else // else
double foo(const A);
-#endif
+#endif // end
+
+#if 1
+ double foo(const A);
+#elif 1
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#endif // end
+
+#if 0
+ double foo(const A);
+#elif 1
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#endif // end
+
+#if 0
+ double foo(const A);
+#elif a
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#elif a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 0 // blah blah
+ double foo(const A);
+#elif 1 // blah blah
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 0 || a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 1 || a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 0 && a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if 1 && a
+ double foo(const A);
+#else // else
+ double foo(const A);
+#endif // end
+
+#if a
+ double foo(const A);
+#elif 0
+ double foo(const A);
+#endif // end
+
+#if a
+ double foo(const A);
+#elif 1
+ double foo(const A);
+#endif // end
+
+#if a
+ double foo(const A);
+#elif a
+ double foo(const A);
+#endif // end
int bar(void*p, void * pp)
{
# if 0
double foo();
-# else
+# else // else
double foo();
-# endif
+# endif // end
}
-static uint64_t intWithSuffix = 42ull;
-static long intWithSuffixAndPrefix = 0b0101L;
+#if abc 0
+ double foo();
+#endif // end
+
+#if xxx
+ double foo();
+#else
+ double foo();
+#endif // end
+
+#if xxx
+ double foo();
+#elif xxx // elseif
+ double foo();
+#elif xxx // elseif
+ double foo();
+#endif // end
+
+// error
+#
+#d
+# d
+#if
+#elif
+#endif
+#ifndef
+#endif
+#ifdef 0
+#endif // end
+
+static uint64_t intWithSuffix = 42ull;
+static long intWithSuffixAndPrefix = 0b0101L;
static int octNum = 07232;
static int invalidOctNum = 09231;
static uint64_t hexNum = 0xDEADBEEF42;
static uint64_t invalidHexNum = 0xGLDFKG;
static char binNum = 0b0101010;
-static int64_t intWithSuffix = -42LL;
-static long intWithSuffixAndPrefix = -0b0101L; // BUG
-static int octNum = -07232;
-static int invalidOctNum = -09231;
-static int64_t hexNum = -0xDEADBEEF42;
-static int64_t invalidHexNum = -0xGLDFKG;
-static char binNum = -0b0101010;
+static int64_t intWithSuffix = -42LL;
+static long intWithSuffixAndPrefix = -0b0101L;
+static int octNum = -07232;
+static int invalidOctNum = -09231;
+static int64_t hexNum = -0xDEADBEEF42;
+static int64_t invalidHexNum = -0xGLDFKG;
+static char binNum = -0b0101010;
-static uint64_t intWithSuffixWithSep = 4'2ull;
-static long intWithSuffixAndPrefixWithSep = 0b0'10'1L;
+static uint64_t intWithSuffixWithSep = 4'2ull;
+static long intWithSuffixAndPrefixWithSep = 0b0'10'1L;
static int octNumWithSep = 07'232;
-static int invalidOctNumWithSep = 09'23'1;
+static int invalidOctNumWithSep = 09'23'1;
static uint64_t hexNumWithSep = 0xD'EAD'BE'EF'42;
-static uint64_t invalidHexNumWithSep = 0xGLD'FKG;
+static uint64_t invalidHexNumWithSep = 0xGLD'FKG;
static char binNumWithSep = 0b0'1010'10;
+static uint64_t invalidSep = 42'ull;
+static uint64_t invalidSep = 42';
+
static double d1 = 42.;
static double d2 = .42;
-static double d2a = -0.49;
-static double d2b = -0.09;
+static double d2a = -0.49;
+static double d2b = -0.09;
static double d3 = 42.3e1;
static double d4 = .2e-12;
static double d5 = 32.e+12;
-static double invalidD1 = 32.e+a12;
-static float floatQualifier = 23.123f;
-// TODO c++17
-static double d6 = 0x1ffp10;
-static double d7 = 0X0p-1;
-static double d8 = 0x1.p0;
-static double d9 = 0xf.p-1;
-static double d10 = 0x0.123p-1;
-static double d11 = 0xa.bp10l;
-static double invalidD2 = 0x0.123p-a;
-static float floatQualifier = 0xf.p-1f;
+static double invalidD1 = 32.e+a12;
+static float floatQualifier = 23.123f;
+// Hexadecimal floating point (c++17)
+static double d6 = 0x1ffp10;
+static double d7 = 0X0p-1;
+static double d8 = 0x1.p0;
+static double d9 = 0xf.p-1L;
+static double d10 = 0x0.123p-1;
+static double d11 = 0xa.bp10l;
+static double invalidD2 = 0x0.123p-a;
+static float floatQualifier = 0xf.p-1f;
+
+60min; // c++17
+23._f
+23._fd
+2.3_f
+2.3_fd
+2._f
+2._fd
+2e4_f
+2e4_fd
+
+// error
+23.fd
+2e_fd
+2e
+1.y
+1.0_E+2.0
+1.0_E +2.0 // ok
+1_p+2
+1_p +2 // ok
+4s.count()
+4s. count()
+4s .count() // ok
static bool yes = true;
static bool no = false;
-
-static const char c1 = 'c';
-static const char c1a = u8'c'; // TODO c++17
-static const char16_t c1b = u'c';
-static const char32_t c1c = U'c';
-static const wchar_t c1d = L'c';
+// *char*
+static const char c1 = 'c';
+static const char c1a = u8'c'; // utf-8 char (c++17)
+static const char16_t c1b = u'c';
+static const char32_t c1c = U'c';
+static const wchar_t c1d = L'c';
static const char c2 = '\n';
static const char c2a = '\120'; // octal
static const char c2b = '\x1f'; // hex
static const char c2c = '\'';
static const char c2d = '\\';
+static const wchar_t c2e = L'\x1ff'; // hex
+static const wchar_t c2e = U'\x1fffffff'; // hex
+// error
+'\x123';
+'\u1234';
+'\U12345678';
+U'\u12345';
+u'\u123';
+U'\U1234567';
+U'\U123456789';
+U'\x123456789';
+
+// string
static const char* c3 = "string";
static const char* c4 = "\"string\n\t\012\x12\"";
static const char* c5 = "multiline \
string";
static const char* c6 = "multifragment" "other""string";
static const char* c6a = u8"string";
static const char16_t* c6b = u"string";
static const char32_t* c6c = U"string";
static const wchar_t* c6d = L"string";
static const char* rawString1 = R"(string)";
static const char* rawString1a = u8R"(string)";
static const char16_t* rawString1b = uR"(string)";
static const char32_t* rawString1c = UR"(string)";
static const wchar_t* rawString1d = LR"(string\nstring)";
static const char* rawString2 = R"ab(string\nstring)ab";
static const char* rawString3 = R"ab(string
string)ab";
+" %d %df fd" U"ds %d" R"(a%d)";
+ "\x123xsk";
+ u"\x123xsk";
+// error
+u8"\x123xsk";
// UDL (c++11)
-operator""_a(const char*); // BUG operator not colorized
-operator ""_a(const char*); // BUG colorized or
-operator "" _a(const char*); // BUG or not colorized
-operator "" a(const char*);
-operator ""a(const char*); // BUG
-operator""a(const char*); // BUG
+operator""_a(const char*);
+operator ""_a(const char*);
+operator "" _a(const char*);
+// invalid suffix
+operator "" a(const char*);
+operator ""a(const char*);
+operator""a(const char*);
-"string"_s; // BUG colorized or
-"string"s; // BUG or not colorized
-"string"_s-b; // -b is not part of the string
+"string"_s; // user
+"string"s; // standard
+"string"_s-b; // -b is not part of the string
// Macro
MY_XXX;
BOOST_XXX;
__STDC_VERSION__;
__TIME__;
__cplusplus;
// Attributes
[[noreturn]] void foo();
[[deprecated]] void foo();
[[deprecated("because")]] void foo();
void foo([[carries_dependency]] int);
-[[opt(1), debug]]
-[[using CC: opt(1), debug]] // c++17
-[[using CC: CC::opt(1)]] // c++17
+[[opt(1), debug]]
+[[using CC: opt(1), debug]] // c++17
+[[using CC: CC::opt(1)]] // c++17
-void f([[maybe_unused]] int val)
+[[gnu::assume_aligned(3'2l,2)]] void* f();
+[[using gnu: assume_aligned(3)]]
+[[clang::assume_aligned(3)]]
+
+void f([[maybe_unused]] int val)
{
- [[maybe_unused]] int x;
+ [[maybe_unused]] int x;
switch (x = foo(); x) {
case 1:
- [[fallthrough]];
+ [[fallthrough]];
case XXX:
case Class::foo():
- [[fallthrough]];
+ [[fallthrough]];
default:
;
}
// c++17: fold expression
(args + ... + (1 * 2));
(v.push_back(args), ...);
- [[omp::parallel]] for (auto&& x : v)
+ [[omp::parallel]] for (auto&& x : v)
x;
for (auto&& [first,second] : mymap) {
}
auto [x, y] = foo();
[x = 1, =y](){};
decltype((auto)) x = foo();
}
auto f() -> decltype(foo());
__attribute__((pure)) void f();
label:
goto label;
//BEGIN region
// TODO comment FIXME comment ### comment BUG comment
//END region
-#wrong
-
// \brief blah blah
/// \brief blah blah
/**
* Doxygen
* @param p1 text
* \brief bold text
* \dot
* a -> b
* \enddot
*
* \verbatim
*
* \endverbatim
* text
*/
#endif
// Some GNU macros, cross-referenced from gcc.xml to isocpp.xml
__GCC_ATOMIC_CHAR16_T_LOCK_FREE
__GNUC__
__linux__
diff --git a/data/syntax/gcc.xml b/data/syntax/gcc.xml
index 986c1b4..258686d 100644
--- a/data/syntax/gcc.xml
+++ b/data/syntax/gcc.xml
@@ -1,581 +1,610 @@
]>
- __float80
- __float128
- _Decimal32
- _Decimal64
- _Decimal128
- __int128
- __fp16
- _Fract
- _Sat
- _Accum
- __asm__
- __const__
- __extension__
- __inline__
- __label__
- __complex__
- __real__
- __restrict__
- __restrict
- __imag__
- __typeof__
- typeof
- __alignof__
- __thread
- __has_nothrow_assign
- __has_nothrow_copy
- __has_nothrow_constructor
- __has_trivial_assign
- __has_trivial_copy
- __has_trivial_constructor
- __has_trivial_destructor
- __has_virtual_destructor
- __is_abstract
- __is_base_of
- __is_class
- __is_empty
- __is_enum
- __is_pod
- __is_polymorphic
- __is_union
- __sync_fetch_and_add
- __sync_fetch_and_sub
- __sync_fetch_and_or
- __sync_fetch_and_and
- __sync_fetch_and_xor
- __sync_fetch_and_nand
- __sync_add_and_fetch
- __sync_sub_and_fetch
- __sync_or_and_fetch
- __sync_and_and_fetch
- __sync_xor_and_fetch
- __sync_nand_and_fetch
- __sync_bool_compare_and_swap
- __sync_val_compare_and_swap
- __sync_synchronize
- __sync_lock_test_and_set
- __sync_lock_release
- __atomic_load_n
- __atomic_load
- __atomic_store_n
- __atomic_store
- __atomic_exchange_n
- __atomic_exchange
- __atomic_compare_exchange_n
- __atomic_compare_exchange
- __atomic_add_fetch
- __atomic_sub_fetch
- __atomic_and_fetch
- __atomic_or_fetch
- __atomic_xor_fetch
- __atomic_nand_fetch
- __atomic_fetch_add
- __atomic_fetch_sub
- __atomic_fetch_and
- __atomic_fetch_or
- __atomic_fetch_xor
- __atomic_fetch_nand
- __atomic_test_and_set
- __atomic_clear
- __atomic_signal_fence
- __atomic_thread_fence
- __atomic_always_lock_free
- __atomic_is_lock_free
- _FORTIFY_SOURCE
- _GNU_SOURCE
- _ILP32
- _LP64
- _REENTRANT
- _STDC_PREDEF_H
- __3dNOW_A__
- __3dNOW__
- __ABM__
- __ADX__
- __AES__
- __ATOMIC_ACQUIRE
- __ATOMIC_ACQ_REL
- __ATOMIC_CONSUME
- __ATOMIC_HLE_ACQUIRE
- __ATOMIC_HLE_RELEASE
- __ATOMIC_RELAXED
- __ATOMIC_RELEASE
- __ATOMIC_SEQ_CST
- __AVX2__
- __AVX__
- __BASE_FILE__
- __BIGGEST_ALIGNMENT__
- __BMI2__
- __BMI__
- __BYTE_ORDER__
- __CHAR16_TYPE__
- __CHAR32_TYPE__
- __CHAR_BIT__
- __CHAR_UNSIGNED__
- __COUNTER__
- __DBL_DECIMAL_DIG__
- __DBL_DENORM_MIN__
- __DBL_DIG__
- __DBL_EPSILON__
- __DBL_HAS_DENORM__
- __DBL_HAS_INFINITY__
- __DBL_HAS_QUIET_NAN__
- __DBL_MANT_DIG__
- __DBL_MAX_10_EXP__
- __DBL_MAX_EXP__
- __DBL_MAX__
- __DBL_MIN_10_EXP__
- __DBL_MIN_EXP__
- __DBL_MIN__
- __DEC128_EPSILON__
- __DEC128_MANT_DIG__
- __DEC128_MAX_EXP__
- __DEC128_MAX__
- __DEC128_MIN_EXP__
- __DEC128_MIN__
- __DEC128_SUBNORMAL_MIN__
- __DEC32_EPSILON__
- __DEC32_MANT_DIG__
- __DEC32_MAX_EXP__
- __DEC32_MAX__
- __DEC32_MIN_EXP__
- __DEC32_MIN__
- __DEC32_SUBNORMAL_MIN__
- __DEC64_EPSILON__
- __DEC64_MANT_DIG__
- __DEC64_MAX_EXP__
- __DEC64_MAX__
- __DEC64_MIN_EXP__
- __DEC64_MIN__
- __DEC64_SUBNORMAL_MIN__
- __DECIMAL_BID_FORMAT__
- __DECIMAL_DIG__
- __DEC_EVAL_METHOD__
- __DEPRECATED
- __ELF__
- __EXCEPTIONS
- __F16C__
- __FAST_MATH__
- __FINITE_MATH_ONLY__
- __FLOAT_WORD_ORDER__
- __FLT_DECIMAL_DIG__
- __FLT_DENORM_MIN__
- __FLT_DIG__
- __FLT_EPSILON__
- __FLT_EVAL_METHOD__
- __FLT_HAS_DENORM__
- __FLT_HAS_INFINITY__
- __FLT_HAS_QUIET_NAN__
- __FLT_MANT_DIG__
- __FLT_MAX_10_EXP__
- __FLT_MAX_EXP__
- __FLT_MAX__
- __FLT_MIN_10_EXP__
- __FLT_MIN_EXP__
- __FLT_MIN__
- __FLT_RADIX__
- __FMA4__
- __FMA__
- __FP_FAST_FMA
- __FP_FAST_FMAF
- __FSGSBASE__
- __FUNCTION__
- __FXSR__
- __GCC_ATOMIC_BOOL_LOCK_FREE
- __GCC_ATOMIC_CHAR16_T_LOCK_FREE
- __GCC_ATOMIC_CHAR32_T_LOCK_FREE
- __GCC_ATOMIC_CHAR_LOCK_FREE
- __GCC_ATOMIC_INT_LOCK_FREE
- __GCC_ATOMIC_LLONG_LOCK_FREE
- __GCC_ATOMIC_LONG_LOCK_FREE
- __GCC_ATOMIC_POINTER_LOCK_FREE
- __GCC_ATOMIC_SHORT_LOCK_FREE
- __GCC_ATOMIC_TEST_AND_SET_TRUEVAL
- __GCC_ATOMIC_WCHAR_T_LOCK_FREE
- __GCC_HAVE_DWARF2_CFI_ASM
- __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
- __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
- __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
- __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
- __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
- __GFORTRAN__
- __GNUC_GNU_INLINE__
- __GNUC_MINOR__
- __GNUC_PATCHLEVEL__
- __GNUC_STDC_INLINE__
- __GNUC__
- __GNUG__
- __GXX_ABI_VERSION
- __GXX_EXPERIMENTAL_CXX0X__
- __GXX_RTTI
- __GXX_WEAK__
- __ILP32__
- __INCLUDE_LEVEL__
- __INT16_C
- __INT16_MAX__
- __INT16_TYPE__
- __INT32_C
- __INT32_MAX__
- __INT32_TYPE__
- __INT64_C
- __INT64_MAX__
- __INT64_TYPE__
- __INT8_C
- __INT8_MAX__
- __INT8_TYPE__
- __INTMAX_C
- __INTMAX_MAX__
- __INTMAX_TYPE__
- __INTPTR_MAX__
- __INTPTR_TYPE__
- __INT_FAST16_MAX__
- __INT_FAST16_TYPE__
- __INT_FAST32_MAX__
- __INT_FAST32_TYPE__
- __INT_FAST64_MAX__
- __INT_FAST64_TYPE__
- __INT_FAST8_MAX__
- __INT_FAST8_TYPE__
- __INT_LEAST16_MAX__
- __INT_LEAST16_TYPE__
- __INT_LEAST32_MAX__
- __INT_LEAST32_TYPE__
- __INT_LEAST64_MAX__
- __INT_LEAST64_TYPE__
- __INT_LEAST8_MAX__
- __INT_LEAST8_TYPE__
- __INT_MAX__
- __LDBL_DENORM_MIN__
- __LDBL_DIG__
- __LDBL_EPSILON__
- __LDBL_HAS_DENORM__
- __LDBL_HAS_INFINITY__
- __LDBL_HAS_QUIET_NAN__
- __LDBL_MANT_DIG__
- __LDBL_MAX_10_EXP__
- __LDBL_MAX_EXP__
- __LDBL_MAX__
- __LDBL_MIN_10_EXP__
- __LDBL_MIN_EXP__
- __LDBL_MIN__
- __LONG_LONG_MAX__
- __LONG_MAX__
- __LP64__
- __LWP__
- __LZCNT__
- __MMX__
- __NEXT_RUNTIME__
- __NO_INLINE__
- __OPTIMIZE_SIZE__
- __OPTIMIZE__
- __ORDER_BIG_ENDIAN__
- __ORDER_LITTLE_ENDIAN__
- __ORDER_PDP_ENDIAN__
- __PCLMUL__
- __PIC__
- __PIE__
- __POPCNT__
- __PRAGMA_REDEFINE_EXTNAME
- __PRETTY_FUNCTION__
- __PRFCHW__
- __PTRDIFF_MAX__
- __PTRDIFF_TYPE__
- __RDRND__
- __RDSEED__
- __REGISTER_PREFIX__
- __RTM__
- __SANITIZE_ADDRESS__
- __SCHAR_MAX__
- __SHRT_MAX__
- __SIG_ATOMIC_MAX__
- __SIG_ATOMIC_MIN__
- __SIG_ATOMIC_TYPE__
- __SIZEOF_DOUBLE__
- __SIZEOF_FLOAT__
- __SIZEOF_INT128__
- __SIZEOF_INT__
- __SIZEOF_LONG_DOUBLE__
- __SIZEOF_LONG_LONG__
- __SIZEOF_LONG__
- __SIZEOF_POINTER__
- __SIZEOF_PTRDIFF_T__
- __SIZEOF_SHORT__
- __SIZEOF_SIZE_T__
- __SIZEOF_WCHAR_T__
- __SIZEOF_WINT_T__
- __SIZE_MAX__
- __SIZE_TYPE__
- __SSE2_MATH__
- __SSE2__
- __SSE3__
- __SSE4A__
- __SSE4_1__
- __SSE4_2__
- __SSE_MATH__
- __SSE__
- __SSP_ALL__
- __SSP__
- __SSSE3__
- __STDC_HOSTED__
- __STDC_IEC_559_COMPLEX__
- __STDC_IEC_559__
- __STDC_ISO_10646__
- __STDC_NO_THREADS__
- __STDC_UTF_16__
- __STDC_UTF_32__
- __STDC_VERSION__
- __STDC__
- __STRICT_ANSI__
- __TBM__
- __TIMESTAMP__
- __UINT16_C
- __UINT16_MAX__
- __UINT16_TYPE__
- __UINT32_C
- __UINT32_MAX__
- __UINT32_TYPE__
- __UINT64_C
- __UINT64_MAX__
- __UINT64_TYPE__
- __UINT8_C
- __UINT8_MAX__
- __UINT8_TYPE__
- __UINTMAX_C
- __UINTMAX_MAX__
- __UINTMAX_TYPE__
- __UINTPTR_MAX__
- __UINTPTR_TYPE__
- __UINT_FAST16_MAX__
- __UINT_FAST16_TYPE__
- __UINT_FAST32_MAX__
- __UINT_FAST32_TYPE__
- __UINT_FAST64_MAX__
- __UINT_FAST64_TYPE__
- __UINT_FAST8_MAX__
- __UINT_FAST8_TYPE__
- __UINT_LEAST16_MAX__
- __UINT_LEAST16_TYPE__
- __UINT_LEAST32_MAX__
- __UINT_LEAST32_TYPE__
- __UINT_LEAST64_MAX__
- __UINT_LEAST64_TYPE__
- __UINT_LEAST8_MAX__
- __UINT_LEAST8_TYPE__
- __USER_LABEL_PREFIX__
- __USING_SJLJ_EXCEPTIONS__
- - __VA_ARGS__
- __VERSION__
- __WCHAR_MAX__
- __WCHAR_MIN__
- __WCHAR_TYPE__
- __WCHAR_UNSIGNED__
- __WINT_MAX__
- __WINT_MIN__
- __WINT_TYPE__
- __XOP__
- __XSAVEOPT__
- __XSAVE__
- __amd64
- __amd64__
- __amdfam10
- __amdfam10__
- __athlon
- __athlon__
- __athlon_sse__
- __atom
- __atom__
- __bdver1
- __bdver1__
- __bdver2
- __bdver2__
- __bdver3
- __bdver3__
- __btver1
- __btver1__
- __btver2
- __btver2__
- __code_model_32__
- __code_model_small__
- __core2
- __core2__
- __core_avx2
- __core_avx2__
- __corei7
- __corei7__
- __cplusplus
- __geode
- __geode__
- __gnu_linux__
- __i386
- __i386__
- __i486
- __i486__
- __i586
- __i586__
- __i686
- __i686__
- __k6
- __k6_2__
- __k6_3__
- __k6__
- __k8
- __k8__
- __linux
- __linux__
- __nocona
- __nocona__
- __pentium
- __pentium4
- __pentium4__
- __pentium__
- __pentium_mmx__
- __pentiumpro
- __pentiumpro__
- __pic__
- __pie__
- __tune_amdfam10__
- __tune_athlon__
- __tune_athlon_sse__
- __tune_atom__
- __tune_bdver1__
- __tune_bdver2__
- __tune_bdver3__
- __tune_btver1__
- __tune_btver2__
- __tune_core2__
- __tune_core_avx2__
- __tune_corei7__
- __tune_geode__
- __tune_i386__
- __tune_i486__
- __tune_i586__
- __tune_i686__
- __tune_k6_2__
- __tune_k6_3__
- __tune_k6__
- __tune_k8__
- __tune_nocona__
- __tune_pentium2__
- __tune_pentium3__
- __tune_pentium4__
- __tune_pentium__
- __tune_pentium_mmx__
- __tune_pentiumpro__
- __unix
- __unix__
- __x86_64
- __x86_64__
- i386
- linux
- unix
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
+
+
+
+
+
diff --git a/data/syntax/isocpp.xml b/data/syntax/isocpp.xml
index e0d2766..60894ed 100644
--- a/data/syntax/isocpp.xml
+++ b/data/syntax/isocpp.xml
@@ -1,515 +1,822 @@
-
-
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
]>
- break
- case
- catch
- continue
- default
- do
- else
- for
- goto
- if
- return
- switch
- throw
- try
- while
- alignof
- alignas
- asm
- auto
- class
+ - concept
+ - requires
- constexpr
- const_cast
- decltype
- delete
- dynamic_cast
- enum
- explicit
- export
- false
- final
- friend
- inline
- namespace
- new
- noexcept
- nullptr
- operator
- override
- private
- protected
- public
- reinterpret_cast
- sizeof
- static_assert
- static_cast
- struct
- template
- this
- true
- typedef
- typeid
- typename
- union
- using
- virtual
- and
- and_eq
- bitand
- bitor
- compl
- not
- not_eq
- or
- or_eq
- xor
- xor_eq
+
+
+
+
+
+
- template
+
- noreturn
- carries_dependency
-
+
- deprecated
+
+ - fallthrough
+ - nodiscard
+ - maybe_unused
+
+ - likely
+ - unlikely
+ - no_unique_address
+
+
+
+
+
+ - using
- bool
- char
- char16_t
- char32_t
- double
- float
- int
- long
- short
- signed
- unsigned
- void
- int8_t
- int16_t
- int32_t
- int64_t
- uint8_t
- uint16_t
- uint32_t
- uint64_t
- int_least8_t
- int_least16_t
- int_least32_t
- int_least64_t
- uint_least8_t
- uint_least16_t
- uint_least32_t
- uint_least64_t
- int_fast8_t
- int_fast16_t
- int_fast32_t
- int_fast64_t
- uint_fast8_t
- uint_fast16_t
- uint_fast32_t
- uint_fast64_t
- size_t
- ssize_t
- wchar_t
- intptr_t
- uintptr_t
- intmax_t
- uintmax_t
- ptrdiff_t
- sig_atomic_t
- wint_t
- va_list
- FILE
- fpos_t
- time_t
- const
- extern
- mutable
- register
- static
- thread_local
- volatile
+
+ - __DATE__
- __FILE__
- __LINE__
- - __DATE__
- - __TIME__
- - __STDC__
- - __STDC_VERSION__
+ - __STDCPP_DEFAULT_NEW_ALIGNMENT__
+ - __STDCPP_STRICT_POINTER_SAFETY__
+ - __STDCPP_THREADS__
- __STDC_HOSTED__
- __STDC_ISO_10646__
- __STDC_MB_MIGHT_NEQ_WC__
+ - __STDC_VERSION__
+ - __STDC__
+ - __TIME__
- __cplusplus
- __func__
+ - assert
+ - _Pragma
+ - __has_include
+
+
+ - __VA_ARGS__
+ - __VA_OPT__
+
+
+ - if
+
+
+ - ifdef
+ - ifndef
+
+
+ - elif
+
+
+ - else
+
+
+ - endif
+
+
+ - cmakedefine01
+ - cmakedefine
+ - define
+
+
+ - include
+
+
+ - error
+ - line
+ - pragma
+ - undef
+ - warning
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
-
+
+
+
+
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
+
+
-
+
+
-
+
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
-
+
+
+
+
-
+