diff options
author | Itamar <itamar8910@gmail.com> | 2021-04-06 19:43:43 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-06 21:51:58 +0200 |
commit | 9e2e36724d87a639be967d212a3c60d0ea5fed2b (patch) | |
tree | df08c4d2637a12ee42ae28dca2571a16e3cffed5 /Userland/Libraries/LibCpp/Parser.h | |
parent | 510b5073de9b2a50a226addd1b02df18da995613 (diff) | |
download | serenity-9e2e36724d87a639be967d212a3c60d0ea5fed2b.zip |
LibCpp: Add TemplatizedName
This type represents templatized names, and replaces our previous use
of 'TemplatizedType' and 'TemplatizedFunctionCall'.
Also, we now parse function calls as secondary expressions.
Diffstat (limited to 'Userland/Libraries/LibCpp/Parser.h')
-rw-r--r-- | Userland/Libraries/LibCpp/Parser.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/Userland/Libraries/LibCpp/Parser.h b/Userland/Libraries/LibCpp/Parser.h index 94961e6968..aad21bd9d0 100644 --- a/Userland/Libraries/LibCpp/Parser.h +++ b/Userland/Libraries/LibCpp/Parser.h @@ -93,14 +93,7 @@ private: bool match_c_style_cast_expression(); bool match_sizeof_expression(); bool match_braced_init_list(); - - enum class TemplatizedMatchResult { - NoMatch, - Regular, - Templatized, - }; - TemplatizedMatchResult match_type(); - TemplatizedMatchResult match_function_call(); + bool match_type(); Optional<NonnullRefPtrVector<Parameter>> parse_parameter_list(ASTNode& parent); Optional<Token> consume_whitespace(); @@ -165,7 +158,7 @@ private: create_ast_node(ASTNode& parent, const Position& start, Optional<Position> end, Args&&... args) { auto node = adopt(*new T(&parent, start, end, m_filename, forward<Args>(args)...)); - if(!parent.is_dummy_node()) { + if (!parent.is_dummy_node()) { m_state.nodes.append(node); } return node; @@ -180,14 +173,12 @@ private: return node; } - DummyAstNode& get_dummy_node() { - static NonnullRefPtr<DummyAstNode> dummy = adopt(*new DummyAstNode(nullptr, {}, {}, {})); + static NonnullRefPtr<DummyAstNode> dummy = adopt(*new DummyAstNode(nullptr, {}, {}, {})); return dummy; } - bool match_attribute_specification(); void consume_attribute_specification(); bool match_ellipsis(); |