Skip to content

Commit e4990dd

Browse files
committed
Introduce func_macro to ParseCallbacks trait
1 parent db52281 commit e4990dd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/callbacks.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,21 @@ pub trait ParseCallbacks: fmt::Debug + UnwindSafe {
3535
None
3636
}
3737

38-
/// This will be run on every string macro. The callback can not influence the further
38+
/// This will be run on every string macro. The callback cannot influence the further
3939
/// treatment of the macro, but may use the value to generate additional code or configuration.
4040
fn str_macro(&self, _name: &str, _value: &[u8]) {}
4141

42+
/// This will be run on every function-like macro. The callback cannot
43+
/// influence the further treatment of the macro, but may use the value to
44+
/// generate additional code or configuration.
45+
///
46+
/// The first parameter represents the name and argument list (including the
47+
/// parentheses) of the function-like macro. The second parameter represents
48+
/// the expansion of the macro. It is not guaranteed that the whitespace of
49+
/// the original is preserved, but it is guaranteed that tokenization will
50+
/// not be changed.
51+
fn func_macro(&self, _name: &str, _value: &str) {}
52+
4253
/// This function should return whether, given an enum variant
4354
/// name, and value, this enum variant will forcibly be a constant.
4455
fn enum_variant_behavior(

0 commit comments

Comments
 (0)