multiple functions in plugin

This commit is contained in:
Fernando Herrera
2021-11-02 21:51:11 +00:00
parent 12eed1f98a
commit e193bf43fb
5 changed files with 119 additions and 53 deletions

View File

@ -963,11 +963,14 @@ pub fn parse_plugin(
// get signature from plugin
match get_signature(source_file) {
Err(err) => Some(ParseError::PluginError(format!("{}", err))),
Ok(signature) => {
// create plugin command declaration (need struct impl Command)
// store declaration in working set
let plugin_decl = PluginDeclaration::new(filename, signature);
working_set.add_decl(Box::new(plugin_decl));
Ok(signatures) => {
for signature in signatures {
// create plugin command declaration (need struct impl Command)
// store declaration in working set
let plugin_decl =
PluginDeclaration::new(filename.clone(), signature);
working_set.add_decl(Box::new(plugin_decl));
}
None
}