On Tue, 27 Dec 2011, SF Markus Elfring wrote:
function|return type|source file|line|column
my_safe_log|int|example1b.c|1|0
my_status|int|example1b.c|2|2
my_addition|int|example1b.c|7|4
Indeed, the value in the "column" column is the leftmost column position of
the
token or metavariable to which the position variable is attached. Both
results
look like they were doing the right thing.
Which number should be assigned to the first column of each line?
I believe it is 0, ie the number of spaces one would have to skip over to
reach the first character. This is the same strategy used by ocaml, eg in
the parser errors.
I have added 0-based to the mentions of column in the ocaml Coccilib man
page. Perhaps the same information will be transmitted to the python page
when there is one...
julia
Would you like to add any information to your documentation about counting
behaviour for position variables in the semantic patch language? ;-)
http://en.wikipedia.org/wiki/Zero-based_numbering
Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)