On 06/21/2012 11:38 AM, SF Markus Elfring wrote:
>> Of course, you don't want an identifier metavariable, you want a string,
>> but it suffices to initialize the metavariable in the python code to a
>> string
>> that contains the string, including the extra ", that you want.
>
> Does your suggestion indicate that a name which is encapsulated by a
> SmPL identifier metavariable may also contain special characters like
> quotes?
SmPL rules will never give you an 'identifier' with special characters
in them. A 'constant' metavariable matching a string will of course
include one or more pairs of '"'.
> Is this a documented implementation detail that can only be used by the
> scripting interfaces?
It is documented that one can generate only 'identifier' metavariables
in the python rules. Coccinelle doesn't seem to verify the identifier
and I do use this feature to amend format strings. I never tried to pass
back invalid data so no clue how coccinelle would handle that.
bye
michael
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)