From aff36a4dca0d2d06b00c5f1e1a0703400fbe3b6b Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Thu, 21 May 2015 16:15:55 -0300 Subject: Fix multiline read of mixed statements (%XXX*% followed by DNN*) We now check if there is a %XXX*% command inside the line before considering it a multiline statement. --- gerber/rs274x.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gerber/rs274x.py') diff --git a/gerber/rs274x.py b/gerber/rs274x.py index 5d1f5fe..2af3ed6 100644 --- a/gerber/rs274x.py +++ b/gerber/rs274x.py @@ -241,10 +241,11 @@ class GerberParser(object): continue # deal with multi-line parameters - if line.startswith("%") and not line.endswith("%"): + if line.startswith("%") and not line.endswith("%") and not "%" in line[1:]: oldline = line continue + did_something = True # make sure we do at least one loop while did_something and len(line) > 0: did_something = False @@ -292,6 +293,7 @@ class GerberParser(object): # parameter (param, r) = _match_one_from_many(self.PARAM_STMT, line) + if param: if param["param"] == "FS": stmt = FSParamStmt.from_dict(param) -- cgit