osa1 / lexgen

A fully-featured lexer generator, implemented as a proc macro
MIT License
63 stars 7 forks source link

Implement location tracking and a way to get a match's location #26

Closed osa1 closed 2 years ago

osa1 commented 2 years ago

Currently error messages return byte index of the error, and we don't provide a method to semantic actions for getting the current locations.

With error messages we should also (in addition to byte index) return the line and column number, and we should provide a method to get the current line and column number.

To allow attaching location information to tokens, we should also return the start and end locations of lexemes when calling semantic actions.