From bc1b4216a802d09e8d00dd277a0e204d49bcaa7f Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 30 Sep 2020 12:38:02 +0200 Subject: =?UTF-8?q?Reorganize=20syntax=20types=20into=20two=20modules=20?= =?UTF-8?q?=F0=9F=93=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 1436dae1..7681f5b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,9 +2,9 @@ //! //! # Steps //! - **Parsing:** The parsing step first transforms a plain string into an -//! [iterator of tokens][tokens]. Then, a parser constructs a syntax tree from -//! the token stream. The structures describing the tree can be found in the -//! [syntax] module. +//! [iterator of tokens][tokens]. Then, a [parser] constructs a syntax tree +//! from the token stream. The structures describing the tree can be found in +//! the [syntax] module. //! - **Layouting:** The next step is to transform the syntax tree into a //! portable representation of the typesetted document. Types for these can be //! found in the [layout] module. A finished layout ready for exporting is a @@ -13,7 +13,8 @@ //! format. Submodules for these formats are located in the [export] module. //! Currently, the only supported output format is [_PDF_]. //! -//! [tokens]: syntax/tokens/struct.Tokens.html +//! [tokens]: parse/struct.Tokens.html +//! [parser]: parse/fn.parse.html //! [syntax]: syntax/index.html //! [layout]: layout/index.html //! [export]: export/index.html @@ -34,6 +35,7 @@ pub mod layout; pub mod length; pub mod library; pub mod paper; +pub mod parse; pub mod prelude; pub mod style; pub mod syntax; @@ -48,10 +50,7 @@ use crate::diagnostic::Diagnostics; use crate::font::SharedFontLoader; use crate::layout::{Commands, MultiLayout}; use crate::style::{LayoutStyle, PageStyle, TextStyle}; -use crate::syntax::decoration::Decorations; -use crate::syntax::parsing::parse; -use crate::syntax::span::{Offset, Pos}; -use crate::syntax::tree::SyntaxTree; +use crate::syntax::{Decorations, Offset, Pos, SyntaxTree}; /// Transforms source code into typesetted layouts. /// @@ -87,7 +86,7 @@ impl Typesetter { /// Parse source code into a syntax tree. pub fn parse(&self, src: &str) -> Pass { - parse(src) + parse::parse(src) } /// Layout a syntax tree and return the produced layout. -- cgit v1.2.3