MS filters

This commit is contained in:
jtm
2012-03-23 19:39:29 +00:00
parent 836cf8669c
commit 6ffa0227da
5 changed files with 18 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ class LessLexer:
'css_important',
'css_vendor_hack',
'css_uri',
'css_ms_filter',
'less_variable',
'less_comment',
@@ -83,6 +84,10 @@ class LessLexer:
'|(not|lang|nth-[a-z\-]+)\(.+\)'
'|and[ \t]\(.+\)')
return t
def t_css_ms_filter(self, t):
r'progid:[^;]*'
return t
def t_css_ident(self, t):
(r'([\-\.\#]?'

View File

@@ -373,6 +373,7 @@ class LessParser(object):
| vendor_property
| istring
| fcall
| css_ms_filter
"""
p[0] = p[1]

View File

@@ -41,9 +41,9 @@ def ldirectory(inpath, outpath, args, scope):
recompile = True
if recompile:
if args.verbose: print("%s -> %s" % (lf, outf))
p = parser.LessParser(yacc_debug=False,
p = parser.LessParser(yacc_debug=(args.debug),
lex_optimize=True,
yacc_optimize=True,
yacc_optimize=(not args.debug),
scope=scope,
tabfile=yacctab,
verbose=args.verbose)
@@ -112,10 +112,9 @@ def run():
scope = None
if args.include:
for u in args.include.split(','):
p = parser.LessParser(
yacc_debug=False,
p = parser.LessParser(yacc_debug=(args.debug),
lex_optimize=True,
yacc_optimize=True,
yacc_optimize=(not args.debug),
tabfile=yacctab,
verbose=args.verbose)
p.parse(filename=u, debuglevel=0)

View File

@@ -2,6 +2,12 @@
@import 'some/other.css.file.CSS';
@import 'some.css' all;
@import "some.print.css" print;
.mixin {
color: red;
}
.mixin {
color: red;
}
.import {
color: red;
width: 6px;

View File

@@ -2,4 +2,6 @@
@import 'some/other.css.file.CSS';
@import 'some.css' all;
@import "some.print.css" print;
.mixin{color:red;}
.mixin{color:red;}
.import{color:red;width:6px;height:9px;}