Files
CMake/Modules/CheckCSourceRuns.cmake
Matthew Woehlke b88b7e7c18 Help: Fix lexing of multi-line strings
Teach our CMake lexer to recognize `[[...]]` multi-line strings, as used
in some 'check source compiles/runs' examples to pass literal C/C++ code
through a CMake function. Previously, this resulted in the lexer trying
to parse such code as CMake, which is obviously incorrect. Also, use the
new `[[` syntax in more places.

Note that, because `[[...]]` can also show up in some instances denoting
optional arguments, we only consider `[[` with no `=` as a string if the
`[[` is followed by a non-identifier character. This heuristic seems to
work for most existing usages.

Co-Authored-By: Georg Brandl <georg@python.org>
2026-02-13 13:36:59 -05:00

2.6 KiB