On 03/24, Kapil Jain wrote:
> On Sun, Mar 24, 2019 at 2:49 PM Christian Couder
> <[email protected]> wrote:
> >
> > The test_language_driver() function used to test the regexps is
> > ...
> > GIT_TEST_CMP which is usually either "diff -u" or "diff -c".
>
> Thanks.
>
> please provide some insights on the regex mentioned below:
I had previously mentioned that this project was attempted already in
my email at [*1*]. Did you take a look at the thread I linked to
there, and the regex used? I still feel like that previous experience
is something you could learn from.
But that said, I think your assumption in the other email that the
output should be
[-$TEST_DIRECTORY-]
{+$TEST_DIR+}
might not be correct. The tests are using 'git diff
--word-diff=color', rather than 'git diff --word-diff=plain'. Only
the latter would add the [- -] and {+ +} around the changed words,
while the former adds the color, which the tests are testing for.
*1*:
https://public-inbox.org/git/[email protected]/
> +
> +PATTERNS("shell",
> + /* Function Names */
> + "([A-Za-z_][A-Za-z0-9_]*)[[:space:]]*\\([[:space:]]*\\)[[:space:]]*\\{",
> + /* Words */
> + "([$#@A-Za-z_\"\'][$#@A-Za-z0-9_\"\']*)"),
> +
>
> reference mail:
> https://public-inbox.org/git/[email protected]/.
> please let me know if the regex is not self explanatory.