Skip to content

Commit

Permalink
Fix error range for command idents
Browse files Browse the repository at this point in the history
  • Loading branch information
Jupeyy committed Jan 17, 2025
1 parent 8fb2ed5 commit d15a796
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/command-parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,9 @@ fn parse_command<const S: usize>(
parse_command_ident(tokens, commands)
.map(|(s, range)| SynOrErr::Syn((Syn::Text(s), range)))
.unwrap_or_else(|range_err| {
let (err, range) = range_err
.unwrap_or_else(|| (anyhow!("No text was given"), range.clone()));
let (err, range) = range_err.unwrap_or_else(|| {
(anyhow!("No text was given"), range.end + 1..range.end + 2)
});
SynOrErr::ParseRes(CommandParseResult::InvalidCommandIdent {
range,
err: err.to_string(),
Expand Down

0 comments on commit d15a796

Please sign in to comment.