This commit is contained in:
jtm
2012-03-15 19:14:24 +00:00
parent 417a340524
commit a2194e0d80
4 changed files with 44 additions and 0 deletions

View File

@@ -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

View File

@@ -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');
}
}

View File

@@ -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');}
}

View File

@@ -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')
}
}