2021-06-11 23:47:51 +02:00
|
|
|
==================
|
|
|
|
|
for tuple expression
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
foo = [for v in ["a", "b"]: v]
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(config_file
|
|
|
|
|
(body
|
|
|
|
|
(attribute
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(expr_term
|
|
|
|
|
(for_expr
|
|
|
|
|
(for_tuple_expr
|
|
|
|
|
(for_intro
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(expr_term
|
|
|
|
|
(collection_value
|
|
|
|
|
(tuple
|
|
|
|
|
(expression (expr_term (literal_value (string_lit))))
|
|
|
|
|
(expression (expr_term (literal_value (string_lit)))))))))
|
|
|
|
|
(expression (expr_term (variable_expr (identifier)))))))))))
|
|
|
|
|
|
2021-06-11 23:57:34 +02:00
|
|
|
==================
|
|
|
|
|
for tuple expression with index
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
foo = [for i, v in ["a", "b"]: i]
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(config_file
|
|
|
|
|
(body
|
|
|
|
|
(attribute
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(expr_term
|
|
|
|
|
(for_expr
|
|
|
|
|
(for_tuple_expr
|
|
|
|
|
(for_intro
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(expr_term
|
|
|
|
|
(collection_value
|
|
|
|
|
(tuple
|
|
|
|
|
(expression (expr_term (literal_value (string_lit))))
|
|
|
|
|
(expression (expr_term (literal_value (string_lit)))))))))
|
|
|
|
|
(expression (expr_term (variable_expr (identifier)))))))))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
for object expression
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
foo = {for i, v in ["a", "b"]: v => i}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(config_file
|
|
|
|
|
(body
|
|
|
|
|
(attribute
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(expr_term
|
|
|
|
|
(for_expr
|
|
|
|
|
(for_object_expr
|
|
|
|
|
(for_intro
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(expr_term
|
|
|
|
|
(collection_value
|
|
|
|
|
(tuple
|
|
|
|
|
(expression (expr_term (literal_value (string_lit))))
|
|
|
|
|
(expression (expr_term (literal_value (string_lit)))))))))
|
|
|
|
|
(expression (expr_term (variable_expr (identifier))))
|
|
|
|
|
(expression (expr_term (variable_expr (identifier)))))))))))
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
|
for object expression 2
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
foo = {for i, v in ["a", "b"]: v => i...}
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
(config_file
|
|
|
|
|
(body
|
|
|
|
|
(attribute
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(expr_term
|
|
|
|
|
(for_expr
|
|
|
|
|
(for_object_expr
|
|
|
|
|
(for_intro
|
|
|
|
|
(identifier)
|
|
|
|
|
(identifier)
|
|
|
|
|
(expression
|
|
|
|
|
(expr_term
|
|
|
|
|
(collection_value
|
|
|
|
|
(tuple
|
|
|
|
|
(expression (expr_term (literal_value (string_lit))))
|
|
|
|
|
(expression (expr_term (literal_value (string_lit)))))))))
|
|
|
|
|
(expression (expr_term (variable_expr (identifier))))
|
|
|
|
|
(expression (expr_term (variable_expr (identifier)))) (ellipsis))))))))
|