Merge pull request #375 from edwinb/interactive

Add new clause at next blank line
This commit is contained in:
Edwin Brady 2020-06-27 21:36:59 +01:00 committed by GitHub
commit fb9f79e3c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -234,7 +234,11 @@ rtrim : String -> String
rtrim str = reverse (ltrim (reverse str))
addClause : String -> Nat -> List String -> List String
addClause c Z xs = rtrim c :: xs
addClause c Z [] = rtrim c :: []
addClause c Z (x :: xs)
= if all isSpace (unpack x)
then rtrim c :: x :: xs
else x :: addClause c Z xs
addClause c (S k) (x :: xs) = x :: addClause c k xs
addClause c (S k) [] = [c]