summaryrefslogtreecommitdiff
path: root/userdiff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-03-23 14:09:29 -0700
committerJunio C Hamano <gitster@pobox.com>2022-03-23 14:09:29 -0700
commit3ece3cb865d55a506bd7b927d7dd824c77972029 (patch)
treee180d56549e3e35192b508ceaf52fca3af6e78d8 /userdiff.c
parentdc2588b2ba2b265e74c10efcfe20a78b291dfad4 (diff)
parent09188ed930bcb08e56d1846fbf9f5cb972a2d188 (diff)
downloadgit-3ece3cb865d55a506bd7b927d7dd824c77972029.tar.gz
Merge branch 'jd/userdiff-kotlin'
A new built-in userdiff driver for kotlin. * jd/userdiff-kotlin: userdiff: add builtin diff driver for kotlin language.
Diffstat (limited to 'userdiff.c')
-rw-r--r--userdiff.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/userdiff.c b/userdiff.c
index 2d9eb99bf2..151d9a5278 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -180,6 +180,18 @@ PATTERNS("java",
"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
"|[-+*/<>%&^|=!]="
"|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
+PATTERNS("kotlin",
+ "^[ \t]*(([a-z]+[ \t]+)*(fun|class|interface)[ \t]+.*)$",
+ /* -- */
+ "[a-zA-Z_][a-zA-Z0-9_]*"
+ /* hexadecimal and binary numbers */
+ "|0[xXbB][0-9a-fA-F_]+[lLuU]*"
+ /* integers and floats */
+ "|[0-9][0-9_]*([.][0-9_]*)?([Ee][-+]?[0-9]+)?[fFlLuU]*"
+ /* floating point numbers beginning with decimal point */
+ "|[.][0-9][0-9_]*([Ee][-+]?[0-9]+)?[fFlLuU]?"
+ /* unary and binary operators */
+ "|[-+*/<>%&^|=!]==?|--|\\+\\+|<<=|>>=|&&|\\|\\||->|\\.\\*|!!|[?:.][.:]"),
PATTERNS("markdown",
"^ {0,3}#{1,6}[ \t].*",
/* -- */