
mlr -n put -v $z = ENV["HOME"]
DSL EXPRESSION:
$z = ENV["HOME"]

AST:
* statement block
    * assignment "="
        * direct field value "z"
        * environment variable "ENV"
            * string literal "HOME"


mlr -n put -v $z = ENV["HOME"][1]
DSL EXPRESSION:
$z = ENV["HOME"][1]

AST:
* statement block
    * assignment "="
        * direct field value "z"
        * array or map index access "[]"
            * environment variable "ENV"
                * string literal "HOME"
            * int literal "1"


mlr -n put -v $ENV["FOO"] = "bar"
DSL EXPRESSION:
$ENV["FOO"] = "bar"

AST:
* statement block
    * assignment "="
        * array or map index access "[]"
            * direct field value "ENV"
            * string literal "FOO"
        * string literal "bar"


mlr -n put -v $ENV["FOO"][2] = "bar"
DSL EXPRESSION:
$ENV["FOO"][2] = "bar"

AST:
* statement block
    * assignment "="
        * array or map index access "[]"
            * array or map index access "[]"
                * direct field value "ENV"
                * string literal "FOO"
            * int literal "2"
        * string literal "bar"


mlr --from ./reg-test/input/s.dkvp --opprint head -n 2 then put $z = ENV["FOO"]
a   b   i x                  y                  z
pan pan 1 0.3467901443380824 0.7268028627434533 BAR
eks pan 2 0.7586799647899636 0.5221511083334797 BAR

mlr --from ./reg-test/input/s.dkvp --opprint head -n 2 then put $z = ENV["FOO"][1]
a   b   i x                  y                  z
pan pan 1 0.3467901443380824 0.7268028627434533 (error)
eks pan 2 0.7586799647899636 0.5221511083334797 (error)

mlr --from ./reg-test/input/s.dkvp --opprint head -n 2 then put ENV["FOO"] = "bar"
a   b   i x                  y
pan pan 1 0.3467901443380824 0.7268028627434533
eks pan 2 0.7586799647899636 0.5221511083334797

mlr --from ./reg-test/input/s.dkvp --opprint head -n 2 then put ENV["FOO"][2] = "bar"

