[gtksourceview] css.lang: Add *-content contexts to aid extensibility
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] css.lang: Add *-content contexts to aid extensibility
- Date: Sun, 3 Jun 2018 14:20:22 +0000 (UTC)
commit 5dac695d6fedc83ea56f36d7c9e9d4c34709ef71
Author: Jeffery To <jeffery to gmail com>
Date: Thu May 17 02:01:21 2018 +0800
css.lang: Add *-content contexts to aid extensibility
This adds *-content contexts to several key container contexts, to make
extending these container contexts easier.
data/language-specs/css.lang | 59 +++++++++++++++++++++++++++++++++-----------
1 file changed, 45 insertions(+), 14 deletions(-)
---
diff --git a/data/language-specs/css.lang b/data/language-specs/css.lang
index ef6b263f..c29d62e5 100644
--- a/data/language-specs/css.lang
+++ b/data/language-specs/css.lang
@@ -487,7 +487,7 @@
</include>
</context>
- <context id="function-arguments-list">
+ <context id="function-content">
<include>
<context ref="all-functions"/>
<context ref="all-basic-data-types"/>
@@ -503,7 +503,7 @@
<context sub-pattern="0" where="start" style-ref="vendor-specific"/>
<context sub-pattern="0" where="end" style-ref="vendor-specific"/>
<context ref="comment"/>
- <context ref="function-arguments-list"/>
+ <context ref="function-content"/>
</include>
</context>
@@ -514,7 +514,7 @@
<context sub-pattern="0" where="start" style-ref="function"/>
<context sub-pattern="0" where="end" style-ref="function"/>
<context ref="comment"/>
- <context ref="function-arguments-list"/>
+ <context ref="function-content"/>
</include>
</context>
@@ -1397,6 +1397,12 @@
</include>
</context>
+ <context id="style-block-content">
+ <include>
+ <context ref="declaration"/>
+ </include>
+ </context>
+
<context id="style-block">
<start>\{</start>
<end>\}</end>
@@ -1404,7 +1410,7 @@
<context sub-pattern="0" where="start" style-ref="block-delimiter"/>
<context sub-pattern="0" where="end" style-ref="block-delimiter"/>
<context ref="comment"/>
- <context ref="declaration"/>
+ <context ref="style-block-content"/>
</include>
</context>
@@ -1483,6 +1489,16 @@
<keyword>standalone</keyword>
</context>
+ <context id="media-feature-test-content">
+ <include>
+ <context ref="media-queries"/>
+ <context ref="css3-media-features"/>
+ <context ref="css3-media-feature-values"/>
+ <context ref="all-basic-data-types"/>
+ <context ref="colon"/>
+ </include>
+ </context>
+
<context id="media-feature-test">
<start>\(</start>
<end>\)</end>
@@ -1490,11 +1506,7 @@
<context sub-pattern="0" where="start" style-ref="test-delimiter"/>
<context sub-pattern="0" where="end" style-ref="test-delimiter"/>
<context ref="comment"/>
- <context ref="media-queries"/>
- <context ref="css3-media-features"/>
- <context ref="css3-media-feature-values"/>
- <context ref="all-basic-data-types"/>
- <context ref="colon"/>
+ <context ref="media-feature-test-content"/>
</include>
</context>
@@ -1820,6 +1832,14 @@
<match>[~|^$*]?=</match>
</context>
+ <context id="attribute-selector-content">
+ <include>
+ <context ref="string"/>
+ <context ref="attribute-selector-attribute-name"/>
+ <context ref="attribute-selector-operators"/>
+ </include>
+ </context>
+
<context id="attribute-selector">
<start>\[</start>
<end>\]</end>
@@ -1827,9 +1847,7 @@
<context sub-pattern="0" where="start" style-ref="attribute-selector"/>
<context sub-pattern="0" where="end" style-ref="attribute-selector"/>
<context ref="comment"/>
- <context ref="string"/>
- <context ref="attribute-selector-attribute-name"/>
- <context ref="attribute-selector-operators"/>
+ <context ref="attribute-selector-content"/>
</include>
</context>
@@ -1893,6 +1911,12 @@
<keyword>visited</keyword>
</context>
+ <context id="lang-pseudo-class-argument-content">
+ <include>
+ <context ref="name"/>
+ </include>
+ </context>
+
<context id="lang-pseudo-class-argument">
<start>(?<=:lang)\(</start>
<end>\)</end>
@@ -1900,6 +1924,7 @@
<context sub-pattern="0" where="start" style-ref="pseudo-class"/>
<context sub-pattern="0" where="end" style-ref="pseudo-class"/>
<context ref="comment"/>
+ <context ref="lang-pseudo-class-argument-content"/>
</include>
</context>
@@ -1949,6 +1974,13 @@
</match>
</context>
+ <context id="nth-pseudo-class-argument-content">
+ <include>
+ <context ref="nth-pseudo-class-argument-keywords"/>
+ <context ref="nth-pseudo-class-argument-expression"/>
+ </include>
+ </context>
+
<context id="nth-pseudo-class-argument">
<start extended="true">
(
@@ -1964,8 +1996,7 @@
<context sub-pattern="0" where="start" style-ref="pseudo-class"/>
<context sub-pattern="0" where="end" style-ref="pseudo-class"/>
<context ref="comment"/>
- <context ref="nth-pseudo-class-argument-keywords"/>
- <context ref="nth-pseudo-class-argument-expression"/>
+ <context ref="nth-pseudo-class-argument-content"/>
</include>
</context>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]