summaryrefslogtreecommitdiff
path: root/userdiff.c
diff options
context:
space:
mode:
authorŁukasz Niemier <lukasz@niemier.pl>2019-11-08 21:38:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-11-10 06:26:26 (GMT)
commita807200f67588f6e30a7b6ac4a3ad97ad176ccc7 (patch)
treefc8563a426a920ff97c55287e2fd138fcccb6249 /userdiff.c
parentda72936f544fec5a335e66432610e4cef4430991 (diff)
downloadgit-a807200f67588f6e30a7b6ac4a3ad97ad176ccc7.zip
git-a807200f67588f6e30a7b6ac4a3ad97ad176ccc7.tar.gz
git-a807200f67588f6e30a7b6ac4a3ad97ad176ccc7.tar.bz2
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>
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 e187d35..577053c 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -32,6 +32,18 @@ PATTERNS("dts",
/* Property names and math operators */
"[a-zA-Z0-9,._+?#-]+"
"|[-+*/%&^|!~]|>>|<<|&&|\\|\\|"),
+PATTERNS("elixir",
+ "^[ \t]*((def(macro|module|impl|protocol|p)?|test)[ \t].*)$",
+ /* Atoms, names, and module attributes */
+ "|[@:]?[a-zA-Z0-9@_?!]+"
+ /* Numbers with specific base */
+ "|[-+]?0[xob][0-9a-fA-F]+"
+ /* Numbers */
+ "|[-+]?[0-9][0-9_.]*([eE][-+]?[0-9_]+)?"
+ /* Operators and atoms that represent them */
+ "|:?(\\+\\+|--|\\.\\.|~~~|<>|\\^\\^\\^|<?\\|>|<<<?|>?>>|<<?~|~>?>|<~>|<=|>=|===?|!==?|=~|&&&?|\\|\\|\\|?|=>|<-|\\\\\\\\|->)"
+ /* Not real operators, but should be grouped */
+ "|:?%[A-Za-z0-9_.]\\{\\}?"),
IPATTERN("fortran",
"!^([C*]|[ \t]*!)\n"
"!^[ \t]*MODULE[ \t]+PROCEDURE[ \t]\n"