
mlr repl

mlr repl
3

mlr repl
{
  "x": 3
}

mlr repl
HOW ARE THINGS?
3
#begin 3
#main  2
#end   3
In the beginning:
HELLO
WORLD
In ...
... the middle!
At the end:
GOODBYE
WORLD

mlr repl
FILENAME="(stdin)",FILENUM=0,NR=0,FNR=0
FILENAME="./reg-test/input/medium.dkvp",FILENUM=1,NR=10,FNR=10
{
  "a": "pan",
  "b": "wye",
  "i": 10,
  "x": 0.5026260055412137,
  "y": 0.9526183602969864
}
a=pan,b=pan,i=11,x=0.7930488423451967,y=0.6505816637259333
a=zee,b=pan,i=12,x=0.3676141320555616,y=0.23614420670296965
a=eks,b=pan,i=13,x=0.4915175580479536,y=0.7709126592971468
a=eks,b=zee,i=14,x=0.5207382318405251,y=0.34141681118811673
a=eks,b=pan,i=15,x=0.07155556372719507,y=0.3596137145616235
a=pan,b=pan,i=16,x=0.5736853980681922,y=0.7554169353781729
a=zee,b=eks,i=17,x=0.29081949506712723,y=0.054478717073354166
a=hat,b=zee,i=18,x=0.05727869223575699,y=0.13343527626645157
a=zee,b=pan,i=19,x=0.43144132839222604,y=0.8442204830496998
a=eks,b=wye,i=20,x=0.38245149780530685,y=0.4730652428100751
FILENAME="./reg-test/input/medium.dkvp",FILENUM=1,NR=20,FNR=20
{
  "a": "eks",
  "b": "wye",
  "i": 20,
  "x": 0.38245149780530685,
  "y": 0.4730652428100751
}
FILENAME="./reg-test/input/medium.dkvp",FILENUM=1,NR=30,FNR=30
{
  "a": "zee",
  "b": "pan",
  "i": 30,
  "x": 0.7514525581952406,
  "y": 0.5869901584461873
}
a=eks,b=pan,i=31,x=0.5701563454882129,y=0.822178550628332
a=wye,b=wye,i=32,x=0.5112738997714514,y=0.33107563648490446
a=hat,b=pan,i=33,x=0.09303747345405,y=0.18404048980291832
a=hat,b=wye,i=34,x=0.49061881414751796,y=0.4721354893261027
a=zee,b=zee,i=35,x=0.12565828887119346,y=0.1936186210637818
a=pan,b=hat,i=36,x=0.9436794292675323,y=0.9111218711707734
a=wye,b=pan,i=37,x=0.056537252420374995,y=0.5450112991603523
a=pan,b=zee,i=38,x=0.508250895522605,y=0.12919877119684198
a=hat,b=pan,i=39,x=0.4591095934684415,y=0.6526252088703994
a=pan,b=hat,i=40,x=0.30302850095892986,y=0.2884018711352886
FILENAME="./reg-test/input/medium.dkvp",FILENUM=1,NR=40,FNR=40
{
  "a": "pan",
  "b": "hat",
  "i": 40,
  "x": 0.30302850095892986,
  "y": 0.2884018711352886
}

mlr repl --j2x ./reg-test/input/flatten-input-2.json
hostname                    localhost
pid                         12345
req.id                      6789
req.method                  GET
req.path                    api/check
req.host                    foo.bar
req.headers.host            bar.baz
req.headers.user-agent      browser
res.status_code             200
res.header.content-type     text
res.header.content-encoding plain
empty1                      {}
empty2                      []
wrapper.empty3              {}
wrapper.emtpy4              []
End of record stream

mlr repl --x2j ./reg-test/input/unflatten-input.xtab
{
  "hostname": "localhost",
  "pid": 12345,
  "req": {
    "id": 6789,
    "method": "GET",
    "path": "api/check",
    "host": "foo.bar",
    "headers": {
      "host": "bar.baz",
      "user-agent": "browser"
    }
  },
  "res": {
    "status_code": 200,
    "header": {
      "content-type": "text",
      "content-encoding": "plain"
    }
  },
  "empty1": {},
  "empty2": [],
  "wrapper": {
    "empty3": {},
    "emtpy4": []
  }
}
End of record stream

mlr repl --xtab ./reg-test/input/unflatten-input.xtab
hostname                    localhost
pid                         12345
req.id                      6789
req.method                  GET
req.path                    api/check
req.host                    foo.bar
req.headers.host            bar.baz
req.headers.user-agent      browser
res.status_code             200
res.header.content-type     text
res.header.content-encoding plain
empty1                      {}
empty2                      []
wrapper.empty3              {}
wrapper.emtpy4              []
End of record stream

mlr repl --json ./reg-test/input/flatten-input-2.json
{
  "hostname": "localhost",
  "pid": 12345,
  "req": {
    "id": 6789,
    "method": "GET",
    "path": "api/check",
    "host": "foo.bar",
    "headers": {
      "host": "bar.baz",
      "user-agent": "browser"
    }
  },
  "res": {
    "status_code": 200,
    "header": {
      "content-type": "text",
      "content-encoding": "plain"
    }
  },
  "empty1": {},
  "empty2": [],
  "wrapper": {
    "empty3": {},
    "emtpy4": []
  }
}
End of record stream

mlr repl --json ./reg-test/input/flatten-input-2.json
{
  "hostname": "localhost",
  "pid": 12345,
  "req": {
    "id": 6789,
    "method": "GET",
    "path": "api/check",
    "host": "foo.bar",
    "headers": {
      "host": "bar.baz",
      "user-agent": "browser"
    }
  },
  "res": {
    "status_code": 200,
    "header": {
      "content-type": "text",
      "content-encoding": "plain"
    }
  },
  "empty1": {},
  "empty2": [],
  "wrapper": {
    "empty3": {},
    "emtpy4": []
  }
}
End of record stream
{
  "hostname": "localhost",
  "pid": 12345,
  "req": {
    "id": 6789,
    "method": "GET",
    "path": "api/check",
    "host": "foo.bar",
    "headers": {
      "host": "bar.baz",
      "user-agent": "browser"
    }
  },
  "res": {
    "status_code": 200,
    "header": {
      "content-type": "text",
      "content-encoding": "plain"
    }
  },
  "empty1": {},
  "empty2": [],
  "wrapper": {
    "empty3": {},
    "emtpy4": []
  }
}
End of record stream

mlr repl -d
(statement-block
    (=
        y
        (+ x 1)
    )
)

mlr repl -D
(statement-block (= y (+ x 1)))

mlr repl -v
* statement block
    * assignment "="
        * local variable "y"
        * operator "+"
            * local variable "x"
            * int literal "1"

