Skip to content

Commit

Permalink
Add previous_assci_char?.
Browse files Browse the repository at this point in the history
  • Loading branch information
I3oris committed Jun 10, 2024
1 parent 1469d88 commit 3443f4f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/char_reader.cr
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class TopDown::CharReader
char
end

def previous_assci_char? : Char?
self.source.to_slice[@char_reader.pos - 2]?.try &.chr
end

# Iterates over each *source* character.
#
# `location` is incremented between each character.
Expand Down

0 comments on commit 3443f4f

Please sign in to comment.