mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
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.
This commit is contained in:
parent
ca2b030336
commit
631927470a
Notes:
sideshowbarker
2024-07-17 04:57:23 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/631927470a Pull-request: https://github.com/SerenityOS/serenity/pull/17715
@ -30,6 +30,8 @@ Optional<ControlKeywordType> control_keyword_from_string(StringView value)
|
|||||||
return ControlKeywordType::Break;
|
return ControlKeywordType::Break;
|
||||||
if (value.equals_ignoring_case("continue"sv))
|
if (value.equals_ignoring_case("continue"sv))
|
||||||
return ControlKeywordType::Continue;
|
return ControlKeywordType::Continue;
|
||||||
|
if (value.equals_ignoring_case("return"sv))
|
||||||
|
return ControlKeywordType::Return;
|
||||||
if (value.equals_ignoring_case("macro"sv))
|
if (value.equals_ignoring_case("macro"sv))
|
||||||
return ControlKeywordType::Macro;
|
return ControlKeywordType::Macro;
|
||||||
if (value.equals_ignoring_case("endmacro"sv))
|
if (value.equals_ignoring_case("endmacro"sv))
|
||||||
@ -38,6 +40,10 @@ Optional<ControlKeywordType> control_keyword_from_string(StringView value)
|
|||||||
return ControlKeywordType::Function;
|
return ControlKeywordType::Function;
|
||||||
if (value.equals_ignoring_case("endfunction"sv))
|
if (value.equals_ignoring_case("endfunction"sv))
|
||||||
return ControlKeywordType::EndFunction;
|
return ControlKeywordType::EndFunction;
|
||||||
|
if (value.equals_ignoring_case("block"sv))
|
||||||
|
return ControlKeywordType::Block;
|
||||||
|
if (value.equals_ignoring_case("endblock"sv))
|
||||||
|
return ControlKeywordType::EndBlock;
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,10 +33,13 @@ enum class ControlKeywordType {
|
|||||||
EndWhile,
|
EndWhile,
|
||||||
Break,
|
Break,
|
||||||
Continue,
|
Continue,
|
||||||
|
Return,
|
||||||
Macro,
|
Macro,
|
||||||
EndMacro,
|
EndMacro,
|
||||||
Function,
|
Function,
|
||||||
EndFunction,
|
EndFunction,
|
||||||
|
Block,
|
||||||
|
EndBlock,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Token {
|
struct Token {
|
||||||
|
Loading…
Reference in New Issue
Block a user