Git fork

userdiff: add Elixir to supported userdiff languages

Adds support for xfuncref in Elixir[1] language which is Ruby-like
language that runs on Erlang[3] Virtual Machine (BEAM).

[1]: https://elixir-lang.org
[2]: https://www.erlang.org

Signed-off-by: Łukasz Niemier <lukasz@niemier.pl>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by hauleth.dev and committed by

Junio C Hamano a807200f da72936f

+78
+2
Documentation/gitattributes.txt
··· 812 812 813 813 - `dts` suitable for devicetree (DTS) files. 814 814 815 + - `elixir` suitable for source code in the Elixir language. 816 + 815 817 - `fortran` suitable for source code in the Fortran language. 816 818 817 819 - `fountain` suitable for Fountain documents.
+1
t/t4018-diff-funcname.sh
··· 32 32 csharp 33 33 css 34 34 dts 35 + elixir 35 36 fortran 36 37 fountain 37 38 golang
+5
t/t4018/elixir-do-not-pick-end
··· 1 + defmodule RIGHT do 2 + end 3 + # 4 + # 5 + # ChangeMe; do not pick up 'end' line
+6
t/t4018/elixir-ex-unit-test
··· 1 + defmodule Test do 2 + test "RIGHT" do 3 + assert true == true 4 + assert ChangeMe 5 + end 6 + end
+5
t/t4018/elixir-function
··· 1 + def function(RIGHT, arg) do 2 + # comment 3 + # comment 4 + ChangeMe 5 + end
+5
t/t4018/elixir-macro
··· 1 + defmacro foo(RIGHT) do 2 + # Code 3 + # Code 4 + ChangeMe 5 + end
+9
t/t4018/elixir-module
··· 1 + defmodule RIGHT do 2 + @moduledoc """ 3 + Foo bar 4 + """ 5 + 6 + def ChangeMe(a) where is_map(a) do 7 + a 8 + end 9 + end
+8
t/t4018/elixir-module-func
··· 1 + defmodule Foo do 2 + def fun(RIGHT) do 3 + # Code 4 + # Code 5 + # Code 6 + ChangeMe 7 + end 8 + end
+9
t/t4018/elixir-nested-module
··· 1 + defmodule MyApp.RIGHT do 2 + @moduledoc """ 3 + Foo bar 4 + """ 5 + 6 + def ChangeMe(a) where is_map(a) do 7 + a 8 + end 9 + end
+5
t/t4018/elixir-private-function
··· 1 + defp function(RIGHT, arg) do 2 + # comment 3 + # comment 4 + ChangeMe 5 + end
+6
t/t4018/elixir-protocol
··· 1 + defprotocol RIGHT do 2 + @doc """ 3 + Calculates the size (and not the length!) of a data structure 4 + """ 5 + def size(data, ChangeMe) 6 + end
+5
t/t4018/elixir-protocol-implementation
··· 1 + defimpl RIGHT do 2 + # Docs 3 + # Docs 4 + def foo(ChangeMe), do: :ok 5 + end
+12
userdiff.c
··· 32 32 /* Property names and math operators */ 33 33 "[a-zA-Z0-9,._+?#-]+" 34 34 "|[-+*/%&^|!~]|>>|<<|&&|\\|\\|"), 35 + PATTERNS("elixir", 36 + "^[ \t]*((def(macro|module|impl|protocol|p)?|test)[ \t].*)$", 37 + /* Atoms, names, and module attributes */ 38 + "|[@:]?[a-zA-Z0-9@_?!]+" 39 + /* Numbers with specific base */ 40 + "|[-+]?0[xob][0-9a-fA-F]+" 41 + /* Numbers */ 42 + "|[-+]?[0-9][0-9_.]*([eE][-+]?[0-9_]+)?" 43 + /* Operators and atoms that represent them */ 44 + "|:?(\\+\\+|--|\\.\\.|~~~|<>|\\^\\^\\^|<?\\|>|<<<?|>?>>|<<?~|~>?>|<~>|<=|>=|===?|!==?|=~|&&&?|\\|\\|\\|?|=>|<-|\\\\\\\\|->)" 45 + /* Not real operators, but should be grouped */ 46 + "|:?%[A-Za-z0-9_.]\\{\\}?"), 35 47 IPATTERN("fortran", 36 48 "!^([C*]|[ \t]*!)\n" 37 49 "!^[ \t]*MODULE[ \t]+PROCEDURE[ \t]\n"