tree-sitter-elixir/test/corpus/term/struct.txt

240 lines
3.6 KiB
Plaintext

=====================================
empty
=====================================
%User{}
---
(source
(map
(struct
(alias))))
=====================================
from keywords
=====================================
%User{a: 1, b: 2}
---
(source
(map
(struct
(alias))
(map_content
(keywords
(pair
(keyword)
(integer))
(pair
(keyword)
(integer))))))
=====================================
from arrow entries
=====================================
%User{:a => 1, "b" => 2, c => 3}
---
(source
(map
(struct
(alias))
(map_content
(binary_operator
(atom)
(integer))
(binary_operator
(string
(quoted_content))
(integer))
(binary_operator
(identifier)
(integer)))))
=====================================
from both arrow entries and keywords
=====================================
%User{"a" => 1, b: 2, c: 3}
---
(source
(map
(struct
(alias))
(map_content
(binary_operator
(string
(quoted_content))
(integer))
(keywords
(pair
(keyword)
(integer))
(pair
(keyword)
(integer))))))
=====================================
trailing separator
=====================================
%User{"a" => 1,}
---
(source
(map
(struct
(alias))
(map_content
(binary_operator
(string
(quoted_content))
(integer)))))
=====================================
update syntax
=====================================
%User{user | name: "Jane", email: "jane@example.com"}
%User{user | "name" => "Jane"}
---
(source
(map
(struct (alias))
(map_content
(binary_operator
(identifier)
(keywords
(pair
(keyword)
(string
(quoted_content)))
(pair
(keyword)
(string
(quoted_content)))))))
(map
(struct
(alias))
(map_content
(binary_operator
(identifier)
(binary_operator
(string
(quoted_content))
(string
(quoted_content)))))))
=====================================
unused struct identifier
=====================================
%_{}
---
(source
(map
(struct
(unused_identifier))))
=====================================
matching struct identifier
=====================================
%name{}
---
(source
(map
(struct
(identifier))))
=====================================
pinned struct identifier
=====================================
%^name{}
---
(source
(map
(struct
(unary_operator
(identifier)))))
=====================================
with special identifier
=====================================
%__MODULE__{}
%__MODULE__.Child{}
---
(source
(map
(struct
(special_identifier)))
(map
(struct
(dot
(special_identifier)
(alias)))))
=====================================
with atom
=====================================
%:"Elixir.Mod"{}
---
(source
(map
(struct
(quoted_atom
(quoted_content)))))
=====================================
with call
=====================================
%fun(){}
%Mod.fun(){}
%fun.(){}
---
(source
(map
(struct
(call
(identifier)
(arguments))))
(map
(struct
(call
(dot
(alias)
(identifier))
(arguments))))
(map
(struct
(call
(dot
(identifier))
(arguments)))))