Copyright | (C) CSIRO 2017-2018 |
---|---|
License | BSD3 |
Maintainer | Isaac Elliott <isaace71295@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Comment a = MkComment {
- _commentAnn :: a
- _commentValue :: String
Documentation
A Python single-line comment, such as on the following line:
y = x + 4 # add four to the value of x
In this case, the structure parsed would be
MkComment () " add four to the value of x"
with the hash being inferred, and the space after the hash being preserved.
Python does not have multi-line comments. There is a common convention of using a multi-line string expression as a multi-line comment, since a string expression is a no-op statement. Such multi-line comments are NOT represented with this data type, but rather as normal string expressions (since that's what they are).
MkComment | |
|
Instances
Functor Comment Source # | |
Foldable Comment Source # | |
Defined in Language.Python.Syntax.Comment fold :: Monoid m => Comment m -> m # foldMap :: Monoid m => (a -> m) -> Comment a -> m # foldr :: (a -> b -> b) -> b -> Comment a -> b # foldr' :: (a -> b -> b) -> b -> Comment a -> b # foldl :: (b -> a -> b) -> b -> Comment a -> b # foldl' :: (b -> a -> b) -> b -> Comment a -> b # foldr1 :: (a -> a -> a) -> Comment a -> a # foldl1 :: (a -> a -> a) -> Comment a -> a # elem :: Eq a => a -> Comment a -> Bool # maximum :: Ord a => Comment a -> a # minimum :: Ord a => Comment a -> a # | |
Traversable Comment Source # | |
Eq1 Comment Source # | |
Ord1 Comment Source # | |
Defined in Language.Python.Syntax.Comment | |
Eq a => Eq (Comment a) Source # | |
Ord a => Ord (Comment a) Source # | |
Defined in Language.Python.Syntax.Comment | |
Show a => Show (Comment a) Source # | |