Closed JuRichter closed 1 year ago
Hi @JuRichter , thanks for the feedback. The regex to parse the enum custom property has been modified to correctly read more white-spaces without the need of the Split() function. This will be available in the next release.
Regards
Thanks a lot!
One of the last changes to the regex for parsing enum definitions caused a strange issue.
Assume this definition:
BA_DEF_ BU_ "AttributeName" ENUM "Val1","Val2","Val3";
Parsing this definition would duplicate the last value.
.Values = { "Val1", "Val2", "Val3Val3" };
I submitted a PR (#46) to fix the issue and add some test code.
Line in dbc file:
BA_DEF_ BO_ "GenMsgSendType" ENUM "Cyclic","Event","CyclicIfActive","SpontanWithDelay","CyclicAndSpontan";
Propose fix in PropertiesDefinitionLineParser.cs: Line 16: Add:
private readonly char[] PropertySeparatorChar = { ' ' };
Line 92: Replace:
var enumDefinition = match.Groups[10].Value.Replace("\"", "").Split(' ')[1];
By:var enumDefinition = match.Groups[10].Value.Replace("\"", "").Split(PropertySeparatorChar, StringSplitOptions.RemoveEmptyEntries)[1];