Skip to content

Commit

Permalink
[#239] Fix #239: Attributes with strings (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brujo Benavides authored Apr 8, 2021
1 parent 2548141 commit 876540f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/formatters/default_formatter.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,8 @@ lay_string(Node, Ctxt) ->
end,
lay_string_lines(string_lines(S), Ctxt).

interpret_string(undefined) ->
undefined;
interpret_string(S) ->
{ok, Tokens, _} = erl_scan:string(S),
erl_parse:parse_exprs(Tokens ++ [{dot, 0}]).
Expand Down
2 changes: 2 additions & 0 deletions test_app/after/src/strings/strings.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

-format #{inline_expressions => true}.

-attr({with, "a string"}).

all() ->
heredoc(), superlong(), repeat(), multiple_calls(), characters().

Expand Down
2 changes: 2 additions & 0 deletions test_app/src/strings/strings.erl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

-format #{inline_expressions => true}.

-attr({with, "a string"}).

all() ->
heredoc(),
superlong(),
Expand Down

0 comments on commit 876540f

Please sign in to comment.