Closed Brainy0207 closed 1 year ago
Thank you for your contribution @Brainy0207 I will do a quick review and merge soon.
Hi @Brainy0207,
thanks for the contribution and for spotting the issue.
However I think there is room for improvement, your proposed solution is breaking the responsibility chain, IMHO.
The parsing related logic (i.e. syntax related stuff or string manipulation) should stay in the (line) parser and should not leak deeper into the builder or even further into the property value and/or definition.
Moreover, analysing code we realised that we are a bit loose on other properties, e.g. we are accepting for an int
property a value of "3"
which should not happen, that is a string
not an int
.
We are then reworking a bit and refactoring also adding to the IParseFailureObserver
the methods to notify the user among others:
int
property receiving a string
, a string
property receiving an int
, etc...)Thanks again for your contribution, it was a very helpful hint to improve code and parsing Feel free to review and comment our PR as soon as we push it.
A
No problem, I will have look at your PR then. My solution was just the minimal approach, to get stuff working as intended and I knew there was room for improvement, like proper argument or out of bound checks.
@Whitehouse112 merged his refactoring, please @Brainy0207 take a look and let us know if you like it
Thanks A
Looks great. Thanks for the quick work. Now I can ditch my local fork and use the official package again.
It seems like dbc files reference the enum value by index. Changed the parser logic to pass the quoted strings to handle both cases correctly and added an additional test.
Fixes #47