summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-07-28 04:06:45 +0430
committerAndreas Kling <kling@serenityos.org>2021-08-02 01:03:59 +0200
commit67a19eaecbca321bbc7215765aa1593c1e1df3b2 (patch)
tree984137804569d5a3fcd263d4e821a9365cce2b9a
parent5d27740387b63a0381b29fe57b21f9aea2a6aecb (diff)
downloadserenity-67a19eaecbca321bbc7215765aa1593c1e1df3b2.zip
LibCpp: Parse "extern" declarations
Note that this is not the `extern "C"` declarations, just extern decl qualifiers.
-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 e3ce9d4186..120793bc70 100644
--- a/Userland/Libraries/LibCpp/Parser.cpp
+++ b/Userland/Libraries/LibCpp/Parser.cpp
@@ -1261,7 +1261,7 @@ Vector<StringView> Parser::parse_type_qualifiers()
if (token.type() != Token::Type::Keyword)
break;
auto text = text_of_token(token);
- if (text == "static" || text == "const") {
+ if (text == "static" || text == "const" || text == "extern") {
qualifiers.append(text);
consume();
} else {
@@ -1280,7 +1280,7 @@ Vector<StringView> Parser::parse_function_qualifiers()
if (token.type() != Token::Type::Keyword)
break;
auto text = text_of_token(token);
- if (text == "static" || text == "inline") {
+ if (text == "static" || text == "inline" || text == "extern") {
qualifiers.append(text);
consume();
} else {