From 987eb72681357b7872a46e8409dfb6f43f2fa673 Mon Sep 17 00:00:00 2001 From: Koen Lageveen Date: Mon, 29 Jan 2018 18:12:55 +0100 Subject: [PATCH] recursive property lists --- LESS.sublime-syntax | 29 +++++++++++------------------ syntax_test_less.less | 11 +++++++++++ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/LESS.sublime-syntax b/LESS.sublime-syntax index 6bafbba..d0d4118 100644 --- a/LESS.sublime-syntax +++ b/LESS.sublime-syntax @@ -15,7 +15,7 @@ variables: ident: '(?:--{{nmchar}}+|-?{{nmstart}}{{nmchar}}*)' contexts: main: - - include: curlies + - include: property-list - include: commas - include: terminator - include: comment-block @@ -42,12 +42,6 @@ contexts: 2: entity.name.namespace.wildcard.css 3: punctuation.separator.namespace.css - curlies: - - match: '\{' - scope: punctuation.section.property-list.begin.css - - match: '\}' - scope: punctuation.section.property-list.end.css - commas: - match: '\s*(,)\s*' captures: @@ -232,6 +226,15 @@ contexts: - match: '(-+|_+)[a-zA-Z_][a-zA-Z0-9_-]*' scope: entity.other.attribute-name.css + property-list: + - match: '\{' + scope: punctuation.section.property-list.begin.css + push: + - match: '\}' + scope: punctuation.section.property-list.end.css + pop: true + - include: main + less-parameters: - match: '\(' scope: punctuation.section.group.begin.less @@ -242,17 +245,7 @@ contexts: pop: true - match: ':' scope: punctuation.separator.key-value.css - - match: '\{' - scope: punctuation.section.property-list.begin.css - push: - - match: '\}' - scope: punctuation.section.property-list.end.css - pop: true - - include: selector - - include: rule-list - - include: less-operators - - include: less-parameters - - include: terminator + - include: property-list - include: comment-line - include: comment-block - include: color-values diff --git a/syntax_test_less.less b/syntax_test_less.less index 6ca6ec8..da9c738 100755 --- a/syntax_test_less.less +++ b/syntax_test_less.less @@ -255,7 +255,18 @@ header { #transition(~'opacity @{duration-short} @{ease}') /* ^ string.quoted.single.css markup.raw.less keyword.operator.less */ } + .site-header-info-extra-tooltip { +/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.selector.css entity.other.attribute-name.class.css */ + opacity: 1; + #transition(~'opacity @{duration-short} @{ease}') + .site-header-info-extra-tooltip { +/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.selector.css entity.other.attribute-name.class.css */ + opacity: 1; + #transition(~'opacity @{duration-short} @{ease}') + + } + } }) .desktop-and-old-ie({