diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-06-30 11:40:27 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-06-30 11:40:27 +0200 |
| commit | 470f8001a1dba0022ec9d3e46c67c3bbc31359be (patch) | |
| tree | d68f60533201658148ea508c90ba704f806561d5 /src/parse/mod.rs | |
| parent | 45812b700114a51f0ee21e31f4454cde3729eaf5 (diff) | |
No more collisions between syntax::Tree and layout::Tree
Diffstat (limited to 'src/parse/mod.rs')
| -rw-r--r-- | src/parse/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parse/mod.rs b/src/parse/mod.rs index e8e16803..0afcd88b 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -19,19 +19,19 @@ use crate::syntax::visit::{mutable::visit_expr, VisitMut}; use crate::syntax::*; /// Parse a string of source code. -pub fn parse(src: &str) -> Pass<Tree> { +pub fn parse(src: &str) -> Pass<SyntaxTree> { let mut p = Parser::new(src); Pass::new(tree(&mut p), p.diags) } /// Parse a syntax tree. -fn tree(p: &mut Parser) -> Tree { +fn tree(p: &mut Parser) -> SyntaxTree { tree_while(p, true, &mut |_| true) } /// Parse a syntax tree that stays right of the column at the start of the next /// non-whitespace token. -fn tree_indented(p: &mut Parser) -> Tree { +fn tree_indented(p: &mut Parser) -> SyntaxTree { p.eat_while(|t| match t { Token::Space(n) => n == 0, Token::LineComment(_) | Token::BlockComment(_) => true, @@ -46,7 +46,7 @@ fn tree_indented(p: &mut Parser) -> Tree { } /// Parse a syntax tree. -fn tree_while<F>(p: &mut Parser, mut at_start: bool, f: &mut F) -> Tree +fn tree_while<F>(p: &mut Parser, mut at_start: bool, f: &mut F) -> SyntaxTree where F: FnMut(&mut Parser) -> bool, { @@ -72,7 +72,7 @@ where tree_while(self.p, true, self.f) } else { self.p.diag(error!(call.callee.span(), "duplicate wide call")); - Tree::default() + SyntaxTree::default() }; call.args.items.push(CallArg::Pos(Expr::Template(TemplateExpr { |
