The AST now allows metadata to be attached to each node
This means the second item in the AST is no longer an integer (representing the line), but a keywords list. Code that relies on the line information from AST or that manually generate AST nodes need to be properly updated.
This commit is contained in:
@@ -62,6 +62,7 @@ defmodule CodeTest do
|
||||
|
||||
test :string_to_ast do
|
||||
assert { :ok, quote line: 1, do: 1 + 2 } = Code.string_to_ast("1 + 2")
|
||||
assert { :ok, quote line: 1, do: (1 + 2; 3 + 4) } = Code.string_to_ast("1 + 2; 3 + 4")
|
||||
assert { :error, _ } = Code.string_to_ast("a.1")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user