Skip to content

Commit

Permalink
fix capture start
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Jun 17, 2024
1 parent 8244fa0 commit e1c7846
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/llguidance_ctrl/src/earley/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,8 +1021,9 @@ impl Parser {
.as_ref()
.unwrap();
let mut bytes = Vec::new();
if item.start_pos() + 1 < curr_idx {
bytes = self.row_infos[item.start_pos() + 1..curr_idx]
let capture_start = item.start_pos() ;
if capture_start < curr_idx {
bytes = self.row_infos[capture_start..curr_idx]
.iter()
.map(|ri| ri.lexeme.visible_bytes())
.collect::<Vec<_>>()
Expand Down

0 comments on commit e1c7846

Please sign in to comment.