From 9fae494a8da347a32cdcd3dcd714ba00aaff9664 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 25 Aug 2018 11:40:17 +0300 Subject: Move ParsedFile to top --- crates/libsyntax2/src/ast/mod.rs | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'crates/libsyntax2/src/ast') diff --git a/crates/libsyntax2/src/ast/mod.rs b/crates/libsyntax2/src/ast/mod.rs index ba80fc64e..6217c5b74 100644 --- a/crates/libsyntax2/src/ast/mod.rs +++ b/crates/libsyntax2/src/ast/mod.rs @@ -4,8 +4,7 @@ use itertools::Itertools; use smol_str::SmolStr; use { - SyntaxNode, SyntaxNodeRef, TreeRoot, SyntaxError, - SyntaxKind::*, + SyntaxNodeRef, SyntaxKind::*, }; pub use self::generated::*; @@ -37,28 +36,6 @@ pub trait AttrsOwner<'a>: AstNode<'a> { } } -#[derive(Clone, Debug)] -pub struct ParsedFile { - root: SyntaxNode -} - -impl ParsedFile { - pub fn parse(text: &str) -> Self { - let root = ::parse(text); - ParsedFile { root } - } - pub fn ast(&self) -> File { - File::cast(self.syntax()).unwrap() - } - pub fn syntax(&self) -> SyntaxNodeRef { - self.root.borrowed() - } - pub fn errors(&self) -> Vec { - self.syntax().root.syntax_root().errors.clone() - } - -} - impl<'a> FnDef<'a> { pub fn has_atom_attr(&self, atom: &str) -> bool { self.attrs() -- cgit v1.2.3