[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nasm-mode b5efa92 07/67: Allow for NASM's crazy label poss
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nasm-mode b5efa92 07/67: Allow for NASM's crazy label possibilities. |
Date: |
Sun, 29 Aug 2021 11:23:42 -0400 (EDT) |
branch: elpa/nasm-mode
commit b5efa926420094d881dfbf752373388ea9ac5221
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Allow for NASM's crazy label possibilities.
Instruction names can now be labels when followed by a colon.
---
nasm-mode.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/nasm-mode.el b/nasm-mode.el
index 200579a..bd736a1 100644
--- a/nasm-mode.el
+++ b/nasm-mode.el
@@ -384,17 +384,18 @@
"NASM preprocessor directives (pptok.c) for `nasm-mode'."))
(defconst nasm-label-regexp
- "^\\s-*[a-zA-Z0-9_.?][a-zA-Z0-9_$#@~.?]*:?\\>"
+ "\\s-*[a-zA-Z0-9_.?][a-zA-Z0-9_$#@~.?]*\\>"
"Regexp for `nasm-mode'.")
(defconst nasm-font-lock-keywords
`(("\\<\\.[a-zA-Z0-9_$#@~.?]+\\>" . font-lock-type-face)
(,(regexp-opt nasm-registers 'words) . font-lock-variable-name-face)
- (,(regexp-opt nasm-instructions 'words) . font-lock-keyword-face)
(,(regexp-opt nasm-prefix 'words) . font-lock-keyword-face)
(,(regexp-opt nasm-directives 'words) . font-lock-builtin-face)
(,(regexp-opt nasm-pp-directives 'words) . font-lock-preprocessor-face)
- (,nasm-label-regexp . font-lock-function-name-face))
+ (,(concat "^" nasm-label-regexp "\\s-*:") . font-lock-function-name-face)
+ (,(regexp-opt nasm-instructions 'words) . font-lock-keyword-face)
+ (,(concat "^" nasm-label-regexp) . font-lock-function-name-face))
"Keywords for `nasm-mode'.")
(defconst nasm-mode-syntax-table
@@ -412,16 +413,17 @@
(defmacro nasm--opt (keywords)
"Prepare KEYWORDS for `looking-at'."
`(eval-when-compile
- (concat "\\s-*" (regexp-opt ,keywords 'words))))
+ (regexp-opt ,keywords 'words)))
(defun nasm-indent-line ()
"Indent current line as NASM assembly code."
(interactive)
(let ((orig (- (point-max) (point))))
- (beginning-of-line)
+ (back-to-indentation)
(if (or (looking-at (nasm--opt nasm-directives))
(looking-at (nasm--opt nasm-pp-directives))
- (looking-at "^\\s-*[[;]")
+ (looking-at "[[;]")
+ (looking-at (concat nasm-label-regexp "\\s-*:"))
(and (looking-at nasm-label-regexp)
(not (looking-at (nasm--opt nasm-instructions)))
(not (looking-at (nasm--opt nasm-prefix)))))
- [nongnu] branch elpa/nasm-mode created (now 65ca654), ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode e950dca 06/67: Use work boundary in smart indentation., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode b5efa92 07/67: Allow for NASM's crazy label possibilities.,
ELPA Syncer <=
- [nongnu] elpa/nasm-mode 3d4786b 08/67: Add ELPA header., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 4155959 21/67: Remove stray newline., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode c303d91 52/67: Add a Makefile for easy static analysis by the compiler, ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode c38cff7 01/67: Check in initial working mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 3af81f6 14/67: Require colons on labels., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 02c2450 40/67: Assume things that start with dot are labels., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 3992726 42/67: Add nasm-join-line keybinding (M-^)., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 2fe823c 43/67: Adjust nasm-mode to remap join-line specifically., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode c3f5475 48/67: Bump to 1.1.0., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode f53b2c5 56/67: Create a formal TODO list, ELPA Syncer, 2021/08/29