-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Elixir and Erlang/OTP versions
Erlang/OTP 27 [erts-15.2.7.3] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Elixir 1.19.3 (compiled with Erlang/OTP 27)
Operating system
any
Current behavior
I noticed this inconsistency: line and column meta is attached to block only in some cases
iex(1)> Code.string_to_quoted!("", columns: true)
{:__block__, [], []}
iex(2)> Code.string_to_quoted!(" ", columns: true)
{:__block__, [], []}
iex(3)> Code.string_to_quoted!("\n", columns: true)
{:__block__, [line: 1, column: 1], []}
iex(4)> Code.string_to_quoted!("#", columns: true)
{:__block__, [], []}
iex(5)> Code.string_to_quoted!("#\n", columns: true)
{:__block__, [line: 1, column: 1], []}
iex(6)> Code.string_to_quoted!(";", columns: true)
{:__block__, [line: 1, column: 1], []}
iex(11)> Code.string_to_quoted!("a\nb", columns: true)
{:__block__, [],
[{:a, [line: 1, column: 1], nil}, {:b, [line: 2, column: 1], nil}]}
Expected behavior
Consistent line and column meta when block represents a real range in code
Metadata
Metadata
Assignees
Labels
No labels