Skip to content

Implement QuasiQuotes syntax in indentation #909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 3, 2015
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: 2 additions & 0 deletions haskell-indentation.el
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,8 @@ line."
(if (or (looking-at "'\\([^\\']\\|\\\\.\\)'")
(looking-at "'\\\\\\([^\\']\\|\\\\.\\)*'")
(looking-at "\"\\([^\\\"]\\|\\\\.\\)*\"")
;; QuasiQuotes, with help of propertize buffer and string delimeters
(looking-at "\\s\"\\S\"*\\s\"")
;; Hierarchical names always start with uppercase
(looking-at
"[[:upper:]]\\(\\s_\\|\\sw\\|'\\)*\\(\\.\\(\\s_\\|\\sw\\|'\\)+\\)*")
Expand Down
15 changes: 15 additions & 0 deletions tests/haskell-indentation-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
(require 'cl-lib)
(require 'ert)
(require 'haskell-mode)
(require 'haskell-font-lock)
(require 'haskell-indentation)

;;; Code:
Expand Down Expand Up @@ -70,6 +71,7 @@ because it helps increase coverage."
(haskell-indentation-mode 1)
(insert source)
(newline)
(font-lock-fontify-buffer)
(goto-char (point-min))
(forward-line (1- line))
(move-to-column column)
Expand Down Expand Up @@ -589,5 +591,18 @@ function (Operation 'Init) = do
"
((2 0) 2))

(hindent-test "29a quasiquote single line" "
test = [randomQQ| This is a quasiquote with the word in |]

"
((2 0) 0 7))

(hindent-test "29b quasiquote multiple lines" "
test = [randomQQ| This is
a quasiquote
with the word in |]

"
((4 0) 0 7))

;;; haskell-indentation-tests.el ends here