Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
(empty lexemes)
  • Loading branch information
mmoskal committed Jul 3, 2024
1 parent cd7490a commit aaeed3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions controllers/llguidance_ctrl/src/earley/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,12 @@ impl Parser {
}

pub fn lexer_allows_eos(&mut self) -> bool {
let curr = self.lexer_state();
self.lexer.allows_eos(curr.lexer_state)
if self.has_pending_lexeme_bytes() {
self.lexer.allows_eos(self.lexer_state().lexer_state)
} else {
// empty lexemes are not allowed
false
}
}

fn item_to_string(&self, idx: usize) -> String {
Expand Down

0 comments on commit aaeed3f

Please sign in to comment.