fixing a bug of func = undefined.

This commit is contained in:
Kazu Yamamoto 2010-06-25 20:31:46 +09:00
parent 266ac30133
commit b3d9b12688
2 changed files with 8 additions and 14 deletions

View File

@ -17,10 +17,6 @@
(ghc-insert-module-template))
((ghc-flymake-have-errs-p)
(ghc-flymake-insert-from-warning))
((save-excursion
(beginning-of-line)
(looking-at "^[^ ]+ *::"))
(ghc-insert-function-template))
(t
(message "Nothing to be done"))))
@ -29,15 +25,6 @@
(let ((mod (file-name-sans-extension (buffer-name))))
(insert "module " mod " where\n")))
(defun ghc-insert-function-template ()
(save-excursion
(beginning-of-line)
(when (looking-at "^\\([^ ]+\\) *::")
(save-match-data
(forward-line)
(if (eobp) (insert "\n")))
(insert (match-string 1) " = undefined\n"))))
(defun ghc-sort-lines (beg end)
(interactive "r")
(save-excursion

View File

@ -72,7 +72,7 @@
(insert title "\n\n")
(mapc (lambda (x) (insert (ghc-replace-character x ghc-null ghc-newline) "\n")) errs)
(goto-char (point-min))
(while (re-search-forward "In the [^:\n ]+: \\|Expected type: \\|Inferred type: \\|Possible fix: " nil t)
(while (re-search-forward "In the definition of [^:\n ]+: \\|In the [^:\n ]+: \\|Expected type: \\|Inferred type: \\|Possible fix: " nil t)
(replace-match (concat "\n" (match-string 0) "\n ")))
(goto-char (point-max))
(while (re-search-backward "In the [a-z]+ argument\\|In the `" nil t)
@ -90,6 +90,13 @@
(insert (match-string 1 data)
(replace-regexp-in-string "\\[Char\\]" "String" (match-string 3 data))
"\n"))
((string-match "lacks an accompanying binding" data)
(beginning-of-line)
(when (looking-at "^\\([^ ]+\\) *::")
(save-match-data
(forward-line)
(if (eobp) (insert "\n")))
(insert (match-string 1) " = undefined\n")))
((string-match "Not in scope: `\\([^']+\\)'" data)
(save-match-data
(unless (re-search-forward "^$" nil t)