mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
LibCpp: Parse enum members with explicit values
This commit is contained in:
parent
67a19eaecb
commit
8fefbfd5ac
3 changed files with 16 additions and 4 deletions
|
@ -616,11 +616,15 @@ public:
|
|||
};
|
||||
|
||||
void set_type(Type type) { m_type = type; }
|
||||
void add_entry(StringView entry) { m_entries.append(move(entry)); }
|
||||
void add_entry(StringView entry, RefPtr<Expression> value = nullptr) { m_entries.append({ entry, move(value) }); }
|
||||
|
||||
private:
|
||||
Type m_type { Type::RegularEnum };
|
||||
Vector<StringView> m_entries;
|
||||
struct EnumerationEntry {
|
||||
StringView name;
|
||||
RefPtr<Expression> value;
|
||||
};
|
||||
Vector<EnumerationEntry> m_entries;
|
||||
};
|
||||
|
||||
class StructOrClassDeclaration : public Declaration {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue