osa1 / lexgen

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

Move common types to a runtime lib, implement location tracking #25

Closed osa1 closed 2 years ago

osa1 commented 2 years ago

This moves code common to all lexers to a runtime library called lexgen_util. This library is not to be used by users.

This has a few advantages:

This also implement location tracking. Instead of byte indices, we now return

struct Loc {
    line: u32,
    col: u32,
    byte_idx: usize,
}

Fixes #26

osa1 commented 2 years ago

This is ready, just need to update README and CHANGELOG.