[gtksourceview/gnome-3-24] css.lang: Improve highlighting of functions: nesting and dimensions
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/gnome-3-24] css.lang: Improve highlighting of functions: nesting and dimensions
- Date: Fri, 23 Jun 2017 09:00:00 +0000 (UTC)
commit 71205dba078292f30101646ba9690f38460877d9
Author: Tobias Schönberg <tobias47n9e gmail com>
Date: Wed Jun 21 19:32:12 2017 +0200
css.lang: Improve highlighting of functions: nesting and dimensions
Currently nested functions are not highlighted. Functions like
'translateX' are not hightlighted when the x is lower case.
Dimensions are not highlighted at all within functions.
This commit fixes these 3 issues. Function context is now
defined after units and imports them. Nesting is allowed.
Regex allows uppercase letters in function names.
https://bugzilla.gnome.org/show_bug.cgi?id=776830
data/language-specs/css.lang | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/data/language-specs/css.lang b/data/language-specs/css.lang
index 043425d..e6b8f23 100644
--- a/data/language-specs/css.lang
+++ b/data/language-specs/css.lang
@@ -163,17 +163,6 @@
<keyword>yellow</keyword>
</context>
- <context id="function">
- <start>[a-zA-Z][a-z0-9-]+\(</start>
- <end>\)</end>
- <include>
- <context sub-pattern="0" where="start" style-ref="function"/>
- <context sub-pattern="0" where="end" style-ref="function"/>
- <context ref="def:escape"/>
- <context ref="def:line-continue"/>
- </include>
- </context>
-
<context id="dimension" style-ref="dimension">
<match>[\+-]?([0-9]+|[0-9]*\.[0-9]+)(%|e(m|x)|(v(h|w|min|max))|ch|fr|rem|p(x|t|c)|in|ft|(m|c)m|k?Hz|deg|g?rad|m?s)</match>
</context>
@@ -979,6 +968,23 @@
<match>[*>+]</match>
</context>
+ <context id="function">
+ <start>[a-zA-Z][a-zA-Z0-9-]+\(</start>
+ <end>\)</end>
+ <include>
+ <context sub-pattern="0" where="start" style-ref="function"/>
+ <context sub-pattern="0" where="end" style-ref="function"/>
+ <context ref="def:escape"/>
+ <context ref="def:line-continue"/>
+ <context ref="hexadecimal-color"/>
+ <context ref="resolution"/>
+ <context ref="dimension"/>
+ <context ref="float-number"/>
+ <context ref="number"/>
+ <context ref="function"/>
+ </include>
+ </context>
+
<context id="css" class="no-spell-check">
<include>
<context ref="def:string"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]