summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/incremental.rs5
-rw-r--r--src/parse/mod.rs6
-rw-r--r--src/parse/parser.rs7
3 files changed, 3 insertions, 15 deletions
diff --git a/src/parse/incremental.rs b/src/parse/incremental.rs
index 7418dd58..bb5288dc 100644
--- a/src/parse/incremental.rs
+++ b/src/parse/incremental.rs
@@ -138,7 +138,7 @@ impl Reparser<'_> {
// Similarly to above, the end of the edit must be in the
// reconsidered range. However, in markup mode, we need to extend
- // the reconsidered range by up to two nodes so that spaceing etc.
+ // the reconsidered range by up to two nodes so that spacing etc.
// results in the same tree.
//
// Therefore, there are two cases:
@@ -400,7 +400,7 @@ fn validate(
let mut right_pos = newborn_span.end;
for child in &superseded[superseded_range.end ..] {
- if child.kind().is_trivia() || child.kind() == &NodeKind::Parbreak {
+ if child.kind().is_trivia() {
right_pos += child.len();
continue;
}
@@ -451,7 +451,6 @@ impl NodeKind {
match self {
// These are all replaceable by other tokens.
Self::Linebreak
- | Self::Parbreak
| Self::Text(_)
| Self::TextInLine(_)
| Self::NonBreakingSpace
diff --git a/src/parse/mod.rs b/src/parse/mod.rs
index c14c45cf..bd217c1c 100644
--- a/src/parse/mod.rs
+++ b/src/parse/mod.rs
@@ -172,11 +172,7 @@ fn markup_node(p: &mut Parser, at_start: &mut bool) {
// Whitespace.
NodeKind::Space(newlines) => {
*at_start |= *newlines > 0;
- if *newlines < 2 {
- p.eat();
- } else {
- p.convert(NodeKind::Parbreak);
- }
+ p.eat();
return;
}
diff --git a/src/parse/parser.rs b/src/parse/parser.rs
index e495dbd0..545f6fd4 100644
--- a/src/parse/parser.rs
+++ b/src/parse/parser.rs
@@ -176,13 +176,6 @@ impl<'s> Parser<'s> {
}
}
- /// Eat the current token, but change its type.
- pub fn convert(&mut self, kind: NodeKind) {
- let marker = self.marker();
- self.eat();
- marker.convert(self, kind);
- }
-
/// Whether the current token is of the given type.
pub fn at(&self, kind: &NodeKind) -> bool {
self.peek() == Some(kind)