mkenums: Can't parse an enum value with value ','
Originally reported in Debian as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=457933 and wrongly forwarded to #65 (closed), but #65 (closed) is not really quite the same bug; still reproducible with 2.78.0.
To reproduce
Reproducer taken from the Debian bug.
$ cat > beef_instruction.h <<EOF
typedef enum {
BEEF_INSTRUCTION_NONE = '\0',
BEEF_INSTRUCTION_PREVIOUS = '<',
BEEF_INSTRUCTION_NEXT = '>',
BEEF_INSTRUCTION_INCREASE = '+',
BEEF_INSTRUCTION_DECREASE = '-',
BEEF_INSTRUCTION_LOOP_BEGIN = '[',
BEEF_INSTRUCTION_LOOP_END = ']',
BEEF_INSTRUCTION_READ = ',',
BEEF_INSTRUCTION_PRINT = '.',
BEEF_INSTRUCTION_TAPE_DUMP = '#'
} BeefInstructionValue;
EOF
$ glib-mkenums --identifier-prefix=Beef --vprod='@VALUENAME@' beef_instruction.h
Expected result
All items are parsed and output
Actual result
WARNING: Failed to parse "BEEF_INSTRUCTION_READ = ','," in beef_instruction.h
and BEEF_INSTRUCTION_READ
is missing from the output.