70 lines
1.7 KiB
Plaintext
70 lines
1.7 KiB
Plaintext
================================================================================
|
|
Simple For Loop
|
|
================================================================================
|
|
|
|
for i in [1, 2, 3] {
|
|
(output i)
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(for
|
|
(identifier)
|
|
(expression
|
|
(value
|
|
(list
|
|
(expression
|
|
(value
|
|
(integer)))
|
|
(expression
|
|
(value
|
|
(integer)))
|
|
(expression
|
|
(value
|
|
(integer))))))
|
|
(block
|
|
(statement
|
|
(expression
|
|
(function_call
|
|
(expression
|
|
(identifier
|
|
(built_in_function)))
|
|
(expression
|
|
(identifier)))))))))
|
|
|
|
================================================================================
|
|
Nested For Loop
|
|
================================================================================
|
|
|
|
for list in list_of_lists {
|
|
for item in list {
|
|
(output item)
|
|
}
|
|
}
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(root
|
|
(statement
|
|
(for
|
|
(identifier)
|
|
(expression
|
|
(identifier))
|
|
(block
|
|
(statement
|
|
(for
|
|
(identifier)
|
|
(expression
|
|
(identifier))
|
|
(block
|
|
(statement
|
|
(expression
|
|
(function_call
|
|
(expression
|
|
(identifier
|
|
(built_in_function)))
|
|
(expression
|
|
(identifier))))))))))))
|