mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 04:22:28 +00:00
LibCpp: Parse enum members with explicit values
This commit is contained in:
parent
67a19eaecb
commit
8fefbfd5ac
Notes:
sideshowbarker
2024-07-18 07:36:43 +09:00
Author: https://github.com/alimpfard
Commit: 8fefbfd5ac
Pull-request: https://github.com/SerenityOS/serenity/pull/9156
Reviewed-by: https://github.com/itamar8910 ✅
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