1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:58:12 +00:00

JSSpecCompiler: Parse accessor property headers

This commit is contained in:
Dan Klishch 2024-01-21 00:10:46 -05:00 committed by Andrew Kaster
parent a9f3a14a13
commit d1fc84c638
4 changed files with 108 additions and 41 deletions

View file

@ -13,13 +13,17 @@
namespace JSSpecCompiler {
struct ClauseHeader {
struct FunctionDefinition {
struct AbstractOperation {
StringView name;
Vector<FunctionArgument> arguments;
};
struct Accessor {
Vector<StringView> qualified_name;
};
StringView section_number;
Variant<AK::Empty, FunctionDefinition> header;
Variant<AK::Empty, AbstractOperation, Accessor> header;
};
struct TextParseError { };
@ -86,6 +90,11 @@ private:
TextParseErrorOr<Tree> parse_if(Tree then_branch);
TextParseErrorOr<Tree> parse_else(Tree else_branch);
TextParseErrorOr<Vector<StringView>> parse_qualified_name();
TextParseErrorOr<Vector<FunctionArgument>> parse_function_arguments_in_declaration();
TextParseErrorOr<ClauseHeader::AbstractOperation> parse_abstract_operation_declaration();
TextParseErrorOr<ClauseHeader::Accessor> parse_accessor_declaration();
SpecificationParsingContext& m_ctx;
Vector<Token> const& m_tokens;
size_t m_next_token_index = 0;