Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src-extra/transformation/JbeamEdit/Transformation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import Data.Bool (bool)
import Data.Foldable.Extra (notNull)
import Data.Function (on)
import Data.List (foldl', partition)

Check warning on line 7 in src-extra/transformation/JbeamEdit/Transformation.hs

View workflow job for this annotation

GitHub Actions / Build and test with Cabal (GHC latest) on windows-latest

The import of ‘foldl'’ from module ‘Data.List’ is redundant

Check warning on line 7 in src-extra/transformation/JbeamEdit/Transformation.hs

View workflow job for this annotation

GitHub Actions / Build and test with Cabal (GHC latest) on ubuntu-latest

The import of ‘foldl'’ from module ‘Data.List’ is redundant

Check warning on line 7 in src-extra/transformation/JbeamEdit/Transformation.hs

View workflow job for this annotation

GitHub Actions / Build for release for 9.10.3 (experimental)

The import of ‘foldl'’ from module ‘Data.List’ is redundant
import Data.List.NonEmpty (NonEmpty)
import Data.List.NonEmpty qualified as NE
import Data.Map (Map)
Expand Down Expand Up @@ -317,7 +317,7 @@
oMap

(_, listsOfNodes) = mapAccumL stepType initialMeta treesOrder
in V.fromList (concat listsOfNodes)
in foldMap V.fromList listsOfNodes

treesOrder :: [VertexTreeType]
treesOrder = [LeftTree, MiddleTree, RightTree, SupportTree]
Expand Down
2 changes: 1 addition & 1 deletion src/JbeamEdit/Core/Node.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ possiblyChildren n = expectArray n <|> expectObject n

moreNodesThanOne :: Vector Node -> Bool
moreNodesThanOne v
| len == 1 = any moreNodesThanOne . possiblyChildren $ V.head v
| len == 1 = any moreNodesThanOne . possiblyChildren $ V.unsafeHead v
| len > 1 = True
| otherwise = False
where
Expand Down
10 changes: 5 additions & 5 deletions src/JbeamEdit/Parsing/Jbeam.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ separatorParser = do
comma <- MP.optional (MP.label "comma" $ byteChar ',')
ws2 <- MP.takeWhileP Nothing wordIsSpace

let countNewlines = length . filter (== '\n') . map toChar . LBS.unpack
totalNewlines = countNewlines ws1 + countNewlines ws2
hasNewline =
isNothing comma && '\n' `elem` map toChar (LBS.unpack ws1)
|| '\n' `elem` map toChar (LBS.unpack ws2)
let nl = toWord8 '\n'
ws1Newlines = LBS.count nl ws1
ws2Newlines = LBS.count nl ws2
totalNewlines = ws1Newlines + ws2Newlines
hasNewline = isNothing comma && ws1Newlines > 0 || ws2Newlines > 0

modify
( \s ->
Expand Down