Skip to content

Commit 33b88fa

Browse files
committed
Merge branch 'ml/userdiff-rust' into next
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
2 parents d8fdbe2 + 33be7b3 commit 33b88fa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

userdiff.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,10 @@ PATTERNS("ruby", "^[ \t]*((class|module|def)[ \t].*)$",
136136
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\?(\\\\C-)?(\\\\M-)?."
137137
"|//=?|[-+*/<>%&^|=!]=|<<=?|>>=?|===|\\.{1,3}|::|[!=]~"),
138138
PATTERNS("rust",
139-
"^[\t ]*((pub(\\([^\\)]+\\))?[\t ]+)?((async|const|unsafe|extern([\t ]+\"[^\"]+\"))[\t ]+)?(struct|enum|union|mod|trait|fn|impl(<.+>)?)[ \t]+[^;]*)$",
139+
"^[\t ]*((pub(\\([^\\)]+\\))?[\t ]+)?((async|const|unsafe|extern([\t ]+\"[^\"]+\"))[\t ]+)?(struct|enum|union|mod|trait|fn|impl)[< \t]+[^;]*)$",
140140
/* -- */
141141
"[a-zA-Z_][a-zA-Z0-9_]*"
142-
"|[-+_0-9.eE]+(f32|f64|u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?"
143-
"|0[box]?[0-9a-fA-F_]+(u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize)?"
142+
"|[0-9][0-9_a-fA-Fiosuxz]*(\\.([0-9]*[eE][+-]?)?[0-9_fF]*)?"
144143
"|[-+*\\/<>%&^|=!:]=|<<=?|>>=?|&&|\\|\\||->|=>|\\.{2}=|\\.{3}|::"),
145144
PATTERNS("bibtex", "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
146145
"[={}\"]|[^={}\" \t]+"),

0 commit comments

Comments
 (0)