mirror of
https://github.com/github/semantic.git
synced 2024-12-18 20:31:55 +03:00
Test whether the last element in a Line is open.
This commit is contained in:
parent
c2f54ce8d8
commit
200037b509
@ -8,6 +8,7 @@ import Syntax
|
|||||||
|
|
||||||
import Control.Comonad.Cofree
|
import Control.Comonad.Cofree
|
||||||
import Range
|
import Range
|
||||||
|
import Control.Monad
|
||||||
import Control.Monad.Free
|
import Control.Monad.Free
|
||||||
import Data.ByteString.Lazy.Internal
|
import Data.ByteString.Lazy.Internal
|
||||||
import Text.Blaze.Html5 hiding (map)
|
import Text.Blaze.Html5 hiding (map)
|
||||||
@ -238,10 +239,7 @@ openElement h = Just h
|
|||||||
openLine :: [Line] -> Maybe Line
|
openLine :: [Line] -> Maybe Line
|
||||||
openLine [] = Nothing
|
openLine [] = Nothing
|
||||||
openLine (EmptyLine : rest) = openLine rest
|
openLine (EmptyLine : rest) = openLine rest
|
||||||
openLine (line : _) = case maybeLast $ unLine line of
|
openLine (line : _) = const line <$> (join . maybeLast $ openElement <$> unLine line)
|
||||||
Just Break -> Nothing
|
|
||||||
Just _ -> Just line
|
|
||||||
Nothing -> Nothing
|
|
||||||
|
|
||||||
adjoin2Lines :: [Line] -> Line -> [Line]
|
adjoin2Lines :: [Line] -> Line -> [Line]
|
||||||
adjoin2Lines [] line = [line]
|
adjoin2Lines [] line = [line]
|
||||||
|
Loading…
Reference in New Issue
Block a user