72 lines
1.7 KiB
Plaintext
72 lines
1.7 KiB
Plaintext
================================================================================
|
|
Simple Reduce Loop
|
|
================================================================================
|
|
|
|
reduce i to acc in [1, 2, 3] {
|
|
acc += i
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(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
|
|
(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)))))))))
|