[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/kotlin-mode 52c8099b45 078/162: Merge pull request #1 from
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/kotlin-mode 52c8099b45 078/162: Merge pull request #1 from taktoa/master |
Date: |
Sat, 29 Jan 2022 08:25:24 -0500 (EST) |
branch: elpa/kotlin-mode
commit 52c8099b4507cedbcd3b92511abe1e0b1c4cab23
Merge: c051947e27 4aef379a2a
Author: Gregg Hernandez <greggory.hz@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #1 from taktoa/master
Various changes
---
Cask | 4 +--
kotlin-mode.el | 81 ++++++++++++++++++++++++----------------------------------
2 files changed, 35 insertions(+), 50 deletions(-)
diff --git a/Cask b/Cask
index 1d46d83ebe..2755da6ab0 100644
--- a/Cask
+++ b/Cask
@@ -6,6 +6,4 @@
(development
(depends-on "ecukes")
(depends-on "ert-expectations")
- (depends-on "ert-runner")
- (depends-on "rx")
- )
+ (depends-on "ert-runner"))
diff --git a/kotlin-mode.el b/kotlin-mode.el
index 0ed25cc941..aab40459e0 100644
--- a/kotlin-mode.el
+++ b/kotlin-mode.el
@@ -1,7 +1,7 @@
;;; kotlin-mode.el --- Major mode for kotlin
;; -*- lexical-binding: t; -*-
-;; Copyright (C) 2015 Shodai Yokoyama
+;; Copyright © 2015 Shodai Yokoyama
;; Author: Shodai Yokoyama (quantumcars@gmail.com)
;; Keywords: languages
@@ -30,13 +30,11 @@
(defcustom kotlin-mode-hook nil
"Hook run after entering `kotlin-mode'."
:type 'hook
- :group 'kotlin
- )
+ :group 'kotlin)
(defvar kotlin-mode-map (make-sparse-keymap)
- "Keymap used by `kotlin-mode'."
- )
+ "Keymap used by `kotlin-mode'.")
(defvar kotlin-mode-syntax-table
@@ -61,7 +59,7 @@
'("package" "import"))
(defconst kotlin-mode--type-decl-keywords
- '("class" "trait" "typealias"))
+ '("nested" "inner" "data" "class" "interface" "trait" "typealias" "enum"))
(defconst kotlin-mode--fun-decl-keywords
'("fun"))
@@ -70,8 +68,14 @@
'("val" "var"))
(defconst kotlin-mode--statement-keywords
- '("if" "else" "try" "while" "do"
- "throw" "return" "continue" "break" "when" "is" "in"))
+ '(;; Branching
+ "if" "else"
+ ;; Exceptions
+ "try" "catch" "finally" "throw"
+ ;; Loops
+ "while" "for" "do" "continue" "break"
+ ;; Miscellaneous
+ "when" "is" "in" "as"))
(defconst kotlin-mode--context-variables-keywords
'("this" "super"))
@@ -83,26 +87,24 @@
kotlin-mode--val-decl-keywords
kotlin-mode--statement-keywords
kotlin-mode--context-variables-keywords)
- "Keywords used in Kotlin language."
- )
+ "Keywords used in Kotlin language.")
(defconst kotlin-mode--constants-keywords
'("null" "true" "false"))
(defconst kotlin-mode--modifier-keywords
'("open" "private" "protected" "public"
- "override" "abstract" "final"))
+ "override" "abstract" "final"
+ "annotation" "internal")) ;; "in" "out"
(defconst kotlin-mode--property-keywords
- '("by" "get" "set"))
+ '()) ;; "by" "get" "set"
(defconst kotlin-mode--initializer-keywords
- '("init" "constructor")
- )
+ '("init" "constructor"))
(defvar kotlin-mode-font-lock-keywords
- `(
- ;; Keywords
+ `(;; Keywords
(,(rx-to-string
`(and bow (group (or ,@kotlin-mode--keywords)) eow)
t)
@@ -110,13 +112,13 @@
;; Types
(,(rx-to-string
- `(and (* space) ":" (* space) (group (+ word)))
+ `(and (* space) ":" (* space) (group (+ (or word "<" ">" "." "?" "!"))))
t)
0 font-lock-type-face)
;; Classes/Enums
(,(rx-to-string
- `(and bow "class" eow (+ space)
+ `(and bow (or ,@kotlin-mode--type-decl-keywords) eow (+ space)
(group (+ word)) eow)
t)
1 font-lock-type-face)
@@ -151,26 +153,13 @@
t)
1 font-lock-keyword-face)
- ;; try-catch-finally
- ;; `catch' and `finally' are valid identifier being used as variable
- (,(rx-to-string
- `(and bow (group "catch") eow
- (* space) (*? anything) "{" )
- t)
- 1 font-lock-keyword-face)
- (,(rx-to-string
- `(and bow (group "finally") eow
- (*? (or space ?\n)) "{")
- t)
- 1 font-lock-keyword-face)
-
;; Properties
;; by/get/set are valid identifiers being used as variable
;; TODO: Highlight keywords in the property declaration statement
- (,(rx-to-string
- `(and bow (group (or ,@kotlin-mode--property-keywords)) eow)
- t)
- 1 font-lock-keyword-face)
+ ;; (,(rx-to-string
+ ;; `(and bow (group (or ,@kotlin-mode--property-keywords)) eow)
+ ;; t)
+ ;; 1 font-lock-keyword-face)
;; Constructor/Initializer blocks
(,(rx-to-string
@@ -186,10 +175,8 @@
1 font-lock-string-face)
;; String interpolation
- (kotlin-mode--match-interpolation 0 font-lock-variable-name-face t)
- )
- "Default highlighting expression for `kotlin-mode'"
- )
+ (kotlin-mode--match-interpolation 0 font-lock-variable-name-face t))
+ "Default highlighting expression for `kotlin-mode'")
(defun kotlin-mode--syntax-propertize-interpolation ()
(let* ((pos (match-beginning 0))
@@ -199,8 +186,7 @@
(put-text-property pos
(1+ pos)
'kotlin-property--interpolation
- (match-data))))
- )
+ (match-data)))))
(defun kotlin-mode--syntax-propertize-function (start end)
(let ((case-fold-search))
@@ -213,8 +199,7 @@
`(or (group "${" (* ,identifier) "}")
(group "$" (+ ,identifier)))))
(0 (ignore (kotlin-mode--syntax-propertize-interpolation)))))
- start end))
- )
+ start end)))
(defun kotlin-mode--match-interpolation (limit)
(let ((pos (next-single-char-property-change (point)
@@ -227,8 +212,7 @@
(if value
(progn (set-match-data value)
t)
- (kotlin-mode--match-interpolation limit)))))
- )
+ (kotlin-mode--match-interpolation limit))))))
(define-derived-mode kotlin-mode prog-mode "Kotlin"
@@ -236,10 +220,13 @@
(setq-local font-lock-defaults '((kotlin-mode-font-lock-keywords) nil nil))
(setq-local syntax-propertize-function
#'kotlin-mode--syntax-propertize-function)
+ (set (make-local-variable 'comment-start) "//")
+ (set (make-local-variable 'comment-padding) 1)
+ (set (make-local-variable 'comment-start-skip) "\\(//+\\|/\\*+\\)\\s *")
+ (set (make-local-variable 'comment-end) "")
:group 'kotlin
- :syntax-table kotlin-mode-syntax-table
- )
+ :syntax-table kotlin-mode-syntax-table)
(provide 'kotlin-mode)
;;; kotlin-mode.el ends here
- [nongnu] elpa/kotlin-mode 613539eedc 042/162: Fix trailing parentheses, (continued)
- [nongnu] elpa/kotlin-mode 613539eedc 042/162: Fix trailing parentheses, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode b4b1ace8cc 043/162: In kotlin-mode.el: (c) -> ©, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 9762ca895d 050/162: The characters '?' and '!' are now font-locked properly in types, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 8910b4bf55 054/162: Add "as" to set of statement keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 4aef379a2a 062/162: Removed rx dependency from Caskfile, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 0d89426a75 064/162: Merge branch 'package-improvements' of https://github.com/rexim/kotlin-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 565a266142 063/162: Add kt to auto-mode-alist to trigger kotlin-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 043615d3c3 065/162: Merge branch 'master' of https://github.com/purcell/kotlin-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode b4ec722a4c 071/162: lexical-binding setting must be at first line, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode ed5bb641a9 073/162: makes tab-width configurable, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 52c8099b45 078/162: Merge pull request #1 from taktoa/master,
ELPA Syncer <=
- [nongnu] elpa/kotlin-mode afbf3ae8fe 081/162: Merge branch 'master' of https://github.com/gregghz/kotlin-mode into gregghz-master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode cd4901acc6 080/162: Merge pull request #6 from jasonm23/patch-1, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode f54da34b3f 088/162: Merge pull request #11 from russel/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode c051947e27 041/162: kotlin-mode: Highlight string interpolations, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode a659099864 037/162: kotlin-mode: Add kotlin-mode--syntax-propertize-interpolation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode c40557c411 053/162: Merge pull request #1 from gergoerdi/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 2f3d991159 060/162: Remove redundant declaration of hook and keymap, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 953bb91328 151/162: Merge pull request #50 from taku0/fix-comment-at-bob, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode ab61099682 152/162: use 4 for defualt tab width, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode e5c6d845e6 093/162: Merge pull request #19 from gregghz/fixes-closing-bracket-indentation, ELPA Syncer, 2022/01/29