From e1285079745914b436a70cd1d9ee38dd4885a309 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Fri, 17 Oct 2014 17:20:23 -0300 Subject: Fix parsing of Unknown statements --- gerber/parser.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gerber') diff --git a/gerber/parser.py b/gerber/parser.py index 8f89211..4900cb1 100644 --- a/gerber/parser.py +++ b/gerber/parser.py @@ -262,7 +262,7 @@ class GerberParser(object): for i, line in enumerate(data): line = oldline + line.strip() - + # skip empty lines if not len(line): continue @@ -287,7 +287,7 @@ class GerberParser(object): (aperture, r) = self._match_one(self.APERTURE_STMT, line) if aperture: yield ApertureStmt(**aperture) - + did_something = True line = r continue @@ -334,7 +334,7 @@ class GerberParser(object): did_something = True line = r continue - + if False: print self.COORD_STMT.pattern print self.APERTURE_STMT.pattern @@ -345,6 +345,10 @@ class GerberParser(object): if line.find('*') > 0: yield UnknownStmt(line) + did_something = True + line = "" + continue + oldline = line def _match_one(self, expr, data): -- cgit