[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 71c7f59 101/495: use correct regexps for labels
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 71c7f59 101/495: use correct regexps for labels |
Date: |
Sat, 7 Aug 2021 09:04:52 -0400 (EDT) |
branch: elpa/go-mode
commit 71c7f595be952934f06fe3be752eced0b1e7c8fc
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>
use correct regexps for labels
labels don't only consist of word characters but also unicode and
underscores
---
go-mode.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index ba1c8ef..3f9bdb9 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -13,6 +13,7 @@
(defconst go-dangling-operators-regexp "[^-]-\\|[^+]\\+\\|[/*&><.=|^]")
(defconst gofmt-stdin-tag "<standard input>")
(defconst go-identifier-regexp "[[:word:][:multibyte:]_]+")
+(defconst go-label-regexp go-identifier-regexp)
(defconst go-type-regexp "[[:word:][:multibyte:]_*]+")
(defconst go-func-regexp (concat "\\<func\\>\\s *\\(" go-identifier-regexp
"\\)"))
(defconst go-func-meth-regexp (concat "\\<func\\>\\s *\\(?:(\\s *"
go-identifier-regexp "\\s +" go-type-regexp "\\s *)\\s *\\)?\\("
go-identifier-regexp "\\)("))
@@ -95,8 +96,8 @@
;; Like the original go-mode this also marks compound literal
;; fields. There, it was marked as to fix, but I grew quite
;; accustomed to it, so it'll stay for now.
- (,(concat "^[[:space:]]*\\(" go-identifier-regexp
"\\)[[:space:]]*:\\(\\S.\\|$\\)") 1 font-lock-constant-face) ;; Labels and
compound literal fields
- ("\\<\\(goto\\|break\\|continue\\)\\>[[:space:]]*\\(\\w+\\)" 2
font-lock-constant-face)))) ;; labels in goto/break/continue
+ (,(concat "^[[:space:]]*\\(" go-label-regexp
"\\)[[:space:]]*:\\(\\S.\\|$\\)") 1 font-lock-constant-face) ;; Labels and
compound literal fields
+ (,(concat "\\<\\(goto\\|break\\|continue\\)\\>[[:space:]]*\\("
go-label-regexp "\\)") 2 font-lock-constant-face)))) ;; labels in
goto/break/continue
(defvar go-mode-map
(let ((m (make-sparse-keymap)))
@@ -150,7 +151,7 @@ STOP-AT-STRING is not true, over strings."
(go-goto-beginning-of-string-or-comment))
(setq pos (point))
(beginning-of-line)
- (if (or (looking-at "^[[:word:]]+:") (looking-at "^[[:space:]]*\\(case
.+\\|default\\):"))
+ (if (or (looking-at (concat "^" go-label-regexp ":")) (looking-at
"^[[:space:]]*\\(case .+\\|default\\):"))
(end-of-line 0)
(goto-char pos))
(if (/= start-pos (point))
@@ -228,7 +229,7 @@ STOP-AT-STRING is not true, over strings."
(if (go-in-string-or-comment-p)
(goto-char point)
(setq indent (go-indentation-at-point))
- (if (looking-at "[[:word:]]+:\\([[:space:]]*/.+\\)?$\\|case
.+:\\|default:")
+ (if (looking-at (concat go-label-regexp ":\\([[:space:]]*/.+\\)?$\\|case
.+:\\|default:"))
(decf indent tab-width))
(setq shift-amt (- indent (current-column)))
(if (zerop shift-amt)
- [nongnu] elpa/go-mode bfbbb7e 072/495: remove debug output, (continued)
- [nongnu] elpa/go-mode bfbbb7e 072/495: remove debug output, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e0de87c 075/495: do not indent labels in column 0 but in normal indentation minus one, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8216ff9 076/495: some nicer lisp, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7d47e3c 079/495: remove old go-propertize-syntax code, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 58640c3 080/495: Do not consider \ an escape character when in raw strings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0c25389 081/495: do not set syntax-propertize-function for emacsen that don't know it (GNU Emacs <24 for one), ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0ecc391 086/495: document issue with go build -o /dev/null, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d7c48cb 089/495: give in and require cl at runtime, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 23310e5 090/495: be more lenient when finding commented imports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2d500b3 091/495: builtins and keywords need to be surrounded by symbols, not word characters, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 71c7f59 101/495: use correct regexps for labels,
ELPA Syncer <=
- [nongnu] elpa/go-mode 3139c0f 107/495: fix regexp-opt usage for emacs <24, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8fb900e 062/495: refactor, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 183c028 068/495: use (car (last)) instead of (car (reverse)), ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0f71cee 083/495: add autoload cookie to gofmt-before-save, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f0059f6 098/495: in go-packages, skip over directories that do not contain a /pkg subdirectory, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3d3ba73 103/495: Use completing-read in godoc--read-query, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 67bb849 108/495: use \\_< instead of \\< and do so in a way that won't break XEmacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4637dd6 110/495: Mention gofmt rewrite in README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d910a0d 112/495: Make _ a word constituent to accomodate inferiority of XEmacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c1074a1 114/495: improve regexps for array, slice and map types, ELPA Syncer, 2021/08/07