[gtksourceview: 2/4] scss.lang, less.lang: Rename subpatterns, use one DEFINE section
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview: 2/4] scss.lang, less.lang: Rename subpatterns, use one DEFINE section
- Date: Tue, 21 Jan 2020 00:25:56 +0000 (UTC)
commit e90eae1ba4dc66d5d43a6f00107f2fec5195bf25
Author: Jeffery To <jeffery to gmail com>
Date: Tue Jan 21 02:16:42 2020 +0800
scss.lang, less.lang: Rename subpatterns, use one DEFINE section
data/language-specs/less.lang | 46 +++++++++++++++-----------------------
data/language-specs/scss.lang | 52 +++++++++++++++++--------------------------
2 files changed, 39 insertions(+), 59 deletions(-)
---
diff --git a/data/language-specs/less.lang b/data/language-specs/less.lang
index b65ffca5..2f483944 100644
--- a/data/language-specs/less.lang
+++ b/data/language-specs/less.lang
@@ -397,29 +397,23 @@
<context id="less-declaration-value">
<start extended="true">
- (?(DEFINE) (?<escape_comment_start> (?: \\ /\* )+ ) )
- (?(DEFINE) (?<escape> (?: \\ . )+ ) )
+ (?(DEFINE)
+ (?<escape_comment_start> (?: \\ /\* )+ )
+ (?<escape> (?: \\ . )+ )
- (?(DEFINE) (?<escape_not_interpolation_start> (?: \\ (?! @{ ) . )+ ) )
+ (?<escape_not_interpolation_start> (?: \\ (?! @{ ) . )+ )
- (?(DEFINE)
(?<interpolation_start_chars>
(?: (?: @ (?! { ) )+ | (?: (?<! @ ) { )+ )
)
- )
- (?(DEFINE)
(?<comment_start_chars>
(?: (?: / (?! \* ) )+ | (?: (?<! / ) \* )+ )
)
- )
- (?(DEFINE)
(?<comment_end_chars>
(?: (?: \* (?! / ) )+ | (?: (?<! \* ) / )+ )
)
- )
- (?(DEFINE)
- (?<interpolation> # recursive subpattern to find matching brackets
+ (?<interpolation> # recursive subpattern to find matching braces
@{
(?:
(?>
@@ -433,8 +427,7 @@
)*
}
)
- )
- (?(DEFINE)
+
(?<parentheses> # recursive subpattern to find matching parentheses
\(
(?:
@@ -447,15 +440,14 @@
)+
) |
(?&parentheses) |
- (?&comment) |
- (?&double_quotes) |
- (?&single_quotes)
+ (?&multiline_comment) |
+ (?&double_quote_string) |
+ (?&single_quote_string)
)*
\)
)
- )
- (?(DEFINE)
- (?<comment> # subpattern to find matching comment delimiters
+
+ (?<multiline_comment> # subpattern to find matching comment delimiters
/\*
(?:
(?>
@@ -468,9 +460,8 @@
)*
\*/
)
- )
- (?(DEFINE)
- (?<double_quotes> # subpattern to find matching double quotes
+
+ (?<double_quote_string> # subpattern to find matching double quotes
"
(?:
(?>
@@ -484,9 +475,8 @@
)*
"
)
- )
- (?(DEFINE)
- (?<single_quotes> # subpattern to find matching single quotes
+
+ (?<single_quote_string> # subpattern to find matching single quotes
'
(?:
(?>
@@ -523,9 +513,9 @@
)+
) |
(?&parentheses) |
- (?&comment) |
- (?&double_quotes) |
- (?&single_quotes)
+ (?&multiline_comment) |
+ (?&double_quote_string) |
+ (?&single_quote_string)
)*
\%{css:declaration-value-end} # with a semicolon or at the end of a block
)
diff --git a/data/language-specs/scss.lang b/data/language-specs/scss.lang
index d52b325c..63ffa8e9 100644
--- a/data/language-specs/scss.lang
+++ b/data/language-specs/scss.lang
@@ -408,28 +408,22 @@
<context id="scss-declaration-value">
<start extended="true">
- (?(DEFINE) (?<escape_interpolation_start> (?: \\ \#{ )+ ) )
- (?(DEFINE) (?<escape_comment_start> (?: \\ /\* )+ ) )
- (?(DEFINE) (?<escape> (?: \\ . )+ ) )
-
(?(DEFINE)
+ (?<escape_interpolation_start> (?: \\ \#{ )+ )
+ (?<escape_comment_start> (?: \\ /\* )+ )
+ (?<escape> (?: \\ . )+ )
+
(?<interpolation_start_chars>
(?: (?: \# (?! { ) )+ | (?: (?<! \# ) { )+ )
)
- )
- (?(DEFINE)
(?<comment_start_chars>
(?: (?: / (?! \* ) )+ | (?: (?<! / ) \* )+ )
)
- )
- (?(DEFINE)
(?<comment_end_chars>
(?: (?: \* (?! / ) )+ | (?: (?<! \* ) / )+ )
)
- )
- (?(DEFINE)
- (?<interpolation> # recursive subpattern to find matching brackets
+ (?<interpolation> # recursive subpattern to find matching braces
\#{
(?:
(?>
@@ -444,14 +438,13 @@
) |
(?&interpolation) |
(?&parentheses) |
- (?&comment) |
- (?&double_quotes) |
- (?&single_quotes)
+ (?&multiline_comment) |
+ (?&double_quote_string) |
+ (?&single_quote_string)
)*
}
)
- )
- (?(DEFINE)
+
(?<parentheses> # recursive subpattern to find matching parentheses
\(
(?:
@@ -467,15 +460,14 @@
) |
(?&interpolation) |
(?&parentheses) |
- (?&comment) |
- (?&double_quotes) |
- (?&single_quotes)
+ (?&multiline_comment) |
+ (?&double_quote_string) |
+ (?&single_quote_string)
)*
\)
)
- )
- (?(DEFINE)
- (?<comment> # subpattern to find matching comment delimiters
+
+ (?<multiline_comment> # subpattern to find matching comment delimiters
/\*
(?:
(?>
@@ -490,9 +482,8 @@
)*
\*/
)
- )
- (?(DEFINE)
- (?<double_quotes> # subpattern to find matching double quotes
+
+ (?<double_quote_string> # subpattern to find matching double quotes
"
(?:
(?>
@@ -507,9 +498,8 @@
)*
"
)
- )
- (?(DEFINE)
- (?<single_quotes> # subpattern to find matching single quotes
+
+ (?<single_quote_string> # subpattern to find matching single quotes
'
(?:
(?>
@@ -549,9 +539,9 @@
) |
(?&interpolation) |
(?&parentheses) |
- (?&comment) |
- (?&double_quotes) |
- (?&single_quotes)
+ (?&multiline_comment) |
+ (?&double_quote_string) |
+ (?&single_quote_string)
)*
)
\%{css:declaration-value-end} # with a semicolon or at the end of a block
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]