Merge branch 'jd/userdiff-kotlin'

A new built-in userdiff driver for kotlin.

* jd/userdiff-kotlin:
  userdiff: add builtin diff driver for kotlin language.
This commit is contained in:
Junio C Hamano
2022-03-23 14:09:29 -07:00
15 changed files with 167 additions and 0 deletions

View File

@ -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].*",
/* -- */