=================================================
if block with boolean
=================================================

if (1) {
  print "hello";
}

---

(source_file
  (if_statement (parenthesized_expression (integer))
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
    )
  )
)

=================================================
if elsif block with boolean
=================================================

if (1) {
  print "hello";
}
elsif (2) {
  print "elsif";
}

---

(source_file
  (if_statement (parenthesized_expression (integer))
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
    )
    (elsif_clause (parenthesized_expression (integer))
      (block
        (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
      )
    )
  )
)

=================================================
if else block with boolean
=================================================

if (1) {
  print "hello";
}
else {
  print "else";
}

---

(source_file
  (if_statement (parenthesized_expression (integer))
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
    )
    (else_clause
      (block
        (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
      )
    )
  )
)

=================================================
if elsif else block with boolean
=================================================

if (1) {
  print "hello";
}
elsif (2) {
  print "elsif";
}
else {
  print "else";
}

---

(source_file
  (if_statement (parenthesized_expression (integer))
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
    )
    (elsif_clause (parenthesized_expression (integer))
      (block
        (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
      )
    )
    (else_clause
      (block
        (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
      )
    )
  )
)

=================================================
unless block with boolean
=================================================

unless (1) {
  print "hello";
}

---

(source_file
  (unless_statement (parenthesized_expression (integer))
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
    )
  )
)

=================================================
unless elsif block with boolean
=================================================

unless (1) {
  print "hello";
}
elsif (2) {
  print "elsif";
}

---

(source_file
  (unless_statement (parenthesized_expression (integer))
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
    )
    (elsif_clause (parenthesized_expression (integer))
      (block
        (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
      )
    )
  )
)

=================================================
unless else block with boolean
=================================================

unless (1) {
  print "hello";
}
else {
  print "else";
}

---

(source_file
  (unless_statement (parenthesized_expression (integer))
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
    )
    (else_clause
      (block
        (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
      )
    )
  )
)

=================================================
unless elsif else block with boolean
=================================================

unless (1) {
  print "hello";
}
elsif (2) {
  print "elsif";
}
else {
  print "else";
}

---

(source_file
  (unless_statement (parenthesized_expression (integer))
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
    )
    (elsif_clause (parenthesized_expression (integer))
      (block
        (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
      )
    )
    (else_clause
      (block
        (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
      )
    )
  )
)



=================================================
Simple while statement
=================================================

my $i = 0;
while ($i < 10) {
  print "hello $i";

  $i++;
}

---

(source_file
  (variable_declaration (scope) (scalar_variable) (integer)) (semi_colon)
  (while_statement (empty_parenthesized_expression (binary_expression (scalar_variable) (integer)))
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted (interpolation (scalar_variable)))))) (semi_colon)
      (unary_expression (scalar_variable)) (semi_colon)
    )
  )
)

=================================================
while statement with label
=================================================

my $i = 0;
MEOW: while ($i < 10) {
  print "hello $i";
  
  next MEOW;

  $i++;
}

---

(source_file
  (variable_declaration (scope) (scalar_variable) (integer)) (semi_colon)
  (while_statement (identifier) (empty_parenthesized_expression (binary_expression (scalar_variable) (integer)))
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted (interpolation (scalar_variable)))))) (semi_colon) (loop_control_statement (loop_control_keyword) (identifier) (semi_colon)) (unary_expression (scalar_variable)) (semi_colon))
  )
)

=================================================
postfix for loop
=================================================

my @array = (1, 3, 4);
print "in a loop" for @array;

---

(source_file
  (variable_declaration (scope) (array_variable) (array (integer) (integer) (integer))) (semi_colon)
  (single_line_statement (call_expression (identifier) (arguments (argument (string_double_quoted)))) (for_simple_statement (array_variable) (semi_colon)))
)

=================================================
simple for loop (C-style)
=================================================

for (my $i=1; $i < 10; $i++) {
}

---

(source_file
  (for_statement_1 (variable_declaration (scope) (scalar_variable) (integer)) (semi_colon) (binary_expression (scalar_variable) (integer)) (semi_colon) (unary_expression (scalar_variable))
    (block)
  )
)

=================================================
infinite for loop (C-style)
=================================================

for (;;) {
  print "hello";
}

---

(source_file
  (for_statement_1 (semi_colon) (semi_colon)
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
    )
  )
)

=================================================
for loop (iterate over array)
=================================================

for my $single (@array) {
}

---

(source_file
  (for_statement_2 (scope) (scalar_variable) (array (array_variable))
    (block)
  )
)

=================================================
foreach loop (iterate over array)
=================================================

foreach my $single (@array) {
}

---

(source_file
  (for_statement_2 (scope) (scalar_variable) (array (array_variable))
    (block)
  )
)

=================================================
infinite foreach loop
=================================================

foreach (;;) {
  print "hello";
}

---

(source_file
  (for_statement_1 (semi_colon) (semi_colon)
    (block
      (call_expression (identifier) (arguments (argument (string_double_quoted)))) (semi_colon)
    )
  )
)

=================================================
foreach without my $element
=================================================

foreach (@array) {
}

---

(source_file
  (for_statement_2 (array (array_variable))
    (block)
  )
)
