summaryrefslogtreecommitdiff
path: root/bindgen/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bindgen/lib.rs')
-rw-r--r--bindgen/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/bindgen/lib.rs b/bindgen/lib.rs
index bfc22bb6..d281e949 100644
--- a/bindgen/lib.rs
+++ b/bindgen/lib.rs
@@ -78,6 +78,8 @@ doc_mod!(ir, ir_docs);
doc_mod!(parse, parse_docs);
doc_mod!(regex_set, regex_set_docs);
+use ir::comment;
+
pub use crate::codegen::{
AliasVariation, EnumVariation, MacroTypeVariation, NonCopyUnionStyle,
};
@@ -2176,6 +2178,14 @@ impl BindgenOptions {
.flat_map(|cb| f(cb.as_ref()))
.collect()
}
+
+ fn process_comment(&self, comment: &str) -> String {
+ let comment = comment::preprocess(comment);
+ self.parse_callbacks
+ .last()
+ .and_then(|cb| cb.process_comment(&comment))
+ .unwrap_or(comment)
+ }
}
impl Default for BindgenOptions {