summaryrefslogtreecommitdiff
path: root/contrib/thrift.el
diff options
context:
space:
mode:
authorCarl Yeksigian <carl@apache.org>2014-03-12 16:48:01 -0400
committerCarl Yeksigian <carl@apache.org>2014-03-12 16:48:01 -0400
commit98bebac1520bcf1dd5392535e06a751d7b2af58e (patch)
treee8a715962d91f13286af586fd9e96503d7f2f085 /contrib/thrift.el
parent52744eed7b8cc8b758825d2ba188933f907e07df (diff)
downloadthrift-98bebac1520bcf1dd5392535e06a751d7b2af58e.tar.gz
THRIFT-2399 Recognize '//'-style comments in emacs
PATCH: David Hull
Diffstat (limited to 'contrib/thrift.el')
-rw-r--r--contrib/thrift.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/thrift.el b/contrib/thrift.el
index 2dc49b03c..941a99fe4 100644
--- a/contrib/thrift.el
+++ b/contrib/thrift.el
@@ -38,7 +38,6 @@
;; syntax coloring
(defconst thrift-font-lock-keywords
(list
- '("#.*$" . font-lock-comment-face) ;; perl style comments
'("\\<\\(include\\|struct\\|exception\\|typedef\\|const\\|enum\\|service\\|extends\\|void\\|oneway\\|throws\\|optional\\|required\\)\\>" . font-lock-keyword-face) ;; keywords
'("\\<\\(bool\\|byte\\|i16\\|i32\\|i64\\|double\\|string\\|binary\\|map\\|list\\|set\\)\\>" . font-lock-type-face) ;; built-in types
'("\\<\\([0-9]+\\)\\>" . font-lock-variable-name-face) ;; ordinals
@@ -112,13 +111,14 @@
(indent-line-to cur-indent)
(indent-line-to 0)))))
-;; C/C++ comments; also allowing underscore in words
+;; C/C++- and sh-style comments; also allowing underscore in words
(defvar thrift-mode-syntax-table
(let ((thrift-mode-syntax-table (make-syntax-table)))
(modify-syntax-entry ?_ "w" thrift-mode-syntax-table)
- (modify-syntax-entry ?/ ". 1456" thrift-mode-syntax-table)
- (modify-syntax-entry ?* ". 23" thrift-mode-syntax-table)
- (modify-syntax-entry ?\n "> b" thrift-mode-syntax-table)
+ (modify-syntax-entry ?# "<" thrift-mode-syntax-table) ; sh-style comments
+ (modify-syntax-entry ?/ ". 124" thrift-mode-syntax-table) ; c/c++-style comments
+ (modify-syntax-entry ?* ". 23b" thrift-mode-syntax-table)
+ (modify-syntax-entry ?\n ">" thrift-mode-syntax-table)
thrift-mode-syntax-table)
"Syntax table for thrift-mode")