aboutsummaryrefslogtreecommitdiffstats
path: root/userdiff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-01-13 11:38:05 -0800
committerJunio C Hamano <gitster@pobox.com>2011-01-13 11:38:05 -0800
commit17e1c9e2fdf684422a91f0b1bc2e0926c1956651 (patch)
tree3741b4cb2d3df4b7e916d632cd0055afc65661b3 /userdiff.c
parent17fd68d0d8f948c23993275aa618c16b83958cd8 (diff)
parenta25e47377d6a1ec1efc6972f2e5e55cf429603a1 (diff)
downloadgit-17e1c9e2fdf684422a91f0b1bc2e0926c1956651.tar.gz
Merge branch 'jn/perl-funcname'
* jn/perl-funcname: userdiff/perl: catch BEGIN/END/... and POD as headers diff: funcname and word patterns for perl
Diffstat (limited to 'userdiff.c')
-rw-r--r--userdiff.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/userdiff.c b/userdiff.c
index 2d5453697a..c384b39e4d 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -61,6 +61,23 @@ PATTERNS("pascal",
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"
"|<>|<=|>=|:=|\\.\\."
"|[^[:space:]]|[\x80-\xff]+"),
+PATTERNS("perl",
+ "^[ \t]*package .*;\n"
+ "^[ \t]*sub .* \\{\n"
+ "^[A-Z]+ \\{\n" /* BEGIN, END, ... */
+ "^=head[0-9] ", /* POD */
+ /* -- */
+ "[[:alpha:]_'][[:alnum:]_']*"
+ "|0[xb]?[0-9a-fA-F_]*"
+ /* taking care not to interpret 3..5 as (3.)(.5) */
+ "|[0-9a-fA-F_]+(\\.[0-9a-fA-F_]+)?([eE][-+]?[0-9_]+)?"
+ "|=>|-[rwxoRWXOezsfdlpSugkbctTBMAC>]|~~|::"
+ "|&&=|\\|\\|=|//=|\\*\\*="
+ "|&&|\\|\\||//|\\+\\+|--|\\*\\*|\\.\\.\\.?"
+ "|[-+*/%.^&<>=!|]="
+ "|=~|!~"
+ "|<<|<>|<=>|>>"
+ "|[^[:space:]]"),
PATTERNS("php",
"^[\t ]*(((public|protected|private|static)[\t ]+)*function.*)$\n"
"^[\t ]*(class.*)$",