5 releases

0.2.0 Feb 16, 2024
0.1.3 Feb 11, 2024
0.1.2 Jan 10, 2024
0.1.1 Jul 18, 2023
0.1.0 Jun 2, 2023

#10 in #logo

MIT license

42KB
1K SLoC

Sourcepawn Lexer

Lossless Sourcepawn lexer build using Logos

Crates.io Crates.io Github release status Code coverage GitHub

Example

use sourcepawn_lsp::lexer::SourcepawnLexer;

fn main() {
    let lexer = SourcepawnLexer::new("int foo = 0;");
    for token in lexer {
        match token.token_kind {
            TokenKind::Literal(_) | TokenKind::Comment(_) => println("{:#?}", token.text()),
            _ => (),
        }
    }
}

Dependencies

~6–8MB
~156K SLoC