Support style and identifier lists in escaped strings.

Example:

  .foo {
    transition: ~"border-color ease-in-out .15s,
                  box-shadow ease-in-out .15s";
  }
This commit is contained in:
Sascha Peilicke
2013-12-17 14:10:33 +01:00
parent 0a2b0690d1
commit 5da1fd891b
2 changed files with 11 additions and 1 deletions

View File

@@ -174,6 +174,15 @@ class LessLexer:
r'@\{[^@\}]+\}'
return t
def t_iselector_t_eclose(self, t):
r'"|\''
# Can only happen if iselector state is on top of estring state.
#
# Example: @item: ~".col-xs-@{index}";
#
t.lexer.pop_state()
return t
def t_iselector_css_filter(self, t):
(r'\[[^\]]*\]'
'|(not|lang|nth-[a-z\-]+)\(.+\)'

View File

@@ -664,7 +664,8 @@ class LessParser(object):
#
def p_escaped_string(self, p):
""" estring : t_eopen style t_eclose
""" estring : t_eopen style_list t_eclose
| t_eopen identifier_list t_eclose
"""
p[0] = p[2]