Skip to content

Commit

Permalink
fix: string inspect retuns quoted string (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrzlgnm authored Dec 14, 2024
1 parent 41fc501 commit 5921416
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/ast/function_expression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ struct function_expression : callable_expression
auto compile(compiler& comp) const -> void override;

const statement* body {};
mutable std::string name;
std::string name;
};
2 changes: 1 addition & 1 deletion source/eval/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct string_object : hashable_object

[[nodiscard]] auto type() const -> object_type override { return object_type::string; }

[[nodiscard]] auto inspect() const -> std::string override { return value; }
[[nodiscard]] auto inspect() const -> std::string override { return fmt::format(R"("{}")", value); }

[[nodiscard]] auto hash_key() const -> hash_key_type override;

Expand Down

0 comments on commit 5921416

Please sign in to comment.