diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-09-20 13:05:55 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-09-20 16:37:15 +0200 |
| commit | 757a701c1aa2a6fb80033c7e75666661818da6f9 (patch) | |
| tree | 0415fec94d3856f4ebc97a1744cf2ba75fe8e7aa /src/syntax | |
| parent | e29f55bb294cc298daad97accf6d8a76976b409c (diff) | |
A New World
Diffstat (limited to 'src/syntax')
| -rw-r--r-- | src/syntax/highlight.rs | 6 | ||||
| -rw-r--r-- | src/syntax/mod.rs | 4 | ||||
| -rw-r--r-- | src/syntax/span.rs | 4 |
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: |
