summaryrefslogtreecommitdiffstats
path: root/crates/rebel-parse/src/grammar/recipe.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rebel-parse/src/grammar/recipe.rs')
-rw-r--r--crates/rebel-parse/src/grammar/recipe.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/rebel-parse/src/grammar/recipe.rs b/crates/rebel-parse/src/grammar/recipe.rs
index 6bd96bb..49b1689 100644
--- a/crates/rebel-parse/src/grammar/recipe.rs
+++ b/crates/rebel-parse/src/grammar/recipe.rs
@@ -97,9 +97,9 @@ peg::parser! {
/ [Token::Number(content)] { ?
ast::Literal::number(content)
}
- / [Token::String(String { content, .. })] {
- let ast_pieces = vec![ast::StringPiece::Chars(content)];
- ast::Literal::String(ast_pieces)
+ / [Token::String(String { pieces, .. })] { ?
+ let ast_pieces = pieces.iter().map(|piece| piece.try_into()).collect::<Result<_, _>>()?;
+ Ok(ast::Literal::String(ast_pieces))
}
/ p('(') p(')') { ast::Literal::Unit }
/ p('(') elements:(expr() ** p(',')) p(',')? p(')') {