mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-23 07:31:36 +00:00
Add PHP and Javascript diff drivers
Since I don't have permission yet on the code from Git, I decided I'd take a stab at writing patterns for PHP and Javascript myself. I think these are pretty weak, but probably better than the default behavior without them.
This commit is contained in:
parent
027b8edac7
commit
7cc001cefb
@ -180,6 +180,22 @@ PATTERNS("csharp",
|
||||
"[a-zA-Z_][a-zA-Z0-9_]*"
|
||||
"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
|
||||
"|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
|
||||
|
||||
PATTERNS("php",
|
||||
"^[ \t]*((public|private|protected|static|final)[ \t]+)*((class|function)[ \t].*)$",
|
||||
/* -- */
|
||||
"[a-zA-Z_][a-zA-Z0-9_]*"
|
||||
"|[-+0-9.e]+[fFlL]?|0[xX]?[0-9a-fA-F]+[lL]?"
|
||||
"|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
|
||||
|
||||
PATTERNS("javascript",
|
||||
"^[ \t]*(\(?function[ \t].*)$\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_]*"
|
||||
"|[-+0-9.e]+[fFlL]?|0[xX]?[0-9a-fA-F]+[lL]?"
|
||||
"|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
|
||||
};
|
||||
|
||||
#undef IPATTERN
|
||||
|
Loading…
Reference in New Issue
Block a user