-
-
Save yonta/80c938a54f4d14a1b75146e9c0b76fc2 to your computer and use it in GitHub Desktop.
Elisp code that enables syntax and type checking of Standard ML code using MLton through Flycheck.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; flycheck-mlton.el --- Flycheck: MLton support -*- lexical-binding: t; -*- | |
;; This code is modified by SAITOU Keita <[email protected]>. | |
;; | |
;; Original source is available here, | |
;; URL: http://hebiyan.hatenablog.com/entry/20160316/1458125059 | |
;; Package-Requires: ((emacs "24.1") (flycheck "0.22") (sml-mode "0.4")) | |
;;; Commentary: | |
;;; Code: | |
(require 'flycheck) | |
(flycheck-define-checker sml-mlton | |
"Standard ML type and syntax checking with mlton compiler. | |
See URL 'http://mlton.org" | |
:command ("mlton" "-stop" "tc" source) | |
:error-patterns | |
(;; <= v20130715, and EOF error in >= v20180207 | |
(error line-start "Error: " (file-name) (+ blank) line "." column ".\n" | |
(message (1+ line-start (+ blank) (+ nonl) "\n"))) | |
;; >= v20180207 | |
(error line-start "Error: " (file-name) (+ blank) | |
line "." column "-" (+ digit) "." (+ digit) ".\n" | |
(message (1+ line-start (+ blank) (+ nonl) "\n")))) | |
:modes sml-mode) | |
(add-to-list 'flycheck-checkers 'sml-mlton) | |
(provide 'flycheck-mlton) | |
;;; flycheck-mlton.el ends here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment