@@ -37,7 +37,7 @@ defmodule Gradient.AstSpecifierTest do
37
37
38
38
[ block , inline | _ ] = AstSpecifier . run_mappers ( ast , tokens ) |> Enum . reverse ( )
39
39
40
- assert { :function , 2 , :int , 0 , [ { :clause , 2 , [ ] , [ ] , [ { :integer , 2 , 1 } ] } ] } = inline
40
+ assert { :function , 2 , :int , 0 , [ { :clause , 2 , [ ] , [ ] , [ { :integer , [ location: { 2 , 16 } , end_location: { 2 , 17 } ] , 1 } ] } ] } = inline
41
41
42
42
assert { :function , 4 , :int_block , 0 , [ { :clause , 4 , [ ] , [ ] , [ { :integer , 5 , 2 } ] } ] } = block
43
43
end
@@ -46,7 +46,7 @@ defmodule Gradient.AstSpecifierTest do
46
46
{ tokens , ast } = load ( "Elixir.Basic.Float.beam" , "basic/float.ex" )
47
47
48
48
[ block , inline | _ ] = AstSpecifier . run_mappers ( ast , tokens ) |> Enum . reverse ( )
49
- assert { :function , 2 , :float , 0 , [ { :clause , 2 , [ ] , [ ] , [ { :float , 2 , 0.12 } ] } ] } = inline
49
+ assert { :function , 2 , :float , 0 , [ { :clause , 2 , [ ] , [ ] , [ { :float , [ location: { 2 , 18 } , end_location: { 2 , 22 } ] , 0.12 } ] } ] } = inline
50
50
51
51
assert { :function , 4 , :float_block , 0 , [ { :clause , 4 , [ ] , [ ] , [ { :float , 5 , 0.12 } ] } ] } = block
52
52
end
@@ -56,9 +56,9 @@ defmodule Gradient.AstSpecifierTest do
56
56
57
57
[ block , inline | _ ] = AstSpecifier . run_mappers ( ast , tokens ) |> Enum . reverse ( )
58
58
59
- assert { :function , 2 , :atom , 0 , [ { :clause , 2 , [ ] , [ ] , [ { :atom , 2 , :ok } ] } ] } = inline
59
+ assert { :function , 2 , :atom , 0 , [ { :clause , 2 , [ ] , [ ] , [ { :atom , [ location: { 2 , 17 } , end_location: { 2 , 19 } ] , :ok } ] } ] } = inline
60
60
61
- assert { :function , 4 , :atom_block , 0 , [ { :clause , 4 , [ ] , [ ] , [ { :atom , 5 , :ok } ] } ] } = block
61
+ assert { :function , 4 , :atom_block , 0 , [ { :clause , 4 , [ ] , [ ] , [ { :atom , [ location: { 5 , 5 } , end_location: { 5 , 7 } ] , :ok } ] } ] } = block
62
62
end
63
63
64
64
test "char" do
@@ -516,10 +516,10 @@ defmodule Gradient.AstSpecifierTest do
516
516
{ tokens , _ } = example_data ( )
517
517
opts = [ end_line: - 1 ]
518
518
519
- assert { { :integer , 21 , 12 } , tokens } =
519
+ assert { { :integer , [ location: { 21 , 9 } , end_location: { 21 , 11 } ] , 12 } , tokens } =
520
520
AstSpecifier . specify_line ( { :integer , 21 , 12 } , tokens , opts )
521
521
522
- assert { { :integer , 22 , 12 } , _tokens } =
522
+ assert { { :integer , [ location: { 22 , 5 } , end_location: { 22 , 7 } ] , 12 } , _tokens } =
523
523
AstSpecifier . specify_line ( { :integer , 20 , 12 } , tokens , opts )
524
524
end
525
525
@@ -1043,8 +1043,8 @@ defmodule Gradient.AstSpecifierTest do
1043
1043
[
1044
1044
{ :map , 7 ,
1045
1045
[
1046
- { :map_field_assoc , 7 , { :atom , 7 , : a} , { :integer , 7 , 12 } } ,
1047
- { :map_field_assoc , 7 , { :atom , 7 , : b} , { :call , 7 , { :atom , 7 , :empty_map } , [ ] } }
1046
+ { :map_field_assoc , 7 , { :atom , { :atom , [ location: { 7 , 7 } , end_location: { 7 , 8 } ] , : a} , :a } , { :integer , { :atom , [ location: { 7 , 10 } , end_location: { 7 , 12 } ] , :a } , 12 } } ,
1047
+ { :map_field_assoc , 7 , { :atom , [ location: { 7 , 14 } , end_location: { 7 , 15 } ] , : b} , { :call , [ location: { 7 , 17 } , end_location: { 7 , 27 } ] , { :atom , 7 , :empty_map } , [ ] } }
1048
1048
] }
1049
1049
] }
1050
1050
] } = test_map
@@ -1633,13 +1633,13 @@ defmodule Gradient.AstSpecifierTest do
1633
1633
{ tokensB , astB } = load ( "Elixir.NestedModules.ModuleB.beam" , "nested_modules.ex" )
1634
1634
{ tokens , ast } = load ( "Elixir.NestedModules.beam" , "nested_modules.ex" )
1635
1635
1636
- assert { :function , 3 , :name , 0 , [ { :clause , 3 , [ ] , [ ] , [ { :atom , 4 , :module_a } ] } ] } =
1636
+ assert { :function , 3 , :name , 0 , [ { :clause , 3 , [ ] , [ ] , [ { :atom , [ location: { 4 , 7 } , end_location: { 4 , 15 } ] , :module_a } ] } ] } =
1637
1637
List . last ( AstSpecifier . run_mappers ( astA , tokensA ) )
1638
1638
1639
- assert { :function , 9 , :name , 0 , [ { :clause , 9 , [ ] , [ ] , [ { :atom , 10 , :module_b } ] } ] } =
1639
+ assert { :function , 9 , :name , 0 , [ { :clause , 9 , [ ] , [ ] , [ { :atom , [ location: { 10 , 7 } , end_location: { 10 , 15 } ] , :module_b } ] } ] } =
1640
1640
List . last ( AstSpecifier . run_mappers ( astB , tokensB ) )
1641
1641
1642
- assert { :function , 14 , :name , 0 , [ { :clause , 14 , [ ] , [ ] , [ { :atom , 15 , :module } ] } ] } =
1642
+ assert { :function , 14 , :name , 0 , [ { :clause , 14 , [ ] , [ ] , [ { :atom , [ location: { 15 , 5 } , end_location: { 15 , 11 } ] , :module } ] } ] } =
1643
1643
List . last ( AstSpecifier . run_mappers ( ast , tokens ) )
1644
1644
end
1645
1645
0 commit comments