Scanny
Scanny is a advanced text scanning library for Rust.
Installation
Example
A simple tokenizer using scanny.
use ;
Output
[
WithPos {
value: Let,
byte_pos: 9..12,
line_pos: 2..=2,
},
WithPos {
value: Mut,
byte_pos: 13..16,
line_pos: 2..=2,
},
WithPos {
value: Ident(
"foo",
),
byte_pos: 17..20,
line_pos: 2..=2,
},
WithPos {
value: Eq,
byte_pos: 21..22,
line_pos: 2..=2,
},
WithPos {
value: Number(
500,
),
byte_pos: 23..26,
line_pos: 2..=2,
},
WithPos {
value: Colon,
byte_pos: 26..27,
line_pos: 2..=2,
},
WithPos {
value: Let,
byte_pos: 36..39,
line_pos: 3..=3,
},
WithPos {
value: Ident(
"bar",
),
byte_pos: 40..43,
line_pos: 3..=3,
},
WithPos {
value: Eq,
byte_pos: 44..45,
line_pos: 3..=3,
},
WithPos {
value: String(
"Hello \\\" World\\\n'hello world' ",
),
byte_pos: 46..78,
line_pos: 3..=4,
},
WithPos {
value: Colon,
byte_pos: 78..79,
line_pos: 4..=4,
},
]
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.