Skip attributes in enum
This commit is contained in:
parent
e0b76a07d0
commit
76f4136c86
1 changed files with 8 additions and 5 deletions
|
|
@ -20,9 +20,10 @@ namespace
|
||||||
detail::tokenizer tokenizer(context.tu, context.file, cur);
|
detail::tokenizer tokenizer(context.tu, context.file, cur);
|
||||||
detail::token_stream stream(tokenizer, cur);
|
detail::token_stream stream(tokenizer, cur);
|
||||||
|
|
||||||
// <identifier>,
|
// <identifier> [<attribute>],
|
||||||
// or: <identifier> = <expression>,
|
// or: <identifier> [<attribute>] = <expression>,
|
||||||
auto& name = stream.get().value();
|
auto& name = stream.get().value();
|
||||||
|
detail::skip_attribute(stream);
|
||||||
|
|
||||||
std::unique_ptr<cpp_expression> value;
|
std::unique_ptr<cpp_expression> value;
|
||||||
if (detail::skip_if(stream, "="))
|
if (detail::skip_if(stream, "="))
|
||||||
|
|
@ -45,10 +46,12 @@ namespace
|
||||||
detail::tokenizer tokenizer(context.tu, context.file, cur);
|
detail::tokenizer tokenizer(context.tu, context.file, cur);
|
||||||
detail::token_stream stream(tokenizer, cur);
|
detail::token_stream stream(tokenizer, cur);
|
||||||
|
|
||||||
// enum [class] name [: type] {
|
// [<attribute>] enum [class] [<attribute>] name [: type] {
|
||||||
|
detail::skip_attribute(stream);
|
||||||
detail::skip(stream, "enum");
|
detail::skip(stream, "enum");
|
||||||
auto scoped = detail::skip_if(stream, "class");
|
auto scoped = detail::skip_if(stream, "class");
|
||||||
auto& name = stream.get().value();
|
detail::skip_attribute(stream);
|
||||||
|
auto& name = stream.get().value();
|
||||||
|
|
||||||
std::unique_ptr<cpp_type> type;
|
std::unique_ptr<cpp_type> type;
|
||||||
if (detail::skip_if(stream, ":"))
|
if (detail::skip_if(stream, ":"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue