From 2fe5f36db233e6c45e0d6b2443b025baf173211e Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Thu, 21 May 2015 15:54:32 -0300 Subject: Fix ADD statement parsing for concatened statements. ADDxxx param statements were too greedy on the mofidiers and were matching more than it should in cases where there are no newlines after the statement like: '%ADD12C,0.305*%%LPD*%', in a single line. The '%' was not exluded form modifiers so it got confused with the %LPD*% concatened. top_copper.GTL example was changed to be in a single line now with no spaces at all and it works well. --- gerber/rs274x.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gerber/rs274x.py') diff --git a/gerber/rs274x.py b/gerber/rs274x.py index 20baaa7..5d1f5fe 100644 --- a/gerber/rs274x.py +++ b/gerber/rs274x.py @@ -144,12 +144,12 @@ class GerberParser(object): FS = r"(?PFS)(?P(L|T|D))?(?P(A|I))X(?P[0-7][0-7])Y(?P[0-7][0-7])" MO = r"(?PMO)(?P(MM|IN))" LP = r"(?PLP)(?P(D|C))" - AD_CIRCLE = r"(?PAD)D(?P\d+)(?PC)[,]?(?P[^,]*)?" - AD_RECT = r"(?PAD)D(?P\d+)(?PR)[,](?P[^,]*)" - AD_OBROUND = r"(?PAD)D(?P\d+)(?PO)[,](?P[^,]*)" - AD_POLY = r"(?PAD)D(?P\d+)(?PP)[,](?P[^,]*)" - AD_MACRO = r"(?PAD)D(?P\d+)(?P{name})[,]?(?P[^,]*)?".format(name=NAME) - AM = r"(?PAM)(?P{name})\*(?P.*)".format(name=NAME) + AD_CIRCLE = r"(?PAD)D(?P\d+)(?PC)[,]?(?P[^,%]*)?" + AD_RECT = r"(?PAD)D(?P\d+)(?PR)[,](?P[^,%]*)" + AD_OBROUND = r"(?PAD)D(?P\d+)(?PO)[,](?P[^,%]*)" + AD_POLY = r"(?PAD)D(?P\d+)(?PP)[,](?P[^,%]*)" + AD_MACRO = r"(?PAD)D(?P\d+)(?P{name})[,]?(?P[^,%]*)?".format(name=NAME) + AM = r"(?PAM)(?P{name})\*(?P[^%]*)".format(name=NAME) # begin deprecated AS = r"(?PAS)(?P(AXBY)|(AYBX))" -- cgit