summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax')
-rw-r--r--src/syntax/highlight.rs6
-rw-r--r--src/syntax/mod.rs4
-rw-r--r--src/syntax/span.rs4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/syntax/highlight.rs b/src/syntax/highlight.rs
index 6470e4fb..7f5ee083 100644
--- a/src/syntax/highlight.rs
+++ b/src/syntax/highlight.rs
@@ -384,10 +384,10 @@ mod tests {
use Category::*;
#[track_caller]
- fn test(src: &str, goal: &[(Range<usize>, Category)]) {
+ fn test(text: &str, goal: &[(Range<usize>, Category)]) {
let mut vec = vec![];
- let source = Source::detached(src);
- let full = 0 .. src.len();
+ let source = Source::detached(text);
+ let full = 0 .. text.len();
highlight_node(source.root(), full, &mut |range, category| {
vec.push((range, category));
});
diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs
index eb070a04..c2b06efe 100644
--- a/src/syntax/mod.rs
+++ b/src/syntax/mod.rs
@@ -980,7 +980,7 @@ impl NodeKind {
Self::LineComment => "line comment",
Self::BlockComment => "block comment",
Self::Error(_, _) => "parse error",
- Self::Unknown(src) => match src.as_str() {
+ Self::Unknown(text) => match text.as_str() {
"*/" => "end of block comment",
_ => "invalid token",
},
@@ -1107,7 +1107,7 @@ impl Hash for NodeKind {
Self::LineComment => {}
Self::BlockComment => {}
Self::Error(pos, msg) => (pos, msg).hash(state),
- Self::Unknown(src) => src.hash(state),
+ Self::Unknown(text) => text.hash(state),
}
}
}
diff --git a/src/syntax/span.rs b/src/syntax/span.rs
index 3f66efa7..4eae4124 100644
--- a/src/syntax/span.rs
+++ b/src/syntax/span.rs
@@ -42,8 +42,8 @@ impl<T: Debug> Debug for Spanned<T> {
/// A unique identifier for a syntax node.
///
/// This is used throughout the compiler to track which source section an error
-/// or element stems from. Can be [mapped back](crate::source::SourceStore::range)
-/// to a source id + byte range for user facing display.
+/// or element stems from. Can be [mapped back](crate::source::Source::range)
+/// to a byte range for user facing display.
///
/// Span ids are ordered in the tree to enable quickly finding the node with
/// some id: