diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-11-08 13:08:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-08 13:08:15 +0100 |
| commit | c6f8ad35f45248f1fd36ee00195966f1629c6ca7 (patch) | |
| tree | 51faa3f6bbc56f75636823adeea135ed76e1b33b /src/lib.rs | |
| parent | ea6ee3f667e922ed2f21b08719a45d2395787932 (diff) | |
| parent | 38c5c362419c5eee7a4fdc0b43d3a9dfb339a6d2 (diff) | |
Merge pull request #46 from typst/parser-ng
Next Generation Parser
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -20,7 +20,7 @@ //! //! [tokens]: parse::Tokens //! [parsed]: parse::parse -//! [markup]: syntax::Markup +//! [markup]: syntax::ast::Markup //! [evaluate]: eval::eval //! [module]: eval::Module //! [layout tree]: layout::LayoutTree @@ -58,7 +58,6 @@ use crate::layout::{EvictionPolicy, LayoutCache}; use crate::loading::Loader; use crate::source::{SourceId, SourceStore}; use crate::style::Style; -use crate::syntax::Markup; /// The core context which holds the loader, configuration and cached artifacts. pub struct Context { @@ -100,14 +99,9 @@ impl Context { &self.style } - /// Parse a source file and return the resulting markup. - pub fn parse(&mut self, id: SourceId) -> TypResult<Markup> { - parse::parse(self.sources.get(id)) - } - /// Evaluate a source file and return the resulting module. pub fn evaluate(&mut self, id: SourceId) -> TypResult<Module> { - let ast = self.parse(id)?; + let ast = self.sources.get(id).ast()?; eval::eval(self, id, &ast) } |
