summaryrefslogtreecommitdiff
path: root/userdiff.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-06-17 10:15:17 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-06-17 10:15:17 -0700
commit2f475317f2a3f8cf3b1a4bd16445ff9fecfd30df (patch)
treef74823fb4c205fb20014dd707ebdd4cbc9166236 /userdiff.c
parentMerge branch 'ba/clone-remote-submodules' (diff)
parentuserdiff: fix grammar and style issues (diff)
downloadtgif-2f475317f2a3f8cf3b1a4bd16445ff9fecfd30df.tar.xz
Merge branch 'bl/userdiff-octave'
The pattern "git diff/grep" use to extract funcname and words boundary for Matlab has been extend to cover Octave, which is more or less equivalent. * bl/userdiff-octave: userdiff: fix grammar and style issues userdiff: add Octave
Diffstat (limited to 'userdiff.c')
-rw-r--r--userdiff.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/userdiff.c b/userdiff.c
index 3a78fbf504..04270fb4d7 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -58,7 +58,12 @@ PATTERNS("java",
"|[-+*/<>%&^|=!]="
"|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|"),
PATTERNS("matlab",
- "^[[:space:]]*((classdef|function)[[:space:]].*)$|^%%[[:space:]].*$",
+ /*
+ * Octave pattern is mostly the same as matlab, except that '%%%' and
+ * '##' can also be used to begin code sections, in addition to '%%'
+ * that is understood by both.
+ */
+ "^[[: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 */