diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:31 +0000 |
commit | 2ff14448863ac1a1dd9533461708e29aae170c2d (patch) | |
tree | 85b9fea2bbfe3f06473cfa381eed11f273b57c5c /vendor/pest_derive/tests | |
parent | Adding debian version 1.64.0+dfsg1-1. (diff) | |
download | rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.tar.xz rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.zip |
Adding debian version 1.65.0+dfsg1-2.debian/1.65.0+dfsg1-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/pest_derive/tests/grammar.pest | 4 | ||||
-rw-r--r-- | vendor/pest_derive/tests/grammar.rs | 31 | ||||
-rw-r--r-- | vendor/pest_derive/tests/grammar_inline.rs | 4 | ||||
-rw-r--r-- | vendor/pest_derive/tests/lists.rs | 4 | ||||
-rw-r--r-- | vendor/pest_derive/tests/reporting.rs | 4 |
5 files changed, 47 insertions, 0 deletions
diff --git a/vendor/pest_derive/tests/grammar.pest b/vendor/pest_derive/tests/grammar.pest index 43a7b8cfd..126f112d3 100644 --- a/vendor/pest_derive/tests/grammar.pest +++ b/vendor/pest_derive/tests/grammar.pest @@ -22,6 +22,7 @@ sequence_atomic_compound = @{ sequence_compound } sequence_nested = { string ~ string } sequence_compound_nested = ${ sequence_nested } choice = { string | range } +choice_prefix = { | string | range } optional = { string? } repeat = { string* } repeat_atomic = @{ string* } @@ -36,6 +37,9 @@ repeat_max = { string{, 2} } repeat_max_atomic = @{ string{, 2} } soi_at_start = { SOI ~ string } repeat_mutate_stack = { (PUSH('a'..'c') ~ ",")* ~ POP ~ POP ~ POP } +repeat_mutate_stack_pop_all = { (PUSH('a'..'c') ~ ",")* ~ POP_ALL } +will_fail = { repeat_mutate_stack_pop_all ~ "FAIL" } +stack_resume_after_fail = { will_fail | repeat_mutate_stack_pop_all } peek_ = { PUSH(range) ~ PUSH(range) ~ PEEK ~ PEEK } peek_all = { PUSH(range) ~ PUSH(range) ~ PEEK_ALL } peek_slice_23 = { PUSH(range) ~ PUSH(range) ~ PUSH(range) ~ PUSH(range) ~ PUSH(range) ~ PEEK[1..-2] } diff --git a/vendor/pest_derive/tests/grammar.rs b/vendor/pest_derive/tests/grammar.rs index 799beb7e0..57bed9072 100644 --- a/vendor/pest_derive/tests/grammar.rs +++ b/vendor/pest_derive/tests/grammar.rs @@ -6,6 +6,9 @@ // license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. All files in the project carrying such notice may not be copied, // modified, or distributed except according to those terms. +#![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; +use alloc::{format, vec::Vec}; #[macro_use] extern crate pest; @@ -246,6 +249,20 @@ fn choice_range() { } #[test] +fn choice_prefix() { + parses_to! { + parser: GrammarParser, + input: "abc", + rule: Rule::choice_prefix, + tokens: [ + choice_prefix(0, 3, [ + string(0, 3) + ]) + ] + }; +} + +#[test] fn optional_string() { parses_to! { parser: GrammarParser, @@ -783,6 +800,20 @@ fn repeat_mutate_stack() { } #[test] +fn stack_resume_after_fail() { + parses_to! { + parser: GrammarParser, + input: "a,b,c,cba", + rule: Rule::stack_resume_after_fail, + tokens: [ + stack_resume_after_fail(0, 9, [ + repeat_mutate_stack_pop_all(0, 9) + ]) + ] + }; +} + +#[test] fn checkpoint_restore() { parses_to! { parser: GrammarParser, diff --git a/vendor/pest_derive/tests/grammar_inline.rs b/vendor/pest_derive/tests/grammar_inline.rs index 2cc730afc..549a8145e 100644 --- a/vendor/pest_derive/tests/grammar_inline.rs +++ b/vendor/pest_derive/tests/grammar_inline.rs @@ -4,6 +4,10 @@ // option. All files in the project carrying such notice may not be copied, // modified, or distributed except according to those terms. +#![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; +use alloc::{format, vec::Vec}; + #[macro_use] extern crate pest; #[macro_use] diff --git a/vendor/pest_derive/tests/lists.rs b/vendor/pest_derive/tests/lists.rs index 4ba0effce..3678b603b 100644 --- a/vendor/pest_derive/tests/lists.rs +++ b/vendor/pest_derive/tests/lists.rs @@ -7,6 +7,10 @@ // option. All files in the project carrying such notice may not be copied, // modified, or distributed except according to those terms. +#![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; +use alloc::{format, vec::Vec}; + #[macro_use] extern crate pest; #[macro_use] diff --git a/vendor/pest_derive/tests/reporting.rs b/vendor/pest_derive/tests/reporting.rs index aa0a974e0..8a41bef72 100644 --- a/vendor/pest_derive/tests/reporting.rs +++ b/vendor/pest_derive/tests/reporting.rs @@ -7,6 +7,10 @@ // option. All files in the project carrying such notice may not be copied, // modified, or distributed except according to those terms. +#![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; +use alloc::vec; + #[macro_use] extern crate pest; #[macro_use] |