1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 15:35:14 +03:00

Add API to offset ranges in Info and Annotated.

This commit is contained in:
Rob Rix 2015-12-04 10:12:47 -05:00
parent 357a1aa16c
commit 1814806980

View File

@ -34,3 +34,5 @@ main = hspec $ do
where where
info source category = Info (totalRange source) (Range 0 0) (Set.fromList [ category ]) info source category = Info (totalRange source) (Range 0 0) (Set.fromList [ category ])
unchanged source category = Annotated (info source category, info source category) unchanged source category = Annotated (info source category, info source category)
offsetInfo by (Info (Range start end) lineRange categories) = Info (Range (start + by) end) lineRange categories
offsetAnnotated by (Annotated (left, right) syntax) = Annotated (offsetInfo by left, offsetInfo by right) syntax