Add support for TF command (FileAttribute) from GerberX2#5
Add support for TF command (FileAttribute) from GerberX2#5shane-circuithub wants to merge 1 commit intomasterfrom
Conversation
|
This is completely untested right now, but I'm interested to see if either of you have any comments on the work so far before I go any further with it. |
457e3dd to
606a2d8
Compare
HanStolpo
left a comment
There was a problem hiding this comment.
This looks really good and clean great work, I only have question about using the TH constructor for "NPTH" attributes which I think should change, and then maybe we can add a round trip test to see that we can parse what we print, that is if we have a print for the gerber commands.
| parseVia :: MonadFail m => Field -> m Via | ||
| parseVia field = case field of | ||
| "PTH" -> pure TH | ||
| "NPTH" -> pure TH |
There was a problem hiding this comment.
why don't we have a distinct constructor for non plated through hole, I feel we are loosing vital information here, also you won't be able to print what you parse
|
I see we don't have a |
ocharles
left a comment
There was a problem hiding this comment.
All seems good to me! Just one suggestion - and I also agree with Handre's comment.
| (bytes, "") | ByteString.length bytes == 16 -> pure (MD5 bytes) | ||
| _ -> fail "Bad .MD5: must consist of exactly 32 hexadecimal digits" |
There was a problem hiding this comment.
You aren't actually checking both conditions of this error, which I think might lead to confusion later. I suggest we either do check that the digits are hexadecimal, or just drop this from the error message.
There was a problem hiding this comment.
I am checking the condition. If they weren't hexadecimal digits then decode (from base16-bytestring) would fail.
There was a problem hiding this comment.
Or at least wouldn't return 16 bytes of data with nothing leftover.
There was a problem hiding this comment.
Ah sorry, I missed the call to decode. Great!
I wouldn't ignore this comment, it's a fundamental architectural choice of the parser to try and faithfully parse the input into a data structure as close as possible to the input. |

No description provided.