Re: [PATCH] Add built-in diff patterns for MATLAB code
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Nov 15, 2011, 13:14 UTC
- Message-ID
- <201111151414.34141.trast@student.ethz.ch>
- In-Reply-To
- <df238a1919b7c7d05749b4aa637fe2c7@isy.liu.se>
Gustaf Hendeby wrote:
Show 15 quoted lines
> On Tue, 15 Nov 2011 13:37:06 +0100, Thomas Rast wrote:
> > Gustaf Hendeby wrote:
> >> +PATTERNS("matlab",
> >> +
> >> "^[[:space:]]*((classdef|function)[[:space:]].*)$|^%%[[:space:]].*$",
> >> + "[a-zA-Z_][a-zA-Z0-9_]*|[-+0-9.e]+|[=~<>]=|\\|\\||&&"),
> >
> > Shouldn't you, for matlab, ensure that ./ "sticks" as a single word
> > since it is an operator? At least we used the same logic for the C
> > ||
> > and && operators, which you copied.
>
> Good point Thomas, I forgot all about the .-operators. I will add
> \.[*/^'] as words, are there any other ones to consider? Thanks for
> paying attention!Uh, I'm afraid it's been years since I did matlab. But
http://www.mathworks.ch/help/techdoc/matlab_prog/f0-40063.html
seems to indicate you forgot '.\'.
Please also update the testcases to whether this splits correctly, e.g., by changing './' to '/'.
--
Thomas Rast
trast@{inf,student}.ethz.ch