Skip to content

Commit

Permalink
Remove String.trime before parsing code
Browse files Browse the repository at this point in the history
  • Loading branch information
Neylix committed Jul 26, 2023
1 parent 58ec8b7 commit 3024fed
Show file tree
Hide file tree
Showing 2 changed files with 320 additions and 35 deletions.
2 changes: 1 addition & 1 deletion lib/archethic/contracts/interpreter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defmodule Archethic.Contracts.Interpreter do
@spec sanitize_code(binary()) :: {:ok, Macro.t()} | {:error, any()}
def sanitize_code(code) when is_binary(code) do
opts = [static_atoms_encoder: &atom_encoder/2]
charlist_code = code |> String.trim() |> String.to_charlist()
charlist_code = code |> String.to_charlist()

case :elixir.string_to_tokens(charlist_code, 1, 1, "nofile", opts) do
{:ok, tokens} ->
Expand Down
Loading

0 comments on commit 3024fed

Please sign in to comment.