function Tags.get_forward_backward_by_key(way,data,key)
local forward = way:get_value_by_key(key .. ':forward')
local backward = way:get_value_by_key(key .. ':backward')
if not forward or not backward then
local common = way:get_value_by_key(key)
if (data.oneway) then
if data.is_forward_oneway then
forward = forward or common
end
if data.is_reverse_oneway then
backward = backward or common
end
else
forward = forward or common
backward = backward or common
end
end
return forward, backward
end
I'm reading this code and it's not easy to understand. I was wondering, what is the meaning of ":" and what is "data.oneway"? Any references are greatly appreciated.
EDIT: I just learned that this is a special syntax called object-oriented calls. An expression like o:foo(x) is just another way to write o.foo(o, x), that is, to call o.foo adding o as a first extra argument.