================================================================================
function definition on same line should end scope
================================================================================

let f x = x + 1

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

(file
  (value_declaration
    (function_or_value_defn
      (function_declaration_left
        (identifier)
        (argument_patterns
          (long_identifier
            (identifier))))
      (infix_expression
        (long_identifier_or_op
          (identifier))
        (infix_op)
        (const
          (int))))))

================================================================================
function definition on new line should open scope
================================================================================

let f x =
  x + 1
  1

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

(file
  (value_declaration
    (function_or_value_defn
      (function_declaration_left
        (identifier)
        (argument_patterns
          (long_identifier
            (identifier))))
      (sequential_expression
        (infix_expression
          (long_identifier_or_op
            (identifier))
          (infix_op)
          (const
            (int)))
        (const
          (int))))))

================================================================================
function definition aligned to first line should scope correctly
================================================================================

let f x = x + 1
          1

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

(file
  (value_declaration
    (function_or_value_defn
      (function_declaration_left
        (identifier)
        (argument_patterns
          (long_identifier
            (identifier))))
      (sequential_expression
        (infix_expression
          (long_identifier_or_op
            (identifier))
          (infix_op)
          (const
            (int)))
        (const
          (int))))))

================================================================================
call expression with underindentation
================================================================================

do
   Serializer(
  1,
  2,
  3
)

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

(file
  (value_declaration
    (do
      (application_expression
        (long_identifier_or_op
          (identifier))
        (tuple_expression
          (const
            (int))
          (tuple_expression
            (const
              (int))
            (const
              (int))))))))

================================================================================
declaration expression should contain all sequential expressions
================================================================================

let f x =
  let y = x + 1
  printfn y
  printfn y
  printfn y
  printfn y

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

(file
  (value_declaration
    (function_or_value_defn
      (function_declaration_left
        (identifier)
        (argument_patterns
          (long_identifier
            (identifier))))
      (declaration_expression
        (function_or_value_defn
          (value_declaration_left
            (identifier_pattern
              (long_identifier_or_op
                (identifier))))
          (infix_expression
            (long_identifier_or_op
              (identifier))
            (infix_op)
            (const
              (int))))
        (sequential_expression
          (application_expression
            (long_identifier_or_op
              (identifier))
            (long_identifier_or_op
              (identifier)))
          (sequential_expression
            (application_expression
              (long_identifier_or_op
                (identifier))
              (long_identifier_or_op
                (identifier)))
            (sequential_expression
              (application_expression
                (long_identifier_or_op
                  (identifier))
                (long_identifier_or_op
                  (identifier)))
              (application_expression
                (long_identifier_or_op
                  (identifier))
                (long_identifier_or_op
                  (long_identifier
                    (identifier)))))))))))

================================================================================
for-loop in else branch
================================================================================

do
  if b then
    ()
  else
    for x in xs do
      ()
    ()

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

(file
  (value_declaration
    (do
      (if_expression
        (long_identifier_or_op
          (identifier))
        (const
          (unit))
        (sequential_expression
          (for_expression
            (identifier_pattern
              (long_identifier_or_op
                (identifier)))
            (long_identifier_or_op
              (identifier))
            (const
              (unit)))
          (const
            (unit)))))))

================================================================================
prefix associativity
================================================================================

do
  return ctx.Ok message :> IAction

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

(file
  (value_declaration
    (do
      (prefixed_expression
        (typecast_expression
          (application_expression
            (long_identifier_or_op
              (long_identifier
                (identifier)
                (identifier)))
            (long_identifier_or_op
              (identifier)))
          (type
            (long_identifier
              (identifier))))))))

================================================================================
fun expression inside parens
================================================================================

do
  (fun o -> f >=> h o)

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

(file
  (value_declaration
    (do
      (paren_expression
        (fun_expression
          (argument_patterns
            (long_identifier
              (identifier)))
          (application_expression
            (infix_expression
              (long_identifier_or_op
                (identifier))
              (infix_op)
              (long_identifier_or_op
                (identifier)))
            (long_identifier_or_op
              (identifier))))))))

================================================================================
offside infix op
================================================================================

do
  (id 1
  >=> (x
      |> id
      |> id))

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

(file
  (value_declaration
    (do
      (paren_expression
        (infix_expression
          (application_expression
            (long_identifier_or_op
              (identifier))
            (const
              (int)))
          (infix_op)
          (paren_expression
            (infix_expression
              (infix_expression
                (long_identifier_or_op
                  (identifier))
                (infix_op)
                (long_identifier_or_op
                  (identifier)))
              (infix_op)
              (long_identifier_or_op
                (identifier)))))))))
