tree-sitter-elixir/test/corpus/integration/module_definition.txt

139 lines
2.4 KiB
Plaintext
Raw Normal View History

2021-09-01 14:59:04 +00:00
=====================================
empty module definition
=====================================
defmodule Mod do
end
defmodule Mod.Child do
end
---
(source
(call
(identifier)
(arguments
(alias))
(do_block))
(call
(identifier)
(arguments
(alias))
(do_block)))
=====================================
module definition with atom literal
=====================================
defmodule :mod do
end
---
(source
(call
(identifier)
(arguments
2021-09-28 14:00:35 +00:00
(atom))
2021-09-01 14:59:04 +00:00
(do_block)))
=====================================
full module definition
=====================================
defmodule Mod do
@moduledoc """
Example module
"""
use UseMod
@attribute 1
@doc """
Example function
"""
@spec func(integer) :: integer
def func(x) when is_integer(x) do
priv(x) + priv(x)
end
defp priv(x), do: x * x
end
---
(source
(call
(identifier)
(arguments
(alias))
(do_block
(unary_operator
(call
(identifier)
(arguments
(string
2021-09-28 14:00:35 +00:00
(quoted_content)))))
2021-09-01 14:59:04 +00:00
(call
(identifier)
(arguments
(alias)))
(unary_operator
(call
(identifier)
(arguments
(integer))))
(unary_operator
(call
(identifier)
(arguments
(string
2021-09-28 14:00:35 +00:00
(quoted_content)))))
2021-09-01 14:59:04 +00:00
(unary_operator
(call
(identifier)
(arguments
(binary_operator
(call
(identifier)
(arguments
(identifier)))
(identifier)))))
(call
(identifier)
(arguments
(binary_operator
(call
(identifier)
(arguments
(identifier)))
(call
(identifier)
(arguments
(identifier)))))
(do_block
(binary_operator
(call
(identifier)
(arguments
(identifier)))
(call
(identifier)
(arguments
(identifier))))))
(call
(identifier)
(arguments
(call
(identifier)
(arguments
(identifier)))
(keywords
(pair
2021-09-28 14:00:35 +00:00
(keyword)
2021-09-01 14:59:04 +00:00
(binary_operator
(identifier)
(identifier)))))))))