From 98bebac1520bcf1dd5392535e06a751d7b2af58e Mon Sep 17 00:00:00 2001 From: Carl Yeksigian Date: Wed, 12 Mar 2014 16:48:01 -0400 Subject: [PATCH] THRIFT-2399 Recognize '//'-style comments in emacs PATCH: David Hull --- contrib/thrift.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/thrift.el b/contrib/thrift.el index 2dc49b03..941a99fe 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") -- 2.17.1