This file contains 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
const std = @import("std"); | |
const builtin = std.builtin; | |
// Convert an enum to an error set. | |
// | |
// This is quite a kludge that works by generating the ErrorSet using comptime | |
// (possible since a62e9bc8e5). Enum values are converted to error values using | |
// @enumToInt and @intoToError and banking on the hypothesis that error values | |
// are generated sequentially - this only works for enums with sequentially | |
// assigned values. |
This file contains 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-define-checker futhark | |
"A futhark syntax checker using `futhark check`." | |
:command ("futhark" "check" source-inplace) | |
:error-patterns | |
( | |
;; TODO: Use column range | |
(error line-start "Error at " (file-name) ":" line ":" column "-" (1+ digit) ":" | |
(0+ (not graphic)) | |
(message (1+ anything) "If you find this error message confusing")) ;; TODO: exclude delimiter from output (no lookahead support) | |