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

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

[nongnu] elpa/nasm-mode 9e8e7c9 15/67: Add constant syntax highlighting.


From: ELPA Syncer
Subject: [nongnu] elpa/nasm-mode 9e8e7c9 15/67: Add constant syntax highlighting.
Date: Sun, 29 Aug 2021 11:23:44 -0400 (EDT)

branch: elpa/nasm-mode
commit 9e8e7c957bbcfcb824a03e0c3b89e5997cd1bc4c
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>

    Add constant syntax highlighting.
---
 nasm-mode.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/nasm-mode.el b/nasm-mode.el
index d6cc131..49d067d 100644
--- a/nasm-mode.el
+++ b/nasm-mode.el
@@ -395,7 +395,11 @@
 
 (defconst nasm-label-regexp
   "\\(\\<[a-zA-Z_.?][a-zA-Z0-9_$#@~.?]*\\>\\)\\s-*:"
-  "Regexp for `nasm-mode'.")
+  "Regexp for `nasm-mode' for matching labels.")
+
+(defconst nasm-constant-regexp
+  "\\<$?[-+0-9][-+_0-9A-Fa-fHhXxDdTtQqOoBbYyeE.]*\\>"
+  "Regexp for `nasm-mode' for matching numeric constants.")
 
 (defconst nasm-font-lock-keywords
   `(("\\<\\.[a-zA-Z0-9_$#@~.?]+\\>" . font-lock-type-face)
@@ -404,7 +408,8 @@
     (,(regexp-opt nasm-instructions 'words) . font-lock-builtin-face)
     (,(regexp-opt nasm-directives 'words) . font-lock-keyword-face)
     (,(regexp-opt nasm-pp-directives 'words) . font-lock-preprocessor-face)
-    (,(concat "^\\s-*" nasm-label-regexp) (1 font-lock-function-name-face)))
+    (,(concat "^\\s-*" nasm-label-regexp) (1 font-lock-function-name-face))
+    (,nasm-constant-regexp . font-lock-constant-face))
   "Keywords for `nasm-mode'.")
 
 (defconst nasm-mode-syntax-table



reply via email to

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