Skip to content

Commit dd0ea64

Browse files
authored
Merge pull request #1597 from alexbiehl/pr/backpack
Add support for `signature`s and .hsig files
2 parents d71cca7 + 4aec756 commit dd0ea64

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

haskell-completions.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ This list comes from GHC documentation (URL
118118
"proc"
119119
"qualified"
120120
"rec"
121+
"signature"
121122
"then"
122123
"type family"
123124
"type instance"

haskell-font-lock.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ be disabled at that position."
9393
'("case" "class" "data" "default" "deriving" "do"
9494
"else" "if" "import" "in" "infix" "infixl"
9595
"infixr" "instance" "let" "module" "mdo" "newtype" "of"
96-
"rec" "pattern" "proc" "then" "type" "where" "_")
96+
"rec" "pattern" "proc" "signature" "then" "type" "where" "_")
9797
"Identifiers treated as reserved keywords in Haskell."
9898
:group 'haskell-appearance
9999
:type '(repeat string))

haskell-indent.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
(defconst haskell-indent-start-keywords-re
127127
(concat "\\<"
128128
(regexp-opt '("class" "data" "import" "infix" "infixl" "infixr"
129-
"instance" "module" "newtype" "primitive" "type") t)
129+
"instance" "module" "newtype" "primitive" "signature" "type") t)
130130
"\\>")
131131
"Regexp for keywords to complete when standing at the first word of a line.")
132132

haskell-indentation.el

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -517,16 +517,17 @@ and indent when all of the following are true:
517517
"Translation from UnicodeSyntax tokens to their ASCII representation.")
518518

519519
(defconst haskell-indentation-toplevel-list
520-
`(("module" . haskell-indentation-module)
521-
("data" . haskell-indentation-data)
522-
("type" . haskell-indentation-data)
523-
("newtype" . haskell-indentation-data)
524-
("import" . haskell-indentation-import)
525-
("foreign" . haskell-indentation-foreign)
526-
("where" . haskell-indentation-toplevel-where)
527-
("class" . haskell-indentation-class-declaration)
528-
("instance" . haskell-indentation-class-declaration)
529-
("deriving" . haskell-indentation-deriving))
520+
`(("module" . haskell-indentation-module)
521+
("signature" . haskell-indentation-module)
522+
("data" . haskell-indentation-data)
523+
("type" . haskell-indentation-data)
524+
("newtype" . haskell-indentation-data)
525+
("import" . haskell-indentation-import)
526+
("foreign" . haskell-indentation-foreign)
527+
("where" . haskell-indentation-toplevel-where)
528+
("class" . haskell-indentation-class-declaration)
529+
("instance" . haskell-indentation-class-declaration)
530+
("deriving" . haskell-indentation-deriving))
530531
"Alist of toplevel keywords with associated parsers.")
531532

532533
(defconst haskell-indentation-type-list
@@ -1217,7 +1218,7 @@ line."
12171218

12181219
(defun haskell-indentation-peek-token ()
12191220
"Return token starting at point."
1220-
(cond ((looking-at "\\(if\\|then\\|else\\|let\\|in\\|mdo\\|rec\\|do\\|proc\\|case\\|of\\|where\\|module\\|deriving\\|import\\|data\\|type\\|newtype\\|class\\|instance\\)\\([^[:alnum:]'_]\\|$\\)")
1221+
(cond ((looking-at "\\(if\\|then\\|else\\|let\\|in\\|mdo\\|rec\\|do\\|proc\\|case\\|of\\|where\\|module\\|signature\\|deriving\\|import\\|data\\|type\\|newtype\\|class\\|instance\\)\\([^[:alnum:]'_]\\|$\\)")
12211222
(match-string-no-properties 1))
12221223
((looking-at "[][(){}[,;]")
12231224
(match-string-no-properties 0))

haskell-mode.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,8 @@ list marker of some kind), and end of the obstacle."
989989
;;;###autoload
990990
(add-to-list 'auto-mode-alist '("\\.[gh]s\\'" . haskell-mode))
991991
;;;###autoload
992+
(add-to-list 'auto-mode-alist '("\\.hsig\\'" . haskell-mode))
993+
;;;###autoload
992994
(add-to-list 'auto-mode-alist '("\\.l[gh]s\\'" . literate-haskell-mode))
993995
;;;###autoload
994996
(add-to-list 'auto-mode-alist '("\\.hsc\\'" . haskell-mode))

0 commit comments

Comments
 (0)