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

167 lines
2.7 KiB
Plaintext
Raw Normal View History

2021-09-01 14:59:04 +00:00
=====================================
empty
=====================================
%{}
---
(source
(map))
=====================================
from keywords
=====================================
%{a: 1, b: 2}
---
(source
(map
(map_content
(keywords
(pair
2021-09-28 14:00:35 +00:00
(keyword)
2021-09-01 14:59:04 +00:00
(integer))
(pair
2021-09-28 14:00:35 +00:00
(keyword)
2021-09-01 14:59:04 +00:00
(integer))))))
=====================================
from arrow entries
=====================================
%{:a => 1, "b" => 2, c => 3}
---
(source
(map
(map_content
(binary_operator
2021-09-28 14:00:35 +00:00
(atom)
2021-09-01 14:59:04 +00:00
(integer))
(binary_operator
(string
2021-09-28 14:00:35 +00:00
(quoted_content))
2021-09-01 14:59:04 +00:00
(integer))
(binary_operator
(identifier)
(integer)))))
=====================================
from both arrow entries and keywords
=====================================
%{"a" => 1, b: 2, c: 3}
---
(source
(map
(map_content
(binary_operator
(string
2021-09-28 14:00:35 +00:00
(quoted_content))
2021-09-01 14:59:04 +00:00
(integer))
(keywords
(pair
2021-09-28 14:00:35 +00:00
(keyword)
2021-09-01 14:59:04 +00:00
(integer))
(pair
2021-09-28 14:00:35 +00:00
(keyword)
2021-09-01 14:59:04 +00:00
(integer))))))
=====================================
trailing separator
=====================================
%{"a" => 1,}
---
(source
(map
(map_content
(binary_operator
(string
2021-09-28 14:00:35 +00:00
(quoted_content))
2021-09-01 14:59:04 +00:00
(integer)))))
=====================================
update syntax
=====================================
%{user | name: "Jane", email: "jane@example.com"}
%{user | "name" => "Jane"}
---
(source
(map
(map_content
(binary_operator
(identifier)
(keywords
(pair
2021-09-28 14:00:35 +00:00
(keyword)
2021-09-01 14:59:04 +00:00
(string
2021-09-28 14:00:35 +00:00
(quoted_content)))
2021-09-01 14:59:04 +00:00
(pair
2021-09-28 14:00:35 +00:00
(keyword)
2021-09-01 14:59:04 +00:00
(string
2021-09-28 14:00:35 +00:00
(quoted_content)))))))
2021-09-01 14:59:04 +00:00
(map
(map_content
(binary_operator
(identifier)
(binary_operator
(string
2021-09-28 14:00:35 +00:00
(quoted_content))
2021-09-25 00:23:37 +00:00
(string
2021-09-28 14:00:35 +00:00
(quoted_content)))))))
2021-09-01 14:59:04 +00:00
=====================================
[error] ordering
=====================================
2021-09-25 00:23:37 +00:00
%{b: 2, c: 3, 1 => 1}
2021-09-01 14:59:04 +00:00
---
(source
(map
2021-09-28 14:00:35 +00:00
(ERROR
2021-09-25 00:23:37 +00:00
(keywords
(pair
2021-09-28 14:00:35 +00:00
(keyword)
2021-09-25 00:23:37 +00:00
(integer))
(pair
2021-09-28 14:00:35 +00:00
(keyword)
2021-09-25 00:23:37 +00:00
(integer))))
2021-09-28 14:00:35 +00:00
(map_content
(binary_operator
(integer)
(integer)))))
2021-09-01 14:59:04 +00:00
=====================================
[error] missing separator
=====================================
%{"a" => 1 "b" => 2}
---
(source
(map
2021-09-25 00:23:37 +00:00
(map_content
2021-09-01 14:59:04 +00:00
(binary_operator
(string
2021-09-28 14:00:35 +00:00
(quoted_content))
2021-09-25 00:23:37 +00:00
(ERROR (integer))
(binary_operator
(string
2021-09-28 14:00:35 +00:00
(quoted_content))
2021-09-25 00:23:37 +00:00
(integer))))))