"Daniel Verite" <dan...@manitou-mail.org> writes: > Assuming we agree that redundant options should consistently > raise an error for a certain class of statements, could it be handled > at the grammar level?
I don't think this'd be a great idea. The grammar would have to do something pretty brute-force to check for duplication, whereas the individual statements typically know already whether they've seen an instance of a particular option. It will be kind of annoying to make similar changes in every statement, agreed. I wonder if there'd be any value in trying to make a subroutine that deconstructs a DefElem list according to a provided list of option names, allowing centralized handling of unknown-option and duplicate-option cases, and maybe sharing handling of the simpler cases such as boolean and integer options. I'm not quite sure what the output ought to look like though. Some sort of statement-specific struct would be really ideal, but C doesn't make that easy. regards, tom lane