aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parse/mod.rs22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/parse/mod.rs b/src/parse/mod.rs
index 449df98..e7a2d1d 100644
--- a/src/parse/mod.rs
+++ b/src/parse/mod.rs
@@ -962,10 +962,7 @@ impl Parse for ExpString {
while !delim.try_end(b) {
if !b.has() {
if b.is_completion() {
- b.highlights.push(Highlight {
- span: begin.to(b.loc_u32()),
- kind: HighlightKind::Other(OtherHighlights::String),
- });
+ b.highlight_from(begin, OtherHighlights::String);
break 'outer;
} else {
return Err(ParseError::Eof);
@@ -1091,11 +1088,7 @@ impl Parse for ExpString {
}
if !delim.is_none() {
- let end = b.loc_u32();
- b.highlights.push(Highlight {
- span: begin.to(end),
- kind: HighlightKind::Other(OtherHighlights::String),
- });
+ b.highlight_from(begin, OtherHighlights::String);
}
}
@@ -1675,10 +1668,7 @@ impl<'a> Cursor<'a> {
};
if result.is_ok() {
- self.highlights.push(Highlight {
- span,
- kind: HighlightKind::Keyword(kw),
- })
+ self.highlight(span, kw);
}
result
@@ -1841,12 +1831,8 @@ impl Parse for Ast<PreExpansion> {
fn parse(b: &mut Cursor<'_>) -> Result<Self> {
let begin = b.loc();
let result = Ast::parse_inner(b);
- let span = begin.to(b.loc_u32());
if result.is_ok() {
- b.highlights.push(Highlight {
- span,
- kind: HighlightKind::None,
- });
+ b.highlight_from(begin, HighlightKind::None);
}
result
}