From 09188ed930bcb08e56d1846fbf9f5cb972a2d188 Mon Sep 17 00:00:00 2001 From: Jaydeep P Das Date: Sat, 12 Mar 2022 10:18:32 +0530 Subject: userdiff: add builtin diff driver for kotlin language. The xfuncname pattern finds func/class declarations in diffs to display as a hunk header. The word_regex pattern finds individual tokens in Kotlin code to generate appropriate diffs. This patch adds xfuncname regex and word_regex for Kotlin language. Signed-off-by: Jaydeep P Das Acked-by: Johannes Sixt Signed-off-by: Junio C Hamano --- t/t4034/kotlin/expect | 43 +++++++++++++++++++++++++++++++++++++++++++ t/t4034/kotlin/post | 30 ++++++++++++++++++++++++++++++ t/t4034/kotlin/pre | 30 ++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 t/t4034/kotlin/expect create mode 100644 t/t4034/kotlin/post create mode 100644 t/t4034/kotlin/pre (limited to 't/t4034/kotlin') diff --git a/t/t4034/kotlin/expect b/t/t4034/kotlin/expect new file mode 100644 index 0000000000..7f76f7540d --- /dev/null +++ b/t/t4034/kotlin/expect @@ -0,0 +1,43 @@ +diff --git a/pre b/post +index 11ea3de..2e1df4c 100644 +--- a/pre ++++ b/post +@@ -1,30 +1,30 @@ +println("Hello World!\n?") +(1) (-1e10) (0xabcdef) 'xy' +[ax] ax->b ay x.by +!a ax x.inv() ax*b ay x&b +ay +x*b ay x/b ay x%b +ay +x+b ay x-by +a shrshl b +ax<b ay x<=b ay x>b ay x>=b +ay +x==b ay x!=b ay x===b +ay +x and b +ay +x^b +ay +x or b +ay +x&&b ay x||b +ay +x=b ay x+=b ay x-=b ay x*=b ay x/=b ay x%=b ay x<<=b ay x>>=b ay x&=b ay x^=b ay x|=by +a=+=b c+==d e-=<=f g*=>=h i/=/j k%=%l m<<=<<n o>>=>>p q&=&r s^=^t u|=|v +a<<=<=b +a|||b a&&&b +ax,y +--a==!=--b +a++==!=++b +0xFF_EC_DE_5E 0b100_000 100_0000xFF_E1_DE_5E 0b100_100 200_000 +a=====b +a!!!=b +_32_33.find(arr) +X.fillfind() +X.uf+1 +X.u-+2 +a...b +a?.?:b +.32_00_456.32_00_446 diff --git a/t/t4034/kotlin/post b/t/t4034/kotlin/post new file mode 100644 index 0000000000..2e1df4c6d5 --- /dev/null +++ b/t/t4034/kotlin/post @@ -0,0 +1,30 @@ +println("Hello World?") +(1) (-1e10) (0xabcdef) 'y' +[x] x->y x.y +!x x.inv() x*y x&y +x*y x/y x%y +x+y x-y +a shl b +xy x>=y +x==y x!=y x===y +x and y +x^y +x or y +x&&y x||y +x=y x+=y x-=y x*=y x/=y x%=y x<<=y x>>=y x&=y x^=y x|=y +a+=b c=d e<=f g>=h i/j k%l m<>p q&r s^t u|v +a<=b +a|b a&b +x,y +--a!=--b +a++!=++b +0xFF_E1_DE_5E 0b100_100 200_000 +a===b +a!=b +_33.find(arr) +X.find() +X.f+1 +X.u+2 +a..b +a?:b +.32_00_446 diff --git a/t/t4034/kotlin/pre b/t/t4034/kotlin/pre new file mode 100644 index 0000000000..11ea3de665 --- /dev/null +++ b/t/t4034/kotlin/pre @@ -0,0 +1,30 @@ +println("Hello World!\n") +1 -1e10 0xabcdef 'x' +[a] a->b a.b +!a a.inv() a*b a&b +a*b a/b a%b +a+b a-b +a shr b +ab a>=b +a==b a!=b a===b +a and b +a^b +a or b +a&&b a||b +a=b a+=b a-=b a*=b a/=b a%=b a<<=b a>>=b a&=b a^=b a|=b +a=b c+=d e-=f g*=h i/=j k%=l m<<=n o>>=p q&=r s^=t u|=v +a<<=b +a||b a&&b +a,y +--a==--b +a++==++b +0xFF_EC_DE_5E 0b100_000 100_000 +a==b +a!!b +_32.find(arr) +X.fill() +X.u+1 +X.u-2 +a.b +a?.b +.32_00_456 -- cgit v1.2.3