Add t_tilde token for '~'
To be used inside general_sibling_selector (e.g. 'a ~ b { ... }')
instead of the literal '~'. Necessary since we had to remove the literal
from the lexer in order to tokenize ~"..." and ~'...'.
This commit is contained in:
@@ -53,6 +53,7 @@ class LessLexer:
|
||||
't_popen',
|
||||
't_pclose',
|
||||
't_semicolon',
|
||||
't_tilde',
|
||||
|
||||
't_lsopen',
|
||||
't_lsclose',
|
||||
@@ -234,6 +235,10 @@ class LessLexer:
|
||||
t.lexer.push_state('lessstringapostrophe')
|
||||
return t
|
||||
|
||||
def t_t_tilde(self, t):
|
||||
r'~'
|
||||
return t
|
||||
|
||||
def t_lessstringquotes_less_variable(self, t):
|
||||
r'@\{[^@"\}]+\}'
|
||||
return t
|
||||
|
||||
@@ -797,8 +797,8 @@ class LessParser(object):
|
||||
p[0] = tuple(list(p)[1:])
|
||||
|
||||
def p_general_sibling_selector(self, p):
|
||||
""" general_sibling_selector : '~' t_ws
|
||||
| '~'
|
||||
""" general_sibling_selector : t_tilde t_ws
|
||||
| t_tilde
|
||||
"""
|
||||
p[0] = tuple(list(p)[1:])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user