Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #678 from gracjan/pr-comma-in-parentheses

Fix parsing of comma separated list inside parentheses
commit 680f462b997b08cc2ab5c2ad52e427027c4fa286 2 parents 5b91179 + 9bd2f4d
@gracjan gracjan authored
Showing with 8 additions and 7 deletions.
  1. +8 −6 haskell-indentation.el
  2. +0 −1  tests/haskell-indentation-tests.el
View
14 haskell-indentation.el
@@ -925,20 +925,22 @@ the current buffer."
;; ,
(defun haskell-indentation-separated (parser separator &optional stmt-separator)
(catch 'return
+ (unless (listp separator)
+ (setq separator (list separator)))
+ (unless (listp stmt-separator)
+ (setq stmt-separator (list stmt-separator)))
(while t
(funcall parser)
- (cond ((if (listp separator)
- (member current-token separator)
- (equal current-token separator))
+ (cond ((member current-token separator)
(haskell-indentation-at-separator))
- ((equal current-token stmt-separator)
+ ((member current-token stmt-separator)
(setq starter-indent (current-column))
(haskell-indentation-at-separator))
((eq current-token 'end-tokens)
- (cond ((or (equal following-token separator)
- (equal following-token stmt-separator))
+ (cond ((or (member following-token separator)
+ (member following-token stmt-separator))
;; set an indentation before a separator,
;; for example:
;; [ 1 or [ 1 | a
View
1  tests/haskell-indentation-tests.el
@@ -77,7 +77,6 @@ Example of lines:
(ert-deftest haskell-indentation-check-4 ()
"Import statememnt symbol list 2"
- :expected-result :failed
(haskell-indentation-check
"import Control.Concurrent"
" ( forkIO"
Please sign in to comment.
Something went wrong with that request. Please try again.