License | GPL-3.0-or-later |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Copyright: Oleg Grenrus
Synopsis
- newtype Comments = Comments [ByteString]
- unComments :: Comments -> [ByteString]
- nullComments :: Comments -> Bool
- attachComments :: ByteString -> [Field Position] -> ([Field Comments], Comments)
- overAnn :: forall a b. (FieldPath -> a -> b) -> [Field a] -> [Field b]
- extractComments :: ByteString -> [(Int, Comments)]
- data FieldPath
- fieldPathSize :: FieldPath -> Int
- fieldUniverseN :: [Field ann] -> [(FieldPath, Field ann)]
- fieldUniverse :: Field ann -> [(FieldPath, Field ann)]
- findPath :: (a -> Position) -> Int -> [(FieldPath, a)] -> Maybe FieldPath
Documentation
unComments :: Comments -> [ByteString] Source #
nullComments :: Comments -> Bool Source #
:: ByteString | source with comments |
-> [Field Position] | parsed source fields |
-> ([Field Comments], Comments) |
Returns a Field
forest with comments attached.
- Comments are attached to the field after it.
- A glitch: comments "inside" the field are attached to the field after it.
- End-of-file comments are returned separately.
extractComments :: ByteString -> [(Int, Comments)] Source #
Paths input paths. Essentially a list of offsets. Own type ofr safety.
fieldPathSize :: FieldPath -> Int Source #