-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
14 changed files
with
112 additions
and
24 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "pest_debugger" | ||
description = "pest grammar debugger" | ||
version = "2.7.0" | ||
version = "2.7.1" | ||
edition = "2021" | ||
authors = ["Dragoș Tiselice <[email protected]>", "Tomas Tauber <[email protected]>"] | ||
homepage = "https://pest.rs/" | ||
|
@@ -14,9 +14,9 @@ readme = "_README.md" | |
rust-version = "1.60" | ||
|
||
[dependencies] | ||
pest = { path = "../pest", version = "2.7.0" } | ||
pest_meta = { path = "../meta", version = "2.7.0" } | ||
pest_vm = { path = "../vm", version = "2.7.0" } | ||
pest = { path = "../pest", version = "2.7.1" } | ||
pest_meta = { path = "../meta", version = "2.7.1" } | ||
pest_vm = { path = "../vm", version = "2.7.1" } | ||
reqwest = { version = "= 0.11.13", default-features = false, features = ["blocking", "json", "default-tls"] } | ||
rustyline = "10" | ||
serde_json = "1" | ||
|
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,7 +1,7 @@ | ||
[package] | ||
name = "pest_derive" | ||
description = "pest's derive macro" | ||
version = "2.7.0" | ||
version = "2.7.1" | ||
edition = "2021" | ||
authors = ["Dragoș Tiselice <[email protected]>"] | ||
homepage = "https://pest.rs/" | ||
|
@@ -25,5 +25,5 @@ grammar-extras = ["pest_generator/grammar-extras"] | |
|
||
[dependencies] | ||
# for tests, included transitively anyway | ||
pest = { path = "../pest", version = "2.7.0", default-features = false } | ||
pest_generator = { path = "../generator", version = "2.7.0", default-features = false } | ||
pest = { path = "../pest", version = "2.7.1", default-features = false } | ||
pest_generator = { path = "../generator", version = "2.7.1", default-features = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
WHITESPACE = _{ " " | "\r" | "\n" | "\t" } | ||
|
||
|
||
identifier = { (ASCII_ALPHA | "_")+ } | ||
assign = { identifier ~ "<-" ~ identifier } |
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,29 @@ | ||
#![cfg_attr(not(feature = "std"), no_std)] | ||
extern crate alloc; | ||
#[cfg(not(feature = "std"))] | ||
use alloc::{format, vec::Vec}; | ||
|
||
#[cfg(feature = "grammar-extras")] | ||
use pest::Parser; | ||
use pest_derive::Parser; | ||
|
||
#[derive(Parser)] | ||
#[grammar = "../tests/oneormore.pest"] | ||
pub struct OneOrMoreParser; | ||
|
||
#[test] | ||
#[cfg(feature = "grammar-extras")] | ||
pub fn test_one_or_more() { | ||
let result = OneOrMoreParser::parse(Rule::assign, "k <- b\n"); | ||
assert!(result.is_ok()); | ||
let mut pairs = result.unwrap(); | ||
let pair = pairs.next().unwrap(); | ||
assert_eq!(pair.as_rule(), Rule::assign); | ||
let mut inner = pair.into_inner(); | ||
let lhs = inner.next().unwrap(); | ||
assert_eq!(lhs.as_rule(), Rule::identifier); | ||
assert_eq!(lhs.as_str(), "k"); | ||
let rhs = inner.next().unwrap(); | ||
assert_eq!(rhs.as_rule(), Rule::identifier); | ||
assert_eq!(rhs.as_str(), "b"); | ||
} |
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,7 +1,7 @@ | ||
[package] | ||
name = "pest_generator" | ||
description = "pest code generator" | ||
version = "2.7.0" | ||
version = "2.7.1" | ||
edition = "2021" | ||
authors = ["Dragoș Tiselice <[email protected]>"] | ||
homepage = "https://pest.rs/" | ||
|
@@ -20,8 +20,8 @@ not-bootstrap-in-src = ["pest_meta/not-bootstrap-in-src"] | |
grammar-extras = ["pest_meta/grammar-extras"] | ||
|
||
[dependencies] | ||
pest = { path = "../pest", version = "2.7.0", default-features = false } | ||
pest_meta = { path = "../meta", version = "2.7.0" } | ||
pest = { path = "../pest", version = "2.7.1", default-features = false } | ||
pest_meta = { path = "../meta", version = "2.7.1" } | ||
proc-macro2 = "1.0" | ||
quote = "1.0" | ||
syn = "2.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "pest_grammars" | ||
description = "pest popular grammar implementations" | ||
version = "2.7.0" | ||
version = "2.7.1" | ||
edition = "2021" | ||
authors = ["Dragoș Tiselice <[email protected]>"] | ||
homepage = "https://pest.rs/" | ||
|
@@ -14,8 +14,8 @@ readme = "_README.md" | |
rust-version = "1.60" | ||
|
||
[dependencies] | ||
pest = { path = "../pest", version = "2.7.0" } | ||
pest_derive = { path = "../derive", version = "2.7.0" } | ||
pest = { path = "../pest", version = "2.7.1" } | ||
pest_derive = { path = "../derive", version = "2.7.1" } | ||
|
||
[dev-dependencies] | ||
criterion = "0.5" | ||
|
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,7 +1,7 @@ | ||
[package] | ||
name = "pest_meta" | ||
description = "pest meta language parser and validator" | ||
version = "2.7.0" | ||
version = "2.7.1" | ||
edition = "2021" | ||
authors = ["Dragoș Tiselice <[email protected]>"] | ||
homepage = "https://pest.rs/" | ||
|
@@ -16,7 +16,7 @@ include = ["Cargo.toml", "src/**/*", "src/grammar.rs", "_README.md", "LICENSE-*" | |
rust-version = "1.60" | ||
|
||
[dependencies] | ||
pest = { path = "../pest", version = "2.7.0" } | ||
pest = { path = "../pest", version = "2.7.1" } | ||
once_cell = "1.8.0" | ||
|
||
[build-dependencies] | ||
|
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,7 +1,7 @@ | ||
[package] | ||
name = "pest" | ||
description = "The Elegant Parser" | ||
version = "2.7.0" | ||
version = "2.7.1" | ||
edition = "2021" | ||
authors = ["Dragoș Tiselice <[email protected]>"] | ||
homepage = "https://pest.rs/" | ||
|
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,7 +1,7 @@ | ||
[package] | ||
name = "pest_vm" | ||
description = "pest grammar virtual machine" | ||
version = "2.7.0" | ||
version = "2.7.1" | ||
edition = "2021" | ||
authors = ["Dragoș Tiselice <[email protected]>"] | ||
homepage = "https://pest.rs/" | ||
|
@@ -14,8 +14,8 @@ readme = "_README.md" | |
rust-version = "1.60" | ||
|
||
[dependencies] | ||
pest = { path = "../pest", version = "2.7.0" } | ||
pest_meta = { path = "../meta", version = "2.7.0" } | ||
pest = { path = "../pest", version = "2.7.1" } | ||
pest_meta = { path = "../meta", version = "2.7.1" } | ||
|
||
[features] | ||
grammar-extras = ["pest_meta/grammar-extras"] |
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