@@ -204,6 +204,14 @@ tokenize([$?,$\\,H|T], Line, Scope, Tokens) ->
204204 tokenize (T , Line , Scope , [{number , Line , Char }|Tokens ]);
205205
206206tokenize ([$? ,Char |T ], Line , Scope , Tokens ) ->
207+ case handle_char (Char ) of
208+ {Escape , Name } ->
209+ Msg = io_lib :format (" found ? followed by codepoint 0x~.16B (~ts ), please use ~ts instead" ,
210+ [Char , Name , Escape ]),
211+ elixir_errors :warn (Line , Scope # elixir_tokenizer .file , Msg );
212+ false ->
213+ ok
214+ end ,
207215 tokenize (T , Line , Scope , [{number , Line , Char }|Tokens ]);
208216
209217% Heredocs
@@ -470,6 +478,18 @@ until_eol("\n" ++ _) -> [];
470478until_eol ([]) -> [];
471479until_eol ([H |T ]) -> [H |until_eol (T )].
472480
481+ handle_char (7 ) -> {" \\ a" , " alert" };
482+ handle_char ($\b ) -> {" \\ b" , " backspace" };
483+ handle_char ($\d ) -> {" \\ d" , " delete" };
484+ handle_char ($\e ) -> {" \\ e" , " escape" };
485+ handle_char ($\f ) -> {" \\ f" , " form feed" };
486+ handle_char ($\n ) -> {" \\ n" , " newline" };
487+ handle_char ($\r ) -> {" \\ r" , " carriage return" };
488+ handle_char ($\s ) -> {" \\ s" , " space" };
489+ handle_char ($\t ) -> {" \\ t" , " tab" };
490+ handle_char ($\v ) -> {" \\ v" , " vertical tab" };
491+ handle_char (_ ) -> false .
492+
473493escape_char (List ) ->
474494 <<Char /utf8 >> = elixir_interpolation :unescape_chars (list_to_binary (List )),
475495 Char .
0 commit comments