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:
500500
501501- `java` suitable for source code in the Java language.
502502
503+ - `matlab` suitable for source code in the MATLAB language.
504+
503505- `objc` suitable for source code in the Objective-C language.
504506
505507- `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 () {
105105 grep " ^@@.*@@ $1 " diff
106106}
107107
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
109109do
110110 test_expect_success " builtin $p pattern compiles" '
111111 echo "*.java diff=$p" >.gitattributes &&
Original file line number Diff line number Diff line change @@ -299,6 +299,7 @@ test_language_driver csharp
299299test_language_driver fortran
300300test_language_driver html
301301test_language_driver java
302+ test_language_driver matlab
302303test_language_driver objc
303304test_language_driver pascal
304305test_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",
3737 "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
3838 "|[-+*/<>%&^|=!]="
3939 "|--|\\+\\+|<<=?|>>>?=?|&&|\\|\\|" ),
40+ PATTERNS ("matlab" ,
41+ "^[[:space:]]*((classdef|function)[[:space:]].*)$|^%%[[:space:]].*$" ,
42+ "[a-zA-Z_][a-zA-Z0-9_]*|[-+0-9.e]+|[=~<>]=|\\.[*/\\^']|\\|\\||&&" ),
4043PATTERNS ("objc" ,
4144 /* Negate C statements that can look like functions */
4245 "!^[ \t]*(do|for|if|else|return|switch|while)\n"
You can’t perform that action at this time.
0 commit comments