summaryrefslogtreecommitdiff
path: root/userdiff.c
diff options
context:
space:
mode:
authorAdrien Schildknecht <adrien+dev@schischi.me>2015-03-10 00:40:32 +0100
committerJunio C Hamano <gitster@pobox.com>2015-03-13 21:56:52 -0700
commitf7711b353572616e7d2fdff7a3cc5f757d314eb8 (patch)
treec0f40891db419cdc384748c18e226db09f0ebcda /userdiff.c
parent1165ae6f3d42e0eb0ddfc2d4e6dfa8bd0b88eb60 (diff)
downloadgit-as/userdiff-sh.tar.gz
userdiff: funcname and word patterns for shas/userdiff-sh
Add regexp based on the "Shell Command Language" specifications. Because of the lax syntax of sh, some corner cases may not be handled properly. Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'userdiff.c')
-rw-r--r--userdiff.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/userdiff.c b/userdiff.c
index 2ccbee50cb..cd0cf21f88 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -146,6 +146,13 @@ PATTERNS("csharp",
"[a-zA-Z_][a-zA-Z0-9_]*"
"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
"|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
+PATTERNS("sh",
+ "^([ \t]*(function[ \t]+)?[a-zA-Z_][a-zA-Z0-9_]*[ \t]*\\([ \t]*\\).*)$",
+ /* -- */
+ "[a-zA-Z0-9_]+"
+ "|[-+0-9]+"
+ "|[-+*/<>%&^|=!]=|>>=?|<<=?|\\+\\+|--|\\*\\*|&&|\\|\\||\\[\\[|\\]\\]"
+ "|>\\||[<>]+&|<>|<<-|;;"),
{ "default", NULL, -1, { NULL, 0 } },
};
#undef PATTERNS