================
pipeline
================

pipeline(10) x(clk: clk) -> bool {
        let x = 0;
    reg;
        true
}

---

(source_file
  (unit_definition
    (type (int_literal))
    (identifier)
    (parameter_list
      (typed_parameter
        (parameter (identifier))
        (type (identifier))))
    (type (builtin_type))
    (block
      (let_binding
        (identifier)
        (int_literal))
      (pipeline_reg_marker)
      (bool_literal)))
)


================
pipeline with stage reference
================

pipeline(10) x() -> bool {
    reg;
        stage(+1).x
}

---

(source_file
  (unit_definition
    (type (int_literal))
    (identifier)
    (parameter_list)
    (type (builtin_type))
    (block
      (pipeline_reg_marker)
      (stage_reference (type (int_literal)) (identifier)))))


================
pipeline with named stage reference
================

pipeline(10) x() -> bool {
    reg;
        stage(identifier).x
}

---

(source_file
  (unit_definition
    (type (int_literal))
    (identifier)
    (parameter_list)
    (type (builtin_type))
    (block
      (pipeline_reg_marker)
      (stage_reference (identifier) (identifier)))))


================
pipeline with negative stage referece
================

pipeline(10) x() -> bool {
    reg;
        stage(-1).x
}

---

(source_file
  (unit_definition
    (type (int_literal))
    (identifier)
    (parameter_list)
    (type (builtin_type))
    (block
      (pipeline_reg_marker)
      (stage_reference (type (int_literal)) (identifier)))))


================
pipeline with stage reference with explicit +
================

pipeline(10) x() -> bool {
    reg;
        stage(+1).x
}

---

(source_file
  (unit_definition
    (type (int_literal))
    (identifier)
    (parameter_list)
    (type (builtin_type))
    (block
      (pipeline_reg_marker)
      (stage_reference (type (int_literal)) (identifier)))))


================
reg with multiplier
================

pipeline(10) x() {
    reg*10;
        true
}

---

(source_file
  (unit_definition
    (type (int_literal))
    (identifier)
    (parameter_list)
    (block
      (pipeline_reg_marker (type (int_literal)))
      (bool_literal)))
)
