Added yue-mode
Getty Ritter
9 years ago
27 | 27 |
single
|
28 | 28 |
]
|
29 | 29 |
)
|
| 30 |
(yue-mode .
|
| 31 |
[ (20150915 0000)
|
| 32 |
nil
|
| 33 |
"A simple major mode for editinng Yue source files"
|
| 34 |
single
|
| 35 |
]
|
| 36 |
)
|
30 | 37 |
)
|
| 1 |
;; yue-mode.el --- a simple major mode for editing Yue files
|
| 2 |
|
| 3 |
;; Version: 201509155555.0000
|
| 4 |
;; Author: Getty Ritter
|
| 5 |
;; Url: https://github.com/aisamanra/yue-mode
|
| 6 |
|
| 7 |
(setq yue-font-lock
|
| 8 |
'(( "\\<\\(and\\|do\\|else\\|elseif\\|end\\|for\\|function\\|if\\|in\\|local\\|match\\|mut\\|not\\|or\\|repeat\\|return\\|then\\|type\\|until\\|while\\)\\>" . font-lock-keyword-face )
|
| 9 |
( "\\<\\(\\(u\\|s\\)\\(8\\|16\\|32\\|64\\)\\|f32\\|f64\\|arr\\)\\>" . font-lock-builtin-face )
|
| 10 |
( "\\(type\\|function\\) \\([A-Za-z][A-Za-z0-9_]*\\)" 2 font-lock-function-name-face )
|
| 11 |
( "\\(for\\|local\\) \\([A-Za-z][A-Za-z0-9_]*\\)" 2 font-lock-variable-name-face )
|
| 12 |
( "\\([A-Za-z_][A-Za-z0-9_]*\\) *:" 1 font-lock-variable-name-face )))
|
| 13 |
|
| 14 |
(defvar yue-syntax-table nil "Syntax table for `yue-mode'.")
|
| 15 |
(setq yue-syntax-table
|
| 16 |
(let ((table (make-syntax-table)))
|
| 17 |
|
| 18 |
(modify-syntax-entry ?- ". 12b" table)
|
| 19 |
(modify-syntax-entry ?\n "> b" table)
|
| 20 |
table))
|
| 21 |
|
| 22 |
(define-derived-mode yue-mode prog-mode
|
| 23 |
"Yue mode is a major mode for editing Yue files"
|
| 24 |
:syntax-table yue-syntax-table
|
| 25 |
|
| 26 |
(setq font-lock-defaults '(yue-font-lock))
|
| 27 |
(setq mode-name "Yue mode")
|
| 28 |
(setq comment-start "--")
|
| 29 |
(setq comment-end ""))
|
| 30 |
|
| 31 |
;;;###autoload
|
| 32 |
(add-to-list 'auto-mode-alist '("\\.yue\\'" . yue-mode))
|
| 33 |
|
| 34 |
(provide 'yue-mode)
|
| 35 |
|
| 36 |
;;; yue-mode.el ends here
|