Simplify tokenizer

Fixes #26.
This commit is contained in:
Jonathan Müller 2018-12-04 20:24:12 +01:00
commit 101b7ccc18
4 changed files with 186 additions and 120 deletions

View file

@ -140,6 +140,7 @@ alignas(type) int var;
count = test_visit<cpp_variable>(*file,
[&](const cpp_entity& e) {
auto& attributes = e.attributes();
INFO(e.name());
REQUIRE(attributes.size() == 1u);
auto& attr = attributes.front();
check_attribute(attr, "alignas", type_safe::nullopt, false,
@ -215,6 +216,18 @@ using o [[o]] = int;
template <typename T>
using p [[p]] = T;
// constructor
struct [[q]] q
{
[[q]] q();
};
struct [[r]] r
{
[[r]]
r();
};
)";
auto file = parse({}, "cpp_attribute__matching.cpp", code);
@ -242,5 +255,5 @@ using p [[p]] = T;
return true;
});
REQUIRE(count == 36u);
REQUIRE(count == 40u);
}

View file

@ -93,8 +93,7 @@ namespace ns2
}
}
// requires clang 4.0
TEST_CASE("cpp_include_directive", "[!hide][clang4]")
TEST_CASE("cpp_include_directive")
{
write_file("cpp_include_directive-header.hpp", R"(
#define FOO a\