From 5f6d88136d1fe49a41743bf38dc14c80b85619d5 Mon Sep 17 00:00:00 2001 From: Boris Kheyfets Date: Tue, 27 Oct 2020 23:39:55 +0300 Subject: [PATCH] Update jvm.py Added support for kotlin scripts. --- pygments/lexers/jvm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pygments/lexers/jvm.py b/pygments/lexers/jvm.py index ee0bc7af95..98bb820fa5 100644 --- a/pygments/lexers/jvm.py +++ b/pygments/lexers/jvm.py @@ -1020,7 +1020,7 @@ class KotlinLexer(RegexLexer): name = 'Kotlin' aliases = ['kotlin'] - filenames = ['*.kt'] + filenames = ['*.kt', '*.kts'] mimetypes = ['text/x-kotlin'] flags = re.MULTILINE | re.DOTALL | re.UNICODE @@ -1042,6 +1042,7 @@ class KotlinLexer(RegexLexer): (r'\s+', Text), (r'\\\n', Text), # line continuation (r'//.*?\n', Comment.Single), + (r'^#!/.+?\n', Comment.Single), # shebang for kotlin scripts (r'/[*].*?[*]/', Comment.Multiline), (r'""".*?"""', String), (r'\n', Text),