summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-03-05 11:55:08 +0000
committerAndreas Kling <kling@serenityos.org>2023-03-05 16:54:10 +0100
commit631927470a2a90cc332720eccb47867e6037f88a (patch)
treefabbda8dda47311f0ba1a24deb485a50c1ff8d06 /Userland
parentca2b030336d9cd58f49248fca8cde04fefe9319a (diff)
downloadserenity-631927470a2a90cc332720eccb47867e6037f88a.zip
LibCMake: Treat `block`, `endblock` and `return` as control keywords
I missed these before because they weren't mentioned on the language description page of the CMake manual.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibCMake/Token.cpp6
-rw-r--r--Userland/Libraries/LibCMake/Token.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCMake/Token.cpp b/Userland/Libraries/LibCMake/Token.cpp
index 6442ce5331..68bf98b9f4 100644
--- a/Userland/Libraries/LibCMake/Token.cpp
+++ b/Userland/Libraries/LibCMake/Token.cpp
@@ -30,6 +30,8 @@ Optional<ControlKeywordType> control_keyword_from_string(StringView value)
return ControlKeywordType::Break;
if (value.equals_ignoring_case("continue"sv))
return ControlKeywordType::Continue;
+ if (value.equals_ignoring_case("return"sv))
+ return ControlKeywordType::Return;
if (value.equals_ignoring_case("macro"sv))
return ControlKeywordType::Macro;
if (value.equals_ignoring_case("endmacro"sv))
@@ -38,6 +40,10 @@ Optional<ControlKeywordType> control_keyword_from_string(StringView value)
return ControlKeywordType::Function;
if (value.equals_ignoring_case("endfunction"sv))
return ControlKeywordType::EndFunction;
+ if (value.equals_ignoring_case("block"sv))
+ return ControlKeywordType::Block;
+ if (value.equals_ignoring_case("endblock"sv))
+ return ControlKeywordType::EndBlock;
return {};
}
diff --git a/Userland/Libraries/LibCMake/Token.h b/Userland/Libraries/LibCMake/Token.h
index de902604f2..b83207b874 100644
--- a/Userland/Libraries/LibCMake/Token.h
+++ b/Userland/Libraries/LibCMake/Token.h
@@ -33,10 +33,13 @@ enum class ControlKeywordType {
EndWhile,
Break,
Continue,
+ Return,
Macro,
EndMacro,
Function,
EndFunction,
+ Block,
+ EndBlock,
};
struct Token {