diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-01-04 00:27:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-04 00:27:05 +0100 |
| commit | 4c81a5d43eabd959dbb500a8076f99f21bd037bd (patch) | |
| tree | 03349230f74786c7128876889c07a31a4932f108 /src/syntax/ast.rs | |
| parent | 52761a3baa901865b1fc42366017740cfa7eb566 (diff) | |
| parent | c994cfa7d814e3909682b19322867ed5c676c453 (diff) | |
Merge pull request #48 from typst/parser-incr
Incremental parsing
Diffstat (limited to 'src/syntax/ast.rs')
| -rw-r--r-- | src/syntax/ast.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs index ae8ecdc9..bea4ef00 100644 --- a/src/syntax/ast.rs +++ b/src/syntax/ast.rs @@ -53,7 +53,7 @@ macro_rules! node { node! { /// The syntactical root capable of representing a full parsed document. - Markup + Markup: NodeKind::Markup(_) } impl Markup { @@ -65,7 +65,9 @@ impl Markup { NodeKind::Parbreak => Some(MarkupNode::Parbreak), NodeKind::Strong => Some(MarkupNode::Strong), NodeKind::Emph => Some(MarkupNode::Emph), - NodeKind::Text(s) => Some(MarkupNode::Text(s.clone())), + NodeKind::Text(s) | NodeKind::TextInLine(s) => { + Some(MarkupNode::Text(s.clone())) + } NodeKind::Escape(c) => Some(MarkupNode::Text((*c).into())), NodeKind::EnDash => Some(MarkupNode::Text('\u{2013}'.into())), NodeKind::EmDash => Some(MarkupNode::Text('\u{2014}'.into())), |
