1
0
dust/tree-sitter-dust/corpus/reduce.txt
2023-10-31 09:31:10 -04:00

74 lines
1.4 KiB
Plaintext

==================
Simple Reduce Loop
==================
reduce i to acc in [1, 2, 3] {
acc += i
}
---
(root
(block
(statement
(reduce
(identifier)
(identifier)
(expression
(value
(list
(expression
(value
(integer)))
(expression
(value
(integer)))
(expression
(value
(integer))))))
(block
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(identifier))))))))))
==================
Nested Reduce Loop
==================
reduce i to acc in ["one", "two", "three"] {
acc += i
}
---
(root
(block
(statement
(reduce
(identifier)
(identifier)
(expression
(value
(list
(expression
(value
(string)))
(expression
(value
(string)))
(expression
(value
(string))))))
(block
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(identifier))))))))))