1
0
dust/tree-sitter-dust/corpus/transform.txt
2023-11-10 20:44:03 -05:00

87 lines
2.1 KiB
Plaintext

================================================================================
Transform Loop
================================================================================
transform i in [1, 2, 3] {
(output i)
}
--------------------------------------------------------------------------------
(root
(statement
(transform
(identifier)
(expression
(value
(list
(expression
(value
(integer)))
(expression
(value
(integer)))
(expression
(value
(integer))))))
(block
(statement
(expression
(function_call
(built_in_function
(expression
(identifier))))))))))
================================================================================
Nested Transform Loop
================================================================================
transform i in [['one'] ['two'] ['three']] {
transform j in i {
j += 'foobar'
}
}
--------------------------------------------------------------------------------
(root
(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
(statement
(transform
(identifier)
(expression
(identifier))
(block
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(string)))))))))))))