[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/kotlin-mode 6aa6d56c0a 131/162: Merge pull request #42 fro
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/kotlin-mode 6aa6d56c0a 131/162: Merge pull request #42 from taku0/add_keywords |
Date: |
Sat, 29 Jan 2022 08:25:30 -0500 (EST) |
branch: elpa/kotlin-mode
commit 6aa6d56c0a04e655e3cbfd1ab7904a45b73ae21c
Merge: b4b575ce3a 3c48b34e0d
Author: Gregg Hernandez <greggory.hz@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #42 from taku0/add_keywords
Add highlighted keywords
---
kotlin-mode.el | 59 +++++++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 44 insertions(+), 15 deletions(-)
diff --git a/kotlin-mode.el b/kotlin-mode.el
index f6223a561d..320fff191c 100644
--- a/kotlin-mode.el
+++ b/kotlin-mode.el
@@ -138,6 +138,8 @@
;; Strings
(modify-syntax-entry ?\" "\"" st)
+ (modify-syntax-entry ?\' "\"" st)
+ (modify-syntax-entry ?` "\"" st)
;; `_' as being a valid part of a word
(modify-syntax-entry ?_ "w" st)
@@ -155,7 +157,7 @@
'("package" "import"))
(defconst kotlin-mode--type-decl-keywords
- '("nested" "inner" "data" "class" "interface" "trait" "typealias" "enum"
"object"))
+ '("sealed" "inner" "data" "class" "interface" "trait" "typealias" "enum"
"object"))
(defconst kotlin-mode--fun-decl-keywords
'("fun"))
@@ -176,13 +178,17 @@
(defconst kotlin-mode--context-variables-keywords
'("field" "it" "this" "super"))
+(defconst kotlin-mode--generic-type-parameter-keywords
+ '("where"))
+
(defvar kotlin-mode--keywords
(append kotlin-mode--misc-keywords
kotlin-mode--type-decl-keywords
kotlin-mode--fun-decl-keywords
kotlin-mode--val-decl-keywords
kotlin-mode--statement-keywords
- kotlin-mode--context-variables-keywords)
+ kotlin-mode--context-variables-keywords
+ kotlin-mode--generic-type-parameter-keywords)
"Keywords used in Kotlin language.")
(defconst kotlin-mode--constants-keywords
@@ -191,7 +197,9 @@
(defconst kotlin-mode--modifier-keywords
'("open" "private" "protected" "public" "lateinit"
"override" "abstract" "final" "companion"
- "annotation" "internal" "const" "in" "out")) ;; "in" "out"
+ "annotation" "internal" "const" "in" "out"
+ "actual" "expect" "crossinline" "inline" "noinline" "external"
+ "infix" "operator" "reified" "suspend" "tailrec" "vararg"))
(defconst kotlin-mode--property-keywords
'("by" "get" "set")) ;; "by" "get" "set"
@@ -199,11 +207,18 @@
(defconst kotlin-mode--initializer-keywords
'("init" "constructor"))
+(defconst kotlin-mode--annotation-use-site-target-keywords
+ '("delegate" "field" "file" "get" "param" "property" "receiver" "set"
+ "setparam"))
+
+(defconst kotlin-mode--type-keywords
+ '("dynamic"))
+
(defvar kotlin-mode--font-lock-keywords
`(;; Keywords
(,(rx-to-string
- `(and bow (group (or ,@kotlin-mode--keywords)) eow)
- t)
+ `(and bow (group (or ,@kotlin-mode--keywords)) eow)
+ t)
1 font-lock-keyword-face)
;; Package names
@@ -215,15 +230,20 @@
;; Types
(,(rx-to-string
- `(and bow upper (group (* (or word "<" ">" "." "?" "!" "*"))))
- t)
+ `(and bow upper (group (* (or word "<" ">" "." "?" "!" "*"))))
+ t)
+ 0 font-lock-type-face)
+
+ (,(rx-to-string
+ `(and bow (or ,@kotlin-mode--type-keywords) eow)
+ t)
0 font-lock-type-face)
;; Classes/Enums
(,(rx-to-string
- `(and bow (or ,@kotlin-mode--type-decl-keywords) eow (+ space)
- (group (+ word)) eow)
- t)
+ `(and bow (or ,@kotlin-mode--type-decl-keywords) eow (+ space)
+ (group (+ word)) eow)
+ t)
1 font-lock-type-face)
;; Constants
@@ -270,15 +290,24 @@
t)
1 font-lock-keyword-face)
+ ;; Annotation use-site targets
+ (,(rx-to-string
+ `(and "@"
+ (group (or ,@kotlin-mode--annotation-use-site-target-keywords))
+ eow)
+ t)
+ 1 font-lock-keyword-face)
+
+ ;; Labels
+ (,(rx-to-string
+ `(and bow (group (+ word)) "@")
+ t)
+ 1 font-lock-constant-face)
+
;; String interpolation
(kotlin-mode--match-interpolation 0 font-lock-variable-name-face t))
"Default highlighting expression for `kotlin-mode'")
-(defun kotlin-mode--new-font-lock-keywords ()
- '(
- ("package\\|import" . font-lock-keyword-face)
- ))
-
(defun kotlin-mode--syntax-propertize-interpolation ()
(let* ((pos (match-beginning 0))
(context (save-excursion
- [nongnu] elpa/kotlin-mode 8574583b30 105/162: Fix highlighting escaped identifiers in interpolations, (continued)
- [nongnu] elpa/kotlin-mode 8574583b30 105/162: Fix highlighting escaped identifiers in interpolations, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode eb3704e0e2 106/162: Set adaptive-fill-regexp to comment-start-skip, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 77d709ab54 107/162: Merge pull request #30 from CyberShadow/pull-20180624-142858, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode f08724b978 115/162: Improve handling of bracket-based indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 9fa0d75997 119/162: Tidy up bracked-based indentation into a class, and fix bugs, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 76921927de 117/162: Add a test for correct indentation of sample.kt, and get it to pass (with a few tweaks), ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 511e0a4ee3 121/162: Add in more kotlin keywords and indent get/set methods for properties, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 21ae667561 126/162: Add highlighted keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode b2d5ff65fc 125/162: Highlight single quotes and back quotes, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode dd24461721 128/162: Add prefix to class methods, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 6aa6d56c0a 131/162: Merge pull request #42 from taku0/add_keywords,
ELPA Syncer <=
- [nongnu] elpa/kotlin-mode 2f8a57ba64 138/162: Comment out failing emacs versions and link associated bugs, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 3062e14ac0 140/162: Merge pull request #47 from Emacs-Kotlin-Mode-Maintainers/emacs-version-test, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode d8d6461395 145/162: Fix warnings in tests, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 1f60b01659 148/162: Fix indentation of multiline comment at the beginning of buffer, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 9fba76ff2b 155/162: Fix highlighting of backquotes, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 3e0c34087b 162/162: Merge pull request #61 from taku0/make_underbar_symbol, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode cbeeef8986 015/162: kotlin-mode: Define type declaration keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode c6207be613 038/162: kotlin-mode: Add kotin-mode--syntax-propertize-function, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 78db8656d4 047/162: Fixed font lock for types, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 1624e7d795 052/162: add 'nested' and 'inner' class modifiers, ELPA Syncer, 2022/01/29