From 246f239d9f40f633160f0c18f87a20922d4e77bb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:06:37 +0200 Subject: Merging debian version 1.65.0+dfsg1-2. Signed-off-by: Daniel Baumann --- vendor/pest_derive/tests/grammar.pest | 4 ++++ vendor/pest_derive/tests/grammar.rs | 31 ++++++++++++++++++++++++++++++ vendor/pest_derive/tests/grammar_inline.rs | 4 ++++ vendor/pest_derive/tests/lists.rs | 4 ++++ vendor/pest_derive/tests/reporting.rs | 4 ++++ 5 files changed, 47 insertions(+) (limited to 'vendor/pest_derive/tests') 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 , 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; @@ -245,6 +248,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! { @@ -782,6 +799,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! { 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] -- cgit v1.2.3