diff options
Diffstat (limited to 'src/pretty.rs')
| -rw-r--r-- | src/pretty.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/pretty.rs b/src/pretty.rs index bf475bf6..397bbc38 100644 --- a/src/pretty.rs +++ b/src/pretty.rs @@ -229,6 +229,8 @@ impl Pretty for Expr { Self::If(v) => v.pretty(p), Self::While(v) => v.pretty(p), Self::For(v) => v.pretty(p), + Self::Import(v) => v.pretty(p), + Self::Include(v) => v.pretty(p), } } } @@ -434,6 +436,31 @@ impl Pretty for ForPattern { } } +impl Pretty for ImportExpr { + fn pretty(&self, p: &mut Printer) { + p.push_str("import "); + self.path.pretty(p); + p.push_str(" using "); + self.imports.pretty(p); + } +} + +impl Pretty for Imports { + fn pretty(&self, p: &mut Printer) { + match self { + Self::Wildcard => p.push('*'), + Self::Idents(idents) => p.join(idents, ", ", |item, p| item.pretty(p)), + } + } +} + +impl Pretty for IncludeExpr { + fn pretty(&self, p: &mut Printer) { + p.push_str("include "); + self.path.pretty(p); + } +} + impl Pretty for Ident { fn pretty(&self, p: &mut Printer) { p.push_str(self.as_str()); |
