diff --git a/haskell-indentation.el b/haskell-indentation.el index d4596e1dc..0d1f0e2e2 100644 --- a/haskell-indentation.el +++ b/haskell-indentation.el @@ -1180,7 +1180,8 @@ the current buffer." "Skip to the next token." (let ((case-fold-search nil)) - (if (or (looking-at "'\\([^\\']\\|\\\\.\\)*'") + (if (or (looking-at "'\\([^\\']\\|\\\\.\\)'") + (looking-at "'\\\\\\([^\\']\\|\\\\.\\)*'") (looking-at "\"\\([^\\\"]\\|\\\\.\\)*\"") (looking-at ; Hierarchical names always start with uppercase "[[:upper:]]\\(\\s_\\|\\sw\\|'\\)*\\(\\.\\(\\s_\\|\\sw\\|'\\)+\\)*") diff --git a/tests/haskell-indentation-tests.el b/tests/haskell-indentation-tests.el index 85e11508c..a051fdbf7 100644 --- a/tests/haskell-indentation-tests.el +++ b/tests/haskell-indentation-tests.el @@ -422,3 +422,17 @@ Example of lines: " bar = 0" " , baz = 0" " ^")) + +(ert-deftest haskell-indentation-check-22a () + "names starting with quotes" + (haskell-indentation-check + "f = a (a 'A)" + " (a 'A)" + "^ ^")) + +(ert-deftest haskell-indentation-check-22b () + "character literal (escape sequence)" + (haskell-indentation-check + "f = '\\\\'" + "" + "^ ^"))