1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-22 22:27:39 +00:00
serenity/Userland/Libraries/LibCMake
Sam Atkins 822164a686 LibCMake: Add folding regions to syntax highlighter
This creates folding regions for blocks defined by the following:
- if/elseif/else/endif
- foreach/endforeach
- while/endwhile
- macro/endmacro
- function/endfunction

Since there is no guarantee that each keyword will have a matching
partner, we do our best by looking for the most recent possible start
token matching the current end token. If we find one, we link to it and
drop all the other start-tokens that happened in between. For example,
we would define a folding region for this invalid file like so:

[-] if(TRUE)
 │      while()
 └─ endif()
2023-03-05 16:54:10 +01:00
..
CMakeLists.txt LibCMake+LibSyntax: Add a CMake syntax highlighter 2023-03-04 05:43:43 -07:00
Lexer.cpp LibCMake: Introduce a CMake lexer 2023-03-04 05:43:43 -07:00
Lexer.h LibCMake: Introduce a CMake lexer 2023-03-04 05:43:43 -07:00
SyntaxHighlighter.cpp LibCMake: Add folding regions to syntax highlighter 2023-03-05 16:54:10 +01:00
SyntaxHighlighter.h LibCMake+LibSyntax: Add a CMake syntax highlighter 2023-03-04 05:43:43 -07:00
Token.cpp LibCMake: Treat block, endblock and return as control keywords 2023-03-05 16:54:10 +01:00
Token.h LibCMake: Treat block, endblock and return as control keywords 2023-03-05 16:54:10 +01:00