2023-10-31 15:21:13 -04:00
|
|
|
================================================================================
|
2023-10-18 17:52:56 -04:00
|
|
|
Simple For Loop
|
2023-10-31 15:21:13 -04:00
|
|
|
================================================================================
|
2023-10-18 17:52:56 -04:00
|
|
|
|
2023-11-10 20:44:03 -05:00
|
|
|
for i in [1, 2, 3] {
|
2023-11-14 19:22:26 -05:00
|
|
|
(output i)
|
2023-11-10 20:44:03 -05:00
|
|
|
}
|
2023-10-18 17:52:56 -04:00
|
|
|
|
2023-10-31 15:21:13 -04:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 17:52:56 -04:00
|
|
|
|
|
|
|
(root
|
2023-11-10 20:44:03 -05:00
|
|
|
(statement
|
|
|
|
(for
|
|
|
|
(identifier)
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(list
|
2023-10-18 17:52:56 -04:00
|
|
|
(expression
|
2023-11-10 20:44:03 -05:00
|
|
|
(value
|
|
|
|
(integer)))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer))))))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(function_call
|
|
|
|
(built_in_function
|
|
|
|
(expression
|
|
|
|
(identifier))))))))))
|
2023-10-18 17:52:56 -04:00
|
|
|
|
2023-10-31 15:21:13 -04:00
|
|
|
================================================================================
|
2023-10-31 01:09:29 -04:00
|
|
|
Nested For Loop
|
2023-10-31 15:21:13 -04:00
|
|
|
================================================================================
|
2023-10-18 17:52:56 -04:00
|
|
|
|
2023-11-10 20:44:03 -05:00
|
|
|
for list in list_of_lists {
|
|
|
|
for item in list {
|
2023-11-14 19:22:26 -05:00
|
|
|
(output item)
|
2023-11-10 20:44:03 -05:00
|
|
|
}
|
|
|
|
}
|
2023-10-18 17:52:56 -04:00
|
|
|
|
2023-10-31 15:21:13 -04:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 17:52:56 -04:00
|
|
|
|
|
|
|
(root
|
2023-11-10 20:44:03 -05:00
|
|
|
(statement
|
|
|
|
(for
|
|
|
|
(identifier)
|
|
|
|
(expression
|
|
|
|
(identifier))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(for
|
|
|
|
(identifier)
|
|
|
|
(expression
|
|
|
|
(identifier))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(function_call
|
|
|
|
(built_in_function
|
|
|
|
(expression
|
|
|
|
(identifier)))))))))))))
|