-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After months of waiting for a response from @maciejhirsz, regarding the access to publishing to crates.io, I think it is better to move on and publish a new crate, logos2 (and related). The libraries' name is the same, but crates have a `2` appended at the end. This will allow to community to continue working on Logos, and publishing new releases when possible.
- Loading branch information
Showing
18 changed files
with
133 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
[profile] | ||
bench = {lto = true} | ||
release = {lto = true} | ||
|
||
[workspace] | ||
members = ["logos", "logos-cli", "logos-codegen", "logos-derive", "tests"] | ||
|
||
[profile] | ||
release = { lto = true } | ||
bench = { lto = true } | ||
[workspace.package] | ||
authors = ["Maciej Hirsz <[email protected]>"] | ||
categories = ["parsing", "text-processing"] | ||
description = "Create ridiculously fast Lexers" | ||
edition = "2021" | ||
homepage = "https://logos.maciej.codes/" | ||
keywords = ["lexer", "lexical", "tokenizer", "parser", "no_std"] | ||
license = "MIT OR Apache-2.0" | ||
readme = "README.md" | ||
repository = "https://github.com/maciejhirsz/logos" | ||
rust-version = "1.65.0" | ||
version = "0.13.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,5 +68,3 @@ for result in Token::lexer("Create ridiculously fast Lexers.") { | |
} | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
[package] | ||
[[bin]] | ||
name = "logos-cli" | ||
version = "0.13.0" | ||
license = "MIT OR Apache-2.0" | ||
description = "Create ridiculously fast Lexers" | ||
repository = "https://github.com/maciejhirsz/logos" | ||
documentation = "https://docs.rs/logos-derive" | ||
keywords = ["lexer", "lexical", "tokenizer", "parser", "no_std"] | ||
categories = ["parsing", "text-processing"] | ||
readme = "../README.md" | ||
edition = "2018" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
anyhow = "1.0.57" | ||
clap = { version = "3.1.18", features = ["derive"] } | ||
clap = {version = "3.1.18", features = ["derive"]} | ||
fs-err = "2.7.0" | ||
logos-codegen = { version = "0.13.0", path = "../logos-codegen" } | ||
logos-codegen2 = {version = "0.13.0", path = "../logos-codegen"} | ||
proc-macro2 = "1.0.39" | ||
|
||
[dev-dependencies] | ||
assert_cmd = "2.0.4" | ||
assert_fs = "1.0.7" | ||
predicates = "2.1.1" | ||
|
||
[package] | ||
name = "logos-cli2" | ||
authors.workspace = true | ||
categories.categories = true | ||
description.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
keywords.workspace = true | ||
license.workspace = true | ||
readme.workspace = true | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
version.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
enum Token { | ||
#[regex("a-z")] | ||
Letter, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# [derive (Debug , Clone , Copy , PartialEq)] enum Token { Letter , }impl < 's > :: logos :: Logos < 's > for Token { type Error = () ; type Extras = () ; type Source = str ; fn lex (lex : & mut :: logos :: Lexer < 's , Self >) { use :: logos :: internal :: { LexerInternal , CallbackResult } ; type Lexer < 's > = :: logos :: Lexer < 's , Token > ; fn _end < 's > (lex : & mut Lexer < 's >) { lex . end () } fn _error < 's > (lex : & mut Lexer < 's >) { lex . bump_unchecked (1) ; lex . error () ; } macro_rules ! _fast_loop { ($ lex : ident , $ test : ident , $ miss : expr) => { while let Some (arr) = $ lex . read :: < & [u8 ; 16] > () { if $ test (arr [0]) { if $ test (arr [1]) { if $ test (arr [2]) { if $ test (arr [3]) { if $ test (arr [4]) { if $ test (arr [5]) { if $ test (arr [6]) { if $ test (arr [7]) { if $ test (arr [8]) { if $ test (arr [9]) { if $ test (arr [10]) { if $ test (arr [11]) { if $ test (arr [12]) { if $ test (arr [13]) { if $ test (arr [14]) { if $ test (arr [15]) { $ lex . bump_unchecked (16) ; continue ; } $ lex . bump_unchecked (15) ; return $ miss ; } $ lex . bump_unchecked (14) ; return $ miss ; } $ lex . bump_unchecked (13) ; return $ miss ; } $ lex . bump_unchecked (12) ; return $ miss ; } $ lex . bump_unchecked (11) ; return $ miss ; } $ lex . bump_unchecked (10) ; return $ miss ; } $ lex . bump_unchecked (9) ; return $ miss ; } $ lex . bump_unchecked (8) ; return $ miss ; } $ lex . bump_unchecked (7) ; return $ miss ; } $ lex . bump_unchecked (6) ; return $ miss ; } $ lex . bump_unchecked (5) ; return $ miss ; } $ lex . bump_unchecked (4) ; return $ miss ; } $ lex . bump_unchecked (3) ; return $ miss ; } $ lex . bump_unchecked (2) ; return $ miss ; } $ lex . bump_unchecked (1) ; return $ miss ; } return $ miss ; } while $ lex . test ($ test) { $ lex . bump_unchecked (1) ; } $ miss } ; } # [inline] fn goto1_x < 's > (lex : & mut Lexer < 's >) { lex . set (Ok (Token :: Letter)) ; } # [inline] fn goto3_at1_with3 < 's > (lex : & mut Lexer < 's >) { match lex . read_at :: < & [u8 ; 2usize] > (1usize) { Some (b"-z") => { lex . bump_unchecked (3usize) ; goto1_x (lex) } , _ => _error (lex) , } } # [inline] fn goto4 < 's > (lex : & mut Lexer < 's >) { let arr = match lex . read :: < & [u8 ; 3usize] > () { Some (arr) => arr , None => return _end (lex) , } ; match arr [0] { b'a' => goto3_at1_with3 (lex) , _ => _error (lex) , } } goto4 (lex) } } | ||
# [derive (Debug , Clone , Copy , PartialEq)] enum Token { Letter , }impl < 's > :: logos :: Logos < 's > for Token { type Error = () ; type Extras = () ; type Source = str ; fn lex (lex : & mut :: logos :: Lexer < 's , Self >) { use :: logos :: internal :: { LexerInternal , CallbackResult } ; type Lexer < 's > = :: logos :: Lexer < 's , Token > ; fn _end < 's > (lex : & mut Lexer < 's >) { lex . end () } fn _error < 's > (lex : & mut Lexer < 's >) { lex . bump_unchecked (1) ; lex . error () ; } macro_rules ! _fast_loop { ($ lex : ident , $ test : ident , $ miss : expr) => { while let Some (arr) = $ lex . read :: < & [u8 ; 16] > () { if $ test (arr [0]) { if $ test (arr [1]) { if $ test (arr [2]) { if $ test (arr [3]) { if $ test (arr [4]) { if $ test (arr [5]) { if $ test (arr [6]) { if $ test (arr [7]) { if $ test (arr [8]) { if $ test (arr [9]) { if $ test (arr [10]) { if $ test (arr [11]) { if $ test (arr [12]) { if $ test (arr [13]) { if $ test (arr [14]) { if $ test (arr [15]) { $ lex . bump_unchecked (16) ; continue ; } $ lex . bump_unchecked (15) ; return $ miss ; } $ lex . bump_unchecked (14) ; return $ miss ; } $ lex . bump_unchecked (13) ; return $ miss ; } $ lex . bump_unchecked (12) ; return $ miss ; } $ lex . bump_unchecked (11) ; return $ miss ; } $ lex . bump_unchecked (10) ; return $ miss ; } $ lex . bump_unchecked (9) ; return $ miss ; } $ lex . bump_unchecked (8) ; return $ miss ; } $ lex . bump_unchecked (7) ; return $ miss ; } $ lex . bump_unchecked (6) ; return $ miss ; } $ lex . bump_unchecked (5) ; return $ miss ; } $ lex . bump_unchecked (4) ; return $ miss ; } $ lex . bump_unchecked (3) ; return $ miss ; } $ lex . bump_unchecked (2) ; return $ miss ; } $ lex . bump_unchecked (1) ; return $ miss ; } return $ miss ; } while $ lex . test ($ test) { $ lex . bump_unchecked (1) ; } $ miss } ; } # [inline] fn goto1_x < 's > (lex : & mut Lexer < 's >) { lex . set (Ok (Token :: Letter)) ; } # [inline] fn goto3_at1_with3 < 's > (lex : & mut Lexer < 's >) { match lex . read_at :: < & [u8 ; 2usize] > (1usize) { Some (b"-z") => { lex . bump_unchecked (3usize) ; goto1_x (lex) } , _ => _error (lex) , } } # [inline] fn goto4 < 's > (lex : & mut Lexer < 's >) { let arr = match lex . read :: < & [u8 ; 3usize] > () { Some (arr) => arr , None => return _end (lex) , } ; match arr [0] { b'a' => goto3_at1_with3 (lex) , _ => _error (lex) , } } goto4 (lex) } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
[package] | ||
name = "logos-codegen" | ||
version = "0.13.0" | ||
authors = ["Maciej Hirsz <[email protected]>"] | ||
license = "MIT OR Apache-2.0" | ||
description = "Implementation details for logos-codegen and logos-derive. Not for public consumption." | ||
repository = "https://github.com/maciejhirsz/logos" | ||
documentation = "https://docs.rs/logos-derive" | ||
keywords = ["lexer", "lexical", "tokenizer", "parser", "no_std"] | ||
categories = ["parsing", "text-processing"] | ||
readme = "../README.md" | ||
edition = "2018" | ||
|
||
[dependencies] | ||
beef = "0.5.0" | ||
fnv = "1.0.6" | ||
syn = { version = "2.0.13", features = ["full"] } | ||
lazy_static = "1.4.0" | ||
proc-macro2 = "1.0.9" | ||
quote = "1.0.3" | ||
proc-macro2 = "1.0.9" | ||
regex-syntax = "0.6" | ||
lazy_static = "1.4.0" | ||
|
||
[dev-dependencies] | ||
pretty_assertions = "0.6.1" | ||
|
||
[lib] | ||
name = "logos_codegen" | ||
|
||
[package] | ||
name = "logos-codegen2" | ||
authors.workspace = true | ||
categories.categories = true | ||
description.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
keywords.workspace = true | ||
license.workspace = true | ||
readme.workspace = true | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
version.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
[package] | ||
name = "logos-derive" | ||
version = "0.13.0" | ||
authors = ["Maciej Hirsz <[email protected]>"] | ||
license = "MIT OR Apache-2.0" | ||
description = "Create ridiculously fast Lexers" | ||
repository = "https://github.com/maciejhirsz/logos" | ||
documentation = "https://docs.rs/logos-derive" | ||
keywords = ["lexer", "lexical", "tokenizer", "parser", "no_std"] | ||
categories = ["parsing", "text-processing"] | ||
readme = "../README.md" | ||
edition = "2018" | ||
[dependencies] | ||
logos-codegen2 = {version = "0.13.0", path = "../logos-codegen"} | ||
|
||
[lib] | ||
name = "logos_derive" | ||
proc-macro = true | ||
|
||
[dependencies] | ||
logos-codegen = { version = "0.13.0", path = "../logos-codegen" } | ||
[package] | ||
name = "logos-derive2" | ||
authors.workspace = true | ||
categories.categories = true | ||
description.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
keywords.workspace = true | ||
license.workspace = true | ||
readme.workspace = true | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
version.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,13 @@ | ||
[package] | ||
name = "logos" | ||
version = "0.13.0" | ||
authors = ["Maciej Hirsz <[email protected]>"] | ||
license = "MIT OR Apache-2.0" | ||
description = "Create ridiculously fast Lexers" | ||
repository = "https://github.com/maciejhirsz/logos" | ||
documentation = "https://docs.rs/logos" | ||
keywords = ["lexer", "lexical", "tokenizer", "parser", "no_std"] | ||
categories = ["parsing", "text-processing"] | ||
readme = "../README.md" | ||
edition = "2021" | ||
rust-version = "1.65.0" | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
|
||
[dependencies] | ||
logos-derive = { version = "0.13.0", path = "../logos-derive", optional = true } | ||
logos-derive2 = {version = "0.13.0", path = "../logos-derive", optional = true} | ||
|
||
[dev-dependencies] | ||
ariadne = { version = "0.2.0", features = ["auto-color"] } | ||
|
||
[features] | ||
default = ["export_derive", "std"] | ||
|
||
# Should the crate use the standard library? | ||
std = [] | ||
|
||
# Re-exports the `Logos` derive macro, so that end user only needs to | ||
# import this crate and `use logos::Logos` to get both the trait and | ||
# derive proc macro. | ||
export_derive = ["logos-derive"] | ||
ariadne = {version = "0.2.0", features = ["auto-color"]} | ||
|
||
[[example]] | ||
doc-scrape-examples = true # Only needed once, because requires dev-dependencies | ||
name = "brainfuck" | ||
path = "examples/brainfuck.rs" | ||
doc-scrape-examples = true # Only needed once, because requires dev-dependencies | ||
|
||
[[example]] | ||
name = "custom_error" | ||
|
@@ -50,3 +20,34 @@ path = "examples/extras.rs" | |
[[example]] | ||
name = "json" | ||
path = "examples/json.rs" | ||
|
||
[features] | ||
default = ["export_derive", "std"] | ||
# Re-exports the `Logos` derive macro, so that end user only needs to | ||
# import this crate and `use logos::Logos` to get both the trait and | ||
# derive proc macro. | ||
export_derive = ["logos-derive2"] | ||
# Should the crate use the standard library? | ||
std = [] | ||
|
||
[lib] | ||
name = "logos" | ||
|
||
[package] | ||
name = "logos2" | ||
authors.workspace = true | ||
categories.categories = true | ||
description.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
keywords.workspace = true | ||
license.workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
readme.workspace = true | ||
repository.workspace = true | ||
rust-version.workspace = true | ||
version.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
[package] | ||
name = "tests" | ||
version = "0.0.0" | ||
authors = ["Maciej Hirsz <[email protected]>"] | ||
license = "MIT OR Apache-2.0" | ||
repository = "https://github.com/maciejhirsz/logos" | ||
edition = "2018" | ||
[[bench]] | ||
harness = false | ||
name = "bench" | ||
|
||
[dependencies] | ||
logos = { path = "../logos", default-features = false, features = ["std"] } | ||
logos-derive = { path = "../logos-derive" } | ||
logos-derive2 = {path = "../logos-derive"} | ||
logos2 = {path = "../logos", default-features = false, features = ["std"]} | ||
|
||
[dev-dependencies] | ||
criterion = "0.4" | ||
|
||
[[bench]] | ||
name = "bench" | ||
harness = false | ||
[package] | ||
name = "tests" | ||
publish = false | ||
version = "0.0.0" |