aboutsummaryrefslogtreecommitdiff
path: root/lib/src/make.rs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/make.rs')
-rw-r--r--lib/src/make.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/src/make.rs b/lib/src/make.rs
index facd247..cf371a2 100644
--- a/lib/src/make.rs
+++ b/lib/src/make.rs
@@ -29,3 +29,12 @@ pub fn inherit_stmt<'a>(nodes: impl IntoIterator<Item = &'a types::Ident>) -> ty
29 .join(" "); 29 .join(" ");
30 ast_from_text(&format!("{{ inherit {}; }}", inherited_idents)) 30 ast_from_text(&format!("{{ inherit {}; }}", inherited_idents))
31} 31}
32
33pub fn inherit_from_stmt<'a>(from: SyntaxNode, nodes: impl IntoIterator<Item = &'a types::Ident>) -> types::Inherit {
34 let inherited_idents = nodes
35 .into_iter()
36 .map(|i| i.as_str().to_owned())
37 .collect::<Vec<_>>()
38 .join(" ");
39 ast_from_text(&format!("{{ inherit ({}) {}; }}", from, inherited_idents))
40}