[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nasm-mode 3af81f6 14/67: Require colons on labels.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nasm-mode 3af81f6 14/67: Require colons on labels. |
Date: |
Sun, 29 Aug 2021 11:23:44 -0400 (EDT) |
branch: elpa/nasm-mode
commit 3af81f6ecefeebb36c4de27339260224d2ab4005
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Require colons on labels.
---
nasm-mode.el | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/nasm-mode.el b/nasm-mode.el
index 81cf6a7..d6cc131 100644
--- a/nasm-mode.el
+++ b/nasm-mode.el
@@ -9,6 +9,11 @@
;;; Commentary:
+;; Labels without colons are not recognized as labels by this mode,
+;; since, without a parser equal to that of NASM itself, it's
+;; otherwise ambiguous between macros and labels. This covers both
+;; indentation and imenu support.
+
;; The keyword lists are up to date as of NASM 2.11.08.
;;; Code:
@@ -389,19 +394,17 @@
"NASM preprocessor directives (pptok.c) for `nasm-mode'."))
(defconst nasm-label-regexp
- "\\<[a-zA-Z_.?][a-zA-Z0-9_$#@~.?]*\\>"
+ "\\(\\<[a-zA-Z_.?][a-zA-Z0-9_$#@~.?]*\\>\\)\\s-*:"
"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-prefix 'words) . font-lock-keyword-face)
- (,(regexp-opt nasm-directives 'words) . font-lock-builtin-face)
+ (,(regexp-opt nasm-prefix 'words) . font-lock-builtin-face)
+ (,(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 "\\s-*:")
- . font-lock-function-name-face)
- (,(regexp-opt nasm-instructions 'words) . font-lock-keyword-face)
- (,(concat "^\\s-*" nasm-label-regexp) . font-lock-function-name-face))
+ (,(concat "^\\s-*" nasm-label-regexp) (1 font-lock-function-name-face)))
"Keywords for `nasm-mode'.")
(defconst nasm-mode-syntax-table
@@ -445,10 +448,7 @@
(if (or (looking-at (nasm--opt nasm-directives))
(looking-at (nasm--opt nasm-pp-directives))
(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)))))
+ (looking-at nasm-label-regexp))
(indent-line-to 0)
(indent-line-to nasm-basic-offset))
(when (> (- (point-max) orig) (point))
@@ -462,7 +462,7 @@
indent-line-function #'nasm-indent-line
comment-start ";"
imenu-generic-expression
- `((nil ,(concat "^\\s-*\\(" nasm-label-regexp "\\)\\s-*:") 1))))
+ `((nil ,(concat "^\\s-*" nasm-label-regexp) 1))))
(provide 'nasm-mode)
- [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, 2021/08/29
- [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 <=
- [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
- [nongnu] elpa/nasm-mode 5110886 64/67: Add type specification to nasm-basic-offset, ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 96a06c0 65/67: Support M-; (comment-dwim function), ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 65ca654 67/67: make comment functions local, ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode b384240 04/67: Include prefixes in smart indentation., ELPA Syncer, 2021/08/29
- [nongnu] elpa/nasm-mode 3da1454 12/67: Add a docstring to nasm-mode., ELPA Syncer, 2021/08/29