Created
August 14, 2013 20:02
-
-
Save iwillspeak/6234995 to your computer and use it in GitHub Desktop.
Mode files for Emacs
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
;; Defines a simple generic mode to hilight lasm files | |
(define-generic-mode 'lasm-mode | |
;; Comment start marker, we just do single line comments for now | |
'("//") | |
;; Keywords, these are just taken verbose from opslist.h | |
'("pushloc" "pusharg" "pushlitn" "pushlitd" "pushlits" "pushtrue" "pushfalse" | |
"pushnull" "pushident" "poploc" "poparg" "dup" "pop" "idlook" "ntod" "ntos" | |
"dtos" "btos" "xton" "xtod" "xtob" "xtos" "add" "sub" "mul" "div" "mod" | |
"pow" "log" "neg" "inc" "dec" "cat" "slice" "strchar" "strcmp" "lt" "lteq" | |
"gt" "gteq" "eq" "noteq" "not" "and" "or" "print" "jump" "jumpt" "jumpf" | |
"call" "ret" "creset" "cnext" "cended" "cgeti" "cgetk" "lmake" | |
"lgeti" "lseti" "lpush" "mmake" "mgeti" "mseti" "mdeli" "opushnew" | |
"ogetfield" "osetfield" "omethlook") | |
;; Extra font locks, this is for labels and pseudo operators | |
'(("^[a-z]+:" . 'font-lock-type-face) | |
("\\(\\.\\(import\\|func\\)\\)" . 'font-lock-builtin-face) | |
("\\-?[0-9]+\\(\\.[0-9]*\\)?" . 'font-lock-constant-face)) | |
;; Lasm is where it's at | |
'("\\.lasm$") | |
;; No extra functions to attach | |
nil | |
;; Docstring, says it all realy | |
"A simple mode for editing Leet Lang assembly files") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment