Skip to content

Commit

Permalink
fix: opening in error only having 1 bracket
Browse files Browse the repository at this point in the history
  • Loading branch information
InioX committed Oct 26, 2024
1 parent eb7d532 commit b56a70b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions matugen-parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,11 @@ impl<'a> Parser<'a> {
if !self.at(Kind::Lbracket) {
self.bump_until_not_at(Kind::Lbracket);
}
// println!("getting opening, {:?}", self.cur_kind());
self.last_bracket_start = self.get_opening().unwrap();

// We would only get the second bracket at the start without the -1,
// the opening will ALWAYS have two brackets unlike the closing, which
// might have an error inside of it (so we dont look ahead for the closing).
self.last_bracket_start = self.get_opening().unwrap() - 1;
let start = self.start_node();

let mut strings: Vec<TokenValue> = vec![];
Expand Down Expand Up @@ -333,8 +336,7 @@ impl<'a> Parser<'a> {
end: self.prev_token_end,
source: self.source,
filename: &self.filename,
line_number: self.lexer.cur_line,

line_number: self.lexer.cur_line,
})
}
}
Expand Down Expand Up @@ -369,8 +371,7 @@ impl<'a> Parser<'a> {
end: self.prev_token_end + 1,
source: self.source,
filename: &self.filename,
line_number: self.lexer.cur_line,

line_number: self.lexer.cur_line,
});
} else {
self.seen_dot = true;
Expand Down

0 comments on commit b56a70b

Please sign in to comment.