Skip to content

Commit f2c9149

Browse files
author
José Valim
committed
Emit warnings for using % as sigils
1 parent 11c4c27 commit f2c9149

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Bug fixes
66

77
* Deprecations
8+
* [Kernel] `%` for sigils is deprecated in favor of `~`
89

910
* Backwards incompatible changes
1011

lib/elixir/src/elixir_tokenizer.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ tokenize([$#|String], Line, Scope, Tokens) ->
138138
% Sigils
139139

140140
tokenize([$%,S,H,H,H|T] = Original, Line, Scope, Tokens) when ?is_quote(H), ?is_upcase(S) orelse ?is_downcase(S) ->
141-
% io:format(standard_error, "~ts:~p: warning: using % for sigils is deprecated, "
142-
% "please use ~~ instead~n", [Scope#elixir_tokenizer.file, Line]),
141+
io:format(standard_error, "~ts:~p: warning: using % for sigils is deprecated, "
142+
"please use ~~ instead~n", [Scope#elixir_tokenizer.file, Line]),
143143

144144
case extract_heredoc_with_interpolation(Line, Scope, ?is_downcase(S), T, H) of
145145
{ ok, NewLine, Parts, Rest } ->
@@ -150,8 +150,8 @@ tokenize([$%,S,H,H,H|T] = Original, Line, Scope, Tokens) when ?is_quote(H), ?is_
150150
end;
151151

152152
tokenize([$%,S,H|T] = Original, Line, Scope, Tokens) when ?is_sigil(H), ?is_upcase(S) orelse ?is_downcase(S) ->
153-
% io:format(standard_error, "~ts:~p: warning: using % for sigils is deprecated, "
154-
% "please use ~~ instead~n", [Scope#elixir_tokenizer.file, Line]),
153+
io:format(standard_error, "~ts:~p: warning: using % for sigils is deprecated, "
154+
"please use ~~ instead~n", [Scope#elixir_tokenizer.file, Line]),
155155

156156
case elixir_interpolation:extract(Line, Scope, ?is_downcase(S), T, sigil_terminator(H)) of
157157
{ NewLine, Parts, Rest } ->

0 commit comments

Comments
 (0)