Variable expansion kills font lock on keywords
For example, in
install(DIRECTORY ./
DESTINATION ${INSTALL_MODULES_DIR}
COMPONENT Development
FILES_MATCHING PATTERN *.cmake)
only DIRECTORY and DESTINATION are properly font locked. Others, COMPONENT, FILES_MATCHING, and PATTERN, are not font locked. However, if I enclose variable expansion into quotes, i.e.
install(DIRECTORY ./
DESTINATION "${INSTALL_MODULES_DIR}"
COMPONENT Development
FILES_MATCHING PATTERN *.cmake)
all keywords are font locked properly. Although, I didn't study the implementation in details, I tend to think that if this is not a bug but at least an unintended side effect. What blocks the current implementation from mitigating this problem on variable expansions? Instead of " as anchors, one has ${ and }. I've read the second problem in README but it makes little sense to me in this case.
Hi!
I tested both your examples, and both seem to be highlighted correctly. All keywords, including COMPONENT and the other your mentioned are highlighted.
Maybe there is some other component that must be present for the problem to occur. Could you make a step by step recipe from Emacs -Q that demonstrates the problem?
The second problem in the readme is unrelated to this, as far as I can tell.
Sincerely, Anders Lindgren
On Sat, Jul 9, 2016 at 10:18 PM, Alexander Shukaev <[email protected]
wrote:
For example, in
install(DIRECTORY ./ DESTINATION ${INSTALL_MODULES_DIR} COMPONENT Development FILES_MATCHING PATTERN *.cmake)
only DIRECTORY and DESTINATION are properly font locked. Others, COMPONENT, FILES_MATCHING, and PATTERN, are not font locked. However, if I enclose variable expansion into quotes, i.e.
install(DIRECTORY ./ DESTINATION "${INSTALL_MODULES_DIR}" COMPONENT Development FILES_MATCHING PATTERN *.cmake)
all keywords are font locked properly. Although, I didn't closely study the implementation, I tend to think that if this is not a bug but at least and unintended side effect. What stops the current implementation to mitigate this problem on variable expansions? Instead of " as anchors, on has ${ and }. I've read the second problem in README but it makes little sense to me in this case.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Lindydancer/cmake-font-lock/issues/4, or mute the thread https://github.com/notifications/unsubscribe/ADBjQHSy2nI04Habispwj098i6k0xAbdks5qUAH9gaJpZM4JIsbB .