File tree Expand file tree Collapse file tree 7 files changed +39
-1
lines changed Expand file tree Collapse file tree 7 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -500,6 +500,8 @@ patterns are available:
500
500
501
501
- `java` suitable for source code in the Java language.
502
502
503
+ - `matlab` suitable for source code in the MATLAB language.
504
+
503
505
- `objc` suitable for source code in the Objective-C language.
504
506
505
507
- `pascal` suitable for source code in the Pascal/Delphi language.
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ test_expect_funcname () {
105
105
grep " ^@@.*@@ $1 " diff
106
106
}
107
107
108
- for p in bibtex cpp csharp fortran html java objc pascal perl php python ruby tex
108
+ for p in bibtex cpp csharp fortran html java matlab objc pascal perl php python ruby tex
109
109
do
110
110
test_expect_success " builtin $p pattern compiles" '
111
111
echo "*.java diff=$p" >.gitattributes &&
Original file line number Diff line number Diff line change @@ -299,6 +299,7 @@ test_language_driver csharp
299
299
test_language_driver fortran
300
300
test_language_driver html
301
301
test_language_driver java
302
+ test_language_driver matlab
302
303
test_language_driver objc
303
304
test_language_driver pascal
304
305
test_language_driver perl
Original file line number Diff line number Diff line change
1
+ <BOLD>diff --git a/pre b/post<RESET>
2
+ <BOLD>index dc204db..70e05f0 100644<RESET>
3
+ <BOLD>--- a/pre<RESET>
4
+ <BOLD>+++ b/post<RESET>
5
+ <CYAN>@@ -1,9 +1,9 @@<RESET>
6
+ (<RED>1<RESET><GREEN>0<RESET>) (<RED>-1e10<RESET><GREEN>-0e10<RESET>) '<RED>b<RESET><GREEN>y<RESET>';
7
+ [<RED>a<RESET><GREEN>x<RESET>] {<RED>a<RESET><GREEN>x<RESET>} <RED>a<RESET><GREEN>x<RESET>.<RED>b<RESET><GREEN>y<RESET>;
8
+ ~<RED>a<RESET><GREEN>x<RESET>;
9
+ <RED>a<RESET><GREEN>x<RESET>*<RED>b a<RESET><GREEN>y x<RESET>.*<RED>b a<RESET><GREEN>y x<RESET>/<RED>b a<RESET><GREEN>y x<RESET>./<RED>b a<RESET><GREEN>y x<RESET>^<RED>b a<RESET><GREEN>y x<RESET>.^<RED>b a<RESET><GREEN>y x<RESET>.\<RED>b a<RESET><GREEN>y x<RESET>.';
10
+ <RED>a<RESET><GREEN>x<RESET>+<RED>b a<RESET><GREEN>y x<RESET>-<RED>b<RESET><GREEN>y<RESET>;
11
+ <RED>a<RESET><GREEN>x<RESET>&<RED>b a<RESET><GREEN>y x<RESET>&&<RED>b a<RESET><GREEN>y x<RESET>|<RED>b a<RESET><GREEN>y x<RESET>||<RED>b<RESET><GREEN>y<RESET>;
12
+ <RED>a<RESET><GREEN>x<RESET><<RED>b a<RESET><GREEN>y x<RESET><=<RED>b a<RESET><GREEN>y x<RESET>><RED>b a<RESET><GREEN>y x<RESET>>=<RED>b<RESET><GREEN>y<RESET>;
13
+ <RED>a<RESET><GREEN>x<RESET>==<RED>b a<RESET><GREEN>y x<RESET>~=<RED>b<RESET><GREEN>y<RESET>;
14
+ <RED>a<RESET><GREEN>x<RESET>,<RED>b<RESET><GREEN>y<RESET>;
Original file line number Diff line number Diff line change
1
+ (0) (-0e10) 'y';
2
+ [x] {x} x.y;
3
+ ~x;
4
+ x*y x.*y x/y x./y x^y x.^y x.\y x.';
5
+ x+y x-y;
6
+ x&y x&&y x|y x||y;
7
+ x<y x<=y x>y x>=y;
8
+ x==y x~=y;
9
+ x,y;
Original file line number Diff line number Diff line change
1
+ (1) (-1e10) 'b';
2
+ [a] {a} a.b;
3
+ ~a;
4
+ a*b a.*b a/b a./b a^b a.^b a.\b a.';
5
+ a+b a-b;
6
+ a&b a&&b a|b a||b;
7
+ a<b a<=b a>b a>=b;
8
+ a==b a~=b;
9
+ a,b;
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ PATTERNS("java",
37
37
"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
38
38
"|[-+*/<>%&^|=!]="
39
39
"|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|" ),
40
+ PATTERNS ("matlab" ,
41
+ "^[[:space:]]*((classdef|function)[[:space:]].*)$|^%%[[:space:]].*$" ,
42
+ "[a-zA-Z_][a-zA-Z0-9_]*|[-+0-9.e]+|[=~<>]=|\\.[*/\\^']|\\|\\||&&" ),
40
43
PATTERNS ("objc" ,
41
44
/* Negate C statements that can look like functions */
42
45
"!^[ \t]*(do|for|if|else|return|switch|while)\n"
You can’t perform that action at this time.
0 commit comments