diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-10-10 22:41:56 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-10-10 22:41:56 +0200 |
| commit | c216a4fc26c72938ddad60bc5fe4fa9e45263b30 (patch) | |
| tree | 0a563e3076a8d0724d0361b5d81a2b8d07d15cbe | |
| parent | 51bf3268ddf5db1bdd61e59bfb4a30f0463a4bfb (diff) | |
Flatten ast module back into syntax module 🌪
| -rw-r--r-- | src/parse/tokens.rs | 3 | ||||
| -rw-r--r-- | src/syntax/ast/mod.rs | 14 | ||||
| -rw-r--r-- | src/syntax/expr.rs (renamed from src/syntax/ast/expr.rs) | 0 | ||||
| -rw-r--r-- | src/syntax/lit.rs (renamed from src/syntax/ast/lit.rs) | 0 | ||||
| -rw-r--r-- | src/syntax/mod.rs | 14 | ||||
| -rw-r--r-- | src/syntax/node.rs (renamed from src/syntax/ast/node.rs) | 0 |
6 files changed, 11 insertions, 20 deletions
diff --git a/src/parse/tokens.rs b/src/parse/tokens.rs index f53ab586..3a90e114 100644 --- a/src/parse/tokens.rs +++ b/src/parse/tokens.rs @@ -4,8 +4,7 @@ use std::fmt::{self, Debug, Formatter}; use super::{is_newline, Scanner}; use crate::geom::Unit; -use crate::syntax::token::*; -use crate::syntax::{is_ident, Pos}; +use crate::syntax::*; use TokenMode::*; diff --git a/src/syntax/ast/mod.rs b/src/syntax/ast/mod.rs deleted file mode 100644 index 60a958a4..00000000 --- a/src/syntax/ast/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -//! Abstract syntax tree definition. - -mod expr; -mod lit; -mod node; - -pub use expr::*; -pub use lit::*; -pub use node::*; - -use super::{Ident, SpanVec, Spanned}; - -/// A collection of nodes which form a tree together with the nodes' children. -pub type SynTree = SpanVec<SynNode>; diff --git a/src/syntax/ast/expr.rs b/src/syntax/expr.rs index 09729f52..09729f52 100644 --- a/src/syntax/ast/expr.rs +++ b/src/syntax/expr.rs diff --git a/src/syntax/ast/lit.rs b/src/syntax/lit.rs index 40b360da..40b360da 100644 --- a/src/syntax/ast/lit.rs +++ b/src/syntax/lit.rs diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs index 8b716da4..81702201 100644 --- a/src/syntax/mod.rs +++ b/src/syntax/mod.rs @@ -1,12 +1,18 @@ //! Syntax types. -pub mod ast; -pub mod token; - +mod expr; mod ident; +mod lit; +mod node; mod span; +mod token; -pub use ast::*; +pub use expr::*; pub use ident::*; +pub use lit::*; +pub use node::*; pub use span::*; pub use token::*; + +/// A collection of nodes which form a tree together with the nodes' children. +pub type SynTree = SpanVec<SynNode>; diff --git a/src/syntax/ast/node.rs b/src/syntax/node.rs index 102ef3b5..102ef3b5 100644 --- a/src/syntax/ast/node.rs +++ b/src/syntax/node.rs |
