Enum with extra ',' at the last item
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyclibrary |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
Hi, firstly thanks for sharing C parser, it helps me a lot.
By the way I got problem with the delimitedList and resolved here.
So I want to share my problem (would be common with people) and solution.
My C code has this kind of enum which have ',' with the last item.
By using pyparsing's delimitedList by default, it denies the last one.
Just resulted in not parsed by the CParser.
enum {
enum1=2,
enum2=0, enum3,
enum4,
enum5,
};
My solution:
I modified buildParser() so that it accepts extra ','.
Original code was
> self.enumType << Keyword('enum') + (Optional(
Modified to
> self.enumType << Keyword('enum') + (Optional(
Related branches
Changed in pyclibrary: | |
status: | Fix Committed → Confirmed |
status: | Confirmed → New |
status: | New → Fix Committed |
Thanks; fixed!