Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve comment highlighting.

ddx-mode uses ; both to end type definitions, and as a comment
character. As a heuristic, it looks like a ; preceded by either
whitespace or start of line is a comment.

smali just uses # as a comment character.
  • Loading branch information...
commit 33838516f32f40198b67ddee303012339b843af2 1 parent 07d49dc
Nelson Elhage authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 ddx.el
7 ddx.el
View
@@ -63,17 +63,18 @@
(defvar ddx-mode-font-lock-keywords
(list
+ (cons "\\(^\\|\\s \\);.*" font-lock-comment-face)
(cons (concat "\\<" (regexp-opt ddx-dex-opcode-list) "\\>")
font-lock-builtin-face)
(cons (concat "\\<" (regexp-opt '("private" "public" "static" "final")) "\\>")
font-lock-keyword-face)
- (cons "[#;].*" font-lock-comment-face)
(cons (concat "\\.\\<" (regexp-opt '("field" "method" "limit"
"throws" "catch" "class"
"super" "var" "line"
"registers" "annotation"
"end" "source" "inner"
- "local" "parameter")) "\\>")
+ "local" "parameter"
+ "catchall")) "\\>")
font-lock-preprocessor-face)
(cons "\\<[vp][[:digit:]]+\\>" font-lock-variable-name-face)))
@@ -86,7 +87,7 @@
(defvar ddx-mode-syntax-table
(let ((tbl (make-syntax-table)))
(modify-syntax-entry ?_ "w" tbl)
- (modify-syntax-entry ?\; "<" tbl)
+ (modify-syntax-entry ?\# "<" tbl)
(modify-syntax-entry ?\n ">" tbl)
tbl))
Please sign in to comment.
Something went wrong with that request. Please try again.