====================================
Definition with zero args
====================================

function greet() {}

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

(program
  (func_def
     (identifier)
    (block)))

====================================
Definition with single arg
====================================

function greet(who) {}

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

(program
  (func_def
     (identifier)
    (param_list
      (identifier))
    (block)))

====================================
Definition with multiple arg
====================================

function greet(who, and_who) {}

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

(program
  (func_def
     (identifier)
    (param_list
      (identifier)
      (identifier))
    (block)))

====================================
Definition with func keyword
====================================

func f() {}

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

(program
  (func_def
     (identifier)
    (block)))

====================================
Wrong definition with trailing comma
====================================

function greet(who,) {}

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

(program
  (func_def
     (identifier)
    (param_list
      (identifier))
    (ERROR)
    (block)))

====================================
Call with zero arguments
====================================

greet()

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

(program
  (rule
    (pattern
      (func_call
         (identifier)))))

====================================
Call with single argument
====================================

greet(a)

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

(program
  (rule
    (pattern
      (func_call
         (identifier)
        (args
          (identifier))))))

====================================
Call with multiple arguments
====================================

greet("you", 42)

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

(program
  (rule
    (pattern
      (func_call
         (identifier)
        (args
          (string)
          (number))))))

====================================
Wrong call with trailing comma
====================================

greet(1,)

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

(program
  (rule
    (pattern
      (func_call
         (identifier)
        (args
          (number))
        (ERROR)))))

====================================
Indirect function call
====================================

@f()

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

(program
  (rule
    (pattern
      (indirect_func_call
        (func_call
           (identifier))))))

====================================
Cannot have NS amont parameters
====================================

function fn(main::x) {}

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

(program
  (func_def
     (identifier)
    (param_list
      (identifier))
    (ERROR
      (identifier))
    (block)))
