Skip to content

Commit

Permalink
Merge pull request #24 from algernon/f/more-keywords
Browse files Browse the repository at this point in the history
Add new keywords, and fix the *-alias highlighting
  • Loading branch information
berkerpeksag committed Feb 2, 2014
2 parents 22125f0 + b23eb99 commit 6672dcd
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions hy-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,34 @@
(defconst hy-font-lock-keywords
`((,(concat "(\\("
(regexp-opt '("defn" "defun" "defclass" "import"
"defmacro" "require" "defmacro-alias"
"defmacro/g!" "defreader"))
"defmacro" "require" "defmacro/g!"
"defreader"))
"\\)\\>"
;; Spaces
"[ \r\n\t]+"
;; Function/class name
"\\([^ \r\n\t()]+\\)")
(1 font-lock-keyword-face)
(2 font-lock-function-name-face nil t))
(,(concat "(\\("
(regexp-opt '("defmacro-alias" "defn-alias"
"defun-alias"))
"\\)\\>"
;; Spaces
"[ \r\n\t]+"
;; Function/class name
"\\[\\([^]\r\n\t()]+\\)\\]"
)
(1 font-lock-keyword-face)
(2 font-lock-function-name-face nil t))
(,(concat "(\\("
(regexp-opt
'("do" "for" "for*" "try" "throw" "raise" "progn" "catch"
"else" "finally" "except" "if" "unless" "when" "assert" "global"
"lambda" "fn" "yield" "with-decorator" "with_decorator" "with"
"with*" "kwapply" "while" "let" "cond" "_>" "->" "_>>" "->>"
"with-gensym"))
"with-gensyms" "eval-and-compile" "loop" "recur"
"if-not" "apply" "break" "continue"))
"\\)[ \n\r\t)]")
(1 font-lock-keyword-face))
(,(concat "(\\("
Expand All @@ -70,7 +82,8 @@
"empty?" "even?" "filter" "float?" "inc" "instance?" "iterable?"
"neg?" "odd?" "pos?" "remove" "repeat" "repeatedly" "second"
"string?" "zero?" "del" "gensym" "macroexpand"
"macroexpand-1" "nil?" "none?" "flatten"))
"macroexpand-1" "nil?" "none?" "flatten" "integer?"
"identity" "yield-from"))
"\\)[ \n\r\t)]")
(1 font-lock-builtin-face))
("\\<:[^ \r\n\t]+\\>" 0 font-lock-constant-face)
Expand Down

0 comments on commit 6672dcd

Please sign in to comment.