Skip to content

Commit dc53e7b

Browse files
committed
Merge branch 'kb/userdiff-rust-macro-rules'
Userdiff for Rust update. * kb/userdiff-rust-macro-rules: userdiff: recognize 'macro_rules!' as starting a Rust function block
2 parents a8a49eb + a04c7e0 commit dc53e7b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

t/t4018/rust-macro-rules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
macro_rules! RIGHT {
2+
() => {
3+
// a comment
4+
let x = ChangeMe;
5+
};
6+
}

userdiff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ PATTERNS("ruby", "^[ \t]*((class|module|def)[ \t].*)$",
165165
"|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\?(\\\\C-)?(\\\\M-)?."
166166
"|//=?|[-+*/<>%&^|=!]=|<<=?|>>=?|===|\\.{1,3}|::|[!=]~"),
167167
PATTERNS("rust",
168-
"^[\t ]*((pub(\\([^\\)]+\\))?[\t ]+)?((async|const|unsafe|extern([\t ]+\"[^\"]+\"))[\t ]+)?(struct|enum|union|mod|trait|fn|impl)[< \t]+[^;]*)$",
168+
"^[\t ]*((pub(\\([^\\)]+\\))?[\t ]+)?((async|const|unsafe|extern([\t ]+\"[^\"]+\"))[\t ]+)?(struct|enum|union|mod|trait|fn|impl|macro_rules!)[< \t]+[^;]*)$",
169169
/* -- */
170170
"[a-zA-Z_][a-zA-Z0-9_]*"
171171
"|[0-9][0-9_a-fA-Fiosuxz]*(\\.([0-9]*[eE][+-]?)?[0-9_fF]*)?"

0 commit comments

Comments
 (0)