2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
Simple For Loop
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-11-11 01:44:03 +00:00
|
|
|
for i in [1, 2, 3] {
|
2023-12-30 01:14:03 +00:00
|
|
|
output(i)
|
2023-11-11 01:44:03 +00:00
|
|
|
}
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(for
|
|
|
|
(identifier)
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(list
|
2023-11-30 00:23:42 +00:00
|
|
|
(expression
|
2024-02-16 15:55:15 +00:00
|
|
|
(value
|
|
|
|
(integer)))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer))))))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(statement_kind
|
|
|
|
(expression
|
|
|
|
(function_call
|
|
|
|
(function_expression
|
|
|
|
(identifier))
|
|
|
|
(expression
|
|
|
|
(identifier)))))))))))
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-31 05:09:29 +00:00
|
|
|
Nested For Loop
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-11-11 01:44:03 +00:00
|
|
|
for list in list_of_lists {
|
|
|
|
for item in list {
|
2023-12-30 01:14:03 +00:00
|
|
|
output(item)
|
2023-11-11 01:44:03 +00:00
|
|
|
}
|
|
|
|
}
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(for
|
|
|
|
(identifier)
|
|
|
|
(expression
|
|
|
|
(identifier))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(statement_kind
|
|
|
|
(for
|
|
|
|
(identifier)
|
2023-11-11 01:44:03 +00:00
|
|
|
(expression
|
2024-02-16 15:55:15 +00:00
|
|
|
(identifier))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(statement_kind
|
|
|
|
(expression
|
|
|
|
(function_call
|
|
|
|
(function_expression
|
|
|
|
(identifier))
|
|
|
|
(expression
|
|
|
|
(identifier)))))))))))))))
|