Skip to content

Commit

Permalink
Update main.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
KajizukaTaichi committed Jan 3, 2025
1 parent eea1b93 commit 47e8ef3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,12 @@ impl Type {
fn get_symbol(&self) -> String {
match self {
Type::Symbol(s) => s.to_string(),
Type::Text(s) => format!("\"{s}\""),
Type::Text(text) => format!(
"\"{}\"",
text.replace("'", "\\'")
.replace("\"", "\\\"")
.replace("`", "\\`")
),
Type::Number(n) => n.to_string(),
Type::Null => "null".to_string(),
Type::Function(Function::BuiltIn(obj)) => format!("λx.{obj:?}"),
Expand Down

0 comments on commit 47e8ef3

Please sign in to comment.