1
0
dust/tree-sitter-dust/corpus/transform.txt

89 lines
2.2 KiB
Plaintext
Raw Normal View History

2023-10-31 19:21:13 +00:00
================================================================================
Transform Loop
2023-10-31 19:21:13 +00:00
================================================================================
transform i in [1, 2, 3] {
(output i)
}
2023-10-31 19:21:13 +00:00
--------------------------------------------------------------------------------
(root
2023-10-31 13:31:10 +00:00
(block
(statement
(transform
(identifier)
(expression
2023-10-31 13:31:10 +00:00
(value
(list
(expression
(value
(integer)))
(expression
(value
(integer)))
(expression
(value
(integer))))))
(block
(statement
(expression
2023-10-31 17:04:22 +00:00
(function_call
2023-10-31 19:21:13 +00:00
(built_in_function
(expression
(identifier)))))))))))
2023-10-31 19:21:13 +00:00
================================================================================
2023-10-31 09:51:37 +00:00
Nested Transform Loop
2023-10-31 19:21:13 +00:00
================================================================================
2023-10-31 09:51:37 +00:00
transform i in [['one'] ['two'] ['three']] {
transform j in i {
j += 'foobar'
}
}
2023-10-31 19:21:13 +00:00
--------------------------------------------------------------------------------
(root
2023-10-31 13:31:10 +00:00
(block
(statement
(transform
(identifier)
(expression
(value
(list
(expression
(value
(list
(expression
(value
(string))))))
(expression
(value
(list
(expression
(value
(string))))))
(expression
(value
(list
(expression
(value
(string)))))))))
(block
2023-10-31 09:51:37 +00:00
(statement
2023-10-31 13:31:10 +00:00
(transform
2023-10-31 09:51:37 +00:00
(identifier)
2023-10-31 13:31:10 +00:00
(expression
(identifier))
(block
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(string))))))))))))))