diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-06-17 10:15:17 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-17 10:15:17 -0700 |
commit | 2f475317f2a3f8cf3b1a4bd16445ff9fecfd30df (patch) | |
tree | f74823fb4c205fb20014dd707ebdd4cbc9166236 /userdiff.c | |
parent | Merge branch 'ba/clone-remote-submodules' (diff) | |
parent | userdiff: fix grammar and style issues (diff) | |
download | tgif-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.c | 7 |
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 */ |