mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Define a point constructor for Span.
This commit is contained in:
parent
935acb47c3
commit
6356443dd1
@ -4,6 +4,7 @@
|
||||
-- Mostly taken from purescript's SourcePos definition.
|
||||
module Source.Span
|
||||
( Span(..)
|
||||
, point
|
||||
, spanFromSrcLoc
|
||||
, Pos(..)
|
||||
, line_
|
||||
@ -47,6 +48,9 @@ instance Lower Span where
|
||||
lowerBound = Span lowerBound lowerBound
|
||||
|
||||
|
||||
point :: Pos -> Span
|
||||
point p = Span p p
|
||||
|
||||
spanFromSrcLoc :: SrcLoc -> Span
|
||||
spanFromSrcLoc s = Span (Pos (srcLocStartLine s) (srcLocStartCol s)) (Pos (srcLocEndLine s) (srcLocEndCol s))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user