Re: parser option handling

Bernhard Fischer <[email protected]> Sat, 5 May 2007 23:17:53 +0200
Newsgroups gmane.comp.documentation.synopsis
Message-ID <[email protected]>
On Sat, May 05, 2007 at 04:26:23PM -0400, Stefan Seefeld wrote:
>Bernhard Fischer wrote:

>> cppflags containing -std= is redundant, of course, but how would i pass
>> cppflags nowadays, if not via -D, -I etc?
>
>You wouldn't, when using the synopsis applet. (and '-std' is in fact not
>a recognized option. I'm not sure it is a good idea to allow unknown options
>to be passed through. Where I think it makes sense to pass them through is
>in the naming of the 'emulated_compiler' flag. (Logically 'gcc' and 'gcc -std=...'
>are two distinct compilers, as far as emulation goes.)

I'm now passing in in emulate_compiler, yes.

>
>> -U seems to be missing, btw.
>
>You are right. I'll add that.

It's already there :) See:
        else if (*(*i + 1) == 'D')
          ctx.add_macro_definition(*i + 2, true);
        else if (*(*i + 1) == 'U')
          ctx.remove_macro_definition(*i + 2);

Just the script didn't pass it down, like:
http://lists.fresco.org/pipermail/synopsis-devel/2007-May/000906.html

btw, is there a way to prevent macromap<ContextT>::add_macro() to call
back on us with is_predefined==true where we immediately bail out, or is
this a price that is too low to try to avoid it? Guess it doesn't make
sense to do this.