On Tue, 18 Dec 2018, Timur Tabi wrote:

> I want to write a Python script that will word-wrap long literal
> strings.  In order to do that properly, I need to know how many spaces
> the parameter is indented, so that I can guarantee that the string is
> wrapped at column 80.  Is that information available?
>
> Coccinelle puts long strings on their own line (in my case, it's
> always the second parameter), so I think all I will need is the indent
> amount that Coccinelle uses for multi-line function calls, not any
> specific parameter.

You only have access to the number of characters from the beginning of the
line (col field of a position variable), but you don't know whether those
characters are spaces or tabs.  If your software only uses spaces, then
the number would be reliable.

julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to