summaryrefslogtreecommitdiff
path: root/gerber
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@gmail.com>2014-10-17 17:20:23 -0300
committerPaulo Henrique Silva <ph.silva@gmail.com>2014-10-17 17:20:23 -0300
commite1285079745914b436a70cd1d9ee38dd4885a309 (patch)
treeb49276f36f640ee0cd18d5e59833dc1c5a25747c /gerber
parentfeda1a639b9ccf1d54938b31c511074b9243c814 (diff)
downloadgerbonara-e1285079745914b436a70cd1d9ee38dd4885a309.tar.gz
gerbonara-e1285079745914b436a70cd1d9ee38dd4885a309.tar.bz2
gerbonara-e1285079745914b436a70cd1d9ee38dd4885a309.zip
Fix parsing of Unknown statements
Diffstat (limited to 'gerber')
-rw-r--r--gerber/parser.py10
1 files changed, 7 insertions, 3 deletions
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):