Skip to content

Commit

Permalink
Define a position comparison function
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Sep 4, 2024
1 parent 3b57e33 commit 2da2638
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Sources/Ligature/TextTokenizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public protocol TextTokenizer<TextRange> {

typealias Position = TextRange.Bound
typealias RangeBuilder = (Position, Position) -> TextRange?
typealias PositionComparator = (Position, Position) -> Bool

func position(from position: Position, toBoundary granularity: TextGranularity, inDirection direction: TextDirection) -> Position?
func rangeEnclosingPosition(_ position: Position, with granularity: TextGranularity, inDirection direction: TextDirection) -> TextRange?
Expand Down

0 comments on commit 2da2638

Please sign in to comment.