summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-07-28 21:34:24 +0430
committerAndreas Kling <kling@serenityos.org>2021-08-02 01:03:59 +0200
commite27ec04cddcb54415a8cfc54fc393913e87f9b9f (patch)
treebe5c07548aabe22ca47f84e306b8405066ab3420
parent5f66874ea06e965c094a0679bee8634012e85739 (diff)
downloadserenity-e27ec04cddcb54415a8cfc54fc393913e87f9b9f.zip
LibCpp: Allow 'override' as a function target qualifier
This is just ignored right now.
-rw-r--r--Userland/Libraries/LibCpp/Parser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibCpp/Parser.cpp b/Userland/Libraries/LibCpp/Parser.cpp
index 0279e8e83d..fc193e57e6 100644
--- a/Userland/Libraries/LibCpp/Parser.cpp
+++ b/Userland/Libraries/LibCpp/Parser.cpp
@@ -132,7 +132,7 @@ NonnullRefPtr<FunctionDeclaration> Parser::parse_function_declaration(ASTNode& p
consume(Token::Type::RightParen);
- if (match_keyword("const")) {
+ while (match_keyword("const") || match_keyword("override")) {
consume();
// FIXME: Note that this function is supposed to be a class member, and `this` has to be const, somehow.
}
@@ -744,7 +744,7 @@ bool Parser::match_function_declaration()
while (consume().type() != Token::Type::RightParen && !eof()) { };
- if (match_keyword("const"))
+ while (match_keyword("const") || match_keyword("override"))
consume();
if (peek(Token::Type::Semicolon).has_value() || peek(Token::Type::LeftCurly).has_value())