use name_range for ruby defns too, not just C
fix off-by-one error