1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
3 // license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
4 // option. All files in the project carrying such notice may not be copied,
5 // modified, or distributed except according to those terms.
6 
7 #![cfg_attr(not(feature = "std"), no_std)]
8 extern crate alloc;
9 use alloc::{format, vec::Vec};
10 
11 #[macro_use]
12 extern crate pest;
13 #[macro_use]
14 extern crate pest_derive;
15 
16 #[derive(Parser)]
17 #[grammar_inline = "string = { \"abc\" }"]
18 struct GrammarParser;
19 
20 #[test]
inline_string()21 fn inline_string() {
22     parses_to! {
23         parser: GrammarParser,
24         input: "abc",
25         rule: Rule::string,
26         tokens: [
27             string(0, 3)
28         ]
29     };
30 }
31