diff options
author | Jeff King <peff@peff.net> | 2014-04-08 18:41:39 -0400 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2014-04-08 18:46:56 -0400 |
commit | 76b4e3d4deef499654ccf082e6ee585f4db873ec (patch) | |
tree | cfa4bd110bcc0c3135b6443dfbff4479e02f20ba /src/userdiff.h | |
parent | ce2e82694a19b9994acaa9376bff81bc8e968637 (diff) | |
download | libgit2-76b4e3d4deef499654ccf082e6ee585f4db873ec.tar.gz |
userdiff: update C/C++ patterns
This pulls upstream changes from:
git/git@8a2e8da367f7175465118510b474ad365161d6b1
git/git@abf8f9860248d8c213600974742f18dadaa8fbb5
git/git@407e07f2a6f55e605fda9e90cb622887269f68b5
all by Johannes Sixt <j6t@kdbg.org>.
Diffstat (limited to 'src/userdiff.h')
-rw-r--r-- | src/userdiff.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/userdiff.h b/src/userdiff.h index 7eb095246..bd6943361 100644 --- a/src/userdiff.h +++ b/src/userdiff.h @@ -159,15 +159,13 @@ PATTERNS("tex", "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$", PATTERNS("cpp", /* Jump targets or access declarations */ - "!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:.*$\n" - /* C/++ functions/methods at top level */ - "^([A-Za-z_][A-Za-z_0-9]*([ \t*]+[A-Za-z_][A-Za-z_0-9]*([ \t]*::[ \t]*[^[:space:]]+)?){1,}[ \t]*\\([^;]*)$\n" - /* compound type at top level */ - "^((struct|class|enum)[^;]*)$", + "!^[ \t]*[A-Za-z_][A-Za-z_0-9]*:[[:space:]]*($|/[/*])\n" + /* functions/methods, variables, and compounds at top level */ + "^((::[[:space:]]*)?[A-Za-z_].*)$", /* -- */ "[a-zA-Z_][a-zA-Z0-9_]*" - "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?" - "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"), + "|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lLuU]*" + "|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->\\*?|\\.\\*"), PATTERNS("csharp", /* Keywords */ |