Split AST into separate files.

This commit is contained in:
Stephen Chung
2021-12-17 16:07:13 +08:00
parent b1b2c62d7d
commit c7ec27acc7
16 changed files with 2693 additions and 2614 deletions

View File

@@ -163,18 +163,15 @@ impl From<&crate::module::FuncInfo> for FnMetadata {
signature: info.gen_signature(),
doc_comments: if info.func.is_script() {
#[cfg(feature = "no_function")]
{
unreachable!("scripted functions should not exist under no_function")
}
unreachable!("script-defined functions should not exist under no_function");
#[cfg(not(feature = "no_function"))]
{
info.func
.get_script_fn_def()
.expect("scripted function")
.comments
.as_ref()
.map_or_else(|| Vec::new(), |v| v.to_vec())
}
info.func
.get_script_fn_def()
.expect("script-defined function")
.comments
.as_ref()
.map_or_else(|| Vec::new(), |v| v.to_vec())
} else {
Vec::new()
},