diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-06-10 23:53:20 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-06-10 23:54:16 +0200 |
| commit | ed6550fdb08eae92bffab6b6b137b1e0eebf62c6 (patch) | |
| tree | 74152a38f7aa2ed2ac2fa190e81494422700ca36 /src/parse/parser.rs | |
| parent | 6aff11057bc88257c9383137952bb41b5b85c3dc (diff) | |
Bump dependencies
Diffstat (limited to 'src/parse/parser.rs')
| -rw-r--r-- | src/parse/parser.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/parse/parser.rs b/src/parse/parser.rs index 722e53ce..f4b02a9c 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -3,8 +3,7 @@ use std::mem; use std::ops::Range; use super::{TokenMode, Tokens}; -use crate::diag::ErrorPos; -use crate::syntax::{InnerNode, NodeData, NodeKind, SyntaxNode}; +use crate::syntax::{InnerNode, NodeData, NodeKind, SpanPos, SyntaxNode}; use crate::util::EcoString; /// A convenient token-based parser. @@ -385,7 +384,7 @@ impl Parser<'_> { pub fn unexpected(&mut self) { if let Some(found) = self.peek() { let msg = format_eco!("unexpected {}", found); - let error = NodeKind::Error(ErrorPos::Full, msg); + let error = NodeKind::Error(SpanPos::Full, msg); self.perform(error, Self::eat); } } @@ -399,7 +398,7 @@ impl Parser<'_> { /// Insert an error message that `what` was expected at the marker position. pub fn expected_at(&mut self, marker: Marker, what: &str) { let msg = format_eco!("expected {}", what); - let error = NodeKind::Error(ErrorPos::Full, msg); + let error = NodeKind::Error(SpanPos::Full, msg); self.children.insert(marker.0, NodeData::new(error, 0).into()); } @@ -409,7 +408,7 @@ impl Parser<'_> { match self.peek() { Some(found) => { let msg = format_eco!("expected {}, found {}", thing, found); - let error = NodeKind::Error(ErrorPos::Full, msg); + let error = NodeKind::Error(SpanPos::Full, msg); self.perform(error, Self::eat); } None => self.expected(thing), @@ -481,7 +480,7 @@ impl Marker { msg.push_str(", found "); msg.push_str(child.kind().as_str()); } - let error = NodeKind::Error(ErrorPos::Full, msg); + let error = NodeKind::Error(SpanPos::Full, msg); let inner = mem::take(child); *child = InnerNode::with_child(error, inner).into(); } |
