-
Notifications
You must be signed in to change notification settings - Fork 100
Add function support to nameof keyword #674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ use crate::modules::types::{Type, Typed}; | |
| use crate::modules::variable::variable_name_extensions; | ||
| use crate::translate::module::TranslateModule; | ||
| use crate::utils::{ParserMetadata, TranslateMetadata}; | ||
| use crate::modules::function::invocation_utils::handle_function_parameters; | ||
| use heraclitus_compiler::prelude::*; | ||
|
|
||
| #[derive(Debug, Clone)] | ||
|
|
@@ -37,6 +38,10 @@ impl SyntaxModule<ParserMetadata> for Nameof { | |
| Ok(()) | ||
| } else if let Some(fun_decl) = meta.get_fun_declaration(&name) { | ||
| self.name = format!("{}__{}_v0", fun_decl.name, fun_decl.id); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Ph0enixKM is there even a way to properly select a variation of a function? i honestly have no idea how to go around this. hardcoding is definitely not the way for obvious reasons There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. Now since we're on a different architecture, we can slowly start to build centralized system that names these functions a certain way and only ask the system for the appropriate name here |
||
|
|
||
| // Create an empty call to ensure referenced function gets built | ||
| let fun_decl2 = fun_decl.clone(); | ||
|
||
| let _ = handle_function_parameters(meta, fun_decl2.id, fun_decl2.clone(), &fun_decl2.arg_types, &[], None); | ||
| Ok(()) | ||
| } else { | ||
| let tok = meta.get_current_token(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please sort
usestatements alphabetically, to simplify future maintenance.