mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
Add a function to align branch elements into their lines.
This commit is contained in:
parent
30bfae37aa
commit
24af4c4af5
@ -185,6 +185,10 @@ data BranchElement
|
||||
= Child String (Join These String {- newlines or asterisks -})
|
||||
| Margin (Join These String {- newlines or hyphens -})
|
||||
|
||||
alignBranchElement :: BranchElement -> [BranchElement]
|
||||
alignBranchElement (Child key contents) = Child key <$> traverse lines contents
|
||||
alignBranchElement (Margin contents) = Margin <$> traverse lines contents
|
||||
|
||||
toSource :: [BranchElement] -> Source.Source Char
|
||||
toSource = Source.fromList . concatMap show
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user