==================
basic ref
==================

&int amount_of_cats = &4

---

(source_file
  (statement
    (variable_declaration
      (type
        (reference_type
          (type)))
      (identifier)
      (expression
        (unary_expression
          (expression
            (int_literal)))))))


==================
basic arrays
==================

thing = thing + nums[2]

---

(source_file
  (statement
    (variable_assignment
      (expression
        (identifier))
      (assignment_operator)
      (expression
        (binary_expression
          (expression
            (identifier))
          (plus)
          (expression
            (index_access
              (expression
                (identifier))
              (expression
                (int_literal)))))))))


==================
variable assignment
==================

int_literal.* += 1

---

(source_file
  (statement
    (variable_assignment
      (expression
        (dereference
          (expression
            (identifier))))
      (assignment_operator)
      (expression
        (int_literal)))))


==================
access array
==================

vec(int) nums = [1, 2, 3]

nums[2] += int_literal.*

---

(source_file
  (statement
    (variable_declaration
      (type
        (vec_type
          (type)))
      (identifier)
      (expression
        (vec_literal
          (expression
            (int_literal))
          (expression
            (int_literal))
          (expression
            (int_literal))))))
  (statement
    (variable_assignment
      (expression
        (index_access
          (expression
            (identifier))
          (expression
            (int_literal))))
      (assignment_operator)
      (expression
        (dereference
          (expression
            (identifier)))))))


==================
crazy bullshit
==================

&people[get_index()].pets[0].* += calculate(x.* + y[2] - z.age / 3 * 2) >= threshold && active

---

(source_file
  (statement
    (variable_assignment
      (expression
        (dereference
          (expression
            (index_access
              (expression
                (member_access
                  (expression
                    (index_access
                      (expression
                        (unary_expression
                          (expression
                            (identifier))))
                      (expression
                        (function_call
                          (expression
                            (identifier))))))
                  (num_identifier)))
              (expression
                (int_literal))))))
      (assignment_operator)
      (expression
        (binary_expression
          (expression
            (binary_expression
              (expression
                (function_call
                  (expression
                    (identifier))
                  (expression
                    (binary_expression
                      (expression
                        (index_access
                          (expression
                            (binary_expression
                              (expression
                                (dereference
                                  (expression
                                    (identifier))))
                              (expression
                                (identifier))))
                          (expression
                            (int_literal))))
                      (expression
                        (binary_expression
                          (expression
                            (binary_expression
                              (expression
                                (member_access
                                  (expression
                                    (identifier))
                                  (num_identifier)))
                              (expression
                                (int_literal))))
                          (expression
                            (int_literal))))))))
              (expression
                (identifier))))
          (expression
            (identifier)))))))


==================
crazy bullshit but just the function
==================

calculate(y - z.age)

---



==================
crazier bullshit
==================

&people[get_index()]]].pets[[[[0].* +++++===== calculate(x.* ++++ y[[    2] ---- z.age //// 3 ** 2) >>>=== threshold &&&&& active

---


(source_file
  (statement
    (variable_assignment
      (expression
        (dereference
          (expression
            (index_access
              (expression
                (member_access
                  (expression
                    (index_access
                      (expression
                        (unary_expression
                          (expression
                            (identifier))))
                      (expression
                        (function_call
                          (expression
                            (identifier))))))
                  (num_identifier)))
              (expression
                (int_literal))))))
      (assignment_operator)
      (expression
        (binary_expression
          (expression
            (binary_expression
              (expression
                (function_call
                  (expression
                    (identifier))
                  (expression
                    (binary_expression
                      (expression
                        (index_access
                          (expression
                            (binary_expression
                              (expression
                                (dereference
                                  (expression
                                    (identifier))))
                              (plus)
                              (expression
                                (identifier))))
                          (expression
                            (int_literal))))
                      (minus)
                      (expression
                        (binary_expression
                          (expression
                            (binary_expression
                              (expression
                                (member_access
                                  (expression
                                    (identifier))
                                  (num_identifier)))
                              (divide)
                              (expression
                                (int_literal))))
                          (times)
                          (expression
                            (int_literal))))))))
              (greater_equal)
              (expression
                (identifier))))
          (and)
          (expression
            (identifier)))))))


==================
crazier bullshit but just the function
==================

calculate(x.* + y[2] - z.age / 3 * 2)

---

(source_file
  (statement
    (void_statement
      (expression
        (function_call
          (expression
            (identifier))
          (expression
            (binary_expression
              (expression
                (index_access
                  (expression
                    (binary_expression
                      (expression
                        (dereference
                          (expression
                            (identifier))))
                      (plus)
                      (expression
                        (identifier))))
                  (expression
                    (int_literal))))
              (minus)
              (expression
                (binary_expression
                  (expression
                    (binary_expression
                      (expression
                        (member_access
                          (expression
                            (identifier))
                          (num_identifier)))
                      (times)
                      (expression
                        (int_literal))))
                  (divide)
                  (expression
                    (int_literal)))))))))))


==================
vec of references
==================

vec(&int) nums = [&1, &2, &3]

nums[2].* += int_literal.*

---

(source_file
  (statement
    (variable_declaration
      (type
        (vec_type
          (type
            (reference_type
              (type)))))
      (identifier)
      (expression
        (vec_literal
          (expression
            (unary_expression
              (expression
                (int_literal))))
          (expression
            (unary_expression
              (expression
                (int_literal))))
          (expression
            (unary_expression
              (expression
                (int_literal))))))))
  (statement
    (variable_assignment
      (expression
        (dereference
          (expression
            (index_access
              (expression
                (identifier))
              (expression
                (int_literal))))))
      (assignment_operator)
      (expression
        (dereference
          (expression
            (identifier)))))))


==================
slice into string via range
==================

str slice = full_text[2..3]

---

(source_file
  (statement
    (variable_declaration
      (type)
      (identifier)
      (expression
        (index_access
          (expression
            (identifier))
          (expression
            (range
              (expression
                (int_literal))
              (expression
                (int_literal)))))))))  
 

==================
slice into string via range 2
==================

str slice = "lsjldfgjdfgd"[2..=3]

---

(source_file
  (statement
    (variable_declaration
      (type)
      (identifier)
      (expression
        (index_access
          (expression
            (string_literal))
          (expression
            (range
              (expression
                (int_literal))
              (expression
                (int_literal)))))))))  
 
