From 3acda65699dabb783d13a4e84b37d99509314f91 Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Sat, 13 Apr 2013 11:38:19 +0300 Subject: [PATCH] show line numbers on unknown tokens --- src/mapcss/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mapcss/__init__.py b/src/mapcss/__init__.py index 0407ca3..56ffa1e 100644 --- a/src/mapcss/__init__.py +++ b/src/mapcss/__init__.py @@ -187,6 +187,7 @@ class MapCSS(): sc=StyleChooser(self.scalepair) #currently being assembled #choosers=[] #o = [] + css_orig = css while (css): # CSS comment @@ -223,9 +224,6 @@ class MapCSS(): css = NOT_CLASS.sub("", css) sc.addCondition(Condition('ne',("::class",cond))) previous=oCONDITION; - #css=css.replace(NOT_CLASS,''); - #sc.addCondition(new Condition('unset',o[1])); - #previous=oCONDITION; #// Zoom elif ZOOM.match(css): @@ -278,7 +276,7 @@ class MapCSS(): #// Unknown pattern elif UNKNOWN.match(css): - log.warning("unknown thing found: %s"%(UNKNOWN.match(css).group())) + log.warning("unknown thing found on line %s: %s"%(unicode(css_orig[:-len(unicode(css))]).count("\n")+1, UNKNOWN.match(css).group())) css=UNKNOWN.sub("",css) else: