[gtksourceview] cmake.lang: add highlighting for environment variable references
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] cmake.lang: add highlighting for environment variable references
- Date: Thu, 16 Nov 2017 14:48:57 +0000 (UTC)
commit c67b8691a54a44fc11b7785f6461d8ceb54ec6c5
Author: Роман Донченко <dpb corrigendum ru>
Date: Sun Nov 12 18:41:09 2017 +0300
cmake.lang: add highlighting for environment variable references
The syntax is nearly the same as for regular variable references, and
I would've just merged the contexts, but builtin variable names have
no special meaning in environment variable references, so I opted to
use a separate context to implement that distinction.
There are actually special environment variable names that CMake
recognizes, but I haven't implemented support for them.
https://bugzilla.gnome.org/show_bug.cgi?id=790345
data/language-specs/cmake.lang | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/data/language-specs/cmake.lang b/data/language-specs/cmake.lang
index 53fdc6d..71dba4d 100644
--- a/data/language-specs/cmake.lang
+++ b/data/language-specs/cmake.lang
@@ -704,6 +704,21 @@
<context sub-pattern="0" where="end" style-ref="def:special-char"/>
<context ref="builtin-variable"/>
<context ref="variable-reference"/>
+ <context ref="env-variable-reference"/>
+ <context ref="escape-sequence"/>
+ <context ref="disallowed-variable-reference-char"/>
+ </include>
+ </context>
+
+ <context id="env-variable-reference" style-ref="variable"
+ style-inside="true" end-at-line-end="true">
+ <start>\$ENV\{</start>
+ <end>\}</end>
+ <include>
+ <context sub-pattern="0" where="start" style-ref="def:special-char"/>
+ <context sub-pattern="0" where="end" style-ref="def:special-char"/>
+ <context ref="variable-reference"/>
+ <context ref="env-variable-reference"/>
<context ref="escape-sequence"/>
<context ref="disallowed-variable-reference-char"/>
</include>
@@ -716,6 +731,7 @@
<context sub-pattern="1" where="start" style-ref="builtin-command"/>
<context sub-pattern="2" where="start" style-ref="variable"/>
<context ref="variable-reference"/>
+ <context ref="env-variable-reference"/>
<context ref="constant"/>
<context ref="def:shell-like-comment"/>
</include>
@@ -724,6 +740,7 @@
<context id="cmake">
<include>
<context ref="variable-reference"/>
+ <context ref="env-variable-reference"/>
<context ref="variable-assignment"/>
<context ref="def:shell-like-comment"/>
<context ref="constant"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]