mirror of
https://github.com/Kitware/CMake.git
synced 2026-06-24 08:47:59 +00:00
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>
2.6 KiB
2.6 KiB