diff options
| author | Martin <mhaug@live.de> | 2021-12-22 20:37:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-22 20:37:34 +0100 |
| commit | f6c7a8292dc1ab0560408fca9d74505e9d7cf13a (patch) | |
| tree | badd3076f6146cec34c55764600df5124c408521 /src/source.rs | |
| parent | 738ff7e1f573bef678932b313be9969a17af8d22 (diff) | |
| parent | 438255519e88bb790480306b9a9b452aaf054519 (diff) | |
Merge pull request #51 from typst/set-rules
Set rules
Diffstat (limited to 'src/source.rs')
| -rw-r--r-- | src/source.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/source.rs b/src/source.rs index 509b0a76..432688a0 100644 --- a/src/source.rs +++ b/src/source.rs @@ -149,7 +149,12 @@ impl SourceFile { Self::new(SourceId(0), Path::new(""), src.into()) } - /// The file's abstract syntax tree. + /// The root node of the file's untyped green tree. + pub fn root(&self) -> &Rc<GreenNode> { + &self.root + } + + /// The root node of the file's typed abstract syntax tree. pub fn ast(&self) -> TypResult<Markup> { let red = RedNode::from_root(self.root.clone(), self.id); let errors = red.errors(); |
