test ws
This commit is contained in:
@@ -75,6 +75,7 @@ class LessLexer:
|
||||
def __init__(self):
|
||||
self.build(reflags=re.UNICODE|re.IGNORECASE)
|
||||
self.last = None
|
||||
self.next = None
|
||||
|
||||
def t_css_filter(self, t):
|
||||
(r'\[[^\]]*\]'
|
||||
@@ -219,11 +220,24 @@ class LessLexer:
|
||||
def token(self):
|
||||
"""
|
||||
"""
|
||||
if self.next:
|
||||
t = self.next
|
||||
self.next = None
|
||||
return t
|
||||
while True:
|
||||
t = self.lexer.token()
|
||||
if not t: return t
|
||||
if t.type == 't_ws' and self.last and self.last.type not in self.significant_ws:
|
||||
continue
|
||||
if t.type == '}' and self.last and self.last.type not in '{;}':
|
||||
self.next = t
|
||||
tok = lex.LexToken()
|
||||
tok.type = ';'
|
||||
tok.value = ';'
|
||||
tok.lineno = t.lineno
|
||||
tok.lexpos = t.lexpos
|
||||
self.last = tok
|
||||
return tok
|
||||
self.last = t
|
||||
break
|
||||
return t
|
||||
|
||||
@@ -23,3 +23,15 @@
|
||||
background: the, great, wall;
|
||||
border: 2px solid black;
|
||||
}
|
||||
.no_final_semi {
|
||||
color: white;
|
||||
}
|
||||
.no_final_semi1 {
|
||||
color: yellow;
|
||||
color: white;
|
||||
}
|
||||
@media all {
|
||||
html {
|
||||
padding: src('no semi in media block');
|
||||
}
|
||||
}
|
||||
|
||||
4
lesscpy/test/css/ws.min.css
vendored
4
lesscpy/test/css/ws.min.css
vendored
@@ -6,3 +6,7 @@
|
||||
.whitespace{color:black;}
|
||||
.white,.space,.mania{color:white;}
|
||||
.newlines{background:the,great,wall;border:2px solid black;}
|
||||
.no_final_semi{color:white;}
|
||||
.no_final_semi1{color:yellow;color:white;}
|
||||
@media all{html{padding:src('no semi in media block');}
|
||||
}
|
||||
|
||||
@@ -43,3 +43,17 @@
|
||||
.empty {
|
||||
|
||||
}
|
||||
.no_final_semi {
|
||||
color: white
|
||||
}
|
||||
.no_final_semi1 {
|
||||
color: yellow;
|
||||
color: white
|
||||
|
||||
|
||||
}
|
||||
@media all {
|
||||
html {
|
||||
padding: src('no semi in media block')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user