From 063f26da6135605493364907106490f07993c28a Mon Sep 17 00:00:00 2001 From: taku0 Date: Wed, 23 Feb 2022 16:09:31 +0900 Subject: [PATCH] Support value modifier --- kotlin-mode-lexer.el | 7 ++++--- test/pathological.kt | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/kotlin-mode-lexer.el b/kotlin-mode-lexer.el index cf37034..0402325 100644 --- a/kotlin-mode-lexer.el +++ b/kotlin-mode-lexer.el @@ -578,7 +578,7 @@ expression as a token with one of the following types: '("vararg" "crossinline" "noinline")) (defconst kotlin-mode--function-modifier-keywords - '("tailrec" "operator" "infix" "inline" "external" "suspend")) + '("tailrec" "operator" "infix" "inline" "value" "external" "suspend")) (defconst kotlin-mode--modifier-keywords (append kotlin-mode--inheritance-modifier-keywords @@ -644,8 +644,9 @@ expression as a token with one of the following types: ;; Labels (eq (kotlin-mode--token-type previous-token) 'label) ;; Modifiers - (member (kotlin-mode--token-text previous-token) - kotlin-mode--modifier-keywords)) + (and (member (kotlin-mode--token-text previous-token) + kotlin-mode--modifier-keywords) + (not (equal (kotlin-mode--token-text previous-token) "value")))) nil) ;; Tokens that cannot end a statement diff --git a/test/pathological.kt b/test/pathological.kt index 09e7c41..c12342f 100644 --- a/test/pathological.kt +++ b/test/pathological.kt @@ -425,8 +425,15 @@ public ) -> C + + // value class + + value + class Foo { // KNOWN_BUG + } // KNOWN_BUG } + // statements fun foo() { //explicit semicolons