summaryrefslogtreecommitdiffstats
path: root/crates/rebel-parse/src/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rebel-parse/src/ast.rs')
-rw-r--r--crates/rebel-parse/src/ast.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/rebel-parse/src/ast.rs b/crates/rebel-parse/src/ast.rs
index c7ddb7a..f9943d4 100644
--- a/crates/rebel-parse/src/ast.rs
+++ b/crates/rebel-parse/src/ast.rs
@@ -135,7 +135,7 @@ pub enum Literal<'a> {
Unit,
Boolean(bool),
Integer(u64),
- String(&'a str),
+ String(Vec<StringPiece<'a>>),
Tuple(Vec<Expr<'a>>),
Array(Vec<Expr<'a>>),
Map(Vec<MapEntry<'a>>),
@@ -158,6 +158,13 @@ impl<'a> Literal<'a> {
}
}
+#[derive(Clone, Debug, PartialEq, Eq)]
+pub enum StringPiece<'a> {
+ Chars(&'a str),
+ Escape(char),
+ Interp(Expr<'a>),
+}
+
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct MapEntry<'a> {
pub key: &'a str,