[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode f2761fb313 178/222: Extract type-name rege
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode f2761fb313 178/222: Extract type-name regexp into reusable constant. |
Date: |
Sun, 6 Feb 2022 16:59:30 -0500 (EST) |
branch: elpa/typescript-mode
commit f2761fb313037ebf23a1dd0f2a3a273be5fc644c
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Extract type-name regexp into reusable constant.
---
typescript-mode.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/typescript-mode.el b/typescript-mode.el
index 2943650868..a911f7f169 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -63,6 +63,9 @@
;;; Constants
+(defconst typescript--type-name-re "[A-Z][A-Za-z0-9]+"
+ "Regexp matching a conventional TypeScript type-name. Must start with
upper-case letter!")
+
(defconst typescript--name-start-re "[a-zA-Z_$]"
"Regexp matching the start of a typescript identifier, without grouping.")
@@ -2006,12 +2009,15 @@ This performs fontification according to
`typescript--class-styles'."
;; - private generic: SomeType<Foo>
;; - private genericArray: SomeType<Foo>[]
;; - function testFunc(): SomeType<> {
-
(":\\s-\\([A-Z][A-Za-z0-9]+\\)\\(<[A-Z][A-Za-z0-9]+>\\)?\\(\[\]\\)?\\([,;]\\)?\\s-*{?"
- (1 'font-lock-type-face))
+ ;; TODO: namespaced classes!
+ ,(list
+ (concat ":\\s-\\(" typescript--type-name-re "\\)\\(<"
typescript--type-name-re ">\\)?\\(\[\]\\)?\\([,;]\\)?\\s-*{?")
+ '(1 'font-lock-type-face))
;; type-casts
- ("<\\([A-Z][A-Za-z0-9]+\\)>"
- (1 'font-lock-type-face))
+ ,(list
+ (concat "<\\(" typescript--type-name-re "\\)>")
+ '(1 'font-lock-type-face))
;; highlights that append to previous levels
;;
- [nongnu] elpa/typescript-mode 1d32c6b3a8 066/222: Improve readability of the code., (continued)
- [nongnu] elpa/typescript-mode 1d32c6b3a8 066/222: Improve readability of the code., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 46e032e932 054/222: Fix list of values compilation mode should use., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 56a1ea861f 082/222: Merge pull request #55 from bkruczyk/fix-regex-font-locking, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 0353bd72f8 133/222: Add bigint, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 18dc5a36a6 140/222: Fixes typo in the README file., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 36105abbb1 141/222: Add 26.1 to the versions we test on., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 08ceb01ff3 142/222: We no longer support 24.3, fixes #100., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f33751e98f 145/222: Fix a case of bad indentation., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1ec94013e7 146/222: Run emacs --version prior to running cask., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 871c23111a 157/222: rename to typescript-mode and move to root, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f2761fb313 178/222: Extract type-name regexp into reusable constant.,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode b4109ac220 192/222: Merge pull request #139 from phst/should-not, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 12b6aae381 196/222: Merge pull request #141 from cireu/fix-auto-mode-list-re, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 3562c0c1f3 203/222: Add badges to README., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 072f8ad43f 213/222: fix eval invocation in typescript--re-search-backward to work with lexical scoping, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2a58631230 207/222: Bump version for ELPA, ELPA Syncer, 2022/02/06