Skip to content

Commit

Permalink
made table mode useful again
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaisia-Estrel committed Mar 23, 2022
1 parent 10f4f9d commit 0721f8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
:i -- Print options
```
* Accidentally made table mode useless


* 2.0.0.1 -- 2022-03-23
** Made table mode useful again
5 changes: 3 additions & 2 deletions src/Process.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ flattenForm xs = applyUntil (all isElem) (concatMap foldForm) $ groupForm xs
reactProdP :: Parser ([Element], [Element])
reactProdP =
((,) `on` (flattenForm . concat))
<$> formulaP `sepByParser` charP '+'
<$> formulaP' `sepByParser` charP '+'
<*> (whiteSpace *> separators
*> formulaP `sepByParser` charP '+')
*> formulaP' `sepByParser` charP '+')
where
formulaP' = (\a b -> map (onLeaforBranch (second (*a)) (second (*a))) b) <$> (whiteSpace *> numP <|> pure 1) <*> formulaP
separators = foldr1 (<|>) [ stringP x | x <- ["->", "", "\\rightarrow"] ]


0 comments on commit 0721f8d

Please sign in to comment.