-
-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
7,741 additions
and
4,748 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
name = "chumsky" | ||
version = "0.9.2" | ||
description = "A parser library for humans with powerful error recovery" | ||
authors = ["Joshua Barretto <[email protected]>"] | ||
authors = ["Joshua Barretto <[email protected]>", "Elijah Hartvigsen <[email protected]", "Jakob Wiesmore <[email protected]>"] | ||
repository = "https://github.com/zesterer/chumsky" | ||
license = "MIT" | ||
keywords = ["parser", "combinator", "token", "language", "syntax"] | ||
|
@@ -14,24 +14,41 @@ exclude = [ | |
] | ||
|
||
[features] | ||
default = ["ahash", "std", "spill-stack"] | ||
# Use `ahash` instead of the standard hasher for maintaining sets of expected inputs | ||
# (Also used if `std` is disabled) | ||
ahash = [] | ||
default = ["std", "spill-stack", "memoization"] | ||
# Integrate with the standard library | ||
std = [] | ||
# Enable nightly-only features like better compiler diagnostics | ||
# Enable nightly-only features like better compiler diagnostics and a Parser impl for ! (the never type) | ||
nightly = [] | ||
# Allows deeper recursion by dynamically spilling stack state on to the heap | ||
spill-stack = ["stacker", "std"] | ||
# Allows parser memoisation, speeding up heavily back-tracking parsers and allowing left recursion | ||
memoization = [] | ||
|
||
[dependencies] | ||
# Used if `std` is disabled. | ||
# Provides `ahash` for the corresponding feature as it uses it by default. | ||
# Due to https://github.com/rust-lang/cargo/issues/1839, this can't be optional | ||
hashbrown = "0.12.3" | ||
hashbrown = "0.13" | ||
stacker = { version = "0.1", optional = true } | ||
# Enables regex combinators | ||
regex = { version = "1.7", optional = true } | ||
|
||
[dev-dependencies] | ||
ariadne = "0.1.2" | ||
pom = "3.0" | ||
ariadne = "0.1.5" | ||
pom = "3.2" | ||
nom = "7.1" | ||
serde_json = { version = "1.0", features = ["preserve_order"] } | ||
criterion = "0.4.0" | ||
pest = "2.5" | ||
pest_derive = "2.5" | ||
sn = "0.1" | ||
logos = "0.12" | ||
|
||
[[bench]] | ||
name = "json" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "lex" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "parser" | ||
harness = false |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
WHITESPACE = _{ " " | "\t" | "\r" | "\n" } | ||
|
||
object = { | ||
"{" ~ "}" | | ||
"{" ~ pair ~ ("," ~ pair)* ~ "}" | ||
} | ||
pair = { string ~ ":" ~ value } | ||
|
||
array = { | ||
"[" ~ "]" | | ||
"[" ~ value ~ ("," ~ value)* ~ "]" | ||
} | ||
|
||
value = _{ object | array | string | number | boolean | null } | ||
|
||
boolean = { "true" | "false" } | ||
|
||
null = { "null" } | ||
|
||
string = ${ "\"" ~ inner ~ "\"" } | ||
inner = @{ char* } | ||
char = { | ||
!("\"" | "\\") ~ ANY | ||
| "\\" ~ ("\"" | "\\" | "/" | "b" | "f" | "n" | "r" | "t") | ||
| "\\" ~ ("u" ~ ASCII_HEX_DIGIT{4}) | ||
} | ||
|
||
number = @{ | ||
"-"? | ||
~ ("0" | ASCII_NONZERO_DIGIT ~ ASCII_DIGIT*) | ||
~ ("." ~ ASCII_DIGIT*)? | ||
~ (^"e" ~ ("+" | "-")? ~ ASCII_DIGIT+)? | ||
} | ||
|
||
json = _{ SOI ~ (object | array) ~ EOI } |
Oops, something went wrong.