Skip to content

Commit

Permalink
Renamed AST function pointer type kind for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacShelton committed Dec 29, 2024
1 parent 5e76b70 commit da46161
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ast/datatype/kind/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl Display for &TypeKind {
TypeKind::FixedArray(fixed_array) => {
write!(f, "array<(amount), {}>", fixed_array.ast_type)?;
}
TypeKind::FunctionPointer(_function) => {
TypeKind::FuncPointer(_function) => {
write!(f, "(function pointer type)")?;
}
TypeKind::Polymorph(polymorph, constraints) => {
Expand Down
2 changes: 1 addition & 1 deletion src/ast/datatype/kind/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub enum TypeKind {
AnonymousStruct(AnonymousStruct),
AnonymousUnion(AnoymousUnion),
AnonymousEnum(AnonymousEnum),
FunctionPointer(FuncPtr),
FuncPointer(FuncPtr),
Polymorph(String, Vec<Type>),
}

Expand Down
2 changes: 1 addition & 1 deletion src/ast/datatype/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl Type {
TypeKind::AnonymousStruct(_) => None,
TypeKind::AnonymousUnion(_) => None,
TypeKind::AnonymousEnum(_) => None,
TypeKind::FunctionPointer(func_pointer) => func_pointer
TypeKind::FuncPointer(func_pointer) => func_pointer
.parameters
.iter()
.flat_map(|param| param.ast_type.contains_polymorph())
Expand Down
2 changes: 1 addition & 1 deletion src/c/translation/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn declare_function(
}

if is_typedef {
let ast_type = ast::TypeKind::FunctionPointer(ast::FuncPtr {
let ast_type = ast::TypeKind::FuncPointer(ast::FuncPtr {
parameters: required,
return_type: Box::new(return_type),
is_cstyle_variadic: parameter_type_list.is_variadic,
Expand Down
2 changes: 1 addition & 1 deletion src/c/translation/types/decorate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn decorate_function(
function: &FunctionQualifier,
source: Source,
) -> Result<Type, ParseError> {
Ok(TypeKind::FunctionPointer(FuncPtr {
Ok(TypeKind::FuncPointer(FuncPtr {
parameters: function.parameters.clone(),
return_type: Box::new(ast_type),
is_cstyle_variadic: function.is_cstyle_variadic,
Expand Down
2 changes: 1 addition & 1 deletion src/resolve/type_ctx/resolve_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl<'a> ResolveTypeCtx<'a> {
todo!("resolve fixed array type with variable size")
}
}
ast::TypeKind::FunctionPointer(function_pointer) => {
ast::TypeKind::FuncPointer(function_pointer) => {
let mut parameters = Vec::with_capacity(function_pointer.parameters.len());

for parameter in function_pointer.parameters.iter() {
Expand Down

0 comments on commit da46161

Please sign in to comment.