Skip to content

Commit

Permalink
stop highlighting special symbols occurring in other symbols
Browse files Browse the repository at this point in the history
highlight variable and method declarations

fixed special keywords highlighting
  • Loading branch information
jordonbiondo committed Aug 12, 2014
1 parent e0afa92 commit 43c079b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions io-mode.el
Expand Up @@ -113,7 +113,7 @@
;;

;; Special? Self and call objects are :)
(defvar io-special-re "\\<self\\|thisContext\\|call\\>")
(defvar io-special-re (regexp-opt '("self" "thisContext" "call") 'symbols))

;; Operators (not all of them are present in the Io core,
;; but you can still define them, if you need it)
Expand Down Expand Up @@ -154,16 +154,24 @@
"then" "thisBlock" "thisMessage" "try" "type"
"uniqueId" "updateSlot" "wait" "while" "write"
"writeln" "yield")
'words))
'symbols))

;; Comments
(defvar io-comments-re "\\(\\(#\\|//\\).*$\\|/\\*\\(.\\|[\r\n]\\)*?\\*/\\)")

;; Methods
(defvar io-method-declaration-name-re "\\(\\sw+\\)\s*:=\s*\\(method\\)")

;; Variables
(defvar io-variable-declaration-name-re "\\(\\sw+\\)\s*:=\s*\\(\\sw+\\)")

;; Create the list for font-lock. Each class of keyword is given a
;; particular face.
(defvar io-font-lock-keywords
;; Note: order here matters!
`((,io-special-re . font-lock-variable-name-face)
(,io-method-declaration-name-re (1 font-lock-function-name-face))
(,io-variable-declaration-name-re (1 font-lock-variable-name-face))
(,io-operators-re . font-lock-builtin-face)
(,io-operators-special-re . font-lock-warning-face)
(,io-boolean-re . font-lock-constant-face)
Expand Down

0 comments on commit 43c079b

Please sign in to comment.