summaryrefslogtreecommitdiff
path: root/src/source.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-04-24 17:52:02 +0200
committerLaurenz <laurmaedje@gmail.com>2022-04-24 18:00:36 +0200
commit2791f59ce2404d0483aee92b8231df95aa45b7a5 (patch)
tree13d4f86f8a3bd7c021dc43721f82b6ef23913e30 /src/source.rs
parent89927d7de069169eeecfa091d6b77408b69fe188 (diff)
Clean up the parser a bit
Diffstat (limited to 'src/source.rs')
-rw-r--r--src/source.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/source.rs b/src/source.rs
index 37aa96ca..a7c95255 100644
--- a/src/source.rs
+++ b/src/source.rs
@@ -10,7 +10,7 @@ use unscanny::Scanner;
use crate::diag::TypResult;
use crate::loading::{FileHash, Loader};
-use crate::parse::{is_newline, parse, Reparser};
+use crate::parse::{is_newline, parse, reparse};
use crate::syntax::ast::Markup;
use crate::syntax::{self, Category, GreenNode, RedNode};
use crate::util::{PathExt, StrExt};
@@ -228,8 +228,7 @@ impl SourceFile {
/// Edit the source file by replacing the given range and increase the
/// revision number.
///
- /// Returns the range of the section in the new source that was ultimately
- /// reparsed.
+ /// Returns the range in the new source that was ultimately reparsed.
///
/// The method panics if the `replace` range is out of bounds.
pub fn edit(&mut self, replace: Range<usize>, with: &str) -> Range<usize> {
@@ -256,7 +255,7 @@ impl SourceFile {
));
// Incrementally reparse the replaced range.
- Reparser::new(&self.src, replace, with.len()).reparse(&mut self.root)
+ reparse(&mut self.root, &self.src, replace, with.len())
}
/// Provide highlighting categories for the given range of the source file.