summaryrefslogtreecommitdiff
path: root/userdiff.c
diff options
context:
space:
mode:
authorGustaf Hendeby <hendeby@isy.liu.se>2011-11-15 21:15:03 +0100
committerJunio C Hamano <gitster@pobox.com>2011-11-15 16:11:52 -0800
commit53b10a140527253f61cfc209a4e85e132c0bc4ee (patch)
treea56ca111bf140b32a6e3e796d44b68636e5c9f06 /userdiff.c
parentbc1bbe0c19a6ff39522b4fa3259f34150e308e1f (diff)
downloadgit-53b10a140527253f61cfc209a4e85e132c0bc4ee.tar.gz
Add built-in diff patterns for MATLAB codegh/userdiff-matlab
MATLAB is often used in industry and academia for scientific computations motivating it being included as a built-in pattern. Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'userdiff.c')
-rw-r--r--userdiff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/userdiff.c b/userdiff.c
index bf553ad91b..7c983c14ff 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -37,6 +37,9 @@ PATTERNS("java",
"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
"|[-+*/<>%&^|=!]="
"|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
+PATTERNS("matlab",
+ "^[[:space:]]*((classdef|function)[[:space:]].*)$|^%%[[:space:]].*$",
+ "[a-zA-Z_][a-zA-Z0-9_]*|[-+0-9.e]+|[=~<>]=|\\.[*/\\^']|\\|\\||&&"),
PATTERNS("objc",
/* Negate C statements that can look like functions */
"!^[ \t]*(do|for|if|else|return|switch|while)\n"