]> git.ipfire.org Git - thirdparty/git.git/commitdiff
userdiff: update Ada patterns
authorAdrian Johnson <ajohnson@redneon.com>
Mon, 3 Feb 2014 11:33:16 +0000 (22:03 +1030)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Feb 2014 18:45:51 +0000 (10:45 -0800)
- Allow extra space in "is new" and "is separate"
- Fix bug in word regex for numbers

Signed-off-by: Adrian Johnson <ajohnson@redneon.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4034/ada/expect
userdiff.c

index be2376e90446ccfe08d5276007ed13c74ee6a098..a682d288b28ba1265de7b61f9c608a9887680e1b 100644 (file)
@@ -4,7 +4,7 @@
 <BOLD>+++ b/post<RESET>
 <CYAN>@@ -1,13 +1,13 @@<RESET>
 Ada.Text_IO.Put_Line("Hello World<RED>!<RESET><GREEN>?<RESET>");
-1 1e<RED>-<RESET>10 16#FE12#E2 3.141_592 '<RED>x<RESET><GREEN>y<RESET>'
+1 <RED>1e-10<RESET><GREEN>1e10<RESET> 16#FE12#E2 3.141_592 '<RED>x<RESET><GREEN>y<RESET>'
 <RED>a<RESET><GREEN>x<RESET>+<RED>b a<RESET><GREEN>y x<RESET>-<RED>b<RESET>
 <RED>a<RESET><GREEN>y<RESET>
 <GREEN>x<RESET>*<RED>b a<RESET><GREEN>y x<RESET>/<RED>b<RESET>
index ea43a0306f1a017f719e0d6b7c1de8b063760184..10b61ec37da035fb864c94a4037960ed30b1248c 100644 (file)
@@ -15,13 +15,13 @@ static int drivers_alloc;
          word_regex "|[^[:space:]]|[\xc0-\xff][\x80-\xbf]+" }
 static struct userdiff_driver builtin_drivers[] = {
 IPATTERN("ada",
-        "!^(.*[ \t])?(is new|renames|is separate)([ \t].*)?$\n"
+        "!^(.*[ \t])?(is[ \t]+new|renames|is[ \t]+separate)([ \t].*)?$\n"
         "!^[ \t]*with[ \t].*$\n"
         "^[ \t]*((procedure|function)[ \t]+.*)$\n"
         "^[ \t]*((package|protected|task)[ \t]+.*)$",
         /* -- */
         "[a-zA-Z][a-zA-Z0-9_]*"
-        "|[0-9][-+0-9#_.eE]"
+        "|[-+]?[0-9][0-9#_.aAbBcCdDeEfF]*([eE][+-]?[0-9_]+)?"
         "|=>|\\.\\.|\\*\\*|:=|/=|>=|<=|<<|>>|<>"),
 IPATTERN("fortran",
         "!^([C*]|[ \t]*!)\n"