[gtksourceview] css.lang: Consistency fixes
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] css.lang: Consistency fixes
- Date: Wed, 9 May 2018 11:02:40 +0000 (UTC)
commit b3e895d47a34d8d3dea10748345d248084e68c1e
Author: Jeffery To <jeffery to gmail com>
Date: Wed May 9 00:41:50 2018 +0800
css.lang: Consistency fixes
* Remove requirement that at-rules start at the beginning of a line
* Add string highlighting to style-block and function contexts
* Rename attribute-value-delimiter context to
attribute-selector-delimiter, to clarify purpose
* Rework operators context and rename to attribute-selector-operators
* Add general sibling selector (~) to selector-grammar context
https://bugzilla.gnome.org/show_bug.cgi?id=795938
data/language-specs/css.lang | 20 ++++++++++++--------
tests/syntax-highlighting/file.css | 3 ++-
2 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/data/language-specs/css.lang b/data/language-specs/css.lang
index 806ccc7..8c98871 100644
--- a/data/language-specs/css.lang
+++ b/data/language-specs/css.lang
@@ -111,7 +111,7 @@
</context>
<context id="css3-at-rules" style-ref="at-rules">
- <prefix>^[ \t]*@</prefix>
+ <prefix>@</prefix>
<keyword>annotation</keyword>
<keyword>character-variant</keyword>
<keyword>font-face</keyword>
@@ -124,7 +124,7 @@
</context>
<context id="at-rules" style-ref="at-rules">
- <prefix>^[ \t]*@</prefix>
+ <prefix>@</prefix>
<keyword>charset</keyword>
<keyword>import</keyword>
<keyword>media</keyword>
@@ -1093,6 +1093,8 @@
<start>\{</start>
<end>\}</end>
<include>
+ <context ref="def:string"/>
+ <context ref="def:single-quoted-string"/>
<context ref="def:c-like-comment-multiline"/>
<context ref="def:c-like-close-comment-outside-comment"/>
<context ref="css3-at-rules"/>
@@ -1119,16 +1121,16 @@
<match>[{}();,]</match>
</context>
- <context id="attribute-value-delimiters" style-ref="others-2">
+ <context id="attribute-selector-delimiters" style-ref="others-2">
<match>(\[|\])</match>
</context>
- <context id="operators" style-ref="function">
- <match>[@%~|!=]</match>
+ <context id="attribute-selector-operators" style-ref="function">
+ <match>[~|^$*]?=</match>
</context>
<context id="selector-grammar" style-ref="others-3">
- <match>[*>+]</match>
+ <match>[*>+~]</match>
</context>
<context id="function">
@@ -1137,6 +1139,8 @@
<include>
<context sub-pattern="0" where="start" style-ref="function"/>
<context sub-pattern="0" where="end" style-ref="function"/>
+ <context ref="def:string"/>
+ <context ref="def:single-quoted-string"/>
<context ref="def:escape"/>
<context ref="def:line-continue"/>
<context ref="hexadecimal-color"/>
@@ -1161,8 +1165,8 @@
<context ref="at-rules"/>
<context ref="style-block"/>
<context ref="punctuators"/>
- <context ref="attribute-value-delimiters"/>
- <context ref="operators"/>
+ <context ref="attribute-selector-delimiters"/>
+ <context ref="attribute-selector-operators"/>
<context ref="selector-grammar"/>
<context ref="selector-id"/>
<context ref="selector-class"/>
diff --git a/tests/syntax-highlighting/file.css b/tests/syntax-highlighting/file.css
index 099176b..5c3a280 100644
--- a/tests/syntax-highlighting/file.css
+++ b/tests/syntax-highlighting/file.css
@@ -1,4 +1,4 @@
-#testID[type=text] {
+#testID[lang|="zh"] {
font: 12px italic "Overpass";
}
@@ -42,6 +42,7 @@ INPUT::PLACEHOLDER {
color: #000;
}
}
+ @media screen {} @media print {}
}
@media (min-resolution: +2.54dpcm) {}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]