diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-12-01 09:04:35 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-12-01 09:04:36 -0800 |
| commit | 376e7309e142d4cc95343faa5afd78fc5e27a135 (patch) | |
| tree | 875ef67a8a1cf895b282ae0910a6e91a493a2549 /userdiff.c | |
| parent | 9a5d34c6dc7e0b98b02482e30d459d4198018a72 (diff) | |
| parent | a807200f67588f6e30a7b6ac4a3ad97ad176ccc7 (diff) | |
| download | git-376e7309e142d4cc95343faa5afd78fc5e27a135.tar.xz | |
Merge branch 'ln/userdiff-elixir'
The patterns to detect function boundary for Elixir language has
been added.
* ln/userdiff-elixir:
userdiff: add Elixir to supported userdiff languages
Diffstat (limited to 'userdiff.c')
| -rw-r--r-- | userdiff.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/userdiff.c b/userdiff.c index e187d356f6..577053c10a 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" |
