================================================================================
Switch #1
================================================================================

from employees
derive distance = switch [
  city == "Calgary" -> 0,
  city == "Edmonton" -> 300,
]

--------------------------------------------------------------------------------

(program
  (pipeline
    (from
      (keyword_from)
      (identifier))
    (transforms
      (derives
        (keyword_derive)
        (term
          (assignment
            (field
              (identifier))
            (switch
              (keyword_switch)
              (switch_condition
                (binary_expression
                  (field
                    (identifier))
                  (literal))
                (literal
                  (integer)))
              (switch_condition
                (binary_expression
                  (field
                    (identifier))
                  (literal))
                (literal
                  (integer))))))))))

================================================================================
Switch with default
================================================================================

from employees
derive distance = switch [
  city == "Calgary" -> 0,
  city == "Edmonton" -> 300,
  true -> "Unknown",
]

--------------------------------------------------------------------------------

(program
  (pipeline
    (from
      (keyword_from)
      (identifier))
    (transforms
      (derives
        (keyword_derive)
        (term
          (assignment
            (field
              (identifier))
            (switch
              (keyword_switch)
              (switch_condition
                (binary_expression
                  (field
                    (identifier))
                  (literal))
                (literal
                  (integer)))
              (switch_condition
                (binary_expression
                  (field
                    (identifier))
                  (literal))
                (literal
                  (integer)))
              (switch_condition
                (literal
                  (keyword_true))
                (literal)))))))))
