diff --git a/Source/Converter/ESCLParser.cs b/Source/Converter/ESCLParser.cs index ed94d39d..c235f5eb 100644 --- a/Source/Converter/ESCLParser.cs +++ b/Source/Converter/ESCLParser.cs @@ -57,7 +57,6 @@ namespace CHeaderToXML public IEnumerable Parse(string[] lines) { char[] splitters = new char[] { ' ', '\t', ',', '(', ')', ';', '\n', '\r' }; - bool is_long_bitfield = false; // Line splitter Func split = line => @@ -66,12 +65,17 @@ namespace CHeaderToXML // Adds new enum to the accumulator (acc) Func, List> enum_name = (line, acc) => { + bool is_long_bitfield = false; + Func get_tokens = (_) => line.Trim("/*. ".ToCharArray()).Split(" _-+".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Select(t => { switch (t.ToLower()) { - case ("bitfield"): is_long_bitfield = true; return "Flags"; + case ("bitfield"): + is_long_bitfield = true; + return "Flags"; + default: if (t.ToLower() == Prefix) return "";