
mlr -n put -v call s()
DSL EXPRESSION:
call s()

AST:
* statement block
    * subroutine callsite "s"


mlr -n put -v call s

mlr -n put -v call s(1,2,3)
DSL EXPRESSION:
call s(1,2,3)

AST:
* statement block
    * subroutine callsite "s"
        * int literal "1"
        * int literal "2"
        * int literal "3"


mlr -n put -v subr s() {}
DSL EXPRESSION:
subr s() {}

AST:
* statement block
    * subroutine definition "s"
        * parameter list
        * statement block


mlr -n put -v subr s() {x=1}
DSL EXPRESSION:
subr s() {x=1}

AST:
* statement block
    * subroutine definition "s"
        * parameter list
        * statement block
            * assignment "="
                * local variable "x"
                * int literal "1"


mlr -n put -v subr s() {return}
DSL EXPRESSION:
subr s() {return}

AST:
* statement block
    * subroutine definition "s"
        * parameter list
        * statement block
            * return "return"


mlr -n put -v subr s() {return 2}
DSL EXPRESSION:
subr s() {return 2}

AST:
* statement block
    * subroutine definition "s"
        * parameter list
        * statement block
            * return "return"
                * int literal "2"


mlr -n put subr s()

mlr -n put -v subr s() {}; call s()
DSL EXPRESSION:
subr s() {}; call s()

AST:
* statement block
    * subroutine definition "s"
        * parameter list
        * statement block
    * subroutine callsite "s"


mlr -n put -v call s(); subr s() {}
DSL EXPRESSION:
call s(); subr s() {}

AST:
* statement block
    * subroutine callsite "s"
    * subroutine definition "s"
        * parameter list
        * statement block


mlr -n put -v subr s(a) {print "HELLO, ".a."!"} call s("WORLD")
DSL EXPRESSION:
subr s(a) {print "HELLO, ".a."!"} call s("WORLD")

AST:
* statement block
    * subroutine definition "s"
        * parameter list
            * parameter
                * parameter name "a"
        * statement block
            * print statement "print"
                * function callsite
                    * operator "."
                        * operator "."
                            * string literal "HELLO, "
                            * local variable "a"
                        * string literal "!"
                * no-op
    * subroutine callsite "s"
        * string literal "WORLD"


mlr --from ./reg-test/input/2.dkvp put subr s() {}
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797

mlr --from ./reg-test/input/2.dkvp put subr s() {return}
a=pan,b=pan,i=1,x=0.3467901443380824,y=0.7268028627434533
a=eks,b=pan,i=2,x=0.7586799647899636,y=0.5221511083334797

mlr --from ./reg-test/input/2.dkvp put call s()

mlr -n put subr s(){} subr s(){}

mlr --from ./reg-test/input/2.dkvp put -v -q 
  func s(x) {
    return x*2;
  }
  subr s(a) {
    print "HELLO, ".a."!"
  }
  print s(NR);
  call s("WORLD");

DSL EXPRESSION:

  func s(x) {
    return x*2;
  }
  subr s(a) {
    print "HELLO, ".a."!"
  }
  print s(NR);
  call s("WORLD");


AST:
* statement block
    * function definition "s"
        * parameter list
            * parameter
                * parameter name "x"
        * statement block
            * return "return"
                * operator "*"
                    * local variable "x"
                    * int literal "2"
    * subroutine definition "s"
        * parameter list
            * parameter
                * parameter name "a"
        * statement block
            * print statement "print"
                * function callsite
                    * operator "."
                        * operator "."
                            * string literal "HELLO, "
                            * local variable "a"
                        * string literal "!"
                * no-op
    * print statement "print"
        * function callsite
            * function callsite "s"
                * context variable "NR"
        * no-op
    * subroutine callsite "s"
        * string literal "WORLD"

2
HELLO, WORLD!
4
HELLO, WORLD!

mlr --opprint --from ./reg-test/input/abixy head -n 5 then put 
    subr s(n) {
        print "n = " . n;
        if (is_numeric(n)) {
            if (n > 0) {
                call s(n-1)
            }
        }
    }
    print "";
    call s(NR)


n = 1
n = 0

n = 2
n = 1
n = 0

n = 3
n = 2
n = 1
n = 0

n = 4
n = 3
n = 2
n = 1
n = 0

n = 5
n = 4
n = 3
n = 2
n = 1
n = 0
a   b   i x                   y
pan pan 1 0.3467901443380824  0.7268028627434533
eks pan 2 0.7586799647899636  0.5221511083334797
wye wye 3 0.20460330576630303 0.33831852551664776
eks wye 4 0.38139939387114097 0.13418874328430463
wye pan 5 0.5732889198020006  0.8636244699032729

