mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Define a ToJSONFields instance for SourceSpan.
This commit is contained in:
parent
70dd381f26
commit
862fb3654b
@ -96,6 +96,9 @@ instance ToJSONFields Range where
|
||||
instance ToJSONFields Category where
|
||||
toJSONFields c = ["category" .= case c of { Other s -> s ; _ -> toS c }]
|
||||
|
||||
instance ToJSONFields SourceSpan where
|
||||
toJSONFields SourceSpan{..} = [ "start" .= spanStart, "end" .= spanEnd ]
|
||||
|
||||
instance ToJSONFields a => ToJSONFields (Maybe a) where
|
||||
toJSONFields = maybe [] toJSONFields
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user