Perl-Critic / PPI

53 stars 44 forks source link

Add byte offsets for Tokens #186

Open ksurent opened 8 years ago

ksurent commented 8 years ago

This patch adds a new method that returns positions of the first and the last bytes of a Token (byte span). It comes in handy e.g. when building smart code viewer apps (PPI::Element->location() is not precise enough) or working with code analysis libraries (all libraries I'm aware of require byte offsets).