[gtksourceview] desktop.lang: support languages with @ in their name
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] desktop.lang: support languages with @ in their name
- Date: Wed, 25 Nov 2015 18:37:57 +0000 (UTC)
commit 3b87ce2c58fd9ac06fa4e360a54f97d04cfd3a12
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Nov 25 19:34:13 2015 +0100
desktop.lang: support languages with @ in their name
The "language" context class was actually dead code.
But since the regex is duplicated at several places, define a regex and
use it.
https://bugzilla.gnome.org/show_bug.cgi?id=757528
data/language-specs/desktop.lang | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/data/language-specs/desktop.lang b/data/language-specs/desktop.lang
index b4cfcc1..662a877 100644
--- a/data/language-specs/desktop.lang
+++ b/data/language-specs/desktop.lang
@@ -45,17 +45,14 @@
</styles>
<definitions>
- <define-regex id="key-suffix">(?=(\[[a-zA-Z_]+\])?\s*=\s*)</define-regex>
+ <define-regex id="language">\[[a-zA-Z_]+ ?[a-zA-Z_]*\]</define-regex>
+ <define-regex id="key-suffix">(?=(\%{language})?\s*=\s*)</define-regex>
<context id="group" style-ref="group">
<start>^\[</start>
<end>\]$</end>
</context>
- <context id="language" style-ref="language">
- <match>\[[a-zA-Z_]+\]</match>
- </context>
-
<context id="boolean" style-ref="boolean">
<keyword>true</keyword>
<keyword>false</keyword>
@@ -285,7 +282,7 @@
<context ref="group"/>
<context ref="key"/>
<context id="lang-and-value" end-at-line-end="true">
- <start>(\[[a-zA-Z_]+\])?\s*=\s*</start>
+ <start>(\%{language})?\s*=\s*</start>
<include>
<context sub-pattern="1" where="start" style-ref="language"/>
<context ref="boolean"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]