pub struct CallExpression {
pub function: Box<Expression>,
pub arguments: Vec<Box<Expression>>,
pub location: SourceLocation,
}Fields§
§function: Box<Expression>§arguments: Vec<Box<Expression>>§location: SourceLocationImplementations§
Source§impl CallExpression
impl CallExpression
Sourcepub fn function_name(&self) -> &str
pub fn function_name(&self) -> &str
Get the function name as a string For identifiers, returns the name For field access, returns the full text (e.g., “parent_class->dispose”)
Sourcepub fn is_function(&self, name: &str) -> bool
pub fn is_function(&self, name: &str) -> bool
Check if the function matches a specific name
Sourcepub fn function_contains(&self, pattern: &str) -> bool
pub fn function_contains(&self, pattern: &str) -> bool
Check if function name contains a pattern
Sourcepub fn function_ends_with(&self, pattern: &str) -> bool
pub fn function_ends_with(&self, pattern: &str) -> bool
Check if function name ends with a pattern
Sourcepub fn function_name_str(&self) -> Option<&str>
pub fn function_name_str(&self) -> Option<&str>
Get the function name as &str (for common case of identifier) Returns None if function is not a simple identifier
Sourcepub fn get_arg(&self, index: usize) -> Option<&Expression>
pub fn get_arg(&self, index: usize) -> Option<&Expression>
Get the expression for the argument at the given index
Sourcepub fn get_arg_text(&self, index: usize) -> Option<&str>
pub fn get_arg_text(&self, index: usize) -> Option<&str>
Get argument as source text
Sourcepub fn has_arg_matching<F>(&self, index: usize, predicate: F) -> bool
pub fn has_arg_matching<F>(&self, index: usize, predicate: F) -> bool
Check if the argument at the given index exists and matches the predicate
Sourcepub fn arg_contains_variable(&self, index: usize, var_name: &str) -> bool
pub fn arg_contains_variable(&self, index: usize, var_name: &str) -> bool
Check if the argument at the given index contains a reference to the specified variable Handles both plain identifiers and field access (e.g., obj->field)
Sourcepub fn is_likely_macro(&self) -> bool
pub fn is_likely_macro(&self) -> bool
Check if this looks like a macro call (ALL_CAPS or ends with ) Examples: I, N_, G_STRINGIFY, GINT_TO_POINTER
Sourcepub fn extract_string_from_arg(&self, index: usize) -> Option<String>
pub fn extract_string_from_arg(&self, index: usize) -> Option<String>
Extract string literal from argument, unwrapping macro calls like I_(“string”) This is useful for g_param_spec calls where the name might be I_(“property-name”)
Sourcepub fn is_allocation_call(&self) -> bool
pub fn is_allocation_call(&self) -> bool
Check if this call is a GObject allocation function Recognizes g_object_new, g_new, and various other allocation patterns
Sourcepub fn is_cleanup_call(&self) -> bool
pub fn is_cleanup_call(&self) -> bool
Check if this call is a GObject cleanup/free function Recognizes g_object_unref, g_free, and various other cleanup patterns