diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-06-21 11:24:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-21 11:24:08 -0700 |
commit | a41dad4330c8291893b5c5b013457499855ec9b5 (patch) | |
tree | 21b5ec00fedc07883eee26ca823d516477e4fc10 /userdiff.c | |
parent | a6a95cd1b46e48e5fe06bdbb0839a67ebeef4682 (diff) | |
parent | 33be7b38c23fbbaf75197f6150323e0d4c84bf12 (diff) | |
download | git-a41dad4330c8291893b5c5b013457499855ec9b5.tar.gz |
Merge branch 'ml/userdiff-rust'
The pattern "git diff/grep" use to extract funcname and words
boundary for Rust has been added.
* ml/userdiff-rust:
userdiff: two simplifications of patterns for rust
userdiff: add built-in pattern for rust
Diffstat (limited to 'userdiff.c')
-rw-r--r-- | userdiff.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/userdiff.c b/userdiff.c index 04270fb4d7..e74a6d4022 100644 --- a/userdiff.c +++ b/userdiff.c @@ -135,6 +135,12 @@ PATTERNS("ruby", "^[ \t]*((class|module|def)[ \t].*)$", "(@|@@|\\$)?[a-zA-Z_][a-zA-Z0-9_]*" "|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\?(\\\\C-)?(\\\\M-)?." "|//=?|[-+*/<>%&^|=!]=|<<=?|>>=?|===|\\.{1,3}|::|[!=]~"), +PATTERNS("rust", + "^[\t ]*((pub(\\([^\\)]+\\))?[\t ]+)?((async|const|unsafe|extern([\t ]+\"[^\"]+\"))[\t ]+)?(struct|enum|union|mod|trait|fn|impl)[< \t]+[^;]*)$", + /* -- */ + "[a-zA-Z_][a-zA-Z0-9_]*" + "|[0-9][0-9_a-fA-Fiosuxz]*(\\.([0-9]*[eE][+-]?)?[0-9_fF]*)?" + "|[-+*\\/<>%&^|=!:]=|<<=?|>>=?|&&|\\|\\||->|=>|\\.{2}=|\\.{3}|::"), PATTERNS("bibtex", "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$", "[={}\"]|[^={}\" \t]+"), PATTERNS("tex", "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$", |