@@ -6,6 +6,7 @@ pub(super) mod error;
66mod file;
77pub ( super ) mod fs;
88pub ( super ) mod include;
9+ mod namespace_organizer;
910pub ( super ) mod out;
1011mod write;
1112
@@ -113,23 +114,23 @@ pub(super) fn generate(syntax: File, opt: &Opt) -> Result<GeneratedCode> {
113114 . ok_or ( Error :: NoBridgeMod ) ?;
114115 let ref namespace = bridge. namespace ;
115116 let trusted = bridge. unsafety . is_some ( ) ;
116- let ref apis = syntax:: parse_items ( errors, bridge. content , trusted) ;
117+ let ref apis = syntax:: parse_items ( errors, bridge. content , trusted, namespace ) ;
117118 let ref types = Types :: collect ( errors, apis) ;
118119 check:: precheck ( errors, apis, opt) ;
119120 errors. propagate ( ) ?;
120- check:: typecheck ( errors, namespace , apis, types) ;
121+ check:: typecheck ( errors, apis, types) ;
121122 errors. propagate ( ) ?;
122123 // Some callers may wish to generate both header and C++
123124 // from the same token stream to avoid parsing twice. But others
124125 // only need to generate one or the other.
125126 Ok ( GeneratedCode {
126127 header : if opt. gen_header {
127- write:: gen ( namespace , apis, types, opt, true ) . content ( )
128+ write:: gen ( apis, types, opt, true ) . content ( )
128129 } else {
129130 Vec :: new ( )
130131 } ,
131132 implementation : if opt. gen_implementation {
132- write:: gen ( namespace , apis, types, opt, false ) . content ( )
133+ write:: gen ( apis, types, opt, false ) . content ( )
133134 } else {
134135 Vec :: new ( )
135136 } ,
0 commit comments