emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/rust-mode 5d0fce5 149/486: Fix word and symbol syntax dist


From: ELPA Syncer
Subject: [nongnu] elpa/rust-mode 5d0fce5 149/486: Fix word and symbol syntax distinction
Date: Sat, 7 Aug 2021 09:25:08 -0400 (EDT)

branch: elpa/rust-mode
commit 5d0fce59c71f66e7d11469dc9264817d37f51028
Author: Roy Crihfield <rscrihf@gmail.com>
Commit: Felix S. Klock II <pnkfelix@pnkfx.org>

    Fix word and symbol syntax distinction
    
    By passing 'symbols as 2nd argument to regexp-opt, keywords will not be
    erroneously matched inside symbols. This obviates changing the syntax of
    `_' to "w".
---
 rust-mode.el | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/rust-mode.el b/rust-mode.el
index 290dd6b..856ee5a 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -32,11 +32,6 @@
     (modify-syntax-entry ?\" "\"" table)
     (modify-syntax-entry ?\\ "\\" table)
 
-    ;; mark _ as a word constituent so that identifiers
-    ;; such as xyz_type don't cause type to be highlighted
-    ;; as a keyword
-    (modify-syntax-entry ?_ "w" table)
-
     ;; Comments
     (modify-syntax-entry ?/  ". 124b" table)
     (modify-syntax-entry ?*  ". 23"   table)
@@ -335,10 +330,10 @@
   (append
    `(
      ;; Keywords proper
-     (,(regexp-opt rust-mode-keywords 'words) . font-lock-keyword-face)
+     (,(regexp-opt rust-mode-keywords 'symbols) . font-lock-keyword-face)
 
      ;; Special types
-     (,(regexp-opt rust-special-types 'words) . font-lock-type-face)
+     (,(regexp-opt rust-special-types 'symbols) . font-lock-type-face)
 
      ;; Attributes like `#[bar(baz)]` or `#![bar(baz)]` or `#[bar = "baz"]`
      (,(rust-re-grab (concat "#\\!?\\[" rust-re-ident "[^]]*\\]"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]