logos icon indicating copy to clipboard operation
logos copied to clipboard

Create ridiculously fast Lexers

Results 130 logos issues
Sort by recently updated
recently updated
newest added

```rust #[derive(Logos, Clone, PartialEq, Debug)] pub enum Token { #[error] Error, // identifiers #[regex("[a-zA-Z_][a-zA-Z0-9_\\.]*", |lex| String::from(lex.slice()))] Id(String), // i'd like to skip spaces after function, space is an operator in...

I have a strange issue where [logos][1] fails tests only on Windows builds. [This][2] is how I define the token types. I test it across [this custom script][3]. While MacOS...

handbook

I'm working on a lexer for a language where I'd like to have `else` and `else if` lexed as separate tokens, but I'm running into suprising behaviour. In the following...

bug

It would be neat if non-`'static` lifetimes could be used in extras. ```rust #[derive(Logos)] #[logos(extras = Option { #[error] Error, #[token("bar", |lex| lex.extras.unwrap())] Bar(&'a str), } ``` Currently, this fails...

enhancement
good first issue

I want to return `&str` of the underlying slice. ```rust fn remove_digit) -> Option { #[regex(r"\d[a-zA-Z]+", remove_digit)] WithNumber(&'a str), #[error] #[regex(r"[ \t\n\f\s]+", logos::skip, priority = 1000)] Error, } ``` Currently...

help wanted
good first issue
book

I'm making use of `Extras` to keep track of current line information, and in my parser I also want to `peek` the next token. The trouble is that if I...

enhancement
good first issue

I wonder if you would consider adding some syntactic sugar procedural macros for "case insensitive tokens" -- the way we have `#[token("foo")]`, if we want to match `Foo` and `FOO`...

handbook

At the moment errors are a single, opaque token. Is there a way to have more user-friendly, structured error values, with error recovery, instead of just returning `Token::Error`? It would...

enhancement

Following [this conversation](https://github.com/maciejhirsz/logos/issues/126#issuecomment-619441936) from #126, it's possible to construct a regex that will produce a state machine graph which would never produce a match ~given that Logos never backtracks across...

when writing a regex using word boundaries I get this ![image](https://user-images.githubusercontent.com/50386709/79793063-9aa0c200-8315-11ea-837a-d4964e683e3e.png) Is there any plan to support something like this?

handbook