]> git.proxmox.com Git - libgit2.git/blobdiff - src/userdiff.h
New upstream version 1.4.3+dfsg.1
[libgit2.git] / src / userdiff.h
index 523f2f8d4eeea44517c453a2418f291e9b98e94d..c9a80d7125136f45e0ee331d57898cbbdf0884be 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef INCLUDE_userdiff_h__
 #define INCLUDE_userdiff_h__
 
+#include "regexp.h"
+
 /*
  * This file isolates the built in diff driver function name patterns.
  * Most of these patterns are taken from Git (with permission from the
@@ -29,7 +31,7 @@ typedef struct {
 #define PATTERNS(NAME, FN_PATS, WORD_PAT) \
        { NAME, FN_PATS, WORD_PAT WORD_DEFAULT, 0 }
 #define IPATTERN(NAME, FN_PATS, WORD_PAT) \
-       { NAME, FN_PATS, WORD_PAT WORD_DEFAULT, REG_ICASE }
+       { NAME, FN_PATS, WORD_PAT WORD_DEFAULT, GIT_REGEXP_ICASE }
 
 /*
  * The table of diff driver patterns
@@ -191,9 +193,9 @@ PATTERNS("php",
         "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
 
 PATTERNS("javascript",
-        "^[ \t]*(function[ \t][a-zA-Z_][^\\{]*)\n"
-        "^[ \t]*(var[ \t]+[a-zA-Z_][a-zA-Z0-9_]*[ \t]*=[ \t]*function[ \t\\(][^\\{]*)\n"
-        "^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*[ \t]*:[ \t]*function[ \t\\(][^\\{]*)",
+        "([a-zA-Z_$][a-zA-Z0-9_$]*(\\.[a-zA-Z0-9_$]+)*[ \t]*=[ \t]*function([ \t][a-zA-Z_$][a-zA-Z0-9_$]*)?[^\\{]*)\n"
+        "([a-zA-Z_$][a-zA-Z0-9_$]*[ \t]*:[ \t]*function([ \t][a-zA-Z_$][a-zA-Z0-9_$]*)?[^\\{]*)\n"
+        "[^a-zA-Z0-9_\\$](function([ \t][a-zA-Z_$][a-zA-Z0-9_$]*)?[^\\{]*)",
         /* -- */
         "[a-zA-Z_][a-zA-Z0-9_]*"
         "|[-+0-9.e]+[fFlL]?|0[xX]?[0-9a-fA-F]+[lL]?"