Skip to content

Commit

Permalink
Add builtin debug function to print debug representation of a struct
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniusnaumann committed Jan 6, 2024
1 parent 2b03218 commit f197e4e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions galvan-transpiler/src/transpile_item/function_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ impl Transpile for FunctionCall {
format!("println!(\"{{}}\", {})", arguments)
} else if self.identifier.as_str() == "print" {
format!("print!(\"{{}}\", {})", arguments)
} else if self.identifier.as_str() == "debug" {
format!("println!(\"{{:?}}\", {})", arguments)
} else {
let ident = self.identifier.transpile(ctx);
format!("{}({})", ident, arguments)
Expand Down

0 comments on commit f197e4e

Please sign in to comment.